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#PREDECESSOR},
  • + *
  • {@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; + add(item:Object):void; + copyToArrayAt(array:Object[],arrayIndex:number):void; + insertAt(index:number,value:Object):void; + get(index:number):Object; + set(index:number,value:Object):void; + isFixedSize:boolean; + insert(index:number,item:Object):void; + removeAt(index:number):void; + getItem(index:number):Object; + setItemAt(index:number,value:Object):void; + } + export module YList{ + /** + * Cursor implementation for class YList. + */ + export interface ListCursorImpl extends Object,yfiles.algorithms.ICursor{ + /** + * 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 number of elements that can be accessed with this cursor. + * @see Specified by {@link yfiles.algorithms.ICursor#size}. + */ + size:number; + /** + * The object currently pointed on. + * @see Specified by {@link yfiles.algorithms.ICursor#current}. + */ + current:Object; + } + } + var YList:{ + $class:yfiles.lang.Class; + /** + * Creates an empty doubly linked list. + */ + new ():yfiles.algorithms.YList; + /** + * Creates a list that is initialized with the elements provided by the given + * Collection object. + */ + FromCollection:{ + new (c:yfiles.algorithms.ICollection):yfiles.algorithms.YList; + }; + /** + * Creates a list that is initialized with the elements provided by the given + * iterator object. + */ + FromIterator:{ + new (it:yfiles.algorithms.IIterator):yfiles.algorithms.YList; + }; + /** + * Creates a list that is initialized with the elements provided by the given + * enumerator object. + */ + FromEnumerator:{ + new (e:yfiles.objectcollections.IEnumerator):yfiles.algorithms.YList; + }; + /** + * Creates a list that is initialized with the elements provided by the given + * YCursor object. + */ + FromCursor:{ + new (c:yfiles.algorithms.ICursor):yfiles.algorithms.YList; + }; + /** + * Creates a list that is initialized with those elements from the given YCursor + * object for which the given data provider returns true upon + * calling its {@link yfiles.algorithms.IDataProvider#getBool getBool} method. + * @param {yfiles.algorithms.ICursor} c A cursor providing objects that should be added to this list. + * @param {yfiles.algorithms.IDataProvider} predicate + * A data provider that acts as a inclusion predicate for each object accessible + * by the given cursor. + */ + FromCursorFiltered:{ + new (c:yfiles.algorithms.ICursor,predicate:yfiles.algorithms.IDataProvider):yfiles.algorithms.YList; + }; + /** + * Creates a list that is initialized with the elements provided by the given + * array of objects. + */ + FromArray:{ + new (a:Object[]):yfiles.algorithms.YList; + }; + /** + * Creates a list that is initialized with the elements stored in the given + * collection. + */ + newInstanceFromCollection(c:yfiles.objectcollections.ICollection):yfiles.algorithms.YList; + /** + * Creates a list that is initialized with the elements stored in the given + * collection. + */ + newInstance(c:yfiles.collections.ICollection):yfiles.algorithms.YList; + ListCursorImpl:{ + $class:yfiles.lang.Class; + new (_enclosing:yfiles.algorithms.YList):yfiles.algorithms.YList; + }; + }; + /** + * Generates pseudo-random numbers and the such. + */ + export interface YRandom extends yfiles.algorithms.Random{ + /** + * Returns a pseudo-random, uniformly distributed int value + * between 0 (inclusive) and the specified value (exclusive), drawn from + * this random number generator's sequence. + * @see Overrides {@link yfiles.algorithms.Random#nextIntInRange} + */ + nextIntInRange(n:number):number; + /** + * Returns an array of n unique random integers that + * lie within the range min (inclusive) and + * max (exclusive). + * If max - min < n + * then null is returned. + */ + getUniqueArray(n:number,min:number,max:number):number[]; + /** + * Returns an array of n randomly chosen boolean values + * of which trueCount of them are true. + * If the requested numbers of true values is bigger than the number + * of requested boolean values, an Exception is raised. + */ + getBoolArray(n:number,trueCount:number):boolean[]; + /** + * Returns an int array of length bucketCount for + * which the values of all fields are non-negative and sum up + * to ballCount. + * The values are put + * in the array randomly. + */ + getIntArray(bucketCount:number,ballCount:number):number[]; + /** + * Returns a double with a random value between minValue + * (inclusive) and maxValue (exclusive). + * Precondition: maxValue > minValue + */ + nextDoubleBetweenMinAndMax(minValue:number,maxValue:number):number; + /** + * Returns an int with a random value between minValue + * (inclusive) and maxValue (exclusive). + * Precondition: maxValue > minValue + */ + nextIntBetweenMinAndMax(minValue:number,maxValue:number):number; + /** + * Permutes the positions of the elements within the given array. + */ + permutate(a:Object[]):void; + } + var YRandom:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this class. + */ + new ():yfiles.algorithms.YRandom; + /** + * Creates a new instance of this class with a given + * initial random seed. + */ + WithSeed:{ + new (seed:number):yfiles.algorithms.YRandom; + }; + }; + /** + * Implements a priority queue for nodes based on AVL Trees. + * The priority values may be non-negative. + */ + export interface TreeIntNodePQ extends Object,yfiles.algorithms.IIntNodePQ{ + /** + * Specifies whether or not this queue is empty. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#empty}. + */ + empty:boolean; + /** + * Returns whether or not the given node is contained within this queue. + * Complexity: O(log(n)). + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#contains}. + */ + contains(n:yfiles.algorithms.Node):boolean; + /** + * Inserts a node into the queue. + * Complexity: O(log(n)). + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#add}. + */ + add(n:yfiles.algorithms.Node,value:number):void; + /** + * Removes a node from the queue. + * Complexity: O(log(n)). + */ + remove(n:yfiles.algorithms.Node):void; + /** + * The node with the minimal value in the queue. + * Complexity: O(log(n)). + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#min}. + */ + min:yfiles.algorithms.Node; + /** + * Removes the node with the minimal value from the queue. + * Complexity: O(log(n)). + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#removeMin}. + */ + removeMin():yfiles.algorithms.Node; + /** + * Decreases the value of a node in the queue to a certain value. + * Complexity: O(log(n)). + * @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; + /** + * Removes all entities from the queue. + * Complexity: O(1). + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#clear}. + */ + clear():void; + /** + * 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 hold resources. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#dispose}. + */ + dispose():void; + } + var TreeIntNodePQ:{ + $class:yfiles.lang.Class; + /** + * Returns an empty Priority-Queue. + * @param {yfiles.algorithms.Graph} _graph the graph which contains the nodes + */ + new (_graph:yfiles.algorithms.Graph):yfiles.algorithms.TreeIntNodePQ; + /** + * 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.TreeIntNodePQ; + }; + /** + * Returns an empty Priority-Queue. + * This constructor takes a NodeMap as argument + * which is used to store the priority values. + * @param {yfiles.algorithms.INodeMap} _valueMap here the priority values are stored + */ + FromNodeMap:{ + new (_valueMap:yfiles.algorithms.INodeMap):yfiles.algorithms.TreeIntNodePQ; + }; + }; + /** + * This class represents an ordered 2-Tuple that is consistent with + * equals() and hashCode(). + * Therefore it can + * safely be used within HashTables, HashSets, HashMaps and the like. + * Using the static create methods, it is possible to + * build 3,4,5-Tuples recursively out of multiple 2-Tuples. + */ + export interface Tuple extends Object{ + /** + * The first element of the Tuple. + */ + o1:Object; + /** + * The second element of the Tuple. + */ + o2:Object; + /** + * Determines if the given Tuple equals another Tuple. + * Returns true iff both elements are equal + * (both null or equals() returns true. + * @param {Object} o the element to compare this tuple with + * @return {boolean} true iff o equals this + */ + equals(o:Object):boolean; + /** + * Generates a hashCode using the two tuple elements. + * @return {number} a hashCode built using the hashCodes of the two elements. + */ + hashCode():number; + toString():string; + } + var Tuple:{ + $class:yfiles.lang.Class; + /** + * Constructs a 2-Tuple using the two given Objects. + * @param {Object} o1 The first element (may be null) + * @param {Object} o2 The second element (may be null) + */ + new (o1:Object,o2:Object):yfiles.algorithms.Tuple; + /** + * Factory method to create a 2-Tuple. + */ + create(o1:Object,o2:Object):Object; + /** + * Factory method to create a 3-Tuple. + */ + createTriple(o1:Object,o2:Object,o3:Object):Object; + /** + * Factory method to create a 4-Tuple. + */ + createQuadruple(o1:Object,o2:Object,o3:Object,o4:Object):Object; + /** + * Factory method to create a 5-Tuple. + */ + createQuintuple(o1:Object,o2:Object,o3:Object,o4:Object,o5:Object):Object; + }; + /** + * This class can be used to wrap a given DataProvider with another one. + * It is intended to work with DataProviders providing Objects only. + * Whenever data is not found in the decorating DataProvider (known as the wrapper). + * The underlying data provider will be queried. + */ + export interface WrappedObjectDataProvider extends Object,yfiles.algorithms.IDataProvider{ + /** + * A DataMap that can be used to read and write values. + */ + dataMapView:yfiles.algorithms.IDataMap; + /** + * Performs the wrapping, the given DataProvider will be unregistered + * from the graph and replaced with this instance. + * @param {yfiles.algorithms.Graph} g the graph which will be registered with the data providers + * @param {Object} dataProviderKey the key used for registering + */ + wrap(g:yfiles.algorithms.Graph,dataProviderKey:Object):void; + /** + * Undoes a previous wrap() operation. + */ + unwrap():void; + /** + * 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 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; + /** + * 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 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; + /** + * The underlying wrapped DataProvider. + */ + wrappedProvider:yfiles.algorithms.IDataProvider; + /** + * The wrapping DataProvider instance. + * This can safely be cast to + * a NodeMap or an EdgeMap respectively if the appropriate static factory + * methods have been used for the construction of this. + */ + wrappingProvider:yfiles.algorithms.IDataProvider; + /** + * Disposes previously allocated data structures. + * First a call to + * unwrap() is made. Then the wrappers are disposed from the + * graph if they are instances of NodeMaps or EdgeMaps respectively. + */ + dispose():void; + } + var WrappedObjectDataProvider:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of WrappedDataProvider. + * This instance + * will delegate queries to the wrapper first. Unsatisfied requests + * will be delegated to the original second provider. + * @param {yfiles.algorithms.IDataProvider} wrapper The DataProvider instance which will be queried first + * @param {yfiles.algorithms.IDataProvider} provider the data provider which will be wrapped by the first one + */ + new (wrapper:yfiles.algorithms.IDataProvider,provider:yfiles.algorithms.IDataProvider):yfiles.algorithms.WrappedObjectDataProvider; + /** + * Creates a new instance of WrappedDataProvider. + * This instance + * will delegate queries to the wrapper first. Unsatisfied requests + * will be delegated to the original provider. This method wraps the + * currently registered DataProvider with this. This can be undone + * by calling unwrap() + * @param {yfiles.algorithms.IDataProvider} wrapper the wrapping data provider + * @param {yfiles.algorithms.Graph} graph the graph which will be registered with the data providers + * @param {Object} dataProviderKey the key used for registering + */ + ForGraph:{ + new (wrapper:yfiles.algorithms.IDataProvider,graph:yfiles.algorithms.Graph,dataProviderKey:Object):yfiles.algorithms.WrappedObjectDataProvider; + }; + /** + * Creates a new instance of WrappedDataProvider. + * This instance + * will delegate queries to a newly created EdgeMap wrapper first. Unsatisfied requests + * will be delegated to the original provider. This method wraps the + * currently registered DataProvider with the returned DataProvider instance. + * This can be undone + * by calling unwrap() + * @param {yfiles.algorithms.Graph} graph the graph which will be registered with the data providers + * @param {Object} dataProviderKey the key used for registering and wrapping + */ + wrapUsingEdgeMap(graph:yfiles.algorithms.Graph,dataProviderKey:Object):yfiles.algorithms.WrappedObjectDataProvider; + /** + * Creates a new instance of WrappedDataProvider. + * This instance + * will delegate queries to a newly created NodeMap wrapper first. Unsatisfied requests + * will be delegated to the original provider. This method wraps the + * currently registered DataProvider with the returned DataProvider instance. + * This can be undone + * by calling unwrap() + * @param {yfiles.algorithms.Graph} graph the graph which will be registered with the data providers + * @param {Object} dataProviderKey the key used for registering and wrapping + */ + wrapUsingNodeMap(graph:yfiles.algorithms.Graph,dataProviderKey:Object):yfiles.algorithms.WrappedObjectDataProvider; + }; + /** + * Defines an interface for specialized priority queues that contains + * nodes which are prioritized by a comparable values. + */ + export interface INodePQ extends Object{ + /** + * Adds the given node with the given priority to the queue. + * Precondition: !contains(v) + * @see Specified by {@link yfiles.algorithms.INodePQ#add}. + */ + add(v:yfiles.algorithms.Node,priority:Object):void; + /** + * Decreased 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. + * @see Specified by {@link yfiles.algorithms.INodePQ#decreasePriority}. + */ + decreasePriority(v:yfiles.algorithms.Node,priority:Object):void; + /** + * Removes the node with smallest priority from this queue. + * Precondition: !isEmpty() + * @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; + /** + * Makes this queue the empty queue. + * in this queue. + * @see Specified by {@link yfiles.algorithms.INodePQ#clear}. + */ + clear():void; + /** + * Returns whether or not the given node is contained + * in this queue. + * @see Specified by {@link yfiles.algorithms.INodePQ#contains}. + */ + contains(v:yfiles.algorithms.Node):boolean; + /** + * Returns the current priority of the given node. + * @see Specified by {@link yfiles.algorithms.INodePQ#getPriority}. + */ + getPriority(v:yfiles.algorithms.Node):Object; + /** + * Specifies whether or not this queue is empty. + * @see Specified by {@link yfiles.algorithms.INodePQ#empty}. + */ + empty:boolean; + /** + * Returns the number of nodes currently in this queue. + * @see Specified by {@link yfiles.algorithms.INodePQ#size}. + */ + size():number; + } + var INodePQ:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class implements a priority queue for objects whose priority + * values are of type int. + * The implementation is based on binary heaps. + */ + export interface IntObjectPQ extends Object{ + /** + * Adds the given node with with given priority to this queue. + * Precondition: !contains(v) + * Complexity: O(log(size())) + */ + add(o:Object,priority:number):void; + /** + * Decreases the priority value of the given node. + * Precondition: contains(v) + * Precondition: priority < getPriority(v) + * Complexity: O(log(size())) + */ + decreasePriority(o:Object,priority:number):void; + /** + * Increases the priority value of the given node. + * Precondition: contains(v) + * Precondition: priority > getPriority(v) + * Complexity: O(log(size())) + */ + increasePriority(o:Object,priority:number):void; + /** + * Changes the priority value of the given node. + * Precondition: contains(v) + * Complexity: O(log(size())) + */ + changePriority(o:Object,p:number):void; + /** + * Removes the node with smallest priority from this queue. + * Precondition: !isEmpty() + * Complexity: O(log(size())) + * @return {Object} the removed node with smallest priority + */ + removeMin():Object; + /** + * He node 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 node 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 node. + * Precondition: contains(v) + */ + getPriority(o:Object):number; + /** + * Removes the given node from this queue. + * Precondition: contains(v) + * Complexity: O(log(size())) + */ + remove(o:Object):void; + /** + * Makes this queue the empty queue. + * in this queue. + * Complexity: O(graph.N()) + */ + clear():void; + /** + * Does nothing. + */ + dispose():void; + } + var IntObjectPQ:{ + $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.IntObjectPQ; + }; + /** + * Specifies the contract of modifiable integer value objects. + */ + export interface IIntValueSettable extends Object{ + /** + * The object's data. + * @see Specified by {@link yfiles.algorithms.IIntValueSettable#value}. + */ + value:number; + } + var IIntValueSettable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Defines an interface for specialized priority queues that contains + * nodes which are prioritized by associated double values. + */ + export interface IDoubleNodePQ extends Object{ + /** + * Specifies whether or not this queue is empty. + * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#empty}. + */ + empty:boolean; + /** + * Returns whether or not the given node is contained within this queue. + * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#contains}. + */ + contains(n:yfiles.algorithms.Node):boolean; + /** + * Adds a node with the given priority to the queue. + * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#add}. + */ + add(n:yfiles.algorithms.Node,priority:number):void; + /** + * Removes the node with the minimal priority from the queue. + * @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; + /** + * Decreases the priority of a node in the queue to a given value. + * @param {yfiles.algorithms.Node} n a node in the priority queue. + * @param {number} priority the new priority of the node. + * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#decreasePriority}. + */ + decreasePriority(n:yfiles.algorithms.Node,priority:number):void; + /** + * Removes all entries from the queue. + * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#clear}. + */ + clear():void; + /** + * Returns the current priority of the given node. + * @see Specified by {@link yfiles.algorithms.IDoubleNodePQ#getPriority}. + */ + getPriority(n: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.IDoubleNodePQ#dispose}. + */ + dispose():void; + } + var IDoubleNodePQ:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Defines an interface for specialized priority queues that contains + * nodes which are prioritized by associated int values. + */ + export interface IIntNodePQ extends Object{ + /** + * Specifies whether or not this queue is empty. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#empty}. + */ + empty:boolean; + /** + * Returns whether or not the given node is contained within this queue. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#contains}. + */ + contains(n:yfiles.algorithms.Node):boolean; + /** + * Adds a node with the given priority to the queue. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#add}. + */ + add(n:yfiles.algorithms.Node,priority:number):void; + /** + * He node with smallest priority in this queue. + * Precondition: !isEmpty() + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#min}. + */ + min:yfiles.algorithms.Node; + /** + * Removes the node with the minimal priority from the queue. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#removeMin}. + */ + removeMin():yfiles.algorithms.Node; + /** + * Decreases the priority of a node in the queue to a given value. + * @param {yfiles.algorithms.Node} n a node in the priority queue. + * @param {number} priority the new priority value of the node. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#decreasePriority}. + */ + decreasePriority(n:yfiles.algorithms.Node,priority:number):void; + /** + * Removes all entries from the queue. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#clear}. + */ + clear():void; + /** + * Returns the current priority of the given node. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#getPriority}. + */ + getPriority(n: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; + } + var IIntNodePQ:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class is an abstract empty implementation of the NodeMap interface. + * Subclasses + */ + export interface NodeMapAdapter extends Object,yfiles.algorithms.INodeMap{ + /** + * Associates the given value to with the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#set}. + */ + set(key:Object,value:Object):void; + /** + * Returns the value bound to the given node. + * @param {Object} key + * @return {Object} null + * @see Specified by {@link yfiles.algorithms.INodeMap#get}. + */ + get(key:Object):Object; + /** + * Associates the given boolean value to with the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setBool}. + */ + setBool(key: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 setBool. + * @param {Object} key + * @return {boolean} false + * @see Specified by {@link yfiles.algorithms.INodeMap#getBool}. + */ + getBool(key:Object):boolean; + /** + * Associates the given double value to with the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setDouble}. + */ + setDouble(key: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 setDouble. + * @return {number} 0.0d + * @see Specified by {@link yfiles.algorithms.INodeMap#getDouble}. + */ + getDouble(key:Object):number; + /** + * Associates the given integer value to with the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setInt}. + */ + setInt(key: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 setInt. + * @return {number} 0 + * @see Specified by {@link yfiles.algorithms.INodeMap#getInt}. + */ + getInt(key:Object):number; + } + var NodeMapAdapter:{ + $class:yfiles.lang.Class; + }; + /** + * A specialized priority queue that contains nodes which are + * prioritized by associated int values. + * This queue is designed for efficiency in scenario's where the + * set of possible integral priority keys is small and + * tight (i.e their values are not far apart). + * Typical int values chosen are the degree of a node. + */ + export interface ListIntNodePQ extends Object,yfiles.algorithms.IIntNodePQ{ + /** + * Disposes this queue. + * It is important to call this method after the queue + * is not needed anymore, since it allocates node maps from the graph + * that owns the nodes within the queue. + * Calling this method frees these node maps again. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#dispose}. + */ + dispose():void; + /** + * Specifies whether or not this queue is empty. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#empty}. + */ + empty:boolean; + /** + * Whether or not the given node is contained within this queue. + * Complexity: O(1) + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#contains}. + */ + contains(v:yfiles.algorithms.Node):boolean; + /** + * Returns the number of nodes still in the queue. + */ + size():number; + /** + * Adds a node to this queue with the given priority. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#add}. + */ + add(v:yfiles.algorithms.Node,value:number):void; + /** + * Decreases the priority of a node in the queue to a certain value. + * @param {yfiles.algorithms.Node} v 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(v:yfiles.algorithms.Node,value:number):void; + /** + * Returns the current priority of the given node. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#getPriority}. + */ + getPriority(v:yfiles.algorithms.Node):number; + /** + * Increases the priority of a node in the queue to a certain value. + * @param {yfiles.algorithms.Node} v a node in the priority queue. + * @param {number} value the new priority value of the node. + */ + increasePriority(v:yfiles.algorithms.Node,value:number):void; + /** + * The node with the minimal value in the queue. + * Precondition: !isEmpty() + * Complexity: Amortized O(1) + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#min}. + */ + min:yfiles.algorithms.Node; + /** + * Removes all entries from the queue. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#clear}. + */ + clear():void; + /** + * Removes a node from the queue. + * Complexity: O(1) + */ + remove(v:yfiles.algorithms.Node):void; + /** + * Same as popMinNode. + * @see Specified by {@link yfiles.algorithms.IIntNodePQ#removeMin}. + */ + removeMin():yfiles.algorithms.Node; + /** + * Returns a node with smallest associated int key within this + * queue. + * the returned node will be removed from the queue by + * this method. + * Precondition: !isEmpty() + * Complexity: Amortized O(1) + */ + popMinNode():yfiles.algorithms.Node; + /** + * Returns a node with highest associated int key within this + * queue. + * the returned node will be removed from the queue by + * this method. + * Precondition: !isEmpty() + * Complexity: Amortized O(1) + */ + popMaxNode():yfiles.algorithms.Node; + /** + * Increments the associated priority value for the given node by 1 + * and updates it's position within the queue accordingly. + * Precondition: contains(v) + * Complexity: O(1) + */ + incrementPriority(v:yfiles.algorithms.Node):void; + /** + * Decrements the associated priority value for the given node by 1 + * and updates it's position within the queue accordingly. + * Precondition: contains(v) + * Complexity: O(1) + */ + decrementPriority(v:yfiles.algorithms.Node):void; + } + var ListIntNodePQ:{ + $class:yfiles.lang.Class; + /** + * Constructs an initially empty PQ. + */ + new (graph:yfiles.algorithms.Graph):yfiles.algorithms.ListIntNodePQ; + /** + * Constructs a PQ that holds all nodes of the given graph. + * the given data provider has to provide for each defined node + * an int value that is not bigger than minValue and + * not smaller than maxValue + * Complexity: O(nc.size()+(maxValue-minValue)) + */ + WithMinValueAndMaxValue:{ + new (graph:yfiles.algorithms.Graph,intData:yfiles.algorithms.IDataProvider,minValue:number,maxValue:number):yfiles.algorithms.ListIntNodePQ; + }; + /** + * Like . + * Additionally a data provider + * can be specified, that holds boolean values for each node in the + * graph. Only nodes for which the data provider returns true + * will be entered in the queue. + */ + WithWantedNodes:{ + new (graph:yfiles.algorithms.Graph,intData:yfiles.algorithms.IDataProvider,minValue:number,maxValue:number,wantedNodes:yfiles.algorithms.IDataProvider):yfiles.algorithms.ListIntNodePQ; + }; + }; + /** + * Provides some convenience methods for code debugging + * and exception handling. + *

+ * The behavior of this class can be adapted by starting + * the Java Virtual Machine with a set system property + * y.debug and y.debug.level. + * The default debug level is 2. It can be changed by + * setting the system property y.debug.level + * appropriately. + *

+ */ + export interface LoggingUtil extends Object{ + } + var LoggingUtil:{ + $class:yfiles.lang.Class; + /** + * The debug level threshold. + * Its default value is + * 2 but may be changed by setting the system property + * y.debug.level. + */ + DEBUG_LEVEL:number; + /** + * Prints the given string to System.out if + * the given debug level if bigger than + * DEBUG_LEVEL. + */ + logWithLevel(level:number,msg:string):void; + /** + * Prints the given object to System.err unconditionally. + */ + logMessage(msg:Object):void; + /** + * Like {@link yfiles.algorithms.LoggingUtil#logMessage}, but omits newline. + */ + shortLogMessage(msg:Object):void; + /** + * Print the given message to System.err if the fully qualified + * class name of the given source object is encoded + * in the system property y.debug and + * if the given debug level if bigger than + * DEBUG_LEVEL. + *

+ * The value of the y.debug property is a colon separated + * list of fully qualified class name prefixes. If the name of the given + * class starts with one of the specified prefixes the debug message will + * be printed to System.err. + *

+ */ + logWithSourceAndMsg(source:Object,msg:Object):void; + /** + * Print the given message to System.err if the fully qualified + * class name of the given source object is encoded + * in the system property y.debug. + *

+ * The value of the y.debug property is a colon separated + * list of fully qualified class name prefixes. If the name of the given + * class starts with one of the specified prefixes the debug message will + * be printed to System.err. + *

+ */ + log(source:Object,level:number,msg:Object):void; + /** + * Like {@link yfiles.algorithms.LoggingUtil#logWithSourceAndMsg}, but does not append a newline to the + * output. + */ + shortLogWithSource(source:Object,msg:Object):void; + /** + * Returns true if the given object type is under observation + * due to the -Dy.debug mechanism. + */ + watchSource(source:Object):boolean; + /** + * Returns true if the given object type is under observation + * due to the -Dy.debug mechanism. + */ + watch(source:string):boolean; + /** + * Outputs the class of the given object and the given message. + * Then throws a RuntimeException using the same message. + * Mostly used in a catch statement to + * signal a definite bug. + */ + fatalWithMessage(source:Object,msg:Object):void; + /** + * Called on a fatal error. + * Mostly used in a catch statement to + * signal a definite bug. + */ + fatal(msg:Object):void; + /** + * Like {@link yfiles.algorithms.LoggingUtil#logWithLevel}, but uses no line-feed. + */ + shortLogWithLevel(level:number,output:string):void; + /** + * Outputs a stack trace on System.err. + */ + traceException(ex:yfiles.lang.Exception):void; + /** + * Outputs a stack trace on System.err. + */ + trace():void; + }; + /** + * This class provides convenience and transformation services for Node- and EdgeMaps. + */ + export interface Maps extends Object{ + } + export module Maps{ + /** + * Implementation of a resettable high performance map for values of type Object. + * A high performance map is a facade to another map which will allow to reset + * all bound values to a default value in constant time. + */ + export interface HighPerformanceObjectMap extends Object,yfiles.algorithms.INodeMap,yfiles.algorithms.IEdgeMap{ + /** + * Resets all values to the given default value in constant time. + * @param {Object} defaultValue the new default value + */ + resetAll(defaultValue:Object):void; + /** + * Returns the value bound to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#get}. + */ + get(dataHolder:Object):Object; + /** + * Associates the given value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#set}. + */ + set(dataHolder:Object,value:Object):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(dataHolder:Object):boolean; + /** + * 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(dataHolder:Object):number; + /** + * 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(dataHolder:Object):number; + /** + * Associates the given boolean value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setBool}. + */ + setBool(dataHolder:Object,value:boolean):void; + /** + * Associates the given double value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setDouble}. + */ + setDouble(dataHolder:Object,value:number):void; + /** + * Associates the given integer value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setInt}. + */ + setInt(dataHolder:Object,value:number):void; + } + /** + * Implementation of a resettable high performance map for values of simple type double. + * A high performance map is a facade to another map which will allow to reset + * all bound values to a default value in constant time. + */ + export interface HighPerformanceDoubleMap extends Object,yfiles.algorithms.INodeMap,yfiles.algorithms.IEdgeMap{ + /** + * Resets all values to the given default value in constant time. + * @param {number} defaultValue the new default value + */ + resetAll(defaultValue:number):void; + /** + * Returns the value bound to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#get}. + */ + get(dataHolder:Object):Object; + /** + * Associates the given value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#set}. + */ + set(dataHolder:Object,value:Object):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(dataHolder:Object):boolean; + /** + * 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(dataHolder:Object):number; + /** + * 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(dataHolder:Object):number; + /** + * Associates the given boolean value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setBool}. + */ + setBool(dataHolder:Object,value:boolean):void; + /** + * Associates the given double value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setDouble}. + */ + setDouble(dataHolder:Object,value:number):void; + /** + * Associates the given integer value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setInt}. + */ + setInt(dataHolder:Object,value:number):void; + } + /** + * Implementation of a resettable high performance map for values of simple type int. + * A high performance map is a facade to another map which will allow to reset + * all bound values to a default value in constant time. + */ + export interface HighPerformanceIntMap extends Object,yfiles.algorithms.INodeMap,yfiles.algorithms.IEdgeMap{ + /** + * Resets all values to the given default value in constant time. + * @param {number} defaultValue the new default value + */ + resetAll(defaultValue:number):void; + /** + * Returns the value bound to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#get}. + */ + get(dataHolder:Object):Object; + /** + * Associates the given value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#set}. + */ + set(dataHolder:Object,value:Object):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(dataHolder:Object):boolean; + /** + * 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(dataHolder:Object):number; + /** + * 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(dataHolder:Object):number; + /** + * Associates the given boolean value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setBool}. + */ + setBool(dataHolder:Object,value:boolean):void; + /** + * Associates the given double value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setDouble}. + */ + setDouble(dataHolder:Object,value:number):void; + /** + * Associates the given integer value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setInt}. + */ + setInt(dataHolder:Object,value:number):void; + } + /** + * Implementation of a resettable high performance map for values of simple type boolean. + * A high performance map is a facade to another map which will allow to reset + * all bound values to a default value in constant time. + */ + export interface HighPerformanceBoolMap extends Object,yfiles.algorithms.INodeMap,yfiles.algorithms.IEdgeMap{ + /** + * Resets all values to the given default value in constant time. + * @param {boolean} defaultValue the new default value + */ + resetAll(defaultValue:boolean):void; + /** + * Returns the value bound to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#get}. + */ + get(dataHolder:Object):Object; + /** + * Associates the given value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#set}. + */ + set(dataHolder:Object,value:Object):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(dataHolder:Object):boolean; + /** + * 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(dataHolder:Object):number; + /** + * 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(dataHolder:Object):number; + /** + * Associates the given boolean value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setBool}. + */ + setBool(dataHolder:Object,value:boolean):void; + /** + * Associates the given double value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setDouble}. + */ + setDouble(dataHolder:Object,value:number):void; + /** + * Associates the given integer value to the given node. + * @see Specified by {@link yfiles.algorithms.INodeMap#setInt}. + */ + setInt(dataHolder:Object,value:number):void; + } + } + var Maps:{ + $class:yfiles.lang.Class; + /** + * Returns a NodeMap view of a double array defined for nodes. + * The double value data[node.index()] will be accessed + * by the NodeMap upon the method calls getDouble(node) + * and setDouble(node,value). + * Warning! The indices of the accessed nodes must not change during + * the use of this NodeMap. + * @param {number[]} data array data for each node of a static graph + * @return {yfiles.algorithms.INodeMap} a NodeMap view of the given array + */ + createIndexNodeMapDouble(data:number[]):yfiles.algorithms.INodeMap; + /** + * Returns a NodeMap view of an int array defined for nodes. + * The int value data[node.index()] will be accessed + * by the NodeMap upon the method calls getInt(node) + * and setInt(node,value). + * Warning! The indices of the accessed nodes must not change during + * the use of this NodeMap. + * @param {number[]} data array data for each node of a static graph + * @return {yfiles.algorithms.INodeMap} a NodeMap view of the given array + */ + createIndexNodeMapInt(data:number[]):yfiles.algorithms.INodeMap; + /** + * Returns a NodeMap view of a boolean array defined for nodes. + * The boolean value data[node.index()] will be accessed + * by the NodeMap upon the method calls getBool(node) + * and setBool(node,value). + * @param {boolean[]} data array data for each node of a static graph + * @return {yfiles.algorithms.INodeMap} a NodeMap view of the given array + */ + createIndexNodeMapBoolean(data:boolean[]):yfiles.algorithms.INodeMap; + /** + * Returns a NodeMap view of an Object array defined for nodes. + * The Object value data[node.index()] will be accessed + * by the NodeMap upon the method calls get(node) + * and set(node,value). + * Warning! The indices of the accessed nodes must not change during + * the use of this NodeMap. + * @param {Object[]} data array data for each node of a static graph + * @return {yfiles.algorithms.INodeMap} a NodeMap view of the given array + */ + createIndexNodeMap(data:Object[]):yfiles.algorithms.INodeMap; + /** + * Returns a NodeMap view of a double, int, boolean and Object + * array defined for nodes. + * The double value doubleData[node.index()] will be accessed + * by the NodeMap upon the method calls getDouble(node) and + * setDouble(node,value). + * The int value intData[node.index()] will be accessed + * by the NodeMap upon the method calls getInt(node) and + * setInt(node,value). + * The boolean value boolData[node.index()] will be accessed + * by the NodeMap upon the method calls getBool(node) and + * setBool(node,value). + * The Object value objectData[node.index()] will be accessed + * by the NodeMap upon the method calls get(node) and + * set(node,value). + * Warning! The indices of the accessed nodes must not change during + * the use of this NodeMap. + * @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.INodeMap} a NodeMap view of the given arrays + */ + createIndexNodeMapFromArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:Object[]):yfiles.algorithms.INodeMap; + /** + * Returns a EdgeMap view of a double array defined for edges. + * The double value data[edge.index()] will be accessed + * by the EdgeMap upon the method calls getDouble(edge) + * and setDouble(edge,value). + * Warning! The indices of the accessed edges must not change during + * the use of this EdgeMap. + * @param {number[]} data array data for each edge of a static graph + * @return {yfiles.algorithms.IEdgeMap} a EdgeMap view of the given array + */ + createIndexEdgeMapDouble(data:number[]):yfiles.algorithms.IEdgeMap; + /** + * Returns a EdgeMap view of an int array defined for edges. + * The int value data[edge.index()] will be accessed + * by the EdgeMap upon the method calls getInt(edge) + * and setInt(edge,value). + * Warning! The indices of the accessed edges must not change during + * the use of this EdgeMap. + * @param {number[]} data array data for each edge of a static graph + * @return {yfiles.algorithms.IEdgeMap} a EdgeMap view of the given array + */ + createIndexEdgeMapInt(data:number[]):yfiles.algorithms.IEdgeMap; + /** + * Returns a EdgeMap view of a boolean array defined for edges. + * The boolean value data[edge.index()] will be accessed + * by the EdgeMap upon the method calls getBool(edge) + * and setBool(edge,value). + * Warning! The indices of the accessed edges must not change during + * the use of this EdgeMap. + * @param {boolean[]} data array data for each edge of a static graph + * @return {yfiles.algorithms.IEdgeMap} a EdgeMap view of the given array + */ + createIndexEdgeMapBoolean(data:boolean[]):yfiles.algorithms.IEdgeMap; + /** + * Returns a EdgeMap view of an Object array defined for edges. + * The Object value data[edge.index()] will be accessed + * by the EdgeMap upon the method calls get(edge) + * and set(edge,value). + * Warning! The indices of the accessed edges must not change during + * the use of this EdgeMap. + * @param {Object[]} data array data for each edge of a static graph + * @return {yfiles.algorithms.IEdgeMap} a EdgeMap view of the given array + */ + createIndexEdgeMap(data:Object[]):yfiles.algorithms.IEdgeMap; + /** + * Returns a EdgeMap view of a double, int, boolean and Object + * array defined for edges. + * The double value doubleData[edge.index()] will be accessed + * by the EdgeMap upon the method calls getDouble(edge) and + * setDouble(edge,value). + * The int value intData[edge.index()] will be accessed + * by the EdgeMap upon the method calls getInt(edge) and + * setInt(edge,value). + * The boolean value boolData[edge.index()] will be accessed + * by the EdgeMap upon the method calls getBool(edge) and + * setBool(edge,value). + * The Object value objectData[edge.index()] will be accessed + * by the EdgeMap upon the method calls get(edge) and + * set(edge,value). + * Warning! The indices of the accessed edges must not change during + * the use of this EdgeMap. + * @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.IEdgeMap} a EdgeMap view of the given arrays + */ + createIndexEdgeMapFromArrays(doubleData:number[],intData:number[],boolData:boolean[],objectData:Object[]):yfiles.algorithms.IEdgeMap; + /** + * Creates a NodeMap that is based on hashing. + * The preconditions specified in java.util.HashMap + * apply for the keys and values of this map. + */ + createHashedNodeMap():yfiles.algorithms.INodeMap; + /** + * Create a NodeMap view of the given map. + * Accessing basic value types is solved by + * storing the corresponding wrapper types + * Double, Integer and Boolean within the given Map. + */ + createNodeMap(map:yfiles.algorithms.IMap):yfiles.algorithms.INodeMap; + /** + * Creates an EdgeMap that is based on hashing. + * The preconditions specified in java.util.HashMap + * apply for the keys and values of this map. + */ + createHashedEdgeMap():yfiles.algorithms.IEdgeMap; + /** + * Create an EdgeMap view of the given map. + * Accessing basic value types is solved by + * storing the corresponding wrapper types + * Double, Integer and Boolean within the given Map. + */ + createEdgeMap(map:yfiles.algorithms.IMap):yfiles.algorithms.IEdgeMap; + /** + * Creates a DataMap that is based on hashing. + * The preconditions specified in java.util.HashMap + * apply for the keys and values of this map. + */ + createHashedDataMap():yfiles.algorithms.IDataMap; + /** + * Create a DataMap view of the given map. + * Accessing basic value types is solved by + * storing the corresponding wrapper types + * Double, Integer and Boolean within the given Map. + */ + createDataMap(map:yfiles.algorithms.IMap):yfiles.algorithms.IDataMap; + HighPerformanceObjectMap:{ + $class:yfiles.lang.Class; + new (backingMap:yfiles.algorithms.IDataMap,defaultValue:Object):yfiles.algorithms.Maps; + FromBackingProviderAndAcceptor:{ + new (backingProvider:yfiles.algorithms.IDataProvider,backingAcceptor:yfiles.algorithms.IDataAcceptor,defaultValue:Object):yfiles.algorithms.Maps; + }; + }; + HighPerformanceDoubleMap:{ + $class:yfiles.lang.Class; + new (backingMap:yfiles.algorithms.IDataMap,defaultValue:number):yfiles.algorithms.Maps; + FromBackingProviderAndAcceptor:{ + new (backingProvider:yfiles.algorithms.IDataProvider,backingAcceptor:yfiles.algorithms.IDataAcceptor,defaultValue:number):yfiles.algorithms.Maps; + }; + }; + HighPerformanceIntMap:{ + $class:yfiles.lang.Class; + new (backingMap:yfiles.algorithms.IDataMap,defaultValue:number):yfiles.algorithms.Maps; + FromBackingProviderAndAcceptor:{ + new (backingProvider:yfiles.algorithms.IDataProvider,backingAcceptor:yfiles.algorithms.IDataAcceptor,defaultValue:number):yfiles.algorithms.Maps; + }; + }; + HighPerformanceBoolMap:{ + $class:yfiles.lang.Class; + new (backingMap:yfiles.algorithms.IDataMap,defaultValue:boolean):yfiles.algorithms.Maps; + FromBackingProviderAndAcceptor:{ + new (backingProvider:yfiles.algorithms.IDataProvider,backingAcceptor:yfiles.algorithms.IDataAcceptor,defaultValue:boolean):yfiles.algorithms.Maps; + }; + }; + }; + /** + * A class implements the Cloneable interface to indicate to the {@link yfiles.algorithms.ICloneable#clone} method that it is legal for that method to make a field-for-field copy of instances of that class. + */ + export interface ICloneable extends Object{ + /** + * Creates and returns a copy of this object. + * The precise meaning of "copy" may depend on the class of the object. + * @see Specified by {@link yfiles.algorithms.ICloneable#clone}. + */ + clone():Object; + } + var ICloneable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The basic interface in the hierarchy of collection classes. + *

+ * A collection contains a number of items. These may or may not be in a + * specific order. The collection may or may not contain duplicate items. + *

+ *

+ * A collection allows adding and removing single as well as whole + * collections of items. + *

+ */ + export interface ICollection extends Object,yfiles.collections.ICollection{ + /** + * Adds the given item to this collection. + * @param {Object} o the object to add to the collection + * @return {boolean} true if this collection has been modified due to the call of this method. + * @see Specified by {@link yfiles.algorithms.ICollection#addObject}. + */ + addObject(o:Object):boolean; + /** + * Adds all items of the given collection to this collection. + * @param {yfiles.algorithms.ICollection} c the collection which items should be added to this collection. + * @return {boolean} true if this collection has been modified due to the call of this method. + * @see Specified by {@link yfiles.algorithms.ICollection#addAll}. + */ + addAll(c:yfiles.algorithms.ICollection):boolean; + /** + * Removes all items in this collection. + * @see Specified by {@link yfiles.algorithms.ICollection#clear}. + */ + clear():void; + /** + * Checks if this collection contains the given item. + * @param {Object} o the item to check. + * @return {boolean} true if this collection contains the given item. + * @see Specified by {@link yfiles.algorithms.ICollection#contains}. + */ + contains(o:Object):boolean; + /** + * Checks if this collection contains all the items of the given collection. + * @param {yfiles.algorithms.ICollection} c the collection that contains the items to check. + * @return {boolean} true if this collection contains all the items of the given collection. + * @see Specified by {@link yfiles.algorithms.ICollection#containsAll}. + */ + containsAll(c:yfiles.algorithms.ICollection):boolean; + /** + * Checks if this collection is equal to the given object. + * @param {Object} o the object to check equality with. + * @return {boolean} true if this collection is equal to the given object. + * @see Specified by {@link yfiles.algorithms.ICollection#equals}. + */ + equals(o:Object):boolean; + /** + * Gets the hash code of this collection. + * @return {number} the hash code of this collection. + * @see Specified by {@link yfiles.algorithms.ICollection#hashCode}. + */ + hashCode():number; + /** + * Checks if this collection is empty. + * @see Specified by {@link yfiles.algorithms.ICollection#empty}. + */ + empty:boolean; + /** + * Gets an iterator for the items of this collection. + * @return {yfiles.algorithms.IIterator} an iterator for the items of this collection. + * @see Specified by {@link yfiles.algorithms.ICollection#iterator}. + */ + iterator():yfiles.algorithms.IIterator; + /** + * Removes the given item from this collection. + * @param {Object} o the item to remove from the collection. + * @return {boolean} true if this collection has been modified due to the call of this method. + * @see Specified by {@link yfiles.algorithms.ICollection#remove}. + */ + remove(o:Object):boolean; + /** + * Removes all items of the given collection from this collection. + * @param {yfiles.algorithms.ICollection} c the collection which items should be removed from this collection. + * @return {boolean} true if this collection has been modified due to the call of this method. + * @see Specified by {@link yfiles.algorithms.ICollection#removeAll}. + */ + removeAll(c:yfiles.algorithms.ICollection):boolean; + /** + * Keeps all the items in this collection that are contained in the given collection. + * items that are not part of the given collection are removed. + * @param {yfiles.algorithms.ICollection} c The collection that contains the items that should be retained. + * @return {boolean} true if this collection has been modified due to the call of this method. + * @see Specified by {@link yfiles.algorithms.ICollection#retainAll}. + */ + retainAll(c:yfiles.algorithms.ICollection):boolean; + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.algorithms.ICollection#count}. + */ + count:number; + /** + * Creates an array containing the items of this collection. + * @return {Object[]} a new array with the items of this collection. + * @see Specified by {@link yfiles.algorithms.ICollection#toArray}. + */ + toArray():Object[]; + /** + * Copies the content of this collection to an array. + * If an array is given and it is large enough, the given array is + * used to copy the content to. Otherwise, a new array is created. + * If the given array is larger than this collection, the first array element after the content is set to null. + * @param {Object} a an optional array to use. + * @return {Object} an array with the same content as this collection. + * @see Specified by {@link yfiles.algorithms.ICollection#toGivenArray}. + */ + toGivenArray(a:Object):Object; + } + var ICollection:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An iterator over the items of a collection. + *

+ * Iterators allow to iterate over the items of a collection one-by-one as + * well as remove the item last iterated over from the list. + *

+ */ + export interface IIterator extends Object{ + /** + * Checks if there is another item in the collection. + * @see Specified by {@link yfiles.algorithms.IIterator#hasNext}. + */ + hasNext:boolean; + /** + * Gets the next item in the collection. + * @return {Object} the next item in the collection. + * @see Specified by {@link yfiles.algorithms.IIterator#next}. + */ + next():Object; + /** + * Returns from the collection the last element returned by next(). + * @see Specified by {@link yfiles.algorithms.IIterator#remove}. + */ + remove():void; + } + var IIterator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Represents a two-dimensional rectangle of size (width x height), + * located at the point (x, y). + */ + export interface Rectangle2D extends Object,yfiles.algorithms.ICloneable{ + /** + * The outer bounds of this rectangle in double coordinates. + */ + frame:yfiles.algorithms.Rectangle2D; + /** + * Sets the outer bounds of this rectangle based on the end points of one of its diagonals. + * @param {number} x1 the x-coordinate of the first end point of a diagonal. + * @param {number} y1 the y-coordinate of the first end point of a diagonal. + * @param {number} x2 the x-coordinate of the other end point of a diagonal. + * @param {number} y2 the y-coordinate of the other end point of a diagonal. + */ + setFrameFromDiagonalCoordinates(x1:number,y1:number,x2:number,y2:number):void; + /** + * Sets the outer bounds of this rectangle based on the end points of one of its diagonals. + * @param {yfiles.algorithms.Point2D} p1 the first end point of a diagonal. + * @param {yfiles.algorithms.Point2D} p2 the other end point of a diagonal. + */ + setFrameFromDiagonal(p1:yfiles.algorithms.Point2D,p2:yfiles.algorithms.Point2D):void; + /** + * Sets the outer bounds of this rectangle based on the specified new center and corner. + * @param {number} centerX the x-coordinate of the new center of this rectangle. + * @param {number} centerY the y-coordinate of the new center of this rectangle. + * @param {number} cornerX the x-coordinate of any new corner of this rectangle. + * @param {number} cornerY the y-coordinate of any new corner of this rectangle. + */ + setFrameFromCenterCoordinates(centerX:number,centerY:number,cornerX:number,cornerY:number):void; + /** + * Sets the outer bounds of this rectangle based on the specified new center and corner. + * @param {yfiles.algorithms.Point2D} center the new center of this rectangle. + * @param {yfiles.algorithms.Point2D} corner any new corner of this rectangle. + */ + setFrameFromCenter(center:yfiles.algorithms.Point2D,corner:yfiles.algorithms.Point2D):void; + /** + * Sets the outer bounds of this rectangle based on the specified location and size. + * @param {number} x the new x-coordinate of the upper left corner. + * @param {number} y the new y-coordinate of the upper left corner. + * @param {number} width the new width. + * @param {number} height the new height. + */ + setFrame(x:number,y:number,width:number,height:number):void; + /** + * The location and size of this rectangle to be similar to the specified rectangle. + */ + rect:yfiles.algorithms.Rectangle2D; + /** + * Sets the location and size of this rectangle to the specified values. + * @param {number} x the new x-coordinate of the upper left corner. + * @param {number} y the new y-coordinate of the upper left corner. + * @param {number} width the new width. + * @param {number} height the new height. + */ + setRect(x:number,y:number,width:number,height:number):void; + /** + * Calculates the intersection of this rectangle with the given rectangle and returns the result as new rectangle. + * @param {yfiles.algorithms.Rectangle2D} r a rectangle to intersect with this rectangle. + * @return {yfiles.algorithms.Rectangle2D} a new rectangle that represents the calculated intersection. + */ + createIntersection(r:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; + /** + * Calculates the union of this rectangle with the given rectangle and returns the result as new rectangle. + * @param {yfiles.algorithms.Rectangle2D} r a rectangle to union with this rectangle. + * @return {yfiles.algorithms.Rectangle2D} a new rectangle that represents the calculated union. + */ + createUnion(r:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; + /** + * Checks if the line segment specified by the given coordinates intersects this rectangle. + * @param {number} x1 the x-coordinate of the first end point of the line. + * @param {number} y1 the y-coordinate of the first end point of the line. + * @param {number} x2 the x-coordinate of the other end point of the line. + * @param {number} y2 the y-coordinate of the other end point of the line. + * @return {boolean} true if the specified line intersects this rectangle; false otherwise. + */ + intersectsLine(x1:number,y1:number,x2:number,y2:number):boolean; + /** + * Checks if the point specified by the given coordinates is contained in this rectangle. + * @param {number} x the x-coordinate of the point. + * @param {number} y the y-coordinate of the point. + * @return {boolean} true if the specified point is contained in this rectangle; false otherwise. + */ + containsPoint(x:number,y:number):boolean; + /** + * Checks whether this rectangle and the second specified rectangle intersect. + * @param {number} x the x coordinate of the second rectangle. + * @param {number} y the y coordinate of the second rectangle. + * @param {number} width the width coordinate of the second rectangle. + * @param {number} height the height coordinate of the second rectangle. + * @return {boolean} true if both rectangles intersect + */ + intersectsRectangleCoordinates(x:number,y:number,width:number,height:number):boolean; + /** + * Checks whether this rectangle completely contains the second specified rectangle. + * @param {number} x the x coordinate of the second rectangle. + * @param {number} y the y coordinate of the second rectangle. + * @param {number} width the width coordinate of the second rectangle. + * @param {number} height the height coordinate of the second rectangle. + * @return {boolean} true if this rectangle contains the second one + */ + containsRectangle(x:number,y:number,width:number,height:number):boolean; + /** + * Adds a point, specified by its coordinates, to this rectangle. + * The rectangle will be grown if necessary. Note that for points that would lie on the right or bottom border of the rectangle, + * {@link yfiles.algorithms.Rectangle2D#containsPoint} will still return false for the added point. + * @param {number} px the x coordinate of the point to add + * @param {number} py the y coordinate of the point to add + */ + addCoordinates(px:number,py:number):void; + /** + * Adds a rectangle to this rectangle. + * The rectangle will be grown to the union of both rectangles + * @param {yfiles.algorithms.Rectangle2D} r the rectangle to add + */ + add(r:yfiles.algorithms.Rectangle2D):void; + hashCode():number; + /** + * Returns whether this rectangle and obj are equal. + * Two rectangles are considered equal if the have the same location and size. + * @param {Object} obj The object to test for equality + * @return {boolean} true if both objects are equal. + */ + equals(obj:Object):boolean; + /** + * Checks whether this rectangle completely contains the second specified rectangle. + * @param {yfiles.algorithms.Rectangle2D} rect the rectangle to check for containment + * @return {boolean} true if this rectangle contains the second one + */ + containsRectangle2D(rect:yfiles.algorithms.Rectangle2D):boolean; + /** + * Checks whether this rectangle and the second specified rectangle intersect. + * @param {yfiles.algorithms.Rectangle2D} rect the rectangle to check for intersection + * @return {boolean} true if both rectangles intersect + */ + intersectsRectangle(rect:yfiles.algorithms.Rectangle2D):boolean; + /** + * The x coordinate of the upper left corner. + */ + x:number; + /** + * The y coordinate of the upper left corner. + */ + y:number; + /** + * The width of this rectangle. + */ + width:number; + /** + * The height of this rectangle. + */ + height:number; + /** + * Specifies whether this instance is empty, i.e. + * covers no area. + */ + empty:boolean; + /** + * The smallest x coordinate of this rectangle. + */ + minX:number; + /** + * The smallest y coordinate of this rectangle. + */ + minY:number; + /** + * The largest x coordinate of this rectangle. + */ + maxX:number; + /** + * The largest y coordinate of this rectangle. + */ + maxY:number; + /** + * The x coordinate of the center point of this rectangle. + */ + centerX:number; + /** + * The y coordinate of the center point of this rectangle. + */ + centerY:number; + toString():string; + /** + * Creates a new instance of this class that has the same values as this objects. + * @return {Object} a new instance of this class that has the same values as this objects. + * @see Specified by {@link yfiles.algorithms.ICloneable#clone}. + */ + clone():Object; + /** + * Creates a {@link yfiles.geometry.RectD} from a given {@link yfiles.algorithms.Rectangle2D}. + * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toRectDFromRectangle2D}. + * @return {yfiles.geometry.RectD} The {@link yfiles.geometry.RectD}. + */ + toRectDFromRectangle2D():yfiles.geometry.RectD; + } + export module Rectangle2D{ + /** + * Concrete implementation of {@link yfiles.algorithms.Rectangle2D}. + */ + export interface Double extends yfiles.algorithms.Rectangle2D{ + /** + * Sets the location and size of this rectangle to the specified values. + * @param {number} x the new x-coordinate of the upper left corner. + * @param {number} y the new y-coordinate of the upper left corner. + * @param {number} width the new width. + * @param {number} height the new height. + */ + setRect(x:number,y:number,width:number,height:number):void; + /** + * Sets the outer bounds of this rectangle based on the specified location and size. + * @param {number} x the new x-coordinate of the upper left corner. + * @param {number} y the new y-coordinate of the upper left corner. + * @param {number} width the new width. + * @param {number} height the new height. + */ + setFrame(x:number,y:number,width:number,height:number):void; + /** + * The outer bounds of this rectangle in double coordinates. + */ + frame:yfiles.algorithms.Rectangle2D; + /** + * Checks whether this rectangle and the second specified rectangle intersect. + * @param {number} x the x coordinate of the second rectangle. + * @param {number} y the y coordinate of the second rectangle. + * @param {number} width the width coordinate of the second rectangle. + * @param {number} height the height coordinate of the second rectangle. + * @return {boolean} true if both rectangles intersect + */ + intersectsRectangleCoordinates(x:number,y:number,width:number,height:number):boolean; + /** + * Calculates the intersection of this rectangle with the given rectangle and returns the result as new rectangle. + * @param {yfiles.algorithms.Rectangle2D} r a rectangle to intersect with this rectangle. + * @return {yfiles.algorithms.Rectangle2D} a new rectangle that represents the calculated intersection. + */ + createIntersection(r:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; + /** + * Calculates the union of this rectangle with the given rectangle and returns the result as new rectangle. + * @param {yfiles.algorithms.Rectangle2D} r a rectangle to union with this rectangle. + * @return {yfiles.algorithms.Rectangle2D} a new rectangle that represents the calculated union. + */ + createUnion(r:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; + /** + * The x coordinate of the upper left corner. + */ + x:number; + /** + * The y coordinate of the upper left corner. + */ + y:number; + /** + * The width of this rectangle. + */ + width:number; + /** + * The height of this rectangle. + */ + height:number; + /** + * Specifies whether this instance is empty, i.e. + * covers no area. + */ + empty:boolean; + /** + * The largest x coordinate of this rectangle. + */ + maxX:number; + /** + * The largest y coordinate of this rectangle. + */ + maxY:number; + /** + * The x coordinate of the center point of this rectangle. + */ + centerX:number; + /** + * The y coordinate of the center point of this rectangle. + */ + centerY:number; + /** + * The bounds of this instance in double precision. + */ + bounds2D:yfiles.algorithms.Rectangle2D; + /** + * Creates and returns a copy of this object. + * The precise meaning of "copy" may depend on the class of the object. + * @see Specified by {@link yfiles.algorithms.ICloneable#clone}. + */ + clone():Object; + /** + * @see Overrides {@link yfiles.algorithms.Rectangle2D#equals} + */ + equals(obj:Object):boolean; + } + } + var Rectangle2D:{ + $class:yfiles.lang.Class; + Double:{ + $class:yfiles.lang.Class; + /** + * Creates a new rectangle of the specified size at the specified location. + * @param {number} x the x-coordinate of the upper left corner of the created rectangle. + * @param {number} y the y-coordinate of the upper left corner of the created rectangle. + * @param {number} width the width of the created rectangle. + * @param {number} height the height of the created rectangle. + */ + FromValues:{ + new (x:number,y:number,width:number,height:number):yfiles.algorithms.Rectangle2D; + }; + /** + * Creates a new rectangle of size (0 x 0) at the location (0, 0). + */ + new ():yfiles.algorithms.Rectangle2D; + }; + /** + * Cannot create instances of this abstract class. + */ + new ():yfiles.algorithms.Rectangle2D; + /** + * Calculates the intersection of the first and second specified rectangle and sets the resulting location and size to + * the third rectangle. + * @param {yfiles.algorithms.Rectangle2D} src1 the first rectangle to intersect. + * @param {yfiles.algorithms.Rectangle2D} src2 the second rectangle to intersect. + * @param {yfiles.algorithms.Rectangle2D} dst the rectangle to which the result is set. + */ + intersect(src1:yfiles.algorithms.Rectangle2D,src2:yfiles.algorithms.Rectangle2D,dst:yfiles.algorithms.Rectangle2D):void; + /** + * Calculates the union of the first and second specified rectangle and sets the resulting location and size to the + * third rectangle. + * @param {yfiles.algorithms.Rectangle2D} src1 the first rectangle to union. + * @param {yfiles.algorithms.Rectangle2D} src2 the second rectangle to union. + * @param {yfiles.algorithms.Rectangle2D} dst the rectangle to which the result is set. + */ + union(src1:yfiles.algorithms.Rectangle2D,src2:yfiles.algorithms.Rectangle2D,dst:yfiles.algorithms.Rectangle2D):void; + }; + /** + * An ordered collection of items. + *

+ * Items can be appended as well as inserted at a specific index. Also, items + * can be retrieved or removed from the list at a certain position using an + * integer index. + *

+ *

+ * A list, unlike a set, can contain the same item more than once at distinct + * positions. + *

+ */ + export interface IList extends Object,yfiles.algorithms.ICollection,yfiles.collections.IList{ + /** + * Appends the given item at the end of the list. + * @param {Object} o the object to add + * @return {boolean} true if this list has been modified due to the call of this method. + * @see Specified by {@link yfiles.algorithms.IList#addObject}. + */ + addObject(o:Object):boolean; + /** + * Appends all items of the given collection at the end of this list. + * @param {yfiles.algorithms.ICollection} c the collection which items should 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#addAll}. + */ + addAll(c:yfiles.algorithms.ICollection):boolean; + /** + * 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,item:Object):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; + /** + * 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; + /** + * Returns the index of first occurrence of the specified item in this list, + * or -1 if the list does not contain the object. + * @param {Object} o the item whose index is being returned. + * @return {number} the index of the specified item, or -1. + * @see Specified by {@link yfiles.algorithms.IList#indexOf}. + */ + indexOf(o:Object):number; + /** + * 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; + /** + * 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; + /** + * 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; + /** + * Removes the first occurrence of the given item from this list. + * @param {Object} o the item to remove. + * @return {boolean} true if this collection has been modified due to the call of this method. + * @see Specified by {@link yfiles.algorithms.IList#remove}. + */ + remove(o:Object):boolean; + /** + * Removes all items of the given collection from this list. + * @param {yfiles.algorithms.ICollection} c the collection which items should be removed from this collection. + * @return {boolean} true if this collection has been modified due to the call of this method. + * @see Specified by {@link yfiles.algorithms.IList#removeAll}. + */ + removeAll(c:yfiles.algorithms.ICollection):boolean; + /** + * 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; + /** + * 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,item:Object):Object; + /** + * 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; + /** + * Clears this collection and makes it empty. + * @see Specified by {@link yfiles.algorithms.IList#clear}. + */ + clear():void; + /** + * Determines whether the provided object is part of this collection. + * @param {Object} o The instance to check. + * @see Specified by {@link yfiles.algorithms.IList#contains}. + */ + contains(o:Object):boolean; + /** + * Yields the number of items in this collection. + * @see Specified by {@link yfiles.algorithms.IList#count}. + */ + count:number; + isFixedSize:boolean; + } + var IList:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface for collections that contain no duplicates. + *

+ * For each pair of elements e1 and e2 in a set, e1.equals(e2) is always false. + * In addition, the {@link yfiles.algorithms.ICollection#addObject} and {@link yfiles.algorithms.ICollection#addAll} methods do not insert objects that are already + * present in the set (again, according to the equals method of the entries). + *

+ *

+ * This interface does not impose restrictions on the order or the type of the entries. + * Concrete implementations may thus allow or disallow null entries or impose a specific order of the entries. + *

+ *

+ * Note that the behavior is undefined if you use mutable objects as entries and change them in a way that affects equality comparisons + * with other entries as long as the object is stored in the set. + *

+ */ + export interface ISet extends Object,yfiles.algorithms.ICollection{ + } + var ISet:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Iterates over a list of items either forwards or backwards. + *

+ * Also allows to insert items into the list at the current + * position. + *

+ *

+ * The cursor can be regarded as being located between two list items. There + * is no current, but only a next and a previous item. + *

+ */ + export interface IListIterator extends Object,yfiles.algorithms.IIterator{ + /** + * Adds an item to the list next to the current cursor position. + * @param {Object} o the item to be added. + * @see Specified by {@link yfiles.algorithms.IListIterator#add}. + */ + add(o:Object):void; + /** + * Checks if there is an item before the current cursor position. + * @see Specified by {@link yfiles.algorithms.IListIterator#hasPrevious}. + */ + hasPrevious:boolean; + /** + * Gets the index of the next element. + * @return {number} + * the index of the next element, or the size of the list if there is + * no next item. + * @see Specified by {@link yfiles.algorithms.IListIterator#nextIndex}. + */ + nextIndex():number; + /** + * Get the element before the current cursor position. + * @return {Object} the element before the current cursor position. + * @see Specified by {@link yfiles.algorithms.IListIterator#previous}. + */ + previous():Object; + /** + * Gets the index of the previous element. + * @return {number} + * the index of the previous element, or -1 if there is + * no previous item. + * @see Specified by {@link yfiles.algorithms.IListIterator#previousIndex}. + */ + previousIndex():number; + /** + * Assigns the specified object to the index of the element that was last + * returned by next() or previous(). + * The item + * previously at this position is replaced. + * @param {Object} o the item which to set at the index of the last item. + * @see Specified by {@link yfiles.algorithms.IListIterator#set}. + */ + set(o:Object):void; + } + var IListIterator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface for objects that store associations between keys and values. + *

+ * Maps are also known as dictionaries or associative arrays and map each element in the {@link yfiles.algorithms.IMap#keySet} collection + * to exactly one element in the {@link yfiles.algorithms.IMap#values} collection (which may be null). Each key-value pair is represented by + * an instance of {@link yfiles.algorithms.IMapEntry}. The set of all key-value pairs can be accessed through the {@link yfiles.algorithms.IMap#entrySet} collection. + *

+ *

+ * This interface does not impose restrictions on the order of the entries and on the + * type of either keys or values. Concrete implementations may thus allow or disallow null keys or impose a specific order of the entries. + *

+ *

+ * Note that the behavior is undefined if you use mutable objects as keys and change them in a way that affects equality comparisons + * with other keys as long as the object is used as key in the map. + *

+ */ + export interface IMap extends Object{ + /** + * Returns the number of entries in this map. + * @return {number} The number of entries in this map. + * @see Specified by {@link yfiles.algorithms.IMap#size}. + */ + size():number; + /** + * true iff this map does not contain any entries. + * @see Specified by {@link yfiles.algorithms.IMap#empty}. + */ + empty:boolean; + /** + * Returns true if the given object is currently mapped to a (possibly null) value. + * @param {Object} key The object whose use as a key is checked. + * @return {boolean} true if key is currently mapped to a value. + * @see Specified by {@link yfiles.algorithms.IMap#containsKey}. + */ + containsKey(key:Object):boolean; + /** + * Returns true if the given object is currently associated to at least one key. + * @param {Object} value The object whose use as a key is checked. + * @return {boolean} true if value is currently associated to at least one key. + * @see Specified by {@link yfiles.algorithms.IMap#containsValue}. + */ + containsValue(value:Object):boolean; + /** + * Retrieves the value that key maps to. + * If no mapping for key exists, this method returns null. A null return value + * may also occur if key has been explicitly mapped to null. To check whether a mapping for the key exists + * at all, use the {@link yfiles.algorithms.IMap#containsKey} method instead. + * @param {Object} key The key object for which the mapped value is requested. + * @return {Object} The value to which the specified key is mapped, or null if no such mapping exists. + * @see Specified by {@link yfiles.algorithms.IMap#get}. + */ + get(key:Object):Object; + /** + * Maps key to value. + * An existing mapping for key will be replaced. Implementations may impose additional restrictions + * on the type or value of key. + * @param {Object} key The key that maps to value. + * @param {Object} value The value that is associated to key. + * @return {Object} The previous value associated with key, or null if no previous mapping existed. + * @see Specified by {@link yfiles.algorithms.IMap#put}. + */ + put(key:Object,value:Object):Object; + /** + * Removes the mapping from key to its associated value. + * key need not be present as an actual key in this map, in which case the map is not modified. + * @param {Object} key The key whose mapping should be removed. + * @return {Object} The previous value associated with key, or null if no previous mapping existed. + * @see Specified by {@link yfiles.algorithms.IMap#remove}. + */ + remove(key:Object):Object; + /** + * Inserts all mappings in t into this map. + * @param {yfiles.algorithms.IMap} t The map whose mappings should be copied. + * @see Specified by {@link yfiles.algorithms.IMap#putAll}. + */ + putAll(t:yfiles.algorithms.IMap):void; + /** + * Clears all mappings from this instance. + * @see Specified by {@link yfiles.algorithms.IMap#clear}. + */ + clear():void; + /** + * The {@link yfiles.algorithms.ISet} of all keys in this map. + *

+ * This is a live view on the map keys in the sense that + * changes in the map are automatically reflected in this collection and vice-versa. + *

+ *

+ * Note that modifications on the map instance while iterating over the set are not supported (i.e. the behavior is undefined) + *

+ * @return {yfiles.algorithms.ISet} The set of keys in this instance. + * @see Specified by {@link yfiles.algorithms.IMap#keySet}. + */ + keySet():yfiles.algorithms.ISet; + /** + * The {@link yfiles.algorithms.ICollection} of all values in this map. + *

+ * This is a live view on the map values in the sense that + * changes in the map are automatically reflected in this collection and vice-versa. This collection may contain duplicate entries + * if a value is associated with more than one key. + *

+ *

+ * Note that modifications on the map instance while iterating over the set are not supported (i.e. the behavior is undefined) + *

+ * @return {yfiles.algorithms.ICollection} The collection of values in this instance. + * @see Specified by {@link yfiles.algorithms.IMap#values}. + */ + values():yfiles.algorithms.ICollection; + /** + * The {@link yfiles.algorithms.ISet} of all key-value mappings in this map. + *

+ * The entries are of type {@link yfiles.algorithms.IMapEntry}. This is a live view on the map entries in the sense that + * changes in the map are automatically reflected in this collection and vice-versa. + *

+ *

+ * Note that modifications on the map instance while iterating over the set are not supported (i.e. the behavior is undefined) + *

+ * @return {yfiles.algorithms.ISet} The set of key-value mappings in this instance. + * @see Specified by {@link yfiles.algorithms.IMap#entrySet}. + */ + entrySet():yfiles.algorithms.ISet; + /** + * Returns whether o is equal to this instance. + * o and this instance are considered equal when o + * is also a Map and both {@link yfiles.algorithms.IMap#entrySet}s are equal. + * @param {Object} o The object that is compared for equality with this instance + * @return {boolean} true when both objects are equal. + * @see Specified by {@link yfiles.algorithms.IMap#equals}. + */ + equals(o:Object):boolean; + /** + * Returns the hash code for this map instance. + * @return {number} The hash code for this map instance. + * @see Specified by {@link yfiles.algorithms.IMap#hashCode}. + */ + hashCode():number; + } + var IMap:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The representation of a key-value mapping in a {@link yfiles.algorithms.IMap}. + * Instances of this interface are returned in the {@link yfiles.algorithms.IMap#entrySet} set. These instances may be invalidated + * if the underlying map is modified. Therefore, it is only safe to use these objects during an iteration that does not modify the + * map. + */ + export interface IMapEntry extends Object{ + /** + * Checks for equality between this object and o. + * @param {Object} o The object that is checked for equality. + * @return {boolean} true iff o and this instance are equal. + * @see Specified by {@link yfiles.algorithms.IMapEntry#equals}. + */ + equals(o:Object):boolean; + /** + * The key stored in this entry. + * If the mapping has been removed on the underlying map instance, the behavior is undefined. + * @see Specified by {@link yfiles.algorithms.IMapEntry#key}. + */ + key:Object; + /** + * The value stored in this entry. + * If the mapping has been removed on the underlying map instance, the behavior is undefined. + * @see Specified by {@link yfiles.algorithms.IMapEntry#value}. + */ + value:Object; + /** + * Returns the hash code for this instance. + * @return {number} The hash code for this instance. + * @see Specified by {@link yfiles.algorithms.IMapEntry#hashCode}. + */ + hashCode():number; + /** + * Changes the value associated with this entry. + * This is a live operation on the underlying map. If the mapping for the key has been removed + * on the underlying map instance, the behavior is undefined. + * @param {Object} value The value that should be associated to the key of this entry. + * @return {Object} The value previously associated to the key of this entry. + * @see Specified by {@link yfiles.algorithms.IMapEntry#setValue}. + */ + setValue(value:Object):Object; + } + var IMapEntry:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Represents a two-dimensional rectangle of size (width x height), + * located at the point (x, y). + */ + export interface Rectangle extends yfiles.algorithms.Rectangle2D{ + /** + * Sets the upper left corner of this rectangle to the given values. + * @param {number} x the x coordinate of the new location + * @param {number} y the y coordinate of the new location + */ + setLocation(x:number,y:number):void; + /** + * Sets the location and size of this rectangle to the specified values. + * @param {number} x the new x-coordinate of the upper left corner. + * @param {number} y the new y-coordinate of the upper left corner. + * @param {number} width the new width. + * @param {number} height the new height. + */ + setRect(x:number,y:number,width:number,height:number):void; + /** + * Sets the location and size of this rectangle to the same values as in the given rectangle. + * @param {yfiles.algorithms.Rectangle} r the rectangle where all values are taken from. + */ + setBounds(r:yfiles.algorithms.Rectangle):void; + /** + * Sets the location and size of this rectangle to the specified values. + * @param {number} x the new x-coordinate of the upper left corner. + * @param {number} y the new y-coordinate of the upper left corner. + * @param {number} width the new width. + * @param {number} height the new height. + */ + setBoundsCoordinates(x:number,y:number,width:number,height:number):void; + /** + * Enlarge this instance by the given amounts. + * The rectangle will be resized by dx units on both the left and right side and dy units on both + * the top and bottom side. For negative values of dx or dy, the rectangle will shrink accordingly. + * @param {number} dx the enlargement in horizontal direction. + * @param {number} dy the enlargement in vertical direction. + */ + grow(dx:number,dy:number):void; + /** + * Moves the rectangle by the given amount in x resp. + * y direction. + * @param {number} mx The movement in x direction + * @param {number} my The movement in y direction + */ + translate(mx:number,my:number):void; + /** + * Adds a point, specified by its coordinates, to this rectangle. + * The rectangle will be grown if necessary. Note that for points that would lie on the right or bottom border of the rectangle, + * {@link yfiles.algorithms.Rectangle#containsIntCoordinates} will still return false for the added point. + * @param {number} px the x coordinate of the point to add + * @param {number} py the y coordinate of the point to add + */ + addIntCoordinates(px:number,py:number):void; + /** + * Adds a rectangle to this rectangle. + * The rectangle will be grown to the union of both rectangles + * @param {yfiles.algorithms.Rectangle} r the rectangle to add + */ + addRectangle(r:yfiles.algorithms.Rectangle):void; + /** + * Checks if the point specified by the given coordinates is contained in this rectangle. + * @param {number} px the x-coordinate of the point. + * @param {number} py the y-coordinate of the point. + * @return {boolean} true if the specified point is contained in this rectangle; false otherwise. + */ + containsIntCoordinates(px:number,py:number):boolean; + /** + * Checks whether this rectangle completely contains the second specified rectangle. + * @param {number} rx the x coordinate of the second rectangle. + * @param {number} ry the y coordinate of the second rectangle. + * @param {number} rw the width coordinate of the second rectangle. + * @param {number} rh the height coordinate of the second rectangle. + * @return {boolean} true if this rectangle contains the second one + */ + containsIntRectangle(rx:number,ry:number,rw:number,rh:number):boolean; + /** + * Checks whether this rectangle completely contains the second specified rectangle. + * @param {yfiles.algorithms.Rectangle} r the rectangle to check for containment + * @return {boolean} true if this rectangle contains the second one + */ + contains(r:yfiles.algorithms.Rectangle):boolean; + /** + * Calculates the intersection of this rectangle with the given rectangle and returns the result as new rectangle. + * @param {yfiles.algorithms.Rectangle2D} r a rectangle to intersect with this rectangle. + * @return {yfiles.algorithms.Rectangle2D} a new rectangle that represents the calculated intersection. + */ + createIntersection(r:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; + /** + * Calculates the intersection of this rectangle with the given rectangle and returns the result as new {@link yfiles.algorithms.Rectangle}. + * @param {yfiles.algorithms.Rectangle} r a rectangle to intersect with this rectangle. + * @return {yfiles.algorithms.Rectangle} a new rectangle that represents the calculated intersection. + */ + intersection(r:yfiles.algorithms.Rectangle):yfiles.algorithms.Rectangle; + /** + * Checks whether this rectangle and the second specified rectangle intersect. + * @param {yfiles.algorithms.Rectangle} r the second rectangle. + * @return {boolean} true if both rectangles intersect + */ + intersects(r:yfiles.algorithms.Rectangle):boolean; + /** + * Calculates the union of this rectangle with the given rectangle and returns the result as new rectangle. + * @param {yfiles.algorithms.Rectangle2D} r a rectangle to union with this rectangle. + * @return {yfiles.algorithms.Rectangle2D} a new rectangle that represents the calculated union. + */ + createUnion(r:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; + /** + * Calculates the union of this rectangle with the given rectangle and returns the result as new {@link yfiles.algorithms.Rectangle}. + * @param {yfiles.algorithms.Rectangle} r a rectangle to union with this rectangle. + * @return {yfiles.algorithms.Rectangle} a new rectangle that represents the calculated union. + */ + union(r:yfiles.algorithms.Rectangle):yfiles.algorithms.Rectangle; + /** + * @see Overrides {@link yfiles.algorithms.Rectangle2D#equals} + */ + equals(obj:Object):boolean; + /** + * The x coordinate of the upper left corner. + */ + x:number; + /** + * The y coordinate of the upper left corner. + */ + y:number; + /** + * The height of this rectangle. + */ + height:number; + /** + * The width of this rectangle. + */ + width:number; + /** + * Specifies whether this instance is empty, i.e. + * covers no area. + */ + empty:boolean; + /** + * The bounds of this rectangle as a new{@link yfiles.algorithms.Rectangle} instance. + */ + bounds:yfiles.algorithms.Rectangle; + /** + * The bounds of this rectangle as a new{@link yfiles.algorithms.Rectangle2D} instance. + */ + bounds2D:yfiles.algorithms.Rectangle2D; + /** + * Creates and returns a copy of this object. + * The precise meaning of "copy" may depend on the class of the object. + * @see Specified by {@link yfiles.algorithms.ICloneable#clone}. + */ + clone():Object; + /** + * Creates a {@link yfiles.geometry.RectD} from a given {@link yfiles.algorithms.Rectangle}. + * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toRectDFromRectangle}. + * @return {yfiles.geometry.RectD} The {@link yfiles.geometry.RectD}. + */ + toRectD():yfiles.geometry.RectD; + } + var Rectangle:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with the given location and dimensions. + * @param {number} x the x coordinate of the upper left corner of the new rectangle + * @param {number} y the y coordinate of the upper left corner of the new rectangle + * @param {number} height the height of the new rectangle + * @param {number} width the width of the new rectangle + */ + FromValues:{ + new (x:number,y:number,width:number,height:number):yfiles.algorithms.Rectangle; + }; + /** + * Creates a new instance located at the coordinate system origin with the given dimensions. + * @param {number} height the height of the new rectangle + * @param {number} width the width of the new rectangle + */ + FromWidthAndHeight:{ + new (width:number,height:number):yfiles.algorithms.Rectangle; + }; + /** + * Creates a new instance with the same values as in the given rectangle. + * @param {yfiles.algorithms.Rectangle} r The rectangle whose values are used for the initialization + */ + FromRectangle:{ + new (r:yfiles.algorithms.Rectangle):yfiles.algorithms.Rectangle; + }; + /** + * Creates a new empty instance located at the coordinate system origin. + */ + new ():yfiles.algorithms.Rectangle; + }; + /** + * A factory class that creates instances of the classes implementing + * {@link yfiles.algorithms.ICollection}. + */ + export interface CollectionFactory extends Object{ + } + var CollectionFactory:{ + $class:yfiles.lang.Class; + /** + * Creates a new {@link yfiles.algorithms.IList}. + * @return {yfiles.algorithms.IList} + * a new instance of {@link yfiles.algorithms.IList}. + */ + createArrayList():yfiles.algorithms.IList; + /** + * Creates a new {@link yfiles.algorithms.IList} with the contents of the specified + * collection. + * @return {yfiles.algorithms.IList} + * a new instance of {@link yfiles.algorithms.IList}. + */ + createArrayListFromCollection(c:yfiles.algorithms.ICollection):yfiles.algorithms.IList; + /** + * Creates a new {@link yfiles.algorithms.IMap}. + * @return {yfiles.algorithms.IMap} + * a new instance of {@link yfiles.algorithms.IMap}. + */ + createHashMap():yfiles.algorithms.IMap; + /** + * Creates a new {@link yfiles.algorithms.ISet}. + * @return {yfiles.algorithms.ISet} + * a new instance of {@link yfiles.algorithms.ISet}. + */ + createHashSet():yfiles.algorithms.ISet; + /** + * Creates a new {@link yfiles.algorithms.ISet} with the contents of the specified + * collection. + * @return {yfiles.algorithms.ISet} + * a new instance of {@link yfiles.algorithms.ISet}. + */ + createHashSetFromCollection(c:yfiles.algorithms.ICollection):yfiles.algorithms.ISet; + /** + * Creates a new {@link yfiles.algorithms.ISet}. + * @return {yfiles.algorithms.ISet} + * a new instance of {@link yfiles.algorithms.ISet}. + */ + createTreeSet():yfiles.algorithms.ISet; + /** + * Creates a new {@link yfiles.algorithms.ISet} with the contents of the specified + * collection. + * @return {yfiles.algorithms.ISet} + * a new instance of {@link yfiles.algorithms.ISet}. + */ + createTreeSetFromCollection(c:yfiles.algorithms.ICollection):yfiles.algorithms.ISet; + }; + /** + * Double-precision immutable insets representation. + */ + export interface Insets extends Object,yfiles.algorithms.ICloneable{ + /** + * The inset from the top. + */ + top:number; + /** + * The inset from the left. + */ + left:number; + /** + * The inset from the bottom. + */ + bottom:number; + /** + * The inset from the right. + */ + right:number; + hashCode():number; + /** + * Returns whether this insets object and o are equal. + * Two insets are considered equal if the have the same values for each side. + * @param {Object} o The object to test for equality + * @return {boolean} true if both objects are equal. + */ + equals(o:Object):boolean; + /** + * Creates and returns a copy of this object. + * The precise meaning of "copy" may depend on the class of the object. + * @see Specified by {@link yfiles.algorithms.ICloneable#clone}. + */ + clone():Object; + toString():string; + /** + * Assigns the given values to this instance. + * @param {number} top The new top inset value + * @param {number} left The new left inset value + * @param {number} bottom The new bottom inset value + * @param {number} right The new right inset value + */ + set(top:number,left:number,bottom:number,right:number):void; + /** + * Creates a {@link yfiles.geometry.InsetsD} from a given {@link yfiles.algorithms.Insets}. + * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toInsetsD}. + * @return {yfiles.geometry.InsetsD} The {@link yfiles.geometry.InsetsD}. + */ + toInsetsD():yfiles.geometry.InsetsD; + } + var Insets:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with the given values. + * @param {number} top The new top inset value + * @param {number} left The new left inset value + * @param {number} bottom The new bottom inset value + * @param {number} right The new right inset value + */ + new (top:number,left:number,bottom:number,right:number):yfiles.algorithms.Insets; + }; + /** + * Represents a two-dimensional point located at (x, y). + */ + export interface Point2D extends Object,yfiles.algorithms.ICloneable{ + /** + * Sets the location of this point to the given coordinates. + * @param {number} x the new x coordinate + * @param {number} y the new y coordinate + */ + setLocation(x:number,y:number):void; + /** + * The location of this point to the same values as for the given point. + */ + location:yfiles.algorithms.Point2D; + toString():string; + /** + * Calculates the squared distance between this points and another one, given as its coordinates. + * @param {number} px The x coordinate of the second point. + * @param {number} py The y coordinate of the second point. + * @return {number} the squared distance between this points and another one, given as its coordinates. + */ + distanceSqToCoordinates(px:number,py:number):number; + /** + * Calculates the squared distance between this points and another one. + * @param {yfiles.algorithms.Point2D} p The second point. + * @return {number} the squared distance between this points and another one. + */ + distanceSq(p:yfiles.algorithms.Point2D):number; + /** + * Calculates the distance between this points and another one, given as its coordinates. + * @param {number} px The x coordinate of the second point. + * @param {number} py The y coordinate of the second point. + * @return {number} the distance between this points and another one, given as its coordinates. + */ + distanceToCoordinates(px:number,py:number):number; + /** + * Calculates the distance between this points and another one. + * @param {yfiles.algorithms.Point2D} p The second point. + * @return {number} the distance between this points and another one. + */ + distance(p:yfiles.algorithms.Point2D):number; + hashCode():number; + /** + * Returns whether this point and obj are equal. + * Two points are considered equal if the have the same location. + * @param {Object} obj The object to test for equality + * @return {boolean} true if both objects are equal. + */ + equals(obj:Object):boolean; + /** + * The x coordinate of this point. + */ + x:number; + /** + * The y coordinate of this point. + */ + y:number; + /** + * Creates a new instance of this class that has the same values as this objects. + * @return {Object} a new instance of this class that has the same values as this objects. + * @see Specified by {@link yfiles.algorithms.ICloneable#clone}. + */ + clone():Object; + /** + * Creates a {@link yfiles.geometry.PointD} from a given {@link yfiles.algorithms.Point2D}. + * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toPointDFromPoint2D}. + * @return {yfiles.geometry.PointD} The {@link yfiles.geometry.PointD}. + */ + toPointD():yfiles.geometry.PointD; + } + export module Point2D{ + /** + * Concrete implementation of {@link yfiles.algorithms.Point2D}. + */ + export interface Double extends yfiles.algorithms.Point2D{ + /** + * The x coordinate of this point. + */ + x:number; + /** + * The y coordinate of this point. + */ + y:number; + /** + * Creates and returns a copy of this object. + * The precise meaning of "copy" may depend on the class of the object. + * @see Specified by {@link yfiles.algorithms.ICloneable#clone}. + */ + clone():Object; + /** + * Sets the location of this point to the given coordinates. + * @param {number} x the new x coordinate + * @param {number} y the new y coordinate + */ + setLocation(x:number,y:number):void; + } + } + var Point2D:{ + $class:yfiles.lang.Class; + Double:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance at the given location. + * @param {number} x The x coordinate of the new point + * @param {number} y The x coordinate of the new point + */ + FromValues:{ + new (x:number,y:number):yfiles.algorithms.Point2D; + }; + /** + * Creates a new instance that is located at (0, 0). + */ + new ():yfiles.algorithms.Point2D; + }; + /** + * Calculates the squared distance between two points, given as their coordinates. + * @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. + * @return {number} the squared distance between two points, given as their coordinates. + */ + distanceSqBetween(x1:number,y1:number,x2:number,y2:number):number; + /** + * Calculates the distance between two points, given as their coordinates. + * @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. + * @return {number} the distance between two points, given as their coordinates. + */ + distanceBetween(x1:number,y1:number,x2:number,y2:number):number; + }; + } + export module binding{ + /** + * This class represents a binding, enabling the specification + * of an arbitrary property path in a JavaScript object. + * Using the Converter and ConverterParameter properties, the bound + * value can be converted to another object using custom code. + */ + export interface Binding extends Object{ + /** + * Gets or sets the property path. + */ + path:string; + /** + * Gets or sets the converter. + * The value can be an {@link yfiles.system.IValueConverter} + * or an arbitrary function. + */ + converter:Object; + /** + * Gets or sets the converter parameter. + */ + converterParameter:Object; + /** + * Evaluates the binding against an object. + * @param {Object} o The object the binding is evaluated against. + * @return {Object} The converted value of the bound property + */ + evaluate(o:Object):Object; + } + var Binding:{ + $class:yfiles.lang.Class; + /** + * Creates a new Binding instance. + * If null is passed in + * for path, this instance returns + * the context object itself when evaluated. + * @param {string} path The property path, or null. + */ + new (path:string):yfiles.binding.Binding; + }; + /** + * This class is an adapter that creates a {@link yfiles.binding.GraphSourceBase#graph} + * from custom business data. + *

+ * This class can be used when the business data specifies a collection of + * nodes and the edges are explicitly defined as collections of incoming and + * outgoing connections of each node object. + *

+ *

+ * The nodes in the graph are determined using the + * {@link yfiles.binding.GraphSourceBase#nodesSource}, {@link yfiles.binding.AdjacentEdgesGraphSource#inEdgesBinding}and + * {@link yfiles.binding.AdjacentEdgesGraphSource#outEdgesBinding} properties. The in-edges and out-edges + * bindings define the connections and direct neighbors of a node. If a + * {@link yfiles.binding.GraphSourceBase#nodeIdBinding} is set, the + * {@link yfiles.binding.AdjacentEdgesGraphSource#inEdgesBinding} and {@link yfiles.binding.AdjacentEdgesGraphSource#outEdgesBinding} + * should yield these IDs instead of the node business objects. + *

+ *

+ * The method {@link yfiles.binding.GraphSourceBase#updateGraph} can be used to + * update the {@link yfiles.graph.IGraph} when the underlying collection of the + * business objects changed. In this case, the nodes specified by + * NodesSource are always present. All other nodes, that are the ones + * defined only in the in-edges or out-edges binding, persist only if they + * are reachable by a sequence of such bindings that originates at a + * node specified by NodesSource. Graph components that are no longer + * reachable by a sequence of such bindings from a node specified by + * NodesSource are completely removed from the graph. + *

+ *

+ * For assigning nodes to groups the + * {@link yfiles.binding.GraphSourceBase#groupBinding} has to be defined. Group nodes + * can be nested using the {@link yfiles.binding.GraphSourceBase#parentGroupBinding} + * property. Labels for the edges can be defined by setting a suitable + * {@link yfiles.binding.AdjacentEdgesGraphSource#edgeLabelBinding}. + *

+ *

+ * The visual appearance of the graph constructed from the business objects + * is configurable using the {@link yfiles.binding.GraphSourceBase#nodeDefaults}, the + * {@link yfiles.binding.GraphSourceBase#groupNodeDefaults}, and the + * {@link yfiles.binding.GraphSourceBase#edgeDefaults}property. + *

+ */ + export interface AdjacentEdgesGraphSource extends yfiles.binding.GraphSourceBase{ + /** + * Get or set the business objects to be represented as edges of the + * {@link yfiles.binding.GraphSourceBase#graph}. This can either be an array of objects, + * a plain JavaScript object or an {@link yfiles.objectcollections.IEnumerable} containing + * the objects to be displayed as edges. + * In case the value of this property is a plain JavaScript object, the + * object's properties are enumerated with Object.getOwnPropertyNames + * and used as the source for the graph edges. + */ + edgesSource:Object; + /** + * Gets or sets the binding for getting the business objects that specify the outgoing + * connections of a business object. + * This binding maps a business object that represents a node to another business object + * o which specifies the outgoing edges of this node. Similar to + * {@link yfiles.binding.AdjacentEdgesGraphSource#edgesSource}, the object o can either be an array, an + * {@link yfiles.collections.IEnumerable}, or a plain JavaScript object and should contain business + * objects that represent edges. If an {@link yfiles.binding.AdjacentEdgesGraphSource#edgeIdBinding} is set, this collection + * should contain the IDs of the objects that specify the edges instead of the objects + * themselves. + *

+ * Unlike groups and nodes, an edge is created only if valid bindings for the source and target + * nodes are also defined. + *

+ *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + * @see {@link yfiles.binding.AdjacentEdgesGraphSource#inEdgesBinding} + */ + outEdgesBinding:Object; + /** + * Gets or sets the binding for getting the business objects that specify the incoming + * connections of a business object. + * This binding maps a business object that represents a node to another business object + * o which specifies the incoming edges of this node. Similar to + * {@link yfiles.binding.AdjacentEdgesGraphSource#edgesSource}, the object o can either be an array, an + * {@link yfiles.collections.IEnumerable}, or a plain JavaScript object and should contain business + * objects that represent edges. If an {@link yfiles.binding.AdjacentEdgesGraphSource#edgeIdBinding} is set, this collection + * should contain the IDs of the objects that specify the edges instead of the objects + * themselves. + *

+ * Unlike groups and nodes, an edge is created only if valid bindings for the source and target + * nodes are also defined. + *

+ *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + * @see {@link yfiles.binding.AdjacentEdgesGraphSource#outEdgesBinding} + */ + inEdgesBinding:Object; + /** + * Gets or sets the mandatory source node binding. + * This binding maps a business object e that represents an edge to another business + * object n which represents a node. This node will become the source node of the edge. + * If a {@link yfiles.binding.GraphSourceBase#nodeIdBinding} is set, the object n should be the + * ID of the object that specifies the node instead of the object itself. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + * @see {@link yfiles.binding.AdjacentEdgesGraphSource#targetNodeBinding} + * @see {@link yfiles.binding.AdjacentEdgesGraphSource#edgesSource} + */ + sourceNodeBinding:Object; + /** + * Gets or sets the mandatory target node binding. + * This binding maps a business object e that represents an edge to another business + * object n which represents a node. This node will become the target node of the edge. + * If a {@link yfiles.binding.GraphSourceBase#nodeIdBinding} is set, the object n should be the + * ID of the object that specifies the node instead of the object itself. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + * @see {@link yfiles.binding.AdjacentEdgesGraphSource#sourceNodeBinding} + * @see {@link yfiles.binding.AdjacentEdgesGraphSource#edgesSource} + */ + targetNodeBinding:Object; + /** + * Gets or sets the edge ID binding. + * This binding maps a business object that represents an edge to its ID. If this binding is + * set, edge IDs can be used in a business object that represents an edge to identify the + * source node and target node of the corresponding edge. The binding should not be changed + * once the graph is built. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.AdjacentEdgesGraphSource#edgesSource} + * @see {@link yfiles.binding.AdjacentEdgesGraphSource#sourceNodeBinding} + * @see {@link yfiles.binding.AdjacentEdgesGraphSource#targetNodeBinding} + * @see {@link yfiles.binding.AdjacentEdgesGraphSource#inEdgesBinding} + * @see {@link yfiles.binding.AdjacentEdgesGraphSource#outEdgesBinding} + */ + edgeIdBinding:Object; + /** + * Gets or sets the edge label binding. + * This binding maps a business object that represents an edge to an object that specifies the + * label data of that edge. By default, the label data object must be convertible into a + * string. This can be customized by overriding {@link yfiles.binding.AdjacentEdgesGraphSource#createEdge} and + * {@link yfiles.binding.AdjacentEdgesGraphSource#updateEdge}. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.AdjacentEdgesGraphSource#edgesSource} + */ + edgeLabelBinding:Object; + /** + * Creates a new edge connecting the given nodes and assigns the + * dataparameter to the edge's + * {@link yfiles.support.ITagOwner#tag Tag} property. + * This class calls this method to create all new edges, and customers may + * override it to customize edge creation. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.INode} sourceNode The source node of the edge. + * @param {yfiles.graph.INode} targetNode The target node of the edge. + * @param {Object} labelData The optional label data of the edge if an + * {@link yfiles.binding.AdjacentEdgesGraphSource#edgeLabelBinding} is specified. + * @param {Object} data The business data associated with the edge. + * @return {yfiles.graph.IEdge} The created edge. + */ + createEdge(graph:yfiles.graph.IGraph,sourceNode:yfiles.graph.INode,targetNode:yfiles.graph.INode,labelData:Object,data:Object):yfiles.graph.IEdge; + /** + * Updates an existing edge when {@link yfiles.binding.GraphSourceBase#updateGraph} + * is called and the edge should remain in the graph. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.IEdge} edge The edge to update. + * @param {Object} labelData The optional label data of the edge if an + * {@link yfiles.binding.AdjacentEdgesGraphSource#edgeLabelBinding} is specified. + * @param {Object} data The business data associated with the edge. + */ + updateEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,labelData:Object,data:Object):void; + /** + * Retrieves the associated edge in the {@link yfiles.binding.GraphSourceBase#graph} for a business + * object from the {@link yfiles.binding.AdjacentEdgesGraphSource#edgesSource}. + * @param {Object} businessObject A business object from the {@link yfiles.binding.AdjacentEdgesGraphSource#edgesSource} to get the + * edge for. + * @return {yfiles.graph.IEdge} The edge associated with the business object or null for unknown + * objects. + * @see {@link yfiles.binding.GraphSourceBase#getBusinessObject} + * @see {@link yfiles.binding.GraphSourceBase#getNode} + * @see {@link yfiles.binding.GraphSourceBase#getGroup} + */ + getEdge(businessObject:Object):yfiles.graph.IEdge; + } + var AdjacentEdgesGraphSource:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of this class. + */ + new ():yfiles.binding.AdjacentEdgesGraphSource; + }; + /** + * This class is an adapter that creates a {@link yfiles.binding.GraphSourceBase#graph} + * from custom business data. + *

+ * This class can be used when the business data specifies a collection of + * nodes and the edges are implicitly defined as collections of predecessors + * and successors of each node object. + *

+ *

+ * The nodes in the graph are determined using the + * {@link yfiles.binding.GraphSourceBase#nodesSource}, + * {@link yfiles.binding.AdjacentNodesGraphSource#predecessorsBinding} and {@link yfiles.binding.AdjacentNodesGraphSource#successorsBinding} + * properties. The predecessors and successors bindings define the direct + * neighbors of a node. Edges are automatically added between a node and its + * predecessors and successors. If a + * {@link yfiles.binding.GraphSourceBase#nodeIdBinding} is set, the + * {@link yfiles.binding.AdjacentNodesGraphSource#predecessorsBinding} and {@link yfiles.binding.AdjacentNodesGraphSource#successorsBinding} + * should yield these IDs instead of the node business objects. + *

+ *

+ * The method {@link yfiles.binding.GraphSourceBase#updateGraph} can be used to + * update the {@link yfiles.graph.IGraph} when the underlying collection of the + * business objects changed. In this case, the nodes specified by + * NodesSource are always present. All other nodes, that are the ones + * defined only in the predecessor or successor binding, persist only if they + * are reachable by a sequence of neighborhood bindings that originates at a + * node specified by NodesSource. Graph components that are no longer + * reachable by a sequence of neighborhood bindings from a node specified by + * NodesSource are completely removed from the graph. + *

+ *

+ * For assigning nodes to groups the + * {@link yfiles.binding.GraphSourceBase#groupBinding} has to be defined. Group nodes + * can be nested using the {@link yfiles.binding.GraphSourceBase#parentGroupBinding} + * property. + *

+ *

+ * The visual appearance of the graph constructed from the business objects + * is configurable using the {@link yfiles.binding.GraphSourceBase#nodeDefaults}, the + * {@link yfiles.binding.GraphSourceBase#groupNodeDefaults}, and the + * {@link yfiles.binding.GraphSourceBase#edgeDefaults}property. + *

+ */ + export interface AdjacentNodesGraphSource extends yfiles.binding.GraphSourceBase{ + /** + * Gets or sets the successors binding. + * This binding maps a business object that represents a node to another business object + * o which specifies the successor nodes of this node. Similar to + * {@link yfiles.binding.GraphSourceBase#nodesSource}, the object o can either be an array, an + * {@link yfiles.collections.IEnumerable}, or a plain JavaScript object and should contain business + * objects that represent nodes. If a {@link yfiles.binding.GraphSourceBase#nodeIdBinding} is set, + * this collection should contain the IDs of the objects that specifies the nodes instead + * of the objects themselves. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + * @see {@link yfiles.binding.AdjacentNodesGraphSource#predecessorsBinding} + */ + successorsBinding:Object; + /** + * Gets or sets the predecessors binding. + * This binding maps a business object that represents a node to another business object + * o which specifies the predecessor nodes of this node. Similar to + * {@link yfiles.binding.GraphSourceBase#nodesSource}, the object o can either be an array, an + * {@link yfiles.collections.IEnumerable}, or a plain JavaScript object and should contain business + * objects that represent nodes. If a {@link yfiles.binding.GraphSourceBase#nodeIdBinding} is set, + * this collection should contain the IDs of the objects that specifies the nodes instead + * of the objects themselves. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + * @see {@link yfiles.binding.AdjacentNodesGraphSource#successorsBinding} + */ + predecessorsBinding:Object; + /** + * Creates a new edge connecting the given nodes. + * This class calls this method to create all new edges, and customers may + * override it to customize edge creation. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.INode} sourceNode The source node of the edge. + * @param {yfiles.graph.INode} targetNode The target node of the edge. + * @return {yfiles.graph.IEdge} The created edge. + */ + createEdge(graph:yfiles.graph.IGraph,sourceNode:yfiles.graph.INode,targetNode:yfiles.graph.INode):yfiles.graph.IEdge; + /** + * Updates an existing edge connecting the given nodes when {@link yfiles.binding.GraphSourceBase#updateGraph} + * is called and the edge should remain in the graph. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.IEdge} edge The edge to update. + * @param {yfiles.graph.INode} sourceNode The source node of the edge. + * @param {yfiles.graph.INode} targetNode The target node of the edge. + */ + updateEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,sourceNode:yfiles.graph.INode,targetNode:yfiles.graph.INode):void; + } + var AdjacentNodesGraphSource:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of this class. + */ + new ():yfiles.binding.AdjacentNodesGraphSource; + }; + /** + * This class is an adapter which creates a {@link yfiles.binding.TreeSource#graph} from hierarchical business data. + *

+ * The nodes in the tree are determined using the {@link yfiles.binding.TreeSource#nodesSource} and {@link yfiles.binding.TreeSource#childBinding} properties. + * Optionally, a collection of group nodes can be specified with {@link yfiles.binding.TreeSource#groupsSource}. + *

+ *

+ * Nodes will be visualized using the style as defined in the {@link yfiles.binding.TreeSource#nodeDefaults} property. + * The created {@link yfiles.binding.TreeSource#graph} is a directed forest, a set of directed trees. Each directed tree has exactly + * one root node with no incoming edges. For every other node v in a directed tree there is exactly + * one directed path from the root node of the directed tree to node v. + *

+ *

+ * To assign nodes to groups the {@link yfiles.binding.GraphSourceBase#groupBinding} has to be defined. + * Group nodes can be nested using the {@link yfiles.binding.GraphSourceBase#parentGroupBinding} + * property. Labels for the edges can be defined by setting a suitable + * {@link yfiles.binding.TreeSource#edgeLabelBinding}, which is resolved on the target (child) node. + *

+ *

+ * This class can be used to {@link yfiles.binding.TreeSource#updateGraph update} the {@link yfiles.binding.TreeSource#graph} + * when the underlying collection of the business objects ({@link yfiles.binding.TreeSource#nodesSource} and {@link yfiles.binding.TreeSource#childBinding}) changes. + *

+ * @see {@link yfiles.binding.TreeSource#nodesSource} + * @see {@link yfiles.binding.TreeSource#childBinding} + */ + export interface TreeSource extends Object{ + /** + * Returns the {@link yfiles.graph.IGraph graph} used by this instance. + */ + graph:yfiles.graph.IGraph; + /** + * Gets or sets the business objects to be represented as nodes. This can either be an array of objects, + * a plain JavaScript object, or an {@link yfiles.objectcollections.IEnumerable} containing the objects to be displayed as nodes. + *

+ * Note that it is not necessary to include all nodes in this property, if they can be reached via the + * {@link yfiles.binding.TreeSource#childBinding}. In this case it suffices to include all root nodes. + *

+ *

+ * If the nodes source + * contains more than just the root nodes, some node sources are visited more than once during the construction + * of the {@link yfiles.binding.TreeSource#graph}. In order to avoid duplicate nodes, the tree source keeps track of node sources + * for which nodes have already been constructed. + *

+ *

In case the value of this property is a plain JavaScript object, the object's properties are enumerated + * with Object.getOwnPropertyNames and used as the source for the tree nodes. + *

+ */ + nodesSource:Object; + /** + * Gets or sets the business objects to be represented as group nodes of the + * {@link yfiles.binding.TreeSource#graph}. This can either be an array of objects, + * a plain JavaScript object or an {@link yfiles.objectcollections.IEnumerable} containing + * the objects to be displayed as group nodes. + * In case the value of this property is a plain JavaScript object, the + * object's properties are enumerated with Object.getOwnPropertyNames + * and used as the source for the graph nodes. + */ + groupsSource:Object; + /** + * Gets or sets the binding for getting the child business objects of a business object. + * Gets or sets the binding for the children of a node. + * This binding can either be a {@link yfiles.binding.Binding} object or a plain + * JavaScript function. + * The context of the binding will be the (parent) business object and the binding should yield + * an Array, a JSON object or null, based on the source type of the parent, + * that can be used to enumerate the child business objects, which are + * then recursively queried for their children. + * + * This binding maps a business object that represents a node to another business object + * o which specifies the children of this node. Similar to + * {@link yfiles.binding.GraphSourceBase#nodesSource}, the object o can either be an array, an + * {@link yfiles.objectcollections.IEnumerable}, or a plain JavaScript object and should contain business + * objects that represent nodes. If a {@link yfiles.binding.GraphSourceBase#nodeIdBinding} is set, + * these collection should contain the IDs of the objects that specifies the nodes instead + * of the objects themselves. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.TreeSource#nodesSource} + * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + */ + childBinding:Object; + /** + * Gets or sets the node ID binding. + * This binding maps a business object that represents a node to its ID. If this binding is + * set, node IDs can be used in a business object that represents an edge to identify the + * source node and target node of the corresponding edge. The binding should not be changed + * once the graph is built. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.TreeSource#nodesSource} + */ + idBinding:Object; + /** + * Gets or sets the edge label binding. + * This binding maps a business object that represents a node to an object that specifies the + * label data of the incoming edge of that node. By default, the label data object must be + * convertible into a string. This can be customized by overriding {@link yfiles.binding.TreeSource#createEdge} and + * {@link yfiles.binding.TreeSource#updateEdge}. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ */ + edgeLabelBinding:Object; + /** + * Gets or sets the node label binding. + * This binding maps a business object that represents a node to an object that specifies the + * label data of that node. It can either be a {@link yfiles.binding.Binding} object or a plain + * JavaScript function. + *

+ * By default, the label data object must be convertible into a string. This can be customized + * by overriding {@link yfiles.binding.TreeSource#createNode} and {@link yfiles.binding.TreeSource#updateNode}. + *

+ *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.TreeSource#nodesSource} + */ + nodeLabelBinding:Object; + /** + * Gets or sets the binding for determining a node's position on the x-axis. + * This binding maps a business object that represents a node to a number that specifies the + * x-coordinate of that node. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.TreeSource#nodesSource} + */ + locationXBinding:Object; + /** + * Gets or sets the binding for determining a node's position on the y-axis. + * This binding maps a business object that represents a node to a number that specifies the + * y-coordinate of that node. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.TreeSource#nodesSource} + */ + locationYBinding:Object; + /** + * Gets or sets the group node ID binding. + * This binding maps a business object that represents a group to its ID. If this binding is + * set, group IDs can be used in a business object that represents a node to identify the + * parent group of the corresponding node. The binding should not be changed once the graph is + * built. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.TreeSource#groupsSource} + */ + groupIdBinding:Object; + /** + * Gets or sets the group binding. + * This binding maps a business object o1 that represents a group to another object + * o2 that specifies the parent group of o1. If o2 is contained in + * {@link yfiles.binding.TreeSource#groupsSource}, then the node for o1 becomes a child node of the group + * for o2. + *

+ * If a {@link yfiles.binding.TreeSource#groupIdBinding} is set, to object o2 should be the ID of the object + * that specifies the group instead of the object itself. + *

+ *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.TreeSource#nodesSource} + */ + groupBinding:Object; + /** + * Gets or sets the parent group binding. + * This binding maps a business object o1 that represents a group to another object + * o2 that specifies the parent group of o1. If o2 is contained in + * {@link yfiles.binding.TreeSource#groupsSource}, then the group for o1 becomes a child node of the group + * for o2. + *

+ * If a {@link yfiles.binding.TreeSource#groupIdBinding} is set, to object o2 should be the ID of the object + * that specifies the group instead of the object itself. + *

+ *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ */ + parentGroupBinding:Object; + /** + * Gets the node defaults to be used in the graph. + */ + nodeDefaults:yfiles.graph.INodeDefaults; + /** + * Gets the group node defaults used by the graph created by this class. + */ + groupNodeDefaults:yfiles.graph.INodeDefaults; + /** + * Gets the edge defaults to be used in the graph. + */ + edgeDefaults:yfiles.graph.IEdgeDefaults; + /** + * Generates the graph instance from the bound business data. + * First, this method clears the graph, and then it adds new groups, nodes, and edges as + * specified by the business data and bindings. + * @return {yfiles.graph.IGraph} The created graph. + * @see {@link yfiles.binding.TreeSource#updateGraph} + */ + buildGraph():yfiles.graph.IGraph; + /** + * Updates the graph instance to fit the bound business data. + * This method can be used to fit the graph to changed business data. In contrast to + * {@link yfiles.binding.TreeSource#buildGraph}, it does not initially clear the graph. Instead, it keeps graph + * elements that for business objects are still present in the data, creates new elements for + * new data, and removes obsolete elements. + */ + updateGraph():void; + /** + * Creates an edge between the source and target node. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.INode} sourceNode The source node of the edge. + * @param {yfiles.graph.INode} targetNode The target node of the edge. + * @param {Object} labelData The optional label data of the edge if an + * {@link yfiles.binding.TreeSource#edgeLabelBinding} is specified. + * @return {yfiles.graph.IEdge} The created edge. + */ + createEdge(graph:yfiles.graph.IGraph,sourceNode:yfiles.graph.INode,targetNode:yfiles.graph.INode,labelData:Object):yfiles.graph.IEdge; + /** + * Creates a node with the specified parent and assigns the data + * parameter to the node's {@link yfiles.support.ITagOwner#tag Tag} property. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph. + * @param {yfiles.graph.INode} parent The node's parent node. + * @param {yfiles.geometry.PointD} location The location of the node. + * @param {Object} labelData The optional label data of the node if an + * {@link yfiles.binding.TreeSource#nodeLabelBinding} is specified. + * @param {Object} data The business data associated with the node. + * @return {yfiles.graph.INode} The created node. + */ + createNode(groupedGraph:yfiles.graph.IGroupedGraph,parent:yfiles.graph.INode,location:yfiles.geometry.PointD,labelData:Object,data:Object):yfiles.graph.INode; + /** + * Creates a new group node and assigns the dataparameter to the group + * node's {@link yfiles.support.ITagOwner#tag Tag} property. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph. + * @param {Object} data The business data associated with the group node. + * @return {yfiles.graph.INode} The created node. + */ + createGroupNode(groupedGraph:yfiles.graph.IGroupedGraph,data:Object):yfiles.graph.INode; + /** + * Updates an edge with the given data. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.IEdge} edge The edge to update. + * @param {yfiles.graph.INode} sourceNode The edge's source node. + * @param {yfiles.graph.INode} targetNode The edge's target node. + * @param {Object} labelData The business data associated with the edge. + */ + updateEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,sourceNode:yfiles.graph.INode,targetNode:yfiles.graph.INode,labelData:Object):void; + /** + * Updates a node with the given data. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph. + * @param {yfiles.graph.INode} node The node to update. + * @param {yfiles.graph.INode} parent The node's parent node. + * @param {yfiles.geometry.PointD} location The location of the node. + * @param {Object} labelData The optional label data of the edge if an + * {@link yfiles.binding.TreeSource#nodeLabelBinding} is specified. + * @param {Object} data The business data associated with the node. + */ + updateNode(groupedGraph:yfiles.graph.IGroupedGraph,node:yfiles.graph.INode,parent:yfiles.graph.INode,location:yfiles.geometry.PointD,labelData:Object,data:Object):void; + /** + * Updates an existing group node when {@link yfiles.binding.TreeSource#updateGraph} is called and the group should + * remain in the graph. + * This class calls this method to create all new groups, and customers may override it to + * customize group creation. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph. + * @param {yfiles.graph.INode} groupNode The group node to update. + * @param {Object} data The business data associated with the group node. + */ + updateGroupNode(groupedGraph:yfiles.graph.IGroupedGraph,groupNode:yfiles.graph.INode,data:Object):void; + /** + * Retrieves the associated business object for a given {@link yfiles.graph.INode node} + * from the {@link yfiles.binding.TreeSource#graph}. + * @param {yfiles.model.IModelItem} graphElement The node of the graph to get the business object for. + * @return {Object} The business object associated with the graph element. + * @see {@link yfiles.binding.TreeSource#getNode} + */ + getBusinessObject(graphElement:yfiles.model.IModelItem):Object; + /** + * Retrieves the associated node in the {@link yfiles.binding.TreeSource#graph} for a business object from the + * {@link yfiles.binding.TreeSource#nodesSource}. + * @param {Object} businessObject A business object from the {@link yfiles.binding.TreeSource#nodesSource} to get the + * node for. + * @return {yfiles.graph.INode} The node associated with the business object or null for unknown + * objects. + * @see {@link yfiles.binding.TreeSource#getBusinessObject} + */ + getNode(businessObject:Object):yfiles.graph.INode; + } + var TreeSource:{ + $class:yfiles.lang.Class; + /** + * Creates a new empty instance. + * The {@link yfiles.binding.TreeSource#graph} will be empty until the {@link yfiles.binding.TreeSource#nodesSource} is set and {@link yfiles.binding.TreeSource#buildGraph} + * is called. + * The {@link yfiles.binding.TreeSource#childBinding} needs to be set in order to actually create a tree. + */ + new ():yfiles.binding.TreeSource; + }; + /** + * Base class for adapters that create a {@link yfiles.binding.GraphSourceBase#graph} from custom + * business data. + * Customers should not create own implementations based on this class but + * use one of the ready-made adapters {@link yfiles.binding.GraphSource}, + * {@link yfiles.binding.AdjacentNodesGraphSource}, or + * {@link yfiles.binding.AdjacentEdgesGraphSource}. + */ + export interface GraphSourceBase extends Object{ + /** + * Returns the {@link yfiles.graph.IGraph graph} used by this class. + */ + graph:yfiles.graph.IGraph; + /** + * Gets or sets the business objects to be represented as nodes of the + * {@link yfiles.binding.GraphSourceBase#graph}. This can either be an array of objects, + * a plain JavaScript object or an {@link yfiles.objectcollections.IEnumerable} containing + * the objects to be displayed as nodes. + * In case the value of this property is a plain JavaScript object, the + * object's properties are enumerated with Object.getOwnPropertyNames + * and used as the source for the graph nodes. + */ + nodesSource:Object; + /** + * Gets or sets the business objects to be represented as group nodes of the + * {@link yfiles.binding.GraphSourceBase#graph}. This can either be an array of objects, + * a plain JavaScript object or an {@link yfiles.objectcollections.IEnumerable} containing + * the objects to be displayed as group nodes. + * In case the value of this property is a plain JavaScript object, the + * object's properties are enumerated with Object.getOwnPropertyNames + * and used as the source for the graph nodes. + */ + groupsSource:Object; + /** + * Gets the node defaults used by the graph created by this class. + */ + nodeDefaults:yfiles.graph.INodeDefaults; + /** + * Gets the group node defaults used by the graph created by this class. + */ + groupNodeDefaults:yfiles.graph.INodeDefaults; + /** + * Gets the edge defaults used by the graph created by this class. + */ + edgeDefaults:yfiles.graph.IEdgeDefaults; + /** + * Gets or sets the node ID binding. + * This binding maps a business object that represents a node to its ID. If this binding is + * set, node IDs can be used in a business object that represents an edge to identify the + * source node and target node of the corresponding edge. The binding should not be changed + * once the graph is built. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + */ + nodeIdBinding:Object; + /** + * Gets or sets the node label binding. + * This binding maps a business object that represents a node to an object that specifies the + * label data of that node. It can either be a {@link yfiles.binding.Binding} object or a plain + * JavaScript function. + *

+ * By default, the label data object must be convertible into a string. This can be customized + * by overriding {@link yfiles.binding.GraphSourceBase#createNode} and {@link yfiles.binding.GraphSourceBase#updateNode}. + *

+ *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + */ + nodeLabelBinding:Object; + /** + * Gets or sets the group node ID binding. + * This binding maps a business object that represents a group to its ID. If this binding is + * set, group IDs can be used in a business object that represents a node to identify the + * parent group of the corresponding node. The binding should not be changed once the graph is + * built. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSourceBase#groupsSource} + */ + groupIdBinding:Object; + /** + * Gets or sets the group binding. + * This binding maps a business object o1 that represents a group to another object + * o2 that specifies the parent group of o1. If o2 is contained in + * {@link yfiles.binding.GraphSourceBase#groupsSource}, then the node for o1 becomes a child node of the group + * for o2. + *

+ * If a {@link yfiles.binding.GraphSourceBase#groupIdBinding} is set, to object o2 should be the ID of the object + * that specifies the group instead of the object itself. + *

+ *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + */ + groupBinding:Object; + /** + * Gets or sets the parent group binding. + * This binding maps a business object o1 that represents a group to another object + * o2 that specifies the parent group of o1. If o2 is contained in + * {@link yfiles.binding.GraphSourceBase#groupsSource}, then the group for o1 becomes a child node of the group + * for o2. + *

+ * If a {@link yfiles.binding.GraphSourceBase#groupIdBinding} is set, to object o2 should be the ID of the object + * that specifies the group instead of the object itself. + *

+ *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ */ + parentGroupBinding:Object; + /** + * Gets or sets the binding for determining a node's position on the x-axis. + * This binding maps a business object that represents a node to a number that specifies the + * x-coordinate of that node. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + */ + locationXBinding:Object; + /** + * Gets or sets the binding for determining a node's position on the y-axis. + * This binding maps a business object that represents a node to a number that specifies the + * y-coordinate of that node. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + */ + locationYBinding:Object; + /** + * Generates the graph instance from the bound business data. + * First, this method clears the graph, and then it adds new groups, nodes, + * and edges as specified by the business data and bindings. + * @return {yfiles.graph.IGraph} The created graph. + * @see {@link yfiles.binding.GraphSourceBase#updateGraph} + */ + buildGraph():yfiles.graph.IGraph; + /** + * Updates the graph instance to fit the bound business data. + * This method can be used to fit the graph to changed business data. In + * contrast to {@link yfiles.binding.GraphSourceBase#buildGraph}, it does not initially clear the + * graph. Instead, it keeps graph elements that for business objects are still + * present in the data, creates new elements for new data, and removes + * obsolete elements. + */ + updateGraph():void; + /** + * Creates a new node with the specified parent and assigns the + * dataparameter to the node's + * {@link yfiles.support.ITagOwner#tag Tag} property. + * + * This class calls this method to create all new nodes, and customers may + * override it to customize node creation. + * + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph. + * @param {yfiles.graph.INode} parent The node's parent node. + * @param {yfiles.geometry.PointD} location The location of the node. + * @param {Object} labelData The optional label data of the node if an + * {@link yfiles.binding.GraphSourceBase#nodeLabelBinding} is specified. + * @param {Object} data The business data associated with the node. + * @return {yfiles.graph.INode} The created node. + */ + createNode(groupedGraph:yfiles.graph.IGroupedGraph,parent:yfiles.graph.INode,location:yfiles.geometry.PointD,labelData:Object,data:Object):yfiles.graph.INode; + /** + * Updates an existing node when {@link yfiles.binding.GraphSourceBase#updateGraph} is called and + * the node should remain in the graph. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph. + * @param {yfiles.graph.INode} node The node to update. + * @param {yfiles.graph.INode} parent The node's parent node. + * @param {yfiles.geometry.PointD} location The location of the node. + * @param {Object} labelData The optional label data of the node if an + * {@link yfiles.binding.GraphSourceBase#nodeLabelBinding} is specified. + * @param {Object} data The business data associated with the node. + */ + updateNode(groupedGraph:yfiles.graph.IGroupedGraph,node:yfiles.graph.INode,parent:yfiles.graph.INode,location:yfiles.geometry.PointD,labelData:Object,data:Object):void; + /** + * Updates an existing group node when {@link yfiles.binding.GraphSourceBase#updateGraph} is called + * and the group should remain in the graph. + * This class calls this method to create all new groups, and customers may + * override it to customize group creation. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph. + * @param {yfiles.graph.INode} groupNode The group node to update. + * @param {Object} data The business data associated with the group node. + */ + updateGroupNode(groupedGraph:yfiles.graph.IGroupedGraph,groupNode:yfiles.graph.INode,data:Object):void; + /** + * Creates a new group node and assigns the + * dataparameter to the group node's + * {@link yfiles.support.ITagOwner#tag Tag} property. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph. + * @param {Object} data The business data associated with the group node. + * @return {yfiles.graph.INode} The created node. + */ + createGroupNode(groupedGraph:yfiles.graph.IGroupedGraph,data:Object):yfiles.graph.INode; + /** + * Retrieves the associated business object for a given {@link yfiles.model.IModelItem graph item} + * from the {@link yfiles.binding.GraphSourceBase#graph}. + * @param {yfiles.model.IModelItem} graphElement The item of the graph to get the business object for. + * @return {Object} The business object associated with the graph item. + * @see {@link yfiles.binding.GraphSourceBase#getNode} + * @see {@link yfiles.binding.GraphSourceBase#getGroup} + */ + getBusinessObject(graphElement:yfiles.model.IModelItem):Object; + /** + * Retrieves the associated node in the {@link yfiles.binding.GraphSourceBase#graph} for a business object from the + * {@link yfiles.binding.GraphSourceBase#nodesSource}. + * @param {Object} businessObject A business object from the {@link yfiles.binding.GraphSourceBase#nodesSource} to get the + * node for. + * @return {yfiles.graph.INode} The node associated with the business object or null for unknown + * objects. + * @see {@link yfiles.binding.GraphSourceBase#getBusinessObject} + * @see {@link yfiles.binding.GraphSourceBase#getGroup} + */ + getNode(businessObject:Object):yfiles.graph.INode; + /** + * Retrieves the associated group node in the {@link yfiles.binding.GraphSourceBase#graph} for a business object from + * the {@link yfiles.binding.GraphSourceBase#groupsSource}. + * @param {Object} businessObject A business object from the {@link yfiles.binding.GraphSourceBase#groupsSource} to get + * the group for. + * @return {yfiles.graph.INode} The group associated with the business object or null for unknown + * objects. + * @see {@link yfiles.binding.GraphSourceBase#getBusinessObject} + * @see {@link yfiles.binding.GraphSourceBase#getNode} + */ + getGroup(businessObject:Object):yfiles.graph.INode; + } + var GraphSourceBase:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of this class. + */ + new ():yfiles.binding.GraphSourceBase; + }; + /** + * This class is an adapter that creates a {@link yfiles.binding.GraphSourceBase#graph} + * from custom business data. + *

+ * This class can be used when the business data specifies a collection of + * nodes, a collection of edges, and optionally, a collection of groups. The + * business data can be set using the + * {@link yfiles.binding.GraphSourceBase#nodesSource}, + * {@link yfiles.binding.GraphSourceBase#groupsSource} and + * {@link yfiles.binding.GraphSource#edgesSource} properties. + *

+ *

+ * To determine the source and target of an edge, the + * {@link yfiles.binding.GraphSource#sourceNodeBinding} and the {@link yfiles.binding.GraphSource#targetNodeBinding} + * need to be set for business objects that are the source for edges. If a + * {@link yfiles.binding.GraphSourceBase#nodeIdBinding} is set, the + * {@link yfiles.binding.GraphSource#sourceNodeBinding} and {@link yfiles.binding.GraphSource#targetNodeBinding} should + * yield these IDs instead of the node business objects. + *

+ *

+ * For assigning nodes to groups the + * {@link yfiles.binding.GraphSourceBase#groupBinding} has to be defined. Group nodes + * can be nested using the {@link yfiles.binding.GraphSourceBase#parentGroupBinding} + * property. Labels for the edges can be defined by setting a suitable + * {@link yfiles.binding.GraphSource#edgeLabelBinding}. + *

+ *

+ * The visual appearance of the graph constructed from the business objects + * is configurable using the {@link yfiles.binding.GraphSourceBase#nodeDefaults}, the + * {@link yfiles.binding.GraphSourceBase#groupNodeDefaults}, and the + * {@link yfiles.binding.GraphSourceBase#edgeDefaults}property. + *

+ */ + export interface GraphSource extends yfiles.binding.GraphSourceBase{ + /** + * Gets or sets a value indicating whether or not the source and target + * bindings must yield business objects that are contained in + * {@link yfiles.binding.GraphSourceBase#nodesSource}. + * If this property is set to false, an edge is created + * if and only if its source and target bindings yield a business object + * that is contained in {@link yfiles.binding.GraphSourceBase#nodesSource}. + * Otherwise, if this property is true, an edge is + * created for each item of {@link yfiles.binding.GraphSource#edgesSource} and nodes are created + * for the source and target as needed. + * Value: + * true if the source and target bindings must yield business + * objects that are contained in + * {@link yfiles.binding.GraphSourceBase#nodesSource}; otherwise, false. + * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + * @see {@link yfiles.binding.GraphSource#edgesSource} + */ + lazyNodeDefinition:boolean; + /** + * Get or set the business objects to be represented as edges of the + * {@link yfiles.binding.GraphSourceBase#graph}. This can either be an array of objects, + * a plain JavaScript object or an {@link yfiles.objectcollections.IEnumerable} containing + * the objects to be displayed as edges. + * In case the value of this property is a plain JavaScript object, the + * object's properties are enumerated with Object.getOwnPropertyNames + * and used as the source for the graph edges. + */ + edgesSource:Object; + /** + * Gets or sets the mandatory source node binding. + * This binding maps a business object e that represents an edge to another business + * object n which represents a node. This node will become the source node of the edge. + * If a {@link yfiles.binding.GraphSourceBase#nodeIdBinding} is set, the object n should be the + * ID of the object that specifies the node instead of the object itself. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + * @see {@link yfiles.binding.GraphSource#targetNodeBinding} + * @see {@link yfiles.binding.GraphSource#edgesSource} + */ + sourceNodeBinding:Object; + /** + * Gets or sets the mandatory target node binding. + * This binding maps a business object e that represents an edge to another business + * object n which represents a node. This node will become the target node of the edge. + * If a {@link yfiles.binding.GraphSourceBase#nodeIdBinding} is set, the object n should be the + * ID of the object that specifies the node instead of the object itself. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSourceBase#nodesSource} + * @see {@link yfiles.binding.GraphSource#sourceNodeBinding} + * @see {@link yfiles.binding.GraphSource#edgesSource} + */ + targetNodeBinding:Object; + /** + * Gets or sets the edge label binding. + * This binding maps a business object that represents an edge to an object that specifies the + * label data of that edge. By default, the label data object must be convertible into a + * string. This can be customized by overriding {@link yfiles.binding.GraphSource#createEdge} and + * {@link yfiles.binding.GraphSource#updateEdge}. + *

+ * The binding can either be a {@link yfiles.binding.Binding} object or a plain JavaScript function. In + * the latter case, the function must have the same signature as {@link yfiles.binding.Binding#evaluate}. + *

+ * @see {@link yfiles.binding.GraphSource#edgesSource} + */ + edgeLabelBinding:Object; + /** + * Creates a new edge connecting the given nodes and assigns the + * dataparameter to the edge's + * {@link yfiles.support.ITagOwner#tag Tag} property. + * This class calls this method to create all new edges, and customers may + * override it to customize edge creation. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.INode} sourceNode The source node of the edge. + * @param {yfiles.graph.INode} targetNode The target node of the edge. + * @param {Object} labelData The optional label data of the edge if an + * {@link yfiles.binding.GraphSource#edgeLabelBinding} is specified. + * @param {Object} data The business data associated with the edge. + * @return {yfiles.graph.IEdge} The created edge. + */ + createEdge(graph:yfiles.graph.IGraph,sourceNode:yfiles.graph.INode,targetNode:yfiles.graph.INode,labelData:Object,data:Object):yfiles.graph.IEdge; + /** + * Updates an existing edge when {@link yfiles.binding.GraphSourceBase#updateGraph} + * is called and the edge should remain in the graph. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.IEdge} edge The edge to update. + * @param {Object} labelData The optional label data of the edge if an + * {@link yfiles.binding.GraphSource#edgeLabelBinding} is specified. + * @param {Object} data The business data associated with the edge. + */ + updateEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,labelData:Object,data:Object):void; + /** + * Retrieves the associated edge in the {@link yfiles.binding.GraphSourceBase#graph} for a business + * object from the {@link yfiles.binding.GraphSource#edgesSource}. + * @param {Object} businessObject A business object from the {@link yfiles.binding.GraphSource#edgesSource} to get the + * edge for. + * @return {yfiles.graph.IEdge} The edge associated with the business object or null for unknown + * objects. + * @see {@link yfiles.binding.GraphSourceBase#getBusinessObject} + * @see {@link yfiles.binding.GraphSourceBase#getNode} + * @see {@link yfiles.binding.GraphSourceBase#getGroup} + */ + getEdge(businessObject:Object):yfiles.graph.IEdge; + } + var GraphSource:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of this class. + */ + new ():yfiles.binding.GraphSource; + }; + } + export module canvas{ + /** + * Helper class that contains constants that are used in XAML files + * in conjunction with yFiles. + */ + export interface XamlConstants extends Object{ + } + var XamlConstants:{ + $class:yfiles.lang.Class; + /** + * The namespace URI that is used by the yFiles XAML extensions. + * The value is 'http://www.yworks.com/xml/yfiles-for-html/1.0/xaml' + */ + YFILES_FOR_HTML_XAML_NS:string; + /** + * The namespace URI that is used by the yFiles for HTML bridge classes. + * The value is 'http://www.yworks.com/xml/yfiles-for-html/1.0/wpfbridge' + */ + YFILES_FOR_HTML_WPF_BRIDGE_NS:string; + /** + * The preferred namespace prefix for the yFiles XAML extensions. + * The value is 'yjs' + */ + YFILES_FOR_HTML_XAML_PREFIX:string; + /** + * The preferred namespace prefix for the yFiles for HTML bridge classes. + * The value is 'wpfbridge' + */ + YFILES_FOR_HTML_WPF_BRIDGE_PREFIX:string; + /** + * The namespace URI for common yFiles extensions to graphml. + * This field has the constant value "http://www.yworks.com/xml/yfiles-common/2.0" + */ + YFILES_COMMON_NS:string; + /** + * The default namespace prefix for {@link yfiles.canvas.XamlConstants#YFILES_COMMON_NS}. + * This field has the constant value "yfiles" + * @see {@link yfiles.canvas.XamlConstants#YFILES_COMMON_NS} + */ + YFILES_COMMON_PREFIX:string; + /** + * The namespace URI that is used by the yFiles XAML extensions for architecture independent elements. + * The value is 'http://www.yworks.com/xml/yfiles-graphml/1.0' + */ + YFILES_COMMON_XAML_NS:string; + /** + * The preferred namespace prefix for the yFiles XAML extensions for architecture independent elements. + * The value is 'ygraphml' + */ + YFILES_COMMON_XAML_PREFIX:string; + /** + * The default namespace prefix for {@link yfiles.canvas.XamlConstants#YFILES_PRIMITIVES_MARKUP_NS}. + * This field has the constant value "sys" + * @see {@link yfiles.canvas.XamlConstants#YFILES_COMMON_NS} + */ + YFILES_PRIMITIVES_MARKUP_PREFIX:string; + /** + * The namespace URI for common yFiles extensions to graphml. + * This field has the constant value "http://www.yworks.com/xml/yfiles-common/markup/2.0" + */ + YFILES_PRIMITIVES_MARKUP_NS:string; + /** + * The namespace URI for common yFiles extensions to graphml. + * This field has the constant value "http://www.yworks.com/xml/yfiles-common/markup/2.0" + */ + YFILES_COMMON_MARKUP_NS:string; + /** + * The default namespace prefix for {@link yfiles.canvas.XamlConstants#YFILES_COMMON_MARKUP_NS}. + * This field has the constant value "x" + * @see {@link yfiles.canvas.XamlConstants#YFILES_COMMON_MARKUP_NS} + */ + YFILES_COMMON_MARKUP_PREFIX:string; + }; + /** + * Contains static extension methods for modifying SVG elements. + */ + export interface SVGExtensions extends Object{ + } + var SVGExtensions:{ + $class:yfiles.lang.Class; + /** + * Sets the brush of the element. + * If the brush is a complex brush, i.e. a gradient, and implements the {@link yfiles.drawing.IDefsSupport} interface, then + * it will be registered in the defs section of the SVG document and a reference to it will be created for the + * given element. + * @param {SVGElement} element The element. + * @param {yfiles.system.Brush} brush The brush. + * @param {yfiles.canvas.ICanvasContext} context The context. + */ + setBrush(element:SVGElement,brush:yfiles.system.Brush,context:yfiles.canvas.ICanvasContext):void; + setTypeface(textElement:SVGTextElement,typeface:yfiles.system.Typeface):void; + /** + * Sets the pen of an SVG element. + * @param {SVGElement} shape The shape. + * @param {yfiles.system.Pen} pen The pen. + * @param {yfiles.canvas.ICanvasContext} context The context. + */ + setPen(shape:SVGElement,pen:yfiles.system.Pen,context:yfiles.canvas.ICanvasContext):void; + /** + * Sets an SVG filter for a SVG element. + * @param {Element} shape The shape. + * @param {SVGFilterElement} filter The filter. + * @param {yfiles.canvas.ICanvasContext} context The context. + */ + setFilter(shape:Element,filter:SVGFilterElement,context:yfiles.canvas.ICanvasContext):void; + /** + * Sets the xlink:href attribute of an image element. + * @param {SVGImageElement} image The image element. + * @param {string} url The url. + */ + setHrefWithString(image:SVGImageElement,url:string):void; + /** + * Sets the xlink:href attribute of an use element. + * @param {SVGUseElement} svgUse The use. + * @param {string} id The id. + */ + setHref(svgUse:SVGUseElement,id:string):void; + /** + * Sets the bounds of a rect element. + * @param {SVGRectElement} rect The rect. + * @param {yfiles.geometry.RectD} bounds The bounds. + */ + setBounds(rect:SVGRectElement,bounds:yfiles.geometry.RectD):void; + /** + * Converts the specified color to a SVG color string. + * @param {yfiles.system.Color} color The color. + * @return {string} + */ + colorToSvgColor(color:yfiles.system.Color):string; + /** + * Converts the gradient stop color to a SVG color string. + * @param {yfiles.system.GradientStop} gradientStop The gradient stop. + * @return {string} + */ + gradientStopToSvgColor(gradientStop:yfiles.system.GradientStop):string; + /** + * Converts the pen to a SVG stroke. + * @param {yfiles.system.Pen} pen The pen. + * @return {string} + */ + toSvgStroke(pen:yfiles.system.Pen):string; + /** + * Adds the gradient stops to the gradient element. + * @param {Node} gradient The gradient. + * @param {yfiles.system.GradientStopCollection} stops The stops. + */ + addGradientStops(gradient:Node,stops:yfiles.system.GradientStopCollection):void; + /** + * Sets the Matrix2D transform on the SVG element. + * @param {SVGElement} transformable The transformable SVG element. + * @param {yfiles.geometry.Matrix2D} matrix The matrix. + */ + setMatrix2D(transformable:SVGElement,matrix:yfiles.geometry.Matrix2D):void; + /** + * Converts the Matrix2D object to a SVG transform. + * @param {yfiles.geometry.Matrix2D} matrix The matrix. + * @return {string} + */ + toSVGTransform(matrix:yfiles.geometry.Matrix2D):string; + /** + * Sets the transform to a translate transform using the given parameters. + * This implementation makes use of the transform baseVal setters if possible + * and thus performs better than {@link yfiles.canvas.SVGExtensions#setMatrix2D}. + * @param {Element} transformable The svg element that should be translated. + * @param {number} dx The offset on the x-axis. + * @param {number} dy The offset on the y-axis. + */ + setTranslate(transformable:Element,dx:number,dy:number):void; + /** + * Sets the transform to a scale transform using the given parameters. + * This implementation makes use of the transform baseVal setters if possible + * and thus performs better than {@link yfiles.canvas.SVGExtensions#setMatrix2D}. + * @param {Element} transformable The svg element that should be translated. + * @param {number} scaleX The vertical scale. + * @param {number} scaleY The horizontal scale. + */ + setScale(transformable:Element,scaleX:number,scaleY:number):void; + /** + * Converts the {@link yfiles.system.FontWeight} to a SVG font weight. + * @param {yfiles.system.FontWeight} fontWeight The font weight. + * @return {string} + */ + toSvgFontWeight(fontWeight:yfiles.system.FontWeight):string; + /** + * Converts the {@link yfiles.system.FontStyle} to a SVG font style. + * @param {yfiles.system.FontStyle} fontStyle The font style. + * @return {string} + */ + toSvgFontStyle(fontStyle:yfiles.system.FontStyle):string; + /** + * Removes all children from the group node. + * @param {Node} group The group. + */ + clearChildren(group:Node):void; + /** + * Returns the child of the group node at the specified index. + * @param {Node} group The group. + * @param {number} index The index. + * @return {SVGElement} + */ + childAt(group:Node,index:number):SVGElement; + /** + * Adds the {@link yfiles.drawing.Visual} to the group node. + * @param {Node} group The group. + * @param {yfiles.drawing.Visual} child The child. + * @return {boolean} + */ + addChildVisual(group:Node,child:yfiles.drawing.Visual):boolean; + /** + * Adds the child to the group node. + * @param {Node} group The group. + * @param {Element} child The child. + * @return {boolean} + */ + addChildElement(group:Node,child:Element):boolean; + /** + * Adds the child to the group node at specified index. + * @param {Node} group The group. + * @param {Element} child The child. + * @param {number} index The index. + * @return {boolean} true, if the element was successfully added; false otherwise. + */ + addChildAt(group:Node,child:Element,index:number):boolean; + /** + * Removes the child at the specified index. + * @param {Node} group The group. + * @param {number} index The index. + */ + removeChildAt(group:Node,index:number):void; + /** + * Replaces the child at the specified index. + * @param {Node} group The group. + * @param {number} index The index. + * @param {Node} child The child. + */ + setChildAt(group:Node,index:number,child:Node):void; + /** + * Gets the number of children of the specified group node. + * @param {Node} group The group. + * @return {number} + */ + getChildCount(group:Node):number; + /** + * Sets the render data cache. + * @param {yfiles.drawing.Visual} element The element. + * @param {Object} renderData The render data. + */ + setRenderDataCache(element:yfiles.drawing.Visual,renderData:Object):void; + /** + * Gets the render data cache. + * @param {yfiles.drawing.Visual} element The element. + * @return {T} The render data cache + */ + getRenderDataCache(tType:yfiles.lang.Class,element:yfiles.drawing.Visual):T; + /** + * Imports the node into the given document. + * If possible, this will import the node using the native importNode method of the document. + * Some browser, i.e. Internet Explorer, do not support this method and in that case its behavior will be emulated + * by cloning the node and all of its children recursively. + * @param {Document} document The document. + * @param {Node} node The node. + * @return {Node} A clone of the given node that belongs to the document. + */ + importNode(document:Document,node:Node):Node; + }; + /** + * This animation linearly interpolates the {@link yfiles.graph.ILabelModel#getGeometry geometry} + * of an {@link yfiles.graph.ILabel}'s {@link yfiles.graph.ILabel#layout} from the current to a + * given {@link yfiles.graph.ILabelModelParameter}. + * This animation will as a side effect assign the new parameter to the label at the {@link yfiles.canvas.LabelAnimation#cleanup end of the animation}. + */ + export interface LabelAnimation extends Object,yfiles.canvas.IAnimation{ + /** + * Initializes the animation. Call this method once before subsequent + * calls to {@link yfiles.canvas.IAnimation#animate}. + * @see Specified by {@link yfiles.canvas.IAnimation#initialize}. + */ + initialize():void; + /** + * Does the animation according to the relative animation time. + * The animation starts with the time 0 and ends with time 1. + * @param {number} time the animation time [0,1] + * @see Specified by {@link yfiles.canvas.IAnimation#animate}. + */ + animate(time:number):void; + /** + * Cleans up after an animation has finished. + * @see Specified by {@link yfiles.canvas.IAnimation#cleanup}. + */ + cleanup():void; + /** + * Gets the preferred duration of the animation. + * @see Specified by {@link yfiles.canvas.IAnimation#preferredDuration}. + */ + preferredDuration:yfiles.system.TimeSpan; + } + var LabelAnimation:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.canvas.LabelAnimation} class. + * @param {yfiles.graph.IGraph} graph The graph that contains the labels. + * @param {yfiles.graph.ILabel} label The label to animate the parameter of. + * @param {yfiles.graph.ILabelModelParameter} parameter The target parameter of the label. + * @param {yfiles.system.TimeSpan} preferredDuration The preferred duration of the animation. + */ + new (graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter,preferredDuration:yfiles.system.TimeSpan):yfiles.canvas.LabelAnimation; + }; + /** + * Animates the layout of an edge. + * The bend points of the edge layout are + * animated. It is assumed that the edge style is a polyline style and the control points + * are the bends accordingly. The animation works for other styles too, but the effect might + * not be as expected. + */ + export interface EdgeAnimation extends yfiles.canvas.CompositeAnimation{ + /** + * initializes the animation. + * This method has to be called once before the first call + * to {@link yfiles.canvas.EdgeAnimation#animate}. + * @see Overrides {@link yfiles.canvas.CompositeAnimation#initialize} + * @see Specified by {@link yfiles.canvas.IAnimation#initialize}. + */ + initialize():void; + /** + * changes the edge layout according to the given time value. + * The animation starts at time 0 and ends at 1. Calls of this + * method have no effect unless {@link yfiles.canvas.EdgeAnimation#initialize} is called once before. + * After the last call of this method {@link yfiles.canvas.EdgeAnimation#cleanup} should be called once. + * It removes unnecessary bends, if the start layout contained more bends than the + * end layout. + * @param {number} time the relative time for the animation [0, 1] + * @see Overrides {@link yfiles.canvas.CompositeAnimation#animate} + * @see Specified by {@link yfiles.canvas.IAnimation#animate}. + */ + animate(time:number):void; + /** + * does a clean up after the animation. + * This method removes obsolete bends after the animation, if the start + * edge layout contains more bends than the end layout. Subsequent calls to {@link yfiles.canvas.EdgeAnimation#animate} + * have no effect. + * @see Overrides {@link yfiles.canvas.CompositeAnimation#cleanup} + * @see Specified by {@link yfiles.canvas.IAnimation#cleanup}. + */ + cleanup():void; + } + var EdgeAnimation:{ + $class:yfiles.lang.Class; + /** + * Creates a new EdgeAnimation instance. + * After creating an instance, {@link yfiles.canvas.EdgeAnimation#initialize} has to be called once. + * Subsequent calls to {@link yfiles.canvas.EdgeAnimation#animate} change the edge layout according to the given + * relative time parameter. The animation starts with time 0 and ends with time 1. It is not necessary + * to call {@link yfiles.canvas.EdgeAnimation#animate} with increasing time values. After the animation is done, + * a final call to {@link yfiles.canvas.EdgeAnimation#cleanup} should be made. + * @param {yfiles.graph.IGraph} g The graph the animated edge belongs to. + * @param {yfiles.graph.IEdge} edge The edge layout to animate. + * @param {yfiles.geometry.IPoint[]} endBends The bend positions after the animation. + * @param {yfiles.geometry.PointD} endSourceLocation The absolute position of the source port after the animation. + * @param {yfiles.geometry.PointD} endTargetLocation The absolute position of the target port after the animation. + * @param {yfiles.system.TimeSpan} preferredDuration The preferred duration of the animation in milliseconds. + */ + new (g:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,endBends:yfiles.geometry.IPoint[],endSourceLocation:yfiles.geometry.PointD,endTargetLocation:yfiles.geometry.PointD,preferredDuration:yfiles.system.TimeSpan):yfiles.canvas.EdgeAnimation; + }; + /** + * Occurs when the value of a {@link yfiles.canvas.ScrollBar} changed. + */ + export interface ScrollEventArgs extends Object{ + /** + * Gets the old value. + */ + oldValue:number; + /** + * Gets the new value. + */ + newValue:number; + /** + * Gets a value indicating whether this {@link yfiles.canvas.ScrollEventArgs} is horizontal. + * Value: + * true if horizontal; otherwise, false. + */ + horizontal:boolean; + } + var ScrollEventArgs:{ + $class:yfiles.lang.Class; + new (oldValue:number,newValue:number,horizontal:boolean):yfiles.canvas.ScrollEventArgs; + }; + /** + * Provides a control for editing multi-line text, for example label texts. + * The underlying UI component of this class is a HTML text area, which can + * be styled with the CSS class yfiles-labeleditbox. + */ + export interface TextBox extends yfiles.canvas.Control{ + /** + * Gets or sets the desired size of this control. + * Value: + * The desired size of this control. + */ + desiredSize:yfiles.geometry.SizeD; + /** + * Focuses the Div element that is backing this instance. + */ + focus():void; + /** + * Gets or sets the text displayed by this text area. + * This setter invokes the {@link yfiles.canvas.TextBox#addTextChangedListener TextChanged} event if the text is changed. + * Value: + * The text displayed by this text area. + */ + text:string; + /** + * Gets or sets the start index of the current selection. + * Value: + * The start index of the current selection. + */ + selectionStart:number; + /** + * Gets or sets the length the current selection. + * Value: + * The length of the current selection. + */ + selectionLength:number; + /** + * Gets the font size of the computed style of this text area. + * Value: + * The font size of the computed style of this text area. + */ + fontSize:number; + /** + * Selects the complete text. + */ + selectAll():void; + /** + * Occurs when the {@link yfiles.canvas.TextBox#text} changed. + */ + addTextChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when the {@link yfiles.canvas.TextBox#text} changed. + */ + removeTextChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Determines and sets the {@link yfiles.canvas.TextBox#desiredSize} of this text area. + * This method assumes the {@link yfiles.canvas.Control#div} of this control is already + * part of the DOM and the parentNode is set. If not, the measured control is + * temporarily being put in window.document.body for the purpose of measuring. + * @param {yfiles.geometry.SizeD} availableSize The size the parent component provides for this control. + */ + measure(availableSize:yfiles.geometry.SizeD):void; + } + var TextBox:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.canvas.TextBox} class. + */ + new ():yfiles.canvas.TextBox; + }; + /** + * Provides a classic scrollbar which consists of a slider and two arrow buttons. + */ + export interface ScrollBar extends yfiles.canvas.Control{ + /** + * Gets or sets a value indicating whether this {@link yfiles.canvas.ScrollBar#control} is enabled. + * Value: + * true if enabled; otherwise, false. + * @see Overrides {@link yfiles.canvas.Control#enabled} + */ + enabled:boolean; + /** + * Gets the control which displays this {@link yfiles.canvas.IScrollBar}. + * @see Specified by {@link yfiles.canvas.IScrollBar#control}. + */ + control:yfiles.canvas.Control; + /** + * Triggers the redrawing of the UI components which display this {@link yfiles.canvas.IScrollBar}. + * @see Specified by {@link yfiles.canvas.IScrollBar#update}. + */ + update():void; + /** + * Occurs when the {@link yfiles.canvas.ScrollBar#value} changes due to scrolling. + */ + addScrollListener(value:(sender:Object,args:yfiles.canvas.ScrollEventArgs)=> void):void; + /** + * Occurs when the {@link yfiles.canvas.ScrollBar#value} changes due to scrolling. + */ + removeScrollListener(value:(sender:Object,args:yfiles.canvas.ScrollEventArgs)=> void):void; + /** + * Gets a value indicating whether this {@link yfiles.canvas.IScrollBar} is horizontal. + * Value: + * true if horizontal; otherwise, false. + * @see Specified by {@link yfiles.canvas.IScrollBar#horizontal}. + */ + horizontal:boolean; + /** + * Gets or sets the value which represents the current range of the view port. + * Value: + * The value which represents the current range of the view port range. + * @see Specified by {@link yfiles.canvas.IScrollBar#value}. + */ + value:number; + /** + * Gets or sets the maximum value of the view port range. + * Value: + * The maximum value of the view port range. + * @see Specified by {@link yfiles.canvas.IScrollBar#maximum}. + */ + maximum:number; + /** + * Gets or sets the minimum value of the view port range. + * Value: + * The minimum value of the view port range. + * @see Specified by {@link yfiles.canvas.IScrollBar#minimum}. + */ + minimum:number; + /** + * Gets or sets the large change which is typically the amount the value is changed when the user clicks the + * track of a scrollbar. + * Value: + * The large change. + * @see Specified by {@link yfiles.canvas.IScrollBar#largeChange}. + */ + largeChange:number; + /** + * Gets or sets the small change which is typically the amount the value is changed when the user clicks the + * buttons of a scrollbar. + * Value: + * The small change. + * @see Specified by {@link yfiles.canvas.IScrollBar#smallChange}. + */ + smallChange:number; + } + var ScrollBar:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.canvas.ScrollBar} class. + * @param {HTMLDivElement} div The div. + * @param {boolean} horizontal if set to true [horizontal]. + */ + new (div:HTMLDivElement,horizontal:boolean):yfiles.canvas.ScrollBar; + }; + /** + * Displays a string or any HTML element as tool tip. + */ + export interface ToolTip extends Object{ + /** + * Gets the div element that represents this {@link yfiles.canvas.ToolTip}. + */ + div:HTMLDivElement; + /** + * Specifies whether the tool tip is visible. + * Value: + * true if this instance is open; otherwise, false. + */ + isOpen:boolean; + /** + * Creates the {@link HTMLDivElement HTML element} in which the content is displayed. + * This implementation creates a simple HTML div element with the CSS class yfiles-tooltip. + * @return {HTMLDivElement} A HTML div element. + */ + createToolTip():HTMLDivElement; + /** + * The top position of the tool tip. + */ + verticalOffset:number; + /** + * The left position of the tool tip. + */ + horizontalOffset:number; + /** + * Gets or sets the desired size of this control. + * Value: + * The desired size of this control. + */ + desiredSize:yfiles.geometry.SizeD; + /** + * Gets or sets the content. + * This setter invokes the method {@link yfiles.canvas.ToolTip#onContentChanged} if the content is changed. + * Value: + * The content. + */ + content:Object; + /** + * Sets the content to the HTML element that is displayed as tool tip. + * This implementation adds a string as innerHTML of the {@link yfiles.canvas.Control#div}. + * A HTMLElement is added as child to the {@link yfiles.canvas.Control#div}. + *

Subclasses which intend to use a more complex element as tool tip have to override this method + * to set the content properly.

+ * @param {Object} oldContent The content to remove. + * @param {Object} newContent The content to add. + */ + onContentChanged(oldContent:Object,newContent:Object):void; + } + var ToolTip:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + * This implementation calls {@link yfiles.canvas.ToolTip#createToolTip} to create the HTML element to display as tool tip. + */ + new ():yfiles.canvas.ToolTip; + }; + /** + * Animates the layout of a graph. + * After creating an instance {@link yfiles.canvas.LayoutMorpher#initialize} has to be called once. + * Subsequent calls to {@link yfiles.canvas.LayoutMorpher#animate} change the graph layout according to the given + * relative time parameter. The animation starts with time 0 and ends with time 1. It is not necessary + * to call {@link yfiles.canvas.LayoutMorpher#animate} with increasing time values. After the animation is done, + * a final call to {@link yfiles.canvas.LayoutMorpher#cleanup} should be made. + */ + export interface LayoutMorpher extends Object,yfiles.canvas.IAnimation{ + /** + * Initializes the animation. + * This method has to be called once before the first call + * to {@link yfiles.canvas.LayoutMorpher#animate}. + * @see Specified by {@link yfiles.canvas.IAnimation#initialize}. + */ + initialize():void; + /** + * Changes the graph layout according to the given time value. + * The animation starts at time 0 and ends at 1. Calls of this + * method have no effect unless {@link yfiles.canvas.LayoutMorpher#initialize} is called once before. + * After the last call of this method {@link yfiles.canvas.LayoutMorpher#cleanup} should be called once. + * @param {number} time The relative time for the animation [0, 1]. + * @see Specified by {@link yfiles.canvas.IAnimation#animate}. + */ + animate(time:number):void; + /** + * Does a clean up after the animation. + * @see Specified by {@link yfiles.canvas.IAnimation#cleanup}. + */ + cleanup():void; + /** + * Gets the preferred duration in milliseconds. + * @see Specified by {@link yfiles.canvas.IAnimation#preferredDuration}. + */ + preferredDuration:yfiles.system.TimeSpan; + } + var LayoutMorpher:{ + $class:yfiles.lang.Class; + /** + * Creates a new LayoutMorpher instance. + * @param {yfiles.graph.IGraph} graph The graph for which the layout should be animated. + * @param {yfiles.model.IMapper.} nodeLayout The node layouts after the animation. + * @param {yfiles.model.IMapper.} bendLocations The bend locations after the animation, for each edge the points are + * interpreted as the position of the bends along the + * edge in the given order. + * @param {yfiles.model.IMapper.} edgeLabelParameters The edge label model parameters for each edge label after + * the animation. + * @param {yfiles.model.IMapper.} portLocations The {@link yfiles.graph.IPortLocationModelParameter}s for each {@link yfiles.graph.IPort} + * in the graph that will be morphed. + * @param {yfiles.model.IMapper.} nodeLabelParameters The node label model parameters for each node label after + * the animation. + * @param {yfiles.system.TimeSpan} preferredDuration The preferred duration of the animation in milliseconds. + */ + new (graph:yfiles.graph.IGraph,nodeLayout:yfiles.model.IMapper,bendLocations:yfiles.model.IMapper,portLocations:yfiles.model.IMapper,nodeLabelParameters:yfiles.model.IMapper,edgeLabelParameters:yfiles.model.IMapper,preferredDuration:yfiles.system.TimeSpan):yfiles.canvas.LayoutMorpher; + }; + /** + * A helper class that handles {@link yfiles.canvas.IAnimation} + * objects and runs their {@link yfiles.canvas.IAnimation#animate} + * methods on a {@link yfiles.canvas.Control}'s . + * This class is primarily intended to be used with {@link yfiles.canvas.CanvasControl}. + * Use the {@link yfiles.canvas.Animator#animate} or {@link yfiles.canvas.Animator#animateAndWait} + * methods to start animations. + * @see {@link yfiles.canvas.IAnimation} + */ + export interface Animator extends Object{ + /** + * Determines whether the {@link yfiles.input.WaitInputMode} should be queried from the + * {@link yfiles.canvas.CanvasControl} and {@link yfiles.input.WaitInputMode#waiting} should be enabled + * during the animation. + * The default is true. + */ + useWaitInputMode:boolean; + /** + * Starts animating the given animation for the specified duration. + * The animation will be performed asynchronously during each {@link yfiles.canvas.Animator#addPreviewRenderingListener PreviewRendering} event. + * This method will not block until the operation is completed but might return + * before the animation has been finished. + * @param {function(number)} handler The handler to use for the animation callbacks. + * @param {yfiles.system.TimeSpan} duration The duration that the animation should last. + * @see {@link yfiles.canvas.Animator#animateHandlerAndWait} + * @see {@link yfiles.canvas.Animator#animate} + * @see {@link yfiles.canvas.Animator#animateHandlerWithCallback} + */ + animateHandler(handler:(time:number)=> void,duration:yfiles.system.TimeSpan):void; + /** + * Starts to animate the given animation for the specified duration and triggers the callback upon completion. + * The animation will be performed asynchronously during each {@link yfiles.canvas.Animator#addPreviewRenderingListener PreviewRendering} event. + * This method will not block until the operation is completed but might return + * before the animation has been finished. + * @param {function(number)} handler The handler to use for the animation callbacks. + * @param {yfiles.system.TimeSpan} duration The duration in milliseconds that the animation should last. + * @param {function(Object, yfiles.system.EventArgs)} finishedCallback A callback that will be triggered once the animation ended. + * @see {@link yfiles.canvas.Animator#animateHandlerAndWait} + * @see {@link yfiles.canvas.Animator#animate} + */ + animateHandlerWithCallback(handler:(time:number)=> void,duration:yfiles.system.TimeSpan,finishedCallback:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Starts to animate the given animation for the specified duration. + * The animation will be performed asynchronously during each {@link yfiles.canvas.Animator#addPreviewRenderingListener PreviewRendering} event. + * This method will block until the operation is completed and will return + * after the animation has been finished. + * @param {function(number)} handler The handler to use for the animation callbacks. + * @param {yfiles.system.TimeSpan} duration The duration in milliseconds that the animation should last. + * @see {@link yfiles.canvas.Animator#animateHandler} + */ + animateHandlerAndWait(handler:(time:number)=> void,duration:yfiles.system.TimeSpan):void; + /** + * Animates the given animation instance. + * The animation will be performed asynchronously during each {@link yfiles.canvas.Animator#addPreviewRenderingListener PreviewRendering} event. + * Thus this method cannot block until the operation is completed if it is started from the + * that is associated with the control this instance has been created for. It will return + * before the animation has finished. + * @param {yfiles.canvas.IAnimation} animation The animation to perform. + * @see {@link yfiles.canvas.Animator#animateAndWait} + * @see {@link yfiles.canvas.Animator#animateHandler} + * @see {@link yfiles.canvas.Animator#animateWithCallback} + */ + animate(animation:yfiles.canvas.IAnimation):void; + /** + * Animates the given animation instance and triggers the callback upon completion. + * The animation will be performed asynchronously during each {@link yfiles.canvas.Animator#addPreviewRenderingListener PreviewRendering} event. + * Thus this method cannot block until the operation is completed if it is started from the + * that is associated with the control this instance has been created for. It will return + * before the animation has finished. Upon animation end the finishedCallback + * will be triggered. + * @param {yfiles.canvas.IAnimation} animation The animation to perform. + * @param {function(Object, yfiles.system.EventArgs)} finishedCallback A callback that will be triggered once the animation ended. The source + * of the event will be the animation instance. + * @see {@link yfiles.canvas.Animator#animateAndWait} + * @see {@link yfiles.canvas.Animator#animateHandler} + */ + animateWithCallback(animation:yfiles.canvas.IAnimation,finishedCallback:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Animates the given animation instance. + * The animation will be performed synchronously. + * It will block until the operation is completed and will return + * after the animation has been finished. + * @param {yfiles.canvas.IAnimation} animation The animation to perform. + * @see {@link yfiles.canvas.Animator#animate} + */ + animateAndWait(animation:yfiles.canvas.IAnimation):void; + /** + * Stops the animations and aborts the animation callbacks. + */ + destroy():void; + /** + * Invalidates the control if {@link yfiles.canvas.Animator#autoInvalidation} is set to true. + * This implementation calls {@link yfiles.canvas.CanvasControl#updateVisual}. + * @param {yfiles.canvas.Control} control The control. + */ + invalidateControl(control:yfiles.canvas.Control):void; + /** + * Gets or sets a value indicating whether to automatically {@link yfiles.canvas.Animator#invalidateControl invalidate the control} + * this instance has been created for. + * The default is true. + * Value: true if invalidation should happen automatically; otherwise, false. + */ + autoInvalidation:boolean; + } + var Animator:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.canvas.Animator} class using the given control + * instance's to run the animations. + * The animation is not started until {@link yfiles.canvas.Animator#animateHandler} + * or {@link yfiles.canvas.Animator#animate} is called. + * @param {yfiles.canvas.Control} control The control. + */ + FromControl:{ + new (control:yfiles.canvas.Control):yfiles.canvas.Animator; + }; + /** + * Initializes a new instance of the {@link yfiles.canvas.Animator} class using the given + * {@link yfiles.canvas.CanvasControl}'s + * to run the animations. + * Using this constructor this instance will query an instance of {@link yfiles.input.WaitInputMode} from + * the {@link yfiles.canvas.CanvasControl#lookup canvas's context} to automatically set the {@link yfiles.input.WaitInputMode#waiting} + * property during animations if {@link yfiles.canvas.Animator#useWaitInputMode} is set to true. + * The animation is not started until {@link yfiles.canvas.Animator#animateHandler} + * or {@link yfiles.canvas.Animator#animate} is called. + * @param {yfiles.canvas.CanvasControl} canvasControl The canvas control. + */ + FromCanvasControl:{ + new (canvasControl:yfiles.canvas.CanvasControl):yfiles.canvas.Animator; + }; + }; + /** + * An animation that morphs the sizes of all stripes in an {@link yfiles.graph.ITable}. + */ + export interface TableAnimation extends yfiles.canvas.CompositeAnimation{ + /** + * Initializes the animation. Call this method once before subsequent + * calls to {@link yfiles.canvas.IAnimation#animate}. + * @see Specified by {@link yfiles.canvas.IAnimation#initialize}. + */ + initialize():void; + /** + * Create the animation for a single {@link yfiles.graph.IStripe}. + * @param {yfiles.graph.IStripe} leaf The stripe + * @param {number} targetSize The target size of the stripe + * @return {yfiles.canvas.IAnimation} An animation that morphs the stripe size + */ + createStripeAnimation(leaf:yfiles.graph.IStripe,targetSize:number):yfiles.canvas.IAnimation; + } + var TableAnimation:{ + $class:yfiles.lang.Class; + /** + * Create a new instance. + * Note that only the sizes of leaf stripes, i.e. those without child stripes, are morphed. The sizes of their parents + * are determined implicitly by this contents. + * @param {yfiles.graph.ITable} table The table to animate + * @param {number[]} columnLayout The sizes of the leaf columns, in natural order. + * @param {number[]} rowLayout The sizes of the leaf rows, in natural order. + */ + new (table:yfiles.graph.ITable,columnLayout:number[],rowLayout:number[]):yfiles.canvas.TableAnimation; + }; + /** + * Convenience control implementation that shows an overview of an {@link yfiles.graph.IGraph} contained in another + * {@link yfiles.canvas.GraphOverviewControl#graphControl}. + * This control uses a {@link yfiles.canvas.GraphOverviewControl#visualCreator} to display the graph in a preview mode + * and an {@link yfiles.canvas.GraphOverviewControl#overviewInputMode} to allow for easily navigating in the {@link yfiles.canvas.GraphOverviewControl#graphControl}. + */ + export interface GraphOverviewControl extends yfiles.canvas.CanvasControl{ + /** + * Gets or sets a value indicating whether the graph is rendered using SVG rendering. + * Value: true if high fidelity SVG rendering is used; otherwise, false, which results in high performance low-fidelity Canvas rendering. + * The default is false. + */ + svgRendering:boolean; + /** + * Gets the {@link yfiles.drawing.OverviewGraphVisualCreator} that is used to render the + * over view graph. + */ + visualCreator:yfiles.drawing.IVisualCreator; + /** + * Gets the {@link yfiles.input.IInputMode} that is used to navigate the client control. + */ + overviewInputMode:yfiles.input.OverviewInputMode; + /** + * Gets or sets the graph that is rendered in the overview. + */ + graph:yfiles.graph.IGraph; + /** + * Raises the {@link yfiles.canvas.CanvasControl#addUpdatingVisualListener UpdatingVisual}. + * @see {@link yfiles.canvas.CanvasControl#addUpdatingVisualListener UpdatingVisual} + */ + raiseUpdatingVisualEvent():void; + /** + * Factory method that creates the {@link yfiles.drawing.IVisualCreator} that renders the preview of the graph. + * @param {yfiles.graph.IGraph} graph The graph to draw. + * @return {yfiles.drawing.IVisualCreator} An {@link yfiles.drawing.IVisualCreator} that either creates SVG rendering or + * HTML canvas rendering based on the {@link yfiles.canvas.GraphOverviewControl#svgRendering} flag. + * @see {@link yfiles.canvas.GraphOverviewControl#createGraphCanvasVisualCreator} + */ + createGraphVisualCreator(graph:yfiles.graph.IGraph):yfiles.drawing.IVisualCreator; + /** + * Factory method that creates the {@link yfiles.drawing.IVisualCreator} that renders the preview of the graph in a HTML canvas element. + * @param {yfiles.graph.IGraph} graph The graph to draw. + * @return {yfiles.drawing.IVisualCreator} An {@link yfiles.drawing.IVisualCreator} that creates HTML canvas rendering. + * @see {@link yfiles.canvas.GraphOverviewControl#createGraphVisualCreator} + */ + createGraphCanvasVisualCreator(graph:yfiles.graph.IGraph):yfiles.drawing.IVisualCreator; + /** + * Gets or sets the client control, that will be used to retrieve the graph from + * and that will be used for navigating. + */ + graphControl:yfiles.canvas.GraphControl; + } + var GraphOverviewControl:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that is not bound to a control. + * In order to be useful, either the {@link yfiles.canvas.GraphOverviewControl#graphControl} + * or the {@link yfiles.canvas.GraphOverviewControl#graph} property need to be set. + */ + new ():yfiles.canvas.GraphOverviewControl; + /** + * This will instantiate and initialize a GraphOverviewControl with default + * properties using the div that was specified as an argument. + * In order to be useful, either the {@link yfiles.canvas.GraphOverviewControl#graphControl} + * or the {@link yfiles.canvas.GraphOverviewControl#graph} property need to be set. + */ + ForDiv:{ + new (div:HTMLDivElement):yfiles.canvas.GraphOverviewControl; + }; + /** + * Creates a new instance that is initially bound to the given control. + */ + ForMaster:{ + new (control:yfiles.canvas.GraphControl):yfiles.canvas.GraphOverviewControl; + }; + /** + * This will instantiate and initialize a GraphOverviewControl with default + * properties using the div that was specified by its id. + * In order to be useful, either the {@link yfiles.canvas.GraphOverviewControl#graphControl} + * or the {@link yfiles.canvas.GraphOverviewControl#graph} property need to be set. + */ + ForId:{ + new (id:string):yfiles.canvas.GraphOverviewControl; + }; + }; + /** + * Convenience class that wraps LayoutMorpher for use with LayoutGraphs. + */ + export interface LayoutMorpherWrapper extends Object,yfiles.canvas.IAnimation{ + /** + * initializes the animation. + * This method has to be called once before the first call + * to {@link yfiles.canvas.LayoutMorpherWrapper#animate}. + * @see Specified by {@link yfiles.canvas.IAnimation#initialize}. + */ + initialize():void; + /** + * changes the graph layout according to the given time value. + * The animation starts at time 0 and ends at 1. Calls of this + * method have no effect unless {@link yfiles.canvas.LayoutMorpherWrapper#initialize} is called once before. + * After the last call of this method {@link yfiles.canvas.LayoutMorpherWrapper#cleanup} should be called once. + * @param {number} time the relative time for the animation [0, 1] + * @see Specified by {@link yfiles.canvas.IAnimation#animate}. + */ + animate(time:number):void; + /** + * does a clean up after the animation. + * @see Specified by {@link yfiles.canvas.IAnimation#cleanup}. + */ + cleanup():void; + /** + * gets the preferred duration in milliseconds. + * @see Specified by {@link yfiles.canvas.IAnimation#preferredDuration}. + */ + preferredDuration:yfiles.system.TimeSpan; + /** + * Convenience method that instantiates a new {@link yfiles.canvas.Animator} + * for the given control and {@link yfiles.canvas.Animator#animate animates} this. + * @param {yfiles.canvas.GraphControl} control The control to pass to the animator instance. + */ + run(control:yfiles.canvas.GraphControl):void; + } + var LayoutMorpherWrapper:{ + $class:yfiles.lang.Class; + /** + * Creates a new LayoutMorpherWrapper instance. + * This constructor is suitable for morphing an {@link yfiles.graph.IGraph} to a layout computed + * by one of the layout algorithms. + *

+      * var adapter = new yfiles.graph.LayoutGraphAdapter.ForGraph(graph);
+      * var layouter = new yfiles.orthogonal.OrthogonalLayouter();
+      * var layout = layouter.calcLayoutWithGraphAndLayout(adapter, adapter);
+      * var morpher = new yfiles.canvas.LayoutMorpherWrapper.ForGraphLayout(graph, layout, yfiles.system.TimeSpan.fromSeconds(1));
+      * 
+ * @param {yfiles.graph.IGraph} graph the graph for which the layout should be animated + * @param {yfiles.layout.IGraphLayout} layout the target layout with respect to layoutGraph + * @param {yfiles.system.TimeSpan} preferredDuration the preferred duration of the animation. + */ + ForGraphLayout:{ + new (graph:yfiles.graph.IGraph,layout:yfiles.layout.IGraphLayout,preferredDuration:yfiles.system.TimeSpan):yfiles.canvas.LayoutMorpherWrapper; + }; + /** + * Creates a new LayoutMorpherWrapper instance that can be directly used together + * with a {@link yfiles.layout.CopiedLayoutGraph} instance. + * This constructor is suitable for morphing an {@link yfiles.graph.IGraph} to a layout computed + * by one of the layout algorithms. + *

+      * var adapter = new yfiles.graph.LayoutGraphAdapter.ForGraph(graph);
+      * var layoutGraph = new yfiles.layout.CopiedLayoutGraph.FromGraphAndLayout(adapter, adapter);
+      * var layouter = new yfiles.orthogonal.OrthogonalLayouter();
+      * layouter.doLayout(layoutGraph);
+      * var morpher = new yfiles.canvas.LayoutMorpherWrapper(graph, layoutGraph, yfiles.system.TimeSpan.fromSeconds(1));
+      * 
+ * @param {yfiles.graph.IGraph} graph the graph for which the layout should be animated + * @param {yfiles.layout.CopiedLayoutGraph} lg the {@link yfiles.layout.CopiedLayoutGraph} that contains all target layout information + * @param {yfiles.system.TimeSpan} preferredDuration the preferred duration of the animation in milliseconds + */ + new (graph:yfiles.graph.IGraph,lg:yfiles.layout.CopiedLayoutGraph,preferredDuration:yfiles.system.TimeSpan):yfiles.canvas.LayoutMorpherWrapper; + }; + /** + * Animates the location of a {@link yfiles.graph.IPort} by interpolating + * linearly between the current {@link yfiles.graph.IPortLocationModel#getLocation location} + * and the target location that is provided by the target {@link yfiles.graph.IPortLocationModelParameter}. + * This animation will as a side effect assign the new parameter to the port at the {@link yfiles.canvas.PortAnimation#cleanup end of the animation}. + */ + export interface PortAnimation extends Object,yfiles.canvas.IAnimation{ + /** + * Initializes the animation. Call this method once before subsequent + * calls to {@link yfiles.canvas.IAnimation#animate}. + * @see Specified by {@link yfiles.canvas.IAnimation#initialize}. + */ + initialize():void; + /** + * Does the animation according to the relative animation time. + * The animation starts with the time 0 and ends with time 1. + * @param {number} time the animation time [0,1] + * @see Specified by {@link yfiles.canvas.IAnimation#animate}. + */ + animate(time:number):void; + /** + * Cleans up after an animation has finished. + * @see Specified by {@link yfiles.canvas.IAnimation#cleanup}. + */ + cleanup():void; + /** + * Gets the preferred duration of the animation. + * @see Specified by {@link yfiles.canvas.IAnimation#preferredDuration}. + */ + preferredDuration:yfiles.system.TimeSpan; + } + var PortAnimation:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.canvas.PortAnimation} class. + * @param {yfiles.graph.IGraph} graph The graph that contains the port. + * @param {yfiles.graph.IPort} port The port to animate. + * @param {yfiles.graph.IPortLocationModelParameter} endParameter The parameter to linearly interpolate to. + * @param {yfiles.system.TimeSpan} preferredDuration The {@link yfiles.canvas.PortAnimation#preferredDuration preferred duration} of this animation. + */ + new (graph:yfiles.graph.IGraph,port:yfiles.graph.IPort,endParameter:yfiles.graph.IPortLocationModelParameter,preferredDuration:yfiles.system.TimeSpan):yfiles.canvas.PortAnimation; + }; + /** + * Animates the layout of a node. + * After creating an instance, {@link yfiles.canvas.NodeAnimation#initialize} has to be called once. + * Subsequent calls to {@link yfiles.canvas.NodeAnimation#animate} change the node layout according to the given + * relative time parameter. The animation starts with time 0 and ends with time 1. It is not necessary + * to call {@link yfiles.canvas.NodeAnimation#animate} with increasing time values. + */ + export interface NodeAnimation extends Object,yfiles.canvas.IAnimation{ + /** + * Initializes the animation. + * This method has to be called once before the first call + * to {@link yfiles.canvas.NodeAnimation#animate}. + * @see Specified by {@link yfiles.canvas.IAnimation#initialize}. + */ + initialize():void; + /** + * Changes the node layout according to the given time value. + * The animation starts at time 0 and ends at 1. Calls of this + * method have no effect unless {@link yfiles.canvas.NodeAnimation#initialize} is called once before. + * @param {number} time The relative time for the animation [0, 1]. + * @see Specified by {@link yfiles.canvas.IAnimation#animate}. + */ + animate(time:number):void; + /** + * Cleans up after an animation has finished. + * @see Specified by {@link yfiles.canvas.IAnimation#cleanup}. + */ + cleanup():void; + /** + * Gets the preferred duration of the animation. + * @see Specified by {@link yfiles.canvas.IAnimation#preferredDuration}. + */ + preferredDuration:yfiles.system.TimeSpan; + } + var NodeAnimation:{ + $class:yfiles.lang.Class; + /** + * Creates a new NodeAnimation instance. + * @param {yfiles.graph.IGraph} g The graph the animated node belongs to. + * @param {yfiles.graph.INode} node The node layout to animate. + * @param {yfiles.geometry.IRectangle} targetLayout The expected node layout after the animation. + * @param {yfiles.system.TimeSpan} preferredDuration The preferred duration of the animation in milliseconds. + */ + new (g:yfiles.graph.IGraph,node:yfiles.graph.INode,targetLayout:yfiles.geometry.IRectangle,preferredDuration:yfiles.system.TimeSpan):yfiles.canvas.NodeAnimation; + }; + /** + * {@link yfiles.system.EventArgs} used by the file operations. + */ + export interface FileEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the contents of a file that was opened. + */ + contents:string; + /** + * Gets the error message if the file operation failed. + */ + errorMessage:string; + /** + * Whether the corresponding file operation failed, that is the opposite of {@link yfiles.canvas.FileEventArgs#succeeded}. + * Value: + * true if failed; otherwise, false. + */ + failed:boolean; + /** + * Whether the corresponding file operation succeeded. + * Value: + * true if succeeded; otherwise, false. + */ + succeeded:boolean; + } + var FileEventArgs:{ + $class:yfiles.lang.Class; + /** + * Gets args for a succeeded file save operation without additional data. + * @return Args for a succeeded file save operation. + */ + EMPTY_SUCCESS:yfiles.canvas.FileEventArgs; + /** + * Creates args for a failed file operation and sets the specified error message. + * @param {string} errorMessage The error message. + * @return {yfiles.canvas.FileEventArgs} Args for a failed file operation. + */ + createFailArgs(errorMessage:string):yfiles.canvas.FileEventArgs; + /** + * Creates args for a succeeded file open operation and sets the specified file contents. + * @param {string} contents The contents of the file that was opened. + * @return {yfiles.canvas.FileEventArgs} Args for a succeeded file open operation. + */ + createSuccessArgs(contents:string):yfiles.canvas.FileEventArgs; + /** + * Initializes a new instance of the {@link yfiles.canvas.FileEventArgs} class. + */ + new ():yfiles.canvas.FileEventArgs; + }; + export enum StorageLocation{ + /** + * No location at all, effectively disabling storage operations. + */ + NONE, + /** + * The local storage as described by the W3C Web Storage API. + */ + LOCAL_STORAGE, + /** + * The session storage as described by the W3C Web Storage API. + */ + SESSION_STORAGE, + /** + * The file system. + * Opening a file from the file system works in all supported browsers. Saving a file is + * supported in Firefox 28+, Chrome 38+, Opera 25+, IE 10+, recent versions of the related + * mobile browsers and Android Browser 4.4.4. If saving to a file is not supported, the file + * contents is shown in a new browser window instead. + */ + FILE_SYSTEM + } + /** + * A control for displaying and editing an {@link yfiles.graph.IGraph}. + *

+ * This is a specialized {@link yfiles.canvas.CanvasControl} + * that can hold, display, and edit an {@link yfiles.graph.IGraph} instance. + * It provides access to the {@link yfiles.canvas.GraphControl#graph} and {@link yfiles.canvas.GraphControl#selection} + * instances, as well as provides convenience methods for {@link yfiles.canvas.GraphControl#undo} + * and {@link yfiles.canvas.GraphControl#redo} operations, as well as {@link yfiles.canvas.GraphControl#cut}, {@link yfiles.canvas.GraphControl#copy}, + * and {@link yfiles.canvas.GraphControl#paste} operations. + * Additionally it provides convenience methods for {@link yfiles.canvas.GraphControl#exportToGraphML exporting the + * graph to GraphML} and {@link yfiles.canvas.GraphControl#importFromGraphMLUrlWithCallback importing a graph from GraphML}. + *

+ *

+ * This control comes with a number of additional default {@link yfiles.canvas.CanvasControl#commandBindings command bindings} + * that work on the graph instance (see also view port related commands in {@link yfiles.canvas.CanvasControl}): + *

    + *
  • {@link yfiles.system.ApplicationCommands#CUT}
  • + *
  • {@link yfiles.system.ApplicationCommands#COPY}
  • + *
  • {@link yfiles.system.ApplicationCommands#PASTE}
  • + *
  • {@link yfiles.system.ApplicationCommands#UNDO}
  • + *
  • {@link yfiles.system.ApplicationCommands#REDO}
  • + *
+ * By default, these commands are enabled and bind to the respective methods implemented by this class. + *

+ *

+ * The following commands are bound to methods implemented by this class, but are disabled by default: + *

    + *
  • {@link yfiles.system.ApplicationCommands#OPEN}
  • + *
  • {@link yfiles.system.ApplicationCommands#SAVE}
  • + *
  • {@link yfiles.system.ApplicationCommands#SAVE_AS}
  • + *
+ * To enable these command, set the {@link yfiles.canvas.GraphControl#storageLocation} dependency property to a value different from + * {@link yfiles.canvas.StorageLocation#NONE}. + *

+ *

+ * In addition to that this class declares the following new {@link yfiles.system.RoutedUICommand}s. + *
    + *
  • {@link yfiles.canvas.GraphControl#FIT_GRAPH_BOUNDS_COMMAND} that invokes {@link yfiles.canvas.GraphControl#fitGraphBounds}
  • + *
  • {@link yfiles.canvas.GraphControl#SET_CURRENT_ITEM_COMMAND} for setting the {@link yfiles.canvas.GraphControl#currentItem}
  • + *
  • {@link yfiles.canvas.GraphControl#ZOOM_TO_CURRENT_ITEM_COMMAND} for adjusting the {@link yfiles.canvas.CanvasControl#viewport} + * to the {@link yfiles.canvas.GraphControl#currentItem}
  • + *
+ * The {@link yfiles.canvas.GraphControl#ZOOM_TO_CURRENT_ITEM_COMMAND} is enabled, if {@link yfiles.canvas.CanvasControl#navigationCommandsEnabled} + * is true. + * All of these commands can be removed from the {@link yfiles.canvas.CanvasControl#commandBindings} collection if necessary. + *

+ *
+ * Related Information in the Developers Guide: + *

+ * The controls that can be used to display and edit a model are discussed + * in the section View Implementations. + *

+ */ + export interface GraphControl extends yfiles.canvas.CanvasControl{ + /** + * Called when the control loses the focus. + */ + onLostFocus(e:yfiles.system.EventArgs):void; + /** + * Called when the control receives the focus. + */ + onGotFocus(e:yfiles.system.EventArgs):void; + /** + * Called when the {@link yfiles.canvas.GraphControl#currentItem} Property changed. + * This implementation updates the {@link yfiles.canvas.GraphControl#focusPaintManager}'s {@link yfiles.model.FocusPaintManager#focusedItem} + * property. + * @param {yfiles.model.IModelItem} oldItem The old item. + * @param {yfiles.model.IModelItem} newItem The new item. + */ + onCurrentItemChanged(oldItem:yfiles.model.IModelItem,newItem:yfiles.model.IModelItem):void; + /** + * Gets or sets the 'current' item. + * Value: The current item by default is given focus indication using the {@link yfiles.canvas.GraphControl#focusPaintManager}. + */ + currentItem:yfiles.model.IModelItem; + /** + * Occurs when the {@link yfiles.canvas.GraphControl#currentItem} property has changed its value. + */ + addCurrentItemChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Occurs when the {@link yfiles.canvas.GraphControl#currentItem} property has changed its value. + */ + removeCurrentItemChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Convenience method that shows a {@link yfiles.canvas.GraphControl#createOpenFileInputElement open file dialog} + * and {@link yfiles.canvas.GraphControl#importFromGraphMLUrlWithCallback imports the GraphML}. + * This method is called in response to the {@link yfiles.system.ApplicationCommands#OPEN} + * command if {@link yfiles.canvas.GraphControl#storageLocation} is set to a value different from + * {@link yfiles.canvas.StorageLocation#NONE}. + * @see {@link yfiles.canvas.GraphControl#storageLocation} + * @see {@link yfiles.canvas.GraphControl#saveFile} + * @see {@link yfiles.canvas.GraphControl#saveFileAs} + * @return {void} Whether the file was successfully opened. + */ + openFile(handler:(sender:Object,e:yfiles.canvas.FileEventArgs)=> void):void; + /** + * Helper callback method that creates the {@link HTMLInputElement} + * for use in the handling of the {@link yfiles.system.ApplicationCommands#OPEN} + * command. + * The open command that is enabled if + * {@link yfiles.canvas.GraphControl#storageLocation} is set to a value different from + * {@link yfiles.canvas.StorageLocation#NONE} will use this method to create the + * input element for opening the files. + * @return {HTMLInputElement} The preconfigured element to use. + */ + createOpenFileInputElement():HTMLInputElement; + /** + * Convenience method that {@link yfiles.canvas.GraphControl#exportToGraphML exports the graph as + * GraphML} and saves it to a storage location. + * This method is called in response to the {@link yfiles.system.ApplicationCommands#SAVE} + * command if {@link yfiles.canvas.GraphControl#storageLocation} is set to a value different from + * {@link yfiles.canvas.StorageLocation#NONE}. + * @see {@link yfiles.canvas.GraphControl#storageLocation} + * @see {@link yfiles.canvas.GraphControl#saveFileAs} + * @see {@link yfiles.canvas.GraphControl#openFile} + * @return {void} Whether the file was successfully saved. + */ + saveFile(handler:(sender:Object,e:yfiles.canvas.FileEventArgs)=> void):void; + /** + * Convenience method that {@link yfiles.canvas.GraphControl#exportToGraphML exports the graph as + * GraphML} and saves it to a storage location. + * This method is called in response to the {@link yfiles.system.ApplicationCommands#SAVE_AS} + * and possibly {@link yfiles.system.ApplicationCommands#SAVE} commands if {@link yfiles.canvas.GraphControl#storageLocation} + * is set to a value different from {@link yfiles.canvas.StorageLocation#NONE}. + * @see {@link yfiles.canvas.GraphControl#storageLocation} + * @see {@link yfiles.canvas.GraphControl#saveFile} + * @see {@link yfiles.canvas.GraphControl#openFile} + * @return {void} Whether the file was successfully saved. + */ + saveFileAs(handler:(sender:Object,e:yfiles.canvas.FileEventArgs)=> void):void; + /** + * Helper callback method that creates the {@link HTMLElement} for use in the handling of + * the {@link yfiles.system.ApplicationCommands#SAVE}and {@link yfiles.system.ApplicationCommands#SAVE_AS} + * commands. + * If {@link yfiles.canvas.GraphControl#storageLocation} is set to {@link yfiles.canvas.StorageLocation#FILE_SYSTEM} but + * saving to a file is not supported by the user's browser, this method is called to create the + * element to which the GraphML content is appended. + * @return {HTMLElement} The preconfigured element to use. Null if element creation failed. + */ + createSaveFileTextElement():HTMLElement; + /** + * Gets or sets the SelectionPaintManager property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.canvas.GraphControl#createSelectionPaintManager} will be called. + * Upon change the {@link yfiles.canvas.GraphControl#onSelectionPaintManagerChanged} method will be called. + */ + selectionPaintManager:yfiles.model.SelectionPaintManager; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#selectionPaintManager} property has been changed. + */ + addSelectionPaintManagerChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#selectionPaintManager} property has been changed. + */ + removeSelectionPaintManagerChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Called when the {@link yfiles.canvas.GraphControl#selectionPaintManager} property value changes + * and after initialization of the field. + * Triggers the {@link yfiles.canvas.GraphControl#addSelectionPaintManagerChangedListener SelectionPaintManagerChanged} event. + * @param {yfiles.model.SelectionPaintManager.} oldSelectionPaintManager the old value, which may be null the first time + * @param {yfiles.model.SelectionPaintManager.} newSelectionPaintManager the new value + */ + onSelectionPaintManagerChanged(oldSelectionPaintManager:yfiles.model.SelectionPaintManager,newSelectionPaintManager:yfiles.model.SelectionPaintManager):void; + /** + * Factory method for the SelectionPaintManager property. + * This method will be called + * upon first access to the {@link yfiles.canvas.GraphControl#selectionPaintManager} property. + * @return {yfiles.model.SelectionPaintManager.} a new instance of SelectionPaintManager<IModelItem> + */ + createSelectionPaintManager():yfiles.model.SelectionPaintManager; + /** + * Gets or sets the HighlightPaintManager property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.canvas.GraphControl#createHighlightPaintManager} will be called. + * Upon change the {@link yfiles.canvas.GraphControl#onHighlightPaintManagerChanged} method will be called. + */ + highlightPaintManager:yfiles.model.HighlightPaintManager; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#highlightPaintManager} property has been changed. + */ + addHighlightPaintManagerChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#highlightPaintManager} property has been changed. + */ + removeHighlightPaintManagerChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Called when the {@link yfiles.canvas.GraphControl#highlightPaintManager} property value changes + * and after initialization of the field. + * Triggers the {@link yfiles.canvas.GraphControl#addHighlightPaintManagerChangedListener HighlightPaintManagerChanged} event. + * @param {yfiles.model.HighlightPaintManager.} oldHighlightPaintManager the old value, which may be null the first time + * @param {yfiles.model.HighlightPaintManager.} newHighlightPaintManager the new value + */ + onHighlightPaintManagerChanged(oldHighlightPaintManager:yfiles.model.HighlightPaintManager,newHighlightPaintManager:yfiles.model.HighlightPaintManager):void; + /** + * Factory method for the HighlightPaintManager property. This method will be called + * upon first access to the {@link yfiles.canvas.GraphControl#highlightPaintManager} property. + * @return {yfiles.model.HighlightPaintManager.} a new instance of HighlightPaintManager + */ + createHighlightPaintManager():yfiles.model.HighlightPaintManager; + /** + * Gets or sets the FocusPaintManager property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.canvas.GraphControl#createFocusPaintManager} will be called. + * Upon change the {@link yfiles.canvas.GraphControl#onFocusPaintManagerChanged} method will be called. + */ + focusPaintManager:yfiles.model.FocusPaintManager; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#focusPaintManager} property has been changed. + */ + addFocusPaintManagerChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#focusPaintManager} property has been changed. + */ + removeFocusPaintManagerChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Called when the {@link yfiles.canvas.GraphControl#focusPaintManager} property value changes + * and after initialization of the field. + * Triggers the {@link yfiles.canvas.GraphControl#addFocusPaintManagerChangedListener FocusPaintManagerChanged} event. + * @param {yfiles.model.FocusPaintManager.} oldFocusPaintManager the old value, which may be null the first time + * @param {yfiles.model.FocusPaintManager.} newFocusPaintManager the new value + */ + onFocusPaintManagerChanged(oldFocusPaintManager:yfiles.model.FocusPaintManager,newFocusPaintManager:yfiles.model.FocusPaintManager):void; + /** + * Factory method for the FocusPaintManager property. This method will be called + * upon first access to the {@link yfiles.canvas.GraphControl#focusPaintManager} property. + * @return {yfiles.model.FocusPaintManager.} a new instance of FocusPaintManager + */ + createFocusPaintManager():yfiles.model.FocusPaintManager; + /** + * Gets or sets the GraphModelManager property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.canvas.GraphControl#createGraphModelManager} will be called. + * Upon change the {@link yfiles.canvas.GraphControl#onGraphModelManagerChanged} method will be called. + */ + graphModelManager:yfiles.drawing.GraphModelManager; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#graphModelManager} property has been changed. + */ + addGraphModelManagerChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#graphModelManager} property has been changed. + */ + removeGraphModelManagerChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Called when the {@link yfiles.canvas.GraphControl#graphModelManager} property value changes + * and after initialization of the field. + * Triggers the {@link yfiles.canvas.GraphControl#addGraphModelManagerChangedListener GraphModelManagerChanged} event. + * @param {yfiles.drawing.GraphModelManager} oldGraphModelManager the old value, which may be null the first time + * @param {yfiles.drawing.GraphModelManager} newGraphModelManager the new value + */ + onGraphModelManagerChanged(oldGraphModelManager:yfiles.drawing.GraphModelManager,newGraphModelManager:yfiles.drawing.GraphModelManager):void; + /** + * Factory method for the GraphModelManager property. This method will be called + * upon first access to the {@link yfiles.canvas.GraphControl#graphModelManager} property. + * @return {yfiles.drawing.GraphModelManager} a new instance of GraphModelManager + */ + createGraphModelManager():yfiles.drawing.GraphModelManager; + /** + * Gets or sets the ContentGroup property. + * The content group is the {@link yfiles.canvas.ICanvasObjectGroup} that + * should be used by the application code to put actual content in. + *

+ * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.canvas.GraphControl#createContentGroup} will be called. + * Upon change the {@link yfiles.canvas.GraphControl#onContentGroupChanged} method will be called. + *

+ */ + contentGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#contentGroup} property has been changed. + */ + addContentGroupChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#contentGroup} property has been changed. + */ + removeContentGroupChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Called when the {@link yfiles.canvas.GraphControl#contentGroup} property value changes + * and after initialization of the field. + * Triggers the {@link yfiles.canvas.GraphControl#addContentGroupChangedListener ContentGroupChanged} event. + * @param {yfiles.canvas.ICanvasObjectGroup} oldContentGroup the old value, which may be null the first time + * @param {yfiles.canvas.ICanvasObjectGroup} newContentGroup the new value + */ + onContentGroupChanged(oldContentGroup:yfiles.canvas.ICanvasObjectGroup,newContentGroup:yfiles.canvas.ICanvasObjectGroup):void; + /** + * Factory method for the ContentGroup property. This method will be called + * upon first access to the {@link yfiles.canvas.GraphControl#contentGroup} property. + * @return {yfiles.canvas.ICanvasObjectGroup} a new instance of ICanvasObjectGroup + */ + createContentGroup():yfiles.canvas.ICanvasObjectGroup; + /** + * Returns a canvas group provider instance that yields {@link yfiles.canvas.GraphControl#contentGroup}. + */ + getContentGroupProvider():yfiles.model.ICanvasGroupProvider; + /** + * Gets or sets the HighlightGroup property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.canvas.GraphControl#createHighlightGroup} will be called. + * Upon change the {@link yfiles.canvas.GraphControl#onHighlightGroupChanged} method will be called. + */ + highlightGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Gets or sets the HighlightGroup property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.canvas.GraphControl#createHighlightGroup} will be called. + * Upon change the {@link yfiles.canvas.GraphControl#onHighlightGroupChanged} method will be called. + */ + focusGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#focusGroup} property has been changed. + */ + addFocusGroupChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#focusGroup} property has been changed. + */ + removeFocusGroupChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Called when the {@link yfiles.canvas.GraphControl#focusGroup} property value changes + * and after initialization of the field. + * Triggers the {@link yfiles.canvas.GraphControl#addFocusGroupChangedListener FocusGroupChanged} event. + * @param {yfiles.canvas.ICanvasObjectGroup} oldFocusGroup the old value, which may be null the first time + * @param {yfiles.canvas.ICanvasObjectGroup} newFocusGroup the new value + */ + onFocusGroupChanged(oldFocusGroup:yfiles.canvas.ICanvasObjectGroup,newFocusGroup:yfiles.canvas.ICanvasObjectGroup):void; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#highlightGroup} property has been changed. + */ + addHighlightGroupChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#highlightGroup} property has been changed. + */ + removeHighlightGroupChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Called when the {@link yfiles.canvas.GraphControl#highlightGroup} property value changes + * and after initialization of the field. + * Triggers the {@link yfiles.canvas.GraphControl#addHighlightGroupChangedListener HighlightGroupChanged} event. + * @param {yfiles.canvas.ICanvasObjectGroup} oldHighlightGroup the old value, which may be null the first time + * @param {yfiles.canvas.ICanvasObjectGroup} newHighlightGroup the new value + */ + onHighlightGroupChanged(oldHighlightGroup:yfiles.canvas.ICanvasObjectGroup,newHighlightGroup:yfiles.canvas.ICanvasObjectGroup):void; + /** + * Factory method for the HighlightGroup property. This method will be called + * upon first access to the {@link yfiles.canvas.GraphControl#highlightGroup} property. + * @return {yfiles.canvas.ICanvasObjectGroup} a new instance of ICanvasObjectGroup + */ + createHighlightGroup():yfiles.canvas.ICanvasObjectGroup; + /** + * Factory method for the {@link yfiles.canvas.GraphControl#focusGroup} property. This method will be called + * upon first access to the {@link yfiles.canvas.GraphControl#focusGroup} property. + * @return {yfiles.canvas.ICanvasObjectGroup} a new instance of ICanvasObjectGroup + */ + createFocusGroup():yfiles.canvas.ICanvasObjectGroup; + /** + * Gets or sets the SelectionGroup property. + * The selection group is the {@link yfiles.canvas.ICanvasObjectGroup} that + * should be used by the application code to put the selection paintables in. + *

+ * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.canvas.GraphControl#createSelectionGroup} will be called. + * Upon change the {@link yfiles.canvas.GraphControl#onSelectionGroupChanged} method will be called. + *

+ */ + selectionGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#selectionGroup} property has been changed. + */ + addSelectionGroupChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#selectionGroup} property has been changed. + */ + removeSelectionGroupChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Called when the {@link yfiles.canvas.GraphControl#selectionGroup} property value changes + * and after initialization of the field. + * Triggers the {@link yfiles.canvas.GraphControl#addSelectionGroupChangedListener SelectionGroupChanged} event. + * @param {yfiles.canvas.ICanvasObjectGroup} oldSelectionGroup the old value, which may be null the first time + * @param {yfiles.canvas.ICanvasObjectGroup} newSelectionGroup the new value + */ + onSelectionGroupChanged(oldSelectionGroup:yfiles.canvas.ICanvasObjectGroup,newSelectionGroup:yfiles.canvas.ICanvasObjectGroup):void; + /** + * Factory method for the SelectionGroup property. This method will be called + * upon first access to the {@link yfiles.canvas.GraphControl#selectionGroup} property. + * @return {yfiles.canvas.ICanvasObjectGroup} a new instance of ICanvasObjectGroup + */ + createSelectionGroup():yfiles.canvas.ICanvasObjectGroup; + /** + * Returns a canvas group provider instance that yields {@link yfiles.canvas.GraphControl#selectionGroup}. + */ + getSelectionGroupProvider():yfiles.model.ICanvasGroupProvider; + /** + * Returns a canvas group provider instance that yields {@link yfiles.canvas.GraphControl#highlightGroup}. + */ + getHighlightGroupProvider():yfiles.model.ICanvasGroupProvider; + /** + * Returns a canvas group provider instance that yields {@link yfiles.canvas.GraphControl#highlightGroup}. + */ + getFocusGroupProvider():yfiles.model.ICanvasGroupProvider; + /** + * Gets or sets the InputModeGroup property. + * This is the canvas object group where the {@link yfiles.input.IInputMode}s should + * add their temporary content to. This group by default is in front of the {@link yfiles.canvas.GraphControl#contentGroup}. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.canvas.GraphControl#createInputModeGroup} will be called. + * Upon change the {@link yfiles.canvas.GraphControl#onInputModeGroupChanged} method will be called. + * @see {@link yfiles.canvas.GraphControl#contentGroup} + * @see {@link yfiles.canvas.GraphControl#backgroundGroup} + */ + inputModeGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#inputModeGroup} property has been changed. + */ + addInputModeGroupChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#inputModeGroup} property has been changed. + */ + removeInputModeGroupChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Called when the {@link yfiles.canvas.GraphControl#inputModeGroup} property value changes + * and after initialization of the field. + * Triggers the {@link yfiles.canvas.GraphControl#addInputModeGroupChangedListener InputModeGroupChanged} event. + * @param {yfiles.canvas.ICanvasObjectGroup} oldInputModeGroup the old value, which may be null the first time + * @param {yfiles.canvas.ICanvasObjectGroup} newInputModeGroup the new value + */ + onInputModeGroupChanged(oldInputModeGroup:yfiles.canvas.ICanvasObjectGroup,newInputModeGroup:yfiles.canvas.ICanvasObjectGroup):void; + /** + * Factory method for the InputModeGroup property. This method will be called + * upon first access to the {@link yfiles.canvas.GraphControl#inputModeGroup} property. + * @return {yfiles.canvas.ICanvasObjectGroup} a new instance of ICanvasObjectGroup + */ + createInputModeGroup():yfiles.canvas.ICanvasObjectGroup; + /** + * Returns a canvas group provider instance that yields {@link yfiles.canvas.GraphControl#inputModeGroup}. + */ + getInputModeGroupProvider():yfiles.model.ICanvasGroupProvider; + /** + * Gets or sets the BackgroundGroup property. + * The background group is the {@link yfiles.canvas.ICanvasObjectGroup} that + * should be used by the application code to put background elements in. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.canvas.GraphControl#createBackgroundGroup} will be called. + * Upon change the {@link yfiles.canvas.GraphControl#onBackgroundGroupChanged} method will be called. + * @see {@link yfiles.canvas.GraphControl#contentGroup} + */ + backgroundGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#backgroundGroup} property has been changed. + */ + addBackgroundGroupChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#backgroundGroup} property has been changed. + */ + removeBackgroundGroupChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Called when the {@link yfiles.canvas.GraphControl#backgroundGroup} property value changes + * and after initialization of the field. + * Triggers the {@link yfiles.canvas.GraphControl#addBackgroundGroupChangedListener BackgroundGroupChanged} event. + * @param {yfiles.canvas.ICanvasObjectGroup} oldBackgroundGroup the old value, which may be null the first time + * @param {yfiles.canvas.ICanvasObjectGroup} newBackgroundGroup the new value + */ + onBackgroundGroupChanged(oldBackgroundGroup:yfiles.canvas.ICanvasObjectGroup,newBackgroundGroup:yfiles.canvas.ICanvasObjectGroup):void; + /** + * Factory method for the BackgroundGroup property. This method will be called + * upon first access to the {@link yfiles.canvas.GraphControl#backgroundGroup} property. + * @return {yfiles.canvas.ICanvasObjectGroup} a new instance of ICanvasObjectGroup + */ + createBackgroundGroup():yfiles.canvas.ICanvasObjectGroup; + /** + * Returns a canvas group provider instance that yields {@link yfiles.canvas.GraphControl#backgroundGroup}. + */ + getBackgroundGroupProvider():yfiles.model.ICanvasGroupProvider; + /** + * Gets or sets the Graph that is displayed in this control. + * Normally the {@link yfiles.graph.GraphSelection} property must be adjusted accordingly if the + * graph instance is replaced. Also depending on the {@link yfiles.input.IInputMode} implementation + * the instances used in this control might need to be replaced or adjusted, too. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.canvas.GraphControl#createGraph} will be called. + * Upon change the {@link yfiles.canvas.GraphControl#onGraphChanged} method will be called. + */ + graph:yfiles.graph.IGraph; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#graph} property has been changed. + */ + addGraphChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#graph} property has been changed. + */ + removeGraphChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Called when the {@link yfiles.canvas.GraphControl#graph} property value changes + * and after initialization of the field. + * Triggers the {@link yfiles.canvas.GraphControl#addGraphChangedListener GraphChanged} event. + * @param {yfiles.graph.IGraph} oldGraph the old value, which may be null the first time + * @param {yfiles.graph.IGraph} newGraph the new value + */ + onGraphChanged(oldGraph:yfiles.graph.IGraph,newGraph:yfiles.graph.IGraph):void; + /** + * Factory method for the Graph property. This method will be called + * upon first access to the {@link yfiles.canvas.GraphControl#graph} property. + * @return {yfiles.graph.IGraph} a new instance of {@link yfiles.graph.DefaultGraph} + */ + createGraph():yfiles.graph.IGraph; + /** + * Gets or sets the selection model that is used for this control. + * The selection model instance needs to be adjusted, normally if the {@link yfiles.canvas.GraphControl#graph} + * instance is changed. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.canvas.GraphControl#createSelection} will be called. + * Upon change the {@link yfiles.canvas.GraphControl#onSelectionChanged} method will be called. + */ + selection:yfiles.graph.IGraphSelection; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#selection} instance has been changed, not when the selected items change. + * This event fires rarely. The {@link yfiles.canvas.GraphControl#selection} property is only the selection model, thus this event is raised when the selection + * model instance itself changes. To listen to changes in the {@link yfiles.canvas.GraphControl}'s selection, please refer to the + * appropriate events on {@link yfiles.graph.IGraphSelection}. + * @see {@link yfiles.model.ISelectionModel#addItemSelectedListener ItemSelected} + * @see {@link yfiles.model.ISelectionModel#addItemDeselectedListener ItemDeselected} + */ + addSelectionChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered if the {@link yfiles.canvas.GraphControl#selection} instance has been changed, not when the selected items change. + * This event fires rarely. The {@link yfiles.canvas.GraphControl#selection} property is only the selection model, thus this event is raised when the selection + * model instance itself changes. To listen to changes in the {@link yfiles.canvas.GraphControl}'s selection, please refer to the + * appropriate events on {@link yfiles.graph.IGraphSelection}. + * @see {@link yfiles.model.ISelectionModel#addItemSelectedListener ItemSelected} + * @see {@link yfiles.model.ISelectionModel#addItemDeselectedListener ItemDeselected} + */ + removeSelectionChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Called when the {@link yfiles.canvas.GraphControl#selection} property value changes + * and after initialization of the field. + * Triggers the {@link yfiles.canvas.GraphControl#addSelectionChangedListener SelectionChanged} event. + * @param {yfiles.graph.IGraphSelection} oldGraphSelection the old value, which may be null the first time + * @param {yfiles.graph.IGraphSelection} newGraphSelection the new value + */ + onSelectionChanged(oldGraphSelection:yfiles.graph.IGraphSelection,newGraphSelection:yfiles.graph.IGraphSelection):void; + /** + * Factory method for the Selection property. This method will be called + * upon first access to the {@link yfiles.canvas.GraphControl#selection} property. + * @return {yfiles.graph.IGraphSelection} a new instance of {@link yfiles.graph.GraphSelection} + */ + createSelection():yfiles.graph.IGraphSelection; + /** + * {@link yfiles.canvas.CanvasControl#updateContentRectWithMarginsForGroup Updates the content rectangle} + * for the {@link yfiles.canvas.GraphControl#contentGroup} and + * {@link yfiles.canvas.CanvasControl#fitContent adjusts the viewport to encompass the contents}. + */ + fitGraphBounds():void; + /** + * {@link yfiles.canvas.CanvasControl#updateContentRectWithMarginsForGroup Updates the content rectangle} + * for the {@link yfiles.canvas.GraphControl#contentGroup} considering the provided insets and + * {@link yfiles.canvas.CanvasControl#fitContent adjusts the viewport to encompass the contents}. + */ + fitGraphBoundsWithInsets(insets:yfiles.geometry.InsetsD):void; + /** + * Gets the {@link yfiles.graphml.IGraphMLIOHandler} to use for the various I/O methods + * in this instance. + * This method will first query the {@link yfiles.support.ILookup#lookup} method of this instance, + * then the lookup of the {@link yfiles.canvas.GraphControl#graph}, + * @return {yfiles.graphml.IGraphMLIOHandler} The instance to use for IO. + */ + getGraphMLIOHandler():yfiles.graphml.IGraphMLIOHandler; + /** + * Convenience method that exports the {@link yfiles.canvas.GraphControl#graph} + * as {@link yfiles.graphml.IGraphMLIOHandler GraphML} to a string. + * For full control over the output use the {@link yfiles.graphml.IGraphMLIOHandler} class. + * This method uses {@link yfiles.canvas.GraphControl#getGraphMLIOHandler} to determine the instance to use + * for the operation. + * @see {@link yfiles.canvas.GraphControl#getGraphMLIOHandler} + */ + exportToGraphMLText():string; + /** + * Convenience method that exports the {@link yfiles.canvas.GraphControl#graph}as + * {@link yfiles.graphml.IGraphMLIOHandler GraphML} to a {@link yfiles.system.StringWriter}. + * For full control over the output use the {@link yfiles.graphml.IGraphMLIOHandler} + * class. This method uses {@link yfiles.canvas.GraphControl#getGraphMLIOHandler} to determine + * the instance to use for the operation. + * @see {@link yfiles.canvas.GraphControl#getGraphMLIOHandler} + * @param {yfiles.system.StringWriter} writer The writer to export the graph to. + */ + exportToGraphML(writer:yfiles.system.StringWriter):void; + /** + * Convenience method that imports the {@link yfiles.canvas.GraphControl#graph} + * from {@link yfiles.graphml.IGraphMLIOHandler GraphML}. + * For full control over the input use the {@link yfiles.graphml.IGraphMLIOHandler} class. + * This method uses {@link yfiles.canvas.GraphControl#getGraphMLIOHandler} to determine the instance to use + * for the operation. + *

+ * After the graph has been loaded the {@link yfiles.canvas.CanvasControl#viewport} will be + * {@link yfiles.canvas.GraphControl#fitGraphBounds updated} to display the entire graph. If + * undo is enabled the {@link yfiles.canvas.GraphControl#getUndoEngine undo engine} will be {@link yfiles.support.UndoEngine#clear cleared}. + *

+ * @see {@link yfiles.canvas.GraphControl#getGraphMLIOHandler} + * @param {Document} document The GraphML document to read the graph from. Note: If + * you are using Internet Explorer 9 and {@link XMLHttpRequest}s to retrieve the + * document, you may not use the value from the {@link XMLHttpRequest#responseXML} + * property. Please parse {@link XMLHttpRequest#responseText} instead and use the + * result. + * For further reference see . + */ + importFromGraphMLDocument(document:Document):void; + /** + * Convenience method that imports the {@link yfiles.canvas.GraphControl#graph} + * from an XML data provided in a string data. + * For full control over the input use the {@link yfiles.graphml.IGraphMLIOHandler} class. + * This method uses {@link yfiles.canvas.GraphControl#getGraphMLIOHandler} to determine the instance to use + * for the operation. + *

+ * After the graph has been loaded the {@link yfiles.canvas.CanvasControl#viewport} will be + * {@link yfiles.canvas.GraphControl#fitGraphBounds updated} to display the entire graph. If + * undo is enabled the {@link yfiles.canvas.GraphControl#getUndoEngine undo engine} will be {@link yfiles.support.UndoEngine#clear cleared}. + *

+ * @see {@link yfiles.canvas.GraphControl#getGraphMLIOHandler} + * @param {string} data A string that contains GraphML data. + */ + importFromGraphMLText(data:string):void; + /** + * Convenience method that imports the {@link yfiles.canvas.GraphControl#graph} + * from a {@link yfiles.graphml.IGraphMLIOHandler GraphML} URL. + *

+ * Note that this is an asynchronous method that returns immediately. You can use the {@link yfiles.canvas.GraphControl#importFromGraphMLUrlWithCallback} overload + * to be notified when the actual parsing has completed. + *

+ *

+ * For full control over the input use the {@link yfiles.graphml.IGraphMLIOHandler} class. + * This method uses {@link yfiles.canvas.GraphControl#getGraphMLIOHandler} to determine the instance to use + * for the operation. + *

+ *

+ * After the graph has been loaded the {@link yfiles.canvas.CanvasControl#viewport} will be + * {@link yfiles.canvas.GraphControl#fitGraphBounds updated} to display the entire graph. If + * undo is enabled the {@link yfiles.canvas.GraphControl#getUndoEngine undo engine} will be {@link yfiles.support.UndoEngine#clear cleared}. + *

+ * @see {@link yfiles.canvas.GraphControl#getGraphMLIOHandler} + * @see {@link yfiles.canvas.GraphControl#importFromGraphMLUrlWithCallback} + * @param {string} url The URL of the GraphML file to read the graph from. + */ + importFromGraphMLUrl(url:string):void; + /** + * Convenience method that imports the {@link yfiles.canvas.GraphControl#graph} + * from a {@link yfiles.graphml.IGraphMLIOHandler GraphML} URL. + *

+ * Note that this is an asynchronous method that returns immediately. You can use the finishedCallback + * to be notified when the actual parsing has completed. + *

+ *

+ * For full control over the input use the {@link yfiles.graphml.IGraphMLIOHandler} class. + * This method uses {@link yfiles.canvas.GraphControl#getGraphMLIOHandler} to determine the instance to use + * for the operation. + *

+ *

+ * After the graph has been loaded the {@link yfiles.canvas.CanvasControl#viewport} will be + * {@link yfiles.canvas.GraphControl#fitGraphBounds updated} to display the entire graph. If + * undo is enabled the {@link yfiles.canvas.GraphControl#getUndoEngine undo engine} will be {@link yfiles.support.UndoEngine#clear cleared}. + *

+ * @param {function(Object, yfiles.system.EventArgs)} finishedCallback Optional callback that is called when parsing is complete. + * @see {@link yfiles.canvas.GraphControl#getGraphMLIOHandler} + * @see {@link yfiles.canvas.GraphControl#importFromGraphMLUrl} + * @param {string} url The URL of the GraphML file to read the graph from. + */ + importFromGraphMLUrlWithCallback(url:string,finishedCallback:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Gets or sets a value indicating the type of storage used by the commands Open/Save/Save As. + * By default this feature is set to {@link yfiles.canvas.StorageLocation#NONE}. + *

+ * This property specifies the storage type of the following commands: + *

    + *
  • {@link yfiles.system.ApplicationCommands#OPEN}
  • + *
  • {@link yfiles.system.ApplicationCommands#SAVE}
  • + *
  • {@link yfiles.system.ApplicationCommands#SAVE_AS}
  • + *
+ *

+ *

Note that this doesn't affect the convenience methods + * {@link yfiles.canvas.GraphControl#importFromGraphMLUrlWithCallback}, + * {@link yfiles.canvas.GraphControl#exportToGraphML} + * and their variants.

+ * The default implementations delegate to {@link yfiles.canvas.GraphControl#openFile}, {@link yfiles.canvas.GraphControl#saveFile} + * and {@link yfiles.canvas.GraphControl#saveFileAs} methods respectively. + * Value: A value indicating the type of storage used. + * @see {@link yfiles.canvas.GraphControl#createOpenFileInputElement} + * @see {@link yfiles.canvas.GraphControl#createSaveFileTextElement} + * @see {@link yfiles.canvas.GraphControl#openFile} + * @see {@link yfiles.canvas.GraphControl#saveFile} + * @see {@link yfiles.canvas.GraphControl#saveFileAs} + */ + storageLocation:yfiles.canvas.StorageLocation; + /** + * Gets or sets a value indicating whether the {@link yfiles.canvas.GraphControl#getUndoEngine undoability} functionality is enabled. + * By default this feature is enabled, however it depends on the {@link yfiles.canvas.GraphControl#getUndoEngine availability} of + * the {@link yfiles.support.UndoEngine}. In order to enable undoability therefor this property needs to be set to + * true and the graph needs to provide an {@link yfiles.support.UndoEngine} implementation. + * {@link yfiles.graph.DefaultGraph#undoEngineEnabled} can be used to turn on undoability on + * a {@link yfiles.graph.DefaultGraph}. + *

+ * In addition, this property enables/disables the following commands: + *

    + *
  • {@link yfiles.system.ApplicationCommands#UNDO}
  • + *
  • {@link yfiles.system.ApplicationCommands#REDO}
  • + *
+ *

+ * Value: true if the undoability functionality is enabled; otherwise, false. + * @see {@link yfiles.canvas.GraphControl#undo} + * @see {@link yfiles.canvas.GraphControl#redo} + * @see {@link yfiles.graph.DefaultGraph#undoEngineEnabled} + */ + undoabilityEnabled:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.canvas.GraphControl#clipboard} functionality is enabled. + * By default this feature is enabled. + * Setting this value to false, will remove the clipboard from the {@link yfiles.support.ILookup} + * of this instance. + *

+ * In addition, this property enables/disables the following commands: + *

    + *
  • {@link yfiles.system.ApplicationCommands#CUT}
  • + *
  • {@link yfiles.system.ApplicationCommands#COPY}
  • + *
  • {@link yfiles.system.ApplicationCommands#PASTE}
  • + *
+ *

+ * Value: true if the clipboard is enabled; otherwise, false. + */ + clipboardEnabled:boolean; + /** + * Delegates to the {@link yfiles.canvas.GraphControl#graph}'s {@link yfiles.support.UndoEngine}'s + * {@link yfiles.support.UndoEngine#canUndo} method. + */ + canUndo():boolean; + /** + * Delegates to the {@link yfiles.canvas.GraphControl#graph}'s {@link yfiles.support.UndoEngine}'s + * {@link yfiles.support.UndoEngine#canRedo} method. + */ + canRedo():boolean; + /** + * Delegates to the {@link yfiles.canvas.GraphControl#graph}'s {@link yfiles.support.UndoEngine}'s + * {@link yfiles.support.UndoEngine#undo} method. + */ + undo():void; + /** + * Delegates to the {@link yfiles.canvas.GraphControl#graph}'s {@link yfiles.support.UndoEngine}'s + * {@link yfiles.support.UndoEngine#redo} method. + */ + redo():void; + /** + * Retrieves the {@link yfiles.support.UndoEngine} associated with + * the current {@link yfiles.canvas.GraphControl#graph} instance. + * {@link yfiles.graph.DefaultGraph#undoEngineEnabled} can be used to turn on undoability on + * a {@link yfiles.graph.DefaultGraph}. + * @return {yfiles.support.UndoEngine} The instance or null. + * @see {@link yfiles.graph.DefaultGraph#undoEngineEnabled} + */ + getUndoEngine():yfiles.support.UndoEngine; + /** + * Gets or sets the {@link yfiles.graph.GraphClipboard} associated with this control. + * If no instance has been configured with this control, a default + * implementation will be used. + */ + clipboard:yfiles.graph.GraphClipboard; + /** + * Delegates to the {@link yfiles.canvas.GraphControl#clipboard}'s + * {@link yfiles.graph.GraphClipboard#cut} method using + * {@link yfiles.graph.GraphClipboard#createSelectionFilter} as the subset to cut. + */ + cut():void; + /** + * Delegates to the {@link yfiles.canvas.GraphControl#clipboard}'s + * {@link yfiles.graph.GraphClipboard#copy} method using + * {@link yfiles.graph.GraphClipboard#createSelectionFilter} as the subset to copy. + */ + copy():void; + /** + * Delegates to the {@link yfiles.canvas.GraphControl#clipboard}'s + * {@link yfiles.graph.GraphClipboard#pasteWithSelection} method. + */ + paste():void; + /** + * Creates the default instance to use if no custom instance has been set. + * @return {yfiles.graph.GraphClipboard} A default {@link yfiles.graph.GraphClipboard} instance. + */ + createGraphClipboard():yfiles.graph.GraphClipboard; + /** + * Convenience method that runs a layouter on the graph of a given graph control + * and animates the transition. An event is called once the animation has finished. + * This is a bridge method that delegates to {@link yfiles.graph.LayoutExtensions#morphLayout}. + * @param {yfiles.layout.ILayouter} layouter The layouter to run. + * @param {yfiles.system.TimeSpan} morphDuration Duration of the animation of the layout. + * @param {function(Object, yfiles.system.EventArgs)} doneHandler The handler that is called after the animation has finished. See {@link yfiles.graph.LayoutExecutor#finishHandler}. + * @see {@link yfiles.graph.LayoutExecutor} + * @see {@link yfiles.graph.LayoutExtensions#doLayout} + */ + morphLayout(layouter:yfiles.layout.ILayouter,morphDuration:yfiles.system.TimeSpan,doneHandler:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + } + var GraphControl:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of the Graph Control in the given div element. + * If the {@link yfiles.canvas.GraphControl#graph} and {@link yfiles.graph.GraphSelection} properties are not populated + * externally they will be initialized with default values upon first access. Thus + * this instance can be used right away without any further initialization. + */ + ForDiv:{ + new (div:HTMLDivElement):yfiles.canvas.GraphControl; + }; + /** + * Creates a new instance of the Graph Control. + * If the {@link yfiles.canvas.GraphControl#graph} and {@link yfiles.graph.GraphSelection} properties are not populated + * externally they will be initialized with default values upon first access. Thus + * this instance can be used right away without any further initialization. + * This constructor creates a new div element that needs to be manually added to the DOM. + */ + new ():yfiles.canvas.GraphControl; + /** + * Creates a new instance of the Graph Control in the div element identified by the given id. + * If the {@link yfiles.canvas.GraphControl#graph} and {@link yfiles.graph.GraphSelection} properties are not populated + * externally they will be initialized with default values upon first access. Thus + * this instance can be used right away without any further initialization. + */ + ForId:{ + new (id:string):yfiles.canvas.GraphControl; + }; + /** + * A {@link yfiles.system.RoutedUICommand} that invokes {@link yfiles.canvas.GraphControl#currentItem} if executed. + */ + SET_CURRENT_ITEM_COMMAND:yfiles.system.RoutedUICommand; + /** + * The {@link yfiles.system.RoutedUICommand} that performs the {@link yfiles.canvas.GraphControl#fitGraphBoundsWithInsets} + * action. + * The parameter can be either an {@link yfiles.geometry.InsetsD} or convertible that will be used to create an + * appropriately sized insets object from. + */ + FIT_GRAPH_BOUNDS_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that changes the {@link yfiles.canvas.CanvasControl#zoom} and the + * {@link yfiles.canvas.CanvasControl#viewPoint} in an animated fashion such that the {@link yfiles.canvas.GraphControl#currentItem} + * becomes fully visible. + */ + ZOOM_TO_CURRENT_ITEM_COMMAND:yfiles.system.RoutedUICommand; + }; + /** + * The CanvasControl is a custom {@link yfiles.canvas.Control} that can be used to + * efficiently display all kinds of data. + * The control supports high performance + * zooming and panning of visual content and provides a high level + * view of the visual tree. The control uses double precision world-coordinates + * to render items that are composed using a visual tree. In its most simple form the + * scene graph is a tree like structure of elements that will be rendered in depth-first-search order. + *

+ * The scene graph tree is made up of {@link yfiles.canvas.ICanvasObject} elements. Multiple elements are grouped + * in {@link yfiles.canvas.ICanvasObjectGroup} elements. + * An ICanvasObject consists of a {@link yfiles.canvas.ICanvasObject#userObject user-object} and an {@link yfiles.canvas.ICanvasObjectDescriptor} that + * is used by the rendering engine to query interfaces that perform the actual creation of the {@link yfiles.drawing.Visual}s, + * hit testing, and bounds calculation. + *

+ *

+ * This control comes with a number of default {@link yfiles.canvas.CanvasControl#commandBindings command bindings} + * that work on the view port: + *

    + *
  • {@link yfiles.system.NavigationCommands#INCREASE_ZOOM NavigationCommands.IncreaseZoom}
  • + *
  • {@link yfiles.system.NavigationCommands#DECREASE_ZOOM NavigationCommands.DecreaseZoom}
  • + *
  • {@link yfiles.system.NavigationCommands#ZOOM NavigationCommands.Zoom}
  • + *
  • {@link yfiles.system.ComponentCommands#SCROLL_PAGE_DOWN ComponentCommands.ScrollPageDown}
  • + *
  • {@link yfiles.system.ComponentCommands#SCROLL_PAGE_UP ComponentCommands.ScrollPageUp}
  • + *
  • {@link yfiles.system.ComponentCommands#SCROLL_PAGE_LEFT ComponentCommands.ScrollPageLeft}
  • + *
  • {@link yfiles.system.ComponentCommands#SCROLL_PAGE_RIGHT ComponentCommands.ScrollPageRight}
  • + *
+ * The handlers for {@link yfiles.system.NavigationCommands#INCREASE_ZOOM} and {@link yfiles.system.NavigationCommands#DECREASE_ZOOM} + * use the specified {@link yfiles.system.ExecutedRoutedEventArgs#parameter command parameter} as the factor by which the + * {@link yfiles.canvas.CanvasControl#zoom} value is multiplied or divided, respectively. The parameter is not required. If it is not present + * a default value is used. The handler for the {@link yfiles.system.NavigationCommands#ZOOM} command needs a parameter. The parameter + * can either be a number which is interpreted as the new zoom level, or it can be a suitable object. Supported objects + * are {@link yfiles.geometry.RectD}, {@link yfiles.geometry.PointD}, {@link yfiles.geometry.Point} and {@link yfiles.support.ILookup}. + * If a rectangle is specified as the parameter for the {@link yfiles.system.NavigationCommands#ZOOM} command, the handler adjusts + * the {@link yfiles.canvas.CanvasControl#viewport} such that the rectangle tightly fits into it. If a point is specified, the handler sets the + * {@link yfiles.canvas.CanvasControl#center} to that point. If the parameter implements {@link yfiles.support.ILookup}, then the handler tries to get a + * {@link yfiles.drawing.IBoundsProvider} from the lookup and uses the bounds obtained from the bounds provider as the rectangle to + * zoom to. + *

+ *

+ *

+ *

+ * In addition to the bindings for existing commands this class declares a new {@link yfiles.system.RoutedUICommand}, + * {@link yfiles.canvas.CanvasControl#FIT_CONTENT_COMMAND}, that will invoke the {@link yfiles.canvas.CanvasControl#fitContent} method. + *

+ *

+ * All commands can be removed from the {@link yfiles.canvas.CanvasControl#commandBindings} if desired. + *

+ *
+ * Related Information in the Developers Guide: + *

+ * CanvasControl is discussed in detail in the section Class CanvasControl. + *

+ * @see {@link yfiles.drawing.IVisualCreator} + * @see {@link yfiles.drawing.IHitTestable} + * @see {@link yfiles.drawing.IVisibilityTest} + */ + export interface CanvasControl extends yfiles.canvas.Control,yfiles.support.ILookup{ + /** + * Gets the control's {@link yfiles.canvas.CanvasControl#defsManager}. + */ + defsManager:yfiles.canvas.DefsManager; + /** + * Gets or sets whether to add a 'glass pane' overlay to the {@link yfiles.canvas.CanvasControl} + * that acts as the source for all mouse and touch events. + * The glass pane can be used as a workaround for bogus mouse and touch event handling: + * If the touch down or mouse down + * event occurs on an element that is removed from the DOM while the + * pointer is down, the up event may not bubble up to the {@link yfiles.canvas.CanvasControl} anymore, + * which leaves {@link yfiles.input.IInputMode input modes} in a bad state. + * Be aware that all direct touch and mouse + * interaction with the SVG DOM is disabled if the glass pane is enabled, so this should be used + * with care. + */ + useGlassPane:boolean; + /** + * Gets or sets the viewport limiter instance that can be used to limit the explorable region. + * By default there are no limits set on the explorable region. + */ + viewportLimiter:yfiles.canvas.ViewportLimiter; + /** + * Property that sets the editable state of this canvas. + * {@link yfiles.input.IInputMode} implementations should honor this property. + * Events will still be delivered to the IInputModes, however they + * should not modify the model. + */ + editable:boolean; + /** + * Specifies an {@link yfiles.input.IEventRecognizer} that determines + * whether the zooming to the center of the view, rather than at the mouse location should be used. + * The default is {@link yfiles.input.KeyEvents#CONTROL_PRESSED}. + */ + centerZoomEventRecognizer:yfiles.input.IEventRecognizer; + /** + * Specifies the visibility policy for the vertical scrollbar. + * Scrollbars don't need to be displayed in order to move the viewport. + * This can be achieved programmatically or using special IInputMode instances. + * The default is {@link yfiles.canvas.ScrollBarVisibility#AS_NEEDED}. + * @see {@link yfiles.input.MoveViewportInputMode} + * @see {@link yfiles.canvas.CanvasControl#horizontalScrollBarPolicy} + */ + verticalScrollBarPolicy:yfiles.canvas.ScrollBarVisibility; + /** + * Specifies the visibility policy for the vertical scrollbar. + * Scrollbars don't need to be displayed in order to move the viewport. + * This can be achieved programmatically or using special IInputMode instances. + * The default is {@link yfiles.canvas.ScrollBarVisibility#AS_NEEDED}. + * @see {@link yfiles.input.MoveViewportInputMode} + * @see {@link yfiles.canvas.CanvasControl#verticalScrollBarPolicy} + */ + horizontalScrollBarPolicy:yfiles.canvas.ScrollBarVisibility; + /** + * Callback when the {@link yfiles.canvas.CanvasControl#editable} property changes. + * @param {yfiles.system.PropertyChangedEventArgs} e the property change event argument + */ + onEditableChanged(e:yfiles.system.PropertyChangedEventArgs):void; + /** + * Gets the command bindings for this control. + */ + commandBindings:yfiles.collections.IList; + /** + * Gets the input bindings for this control. + * Value: The command bindings. + */ + inputBindings:yfiles.system.InputBindingCollection; + /** + * Scrolls to the provided view point and zoom level in an animated fashion. + * @param {yfiles.geometry.PointD} newViewPoint The new {@link yfiles.canvas.CanvasControl#viewPoint} + * @param {number} newZoom The new zoom level. + */ + animateScrollTo(newViewPoint:yfiles.geometry.PointD,newZoom:number):void; + /** + * Determines the behavior of the mouse wheel. + * The behavior can be switched between {@link yfiles.canvas.MouseWheelBehavior#ZOOM}, + * {@link yfiles.canvas.MouseWheelBehavior#SCROLL} and {@link yfiles.canvas.MouseWheelBehavior#NONE}. + * Additionally, this property can be configured to perform the action + * {@link yfiles.canvas.MouseWheelBehavior#ONLY_WHEN_FOCUSED only when the control is focused}. + */ + mouseWheelBehavior:yfiles.canvas.MouseWheelBehavior; + /** + * Gets or sets a value indicating whether {@link yfiles.system.ICommand}s for + * scrolling like {@link yfiles.system.ComponentCommands#SCROLL_PAGE_DOWN} etc. the scrolling should be performed + * in animated fashion. + * Value: + * true if scrolling should be animated; otherwise, false. The default is true. + */ + animateScrollCommands:boolean; + /** + * Gets and sets the Rectangle in world coordinates that holds the contents. + * This influences the display of the scroll bars. If the content rectangle is + * not currently visible in the viewport, scroll bars will be displayed, unless + * they are turned off completely. + * Note that in general the content rectangle is not updated automatically but declared + * as a fixed rectangle. Rather the + * application programmer needs to set this value or call respective automatic update + * methods. + */ + contentRect:yfiles.geometry.RectD; + /** + * Callback when the {@link yfiles.canvas.CanvasControl#contentRect} property changes. + */ + onContentRectChanged(eventArgs:yfiles.system.EventArgs):void; + /** + * Event that gets invoked when the {@link yfiles.canvas.CanvasControl#contentRect content rectangle} + * has been changed. + */ + addContentRectChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that gets invoked when the {@link yfiles.canvas.CanvasControl#contentRect content rectangle} + * has been changed. + */ + removeContentRectChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Sets the content rectangle. + * The content rectangle is the space in world coordinates that the user should at least + * be able to scroll to. I.e. if the area currently visible in the control does not encompass + * the content rect, the scrollbars will be made visible, unless they are disabled. + * @see {@link yfiles.canvas.CanvasControl#contentRect} + * @see {@link yfiles.canvas.CanvasControl#horizontalScrollBarPolicy} + * @see {@link yfiles.canvas.CanvasControl#verticalScrollBarPolicy} + */ + setContentRect(x:number,y:number,w:number,h:number):void; + /** + * Occurs when the size of this {@link yfiles.canvas.Control} is changed. + * @see {@link yfiles.canvas.CanvasControl#sizeChangedDetection} + * @see {@link yfiles.canvas.CanvasControl.SizeChangedDetectionMode} + */ + addSizeChangedListener(value:(sender:Object,e:yfiles.canvas.CanvasControl.SizeChangedEventArgs)=> void):void; + /** + * Occurs when the size of this {@link yfiles.canvas.Control} is changed. + * @see {@link yfiles.canvas.CanvasControl#sizeChangedDetection} + * @see {@link yfiles.canvas.CanvasControl.SizeChangedDetectionMode} + */ + removeSizeChangedListener(value:(sender:Object,e:yfiles.canvas.CanvasControl.SizeChangedEventArgs)=> void):void; + /** + * Gets or sets how size changes of this {@link yfiles.canvas.CanvasControl} will be detected. + * Since there is no size changed event in HTML, {@link yfiles.canvas.CanvasControl} comes with its own + * methods to detect whether the size of its {@link yfiles.canvas.Control#div} element has changed. + * This is needed to update its {@link yfiles.canvas.Control#size} accordingly. + *

+ * The preferred and default mode is {@link yfiles.canvas.CanvasControl.SizeChangedDetectionMode#SENSOR}. If that is + * not available, {@link yfiles.canvas.CanvasControl.SizeChangedDetectionMode#TIMER} is used as fall back instead. + *

+ *

+ * If the {@link yfiles.canvas.Control#div} of this control is removed from the DOM and the current + * mode is {@link yfiles.canvas.CanvasControl.SizeChangedDetectionMode#TIMER}, the mode is automatically changed to + * {@link yfiles.canvas.CanvasControl.SizeChangedDetectionMode#NONE}. Thus, if the element is later re-added to the + * DOM, the timer mode must be set again. + *

+ */ + sizeChangedDetection:yfiles.canvas.CanvasControl.SizeChangedDetectionMode_Interface; + /** + * Fires the size changed event. + */ + fireSizeChanged(oldSize:yfiles.geometry.SizeD):void; + /** + * Gets the size of the control. + * @see Overrides {@link yfiles.canvas.Control#size} + */ + size:yfiles.geometry.SizeD; + /** + * Gets the actual width. + * @see Overrides {@link yfiles.canvas.Control#actualWidth} + */ + actualWidth:number; + /** + * Gets the actual height. + * @see Overrides {@link yfiles.canvas.Control#actualHeight} + */ + actualHeight:number; + /** + * Gets and sets the insets in view coordinates that should be used by the {@link yfiles.canvas.CanvasControl#fitContent} operation. + * This influences the amount of visible whitespace in the view coordinate system around the + * {@link yfiles.canvas.CanvasControl#contentRect} after a {@link yfiles.canvas.CanvasControl#fitContent} operation. + * The default value is (0,0,0,0). + */ + fitContentViewMargins:yfiles.geometry.InsetsD; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates using double + * precision floating points when the mouse has exited the canvas. + * If the mouse leaves this canvas control with the mouse button pressed, this event is + * deferred until the mouse button is released. Thus, this event will not interfere with the + * typical mouse button event cycle. + */ + addMouse2DExitedListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates using double + * precision floating points when the mouse has exited the canvas. + * If the mouse leaves this canvas control with the mouse button pressed, this event is + * deferred until the mouse button is released. Thus, this event will not interfere with the + * typical mouse button event cycle. + */ + removeMouse2DExitedListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates using double + * precision floating points when the mouse has entered the canvas. + * If the mouse enters this canvas control with a mouse button pressed, this event is fired + * instantly but the current button state reported by the {@link yfiles.input.Mouse2DEventArgs} does + * not include this button unless the browser supports the property MouseEvent.buttons. + * See the Known Issues for more details. + */ + addMouse2DEnteredListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates using double + * precision floating points when the mouse has entered the canvas. + * If the mouse enters this canvas control with a mouse button pressed, this event is fired + * instantly but the current button state reported by the {@link yfiles.input.Mouse2DEventArgs} does + * not include this button unless the browser supports the property MouseEvent.buttons. + * See the Known Issues for more details. + */ + removeMouse2DEnteredListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates + * using double precision floating points when the mouse has been moved in + * world coordinates. + * Move elements are delivered if no mouse button is pressed. + * This event will be fired, too, if the mouse does not + * move but the world coordinates to which the current mouse position maps + * change. E.g. this will happen if the zoom level or the view point is changed. + */ + addMouse2DMovedListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates + * using double precision floating points when the mouse has been moved in + * world coordinates. + * Move elements are delivered if no mouse button is pressed. + * This event will be fired, too, if the mouse does not + * move but the world coordinates to which the current mouse position maps + * change. E.g. this will happen if the zoom level or the view point is changed. + */ + removeMouse2DMovedListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates + * using double precision floating points when a mouse button has been pressed. + */ + addMouse2DPressedListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates + * using double precision floating points when a mouse button has been pressed. + */ + removeMouse2DPressedListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates + * using double precision floating points when the mouse is being moved while + * at least one of the mouse buttons is pressed. + */ + addMouse2DDraggedListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates + * using double precision floating points when the mouse is being moved while + * at least one of the mouse buttons is pressed. + */ + removeMouse2DDraggedListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates + * using double precision floating points when the mouse button has been + * released. + */ + addMouse2DReleasedListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates + * using double precision floating points when the mouse button has been + * released. + */ + removeMouse2DReleasedListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates + * using double precision floating points when the mouse capture has been lost. + */ + addMouse2DLostCaptureListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates + * using double precision floating points when the mouse capture has been lost. + */ + removeMouse2DLostCaptureListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates + * using double precision floating points when the mouse wheel has turned. + */ + addMouse2DWheelTurnedListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates + * using double precision floating points when the mouse wheel has turned. + */ + removeMouse2DWheelTurnedListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates + * using double precision floating points when the user clicked the mouse. + * This happens if press and release happens at the same position. + */ + addMouse2DClickedListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Mouse2DEventArgs} in world coordinates + * using double precision floating points when the user clicked the mouse. + * This happens if press and release happens at the same position. + */ + removeMouse2DClickedListener(value:(sender:Object,me:yfiles.input.Mouse2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.CompoundKeyEventArgs} when keys + * are being pressed. + */ + addCompoundKeyPressedListener(value:(sender:Object,args:yfiles.input.CompoundKeyEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.CompoundKeyEventArgs} when keys + * are being pressed. + */ + removeCompoundKeyPressedListener(value:(sender:Object,args:yfiles.input.CompoundKeyEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.CompoundKeyEventArgs} when keys + * are being typed. + */ + addCompoundKeyTypedListener(value:(sender:Object,args:yfiles.input.CompoundKeyEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.CompoundKeyEventArgs} when keys + * are being typed. + */ + removeCompoundKeyTypedListener(value:(sender:Object,args:yfiles.input.CompoundKeyEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.CompoundKeyEventArgs} when keys + * are being released. + */ + addCompoundKeyReleasedListener(value:(sender:Object,args:yfiles.input.CompoundKeyEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.CompoundKeyEventArgs} when keys + * are being released. + */ + removeCompoundKeyReleasedListener(value:(sender:Object,args:yfiles.input.CompoundKeyEventArgs)=> void):void; + /** + * A property change event that gets fired when the {@link yfiles.canvas.CanvasControl#editable} + * property has been changed. + */ + addEditableChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * A property change event that gets fired when the {@link yfiles.canvas.CanvasControl#editable} + * property has been changed. + */ + removeEditableChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * A property change event that gets fired when the {@link yfiles.canvas.CanvasControl#viewport} + * property has been changed. + */ + addViewportChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * A property change event that gets fired when the {@link yfiles.canvas.CanvasControl#viewport} + * property has been changed. + */ + removeViewportChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Callback method that will be invoked if a key has been released. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addCompoundKeyReleasedListener CompoundKeyReleased} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * @param {yfiles.input.CompoundKeyEventArgs} e the event describing the action + * @see {@link yfiles.canvas.CanvasControl#onCompoundKeyTyped} + * @see {@link yfiles.canvas.CanvasControl#onCompoundKeyPressed} + * @see {@link yfiles.canvas.CanvasControl#addCompoundKeyReleasedListener CompoundKeyReleased} + */ + onCompoundKeyReleased(e:yfiles.input.CompoundKeyEventArgs):void; + /** + * Callback method that will be invoked if a key has been typed. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addCompoundKeyTypedListener CompoundKeyTyped} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * @param {yfiles.input.CompoundKeyEventArgs} e the event describing the action + * @see {@link yfiles.canvas.CanvasControl#onCompoundKeyReleased} + * @see {@link yfiles.canvas.CanvasControl#onCompoundKeyPressed} + * @see {@link yfiles.canvas.CanvasControl#addCompoundKeyTypedListener CompoundKeyTyped} + */ + onCompoundKeyTyped(e:yfiles.input.CompoundKeyEventArgs):void; + /** + * Callback method that will be invoked if a key has been pressed. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addCompoundKeyPressedListener CompoundKeyPressed} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * @param {yfiles.input.CompoundKeyEventArgs} e the event describing the action + * @see {@link yfiles.canvas.CanvasControl#onCompoundKeyReleased} + * @see {@link yfiles.canvas.CanvasControl#onCompoundKeyTyped} + * @see {@link yfiles.canvas.CanvasControl#addCompoundKeyPressedListener CompoundKeyPressed} + */ + onCompoundKeyPressed(e:yfiles.input.CompoundKeyEventArgs):void; + /** + * Callback method that is called when a mouse button has been released. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addMouse2DReleasedListener Mouse2DReleased} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Mouse2DEventArgs Mouse 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Mouse2DEventArgs} e the mouse event describing the action + * @see {@link yfiles.canvas.CanvasControl#onMouse2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DExited} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DPressed} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DDragged} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DClicked} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DWheelTurned} + * @see {@link yfiles.canvas.CanvasControl#addMouse2DReleasedListener Mouse2DReleased} + */ + onMouse2DReleased(e:yfiles.input.Mouse2DEventArgs):void; + /** + * Callback method that is called when the mouse capture is lost. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addMouse2DLostCaptureListener Mouse2DLostCapture} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Mouse2DEventArgs Mouse 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Mouse2DEventArgs} e the mouse event describing the action + * @see {@link yfiles.canvas.CanvasControl#onMouse2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DExited} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DPressed} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DDragged} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DClicked} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DWheelTurned} + * @see {@link yfiles.canvas.CanvasControl#addMouse2DReleasedListener Mouse2DReleased} + */ + onMouse2DLostCapture(e:yfiles.input.Mouse2DEventArgs):void; + /** + * Callback method that is called when the mouse wheel has been turned. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addMouse2DWheelTurnedListener Mouse2DWheelTurned} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * This method will call the {@link yfiles.canvas.CanvasControl#mouseWheelZoom} or {@link yfiles.canvas.CanvasControl#mouseWheelScroll} + * methods, if the corresponding {@link yfiles.canvas.CanvasControl#mouseWheelBehavior behavior} is enabled. + * {@link yfiles.input.Mouse2DEventArgs Mouse 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * In order to customize the mouse wheel behavior, set the {@link yfiles.canvas.CanvasControl#mouseWheelBehavior behavior} + * to {@link yfiles.canvas.MouseWheelBehavior#NONE None}. Register to the + * {@link yfiles.canvas.CanvasControl#addMouse2DWheelTurnedListener Mouse2DWheelTurned} event and execute the custom action. + * @param {yfiles.input.Mouse2DEventArgs} e the mouse event describing the action + * @see {@link yfiles.canvas.CanvasControl#onMouse2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DExited} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DPressed} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DDragged} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DReleased} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DClicked} + * @see {@link yfiles.canvas.CanvasControl#addMouse2DWheelTurnedListener Mouse2DWheelTurned} + */ + onMouse2DWheelTurned(e:yfiles.input.Mouse2DEventArgs):void; + /** + * This method will be called by the {@link yfiles.canvas.CanvasControl#onMouse2DWheelTurned} method, + * if the {@link yfiles.canvas.CanvasControl#mouseWheelBehavior} property is set to + * {@link yfiles.canvas.MouseWheelBehavior#ZOOM}. + * This method will adjust the current zoom level. If the Control key modifier has + * been pressed this method will keep the world coordinates at the current mouse position, + * i.e. the zoom will not necessarily be into the center of the canvas. + * @param {yfiles.input.Mouse2DEventArgs} e the event describing the action + * @see {@link yfiles.canvas.CanvasControl#onMouse2DWheelTurned} + * @see {@link yfiles.canvas.CanvasControl#mouseWheelBehavior} + */ + mouseWheelZoom(e:yfiles.input.Mouse2DEventArgs):void; + /** + * This method will be called by the {@link yfiles.canvas.CanvasControl#onMouse2DWheelTurned} method, + * if the {@link yfiles.canvas.CanvasControl#mouseWheelBehavior} property is set to + * {@link yfiles.canvas.MouseWheelBehavior#SCROLL}. + * This method will scroll the view in vertical direction. If the Shift key + * modifier has been pressed this method will scroll in horizontal direction. + * @param {yfiles.input.Mouse2DEventArgs} e the event describing the action + * @see {@link yfiles.canvas.CanvasControl#onMouse2DWheelTurned} + * @see {@link yfiles.canvas.CanvasControl#mouseWheelBehavior} + */ + mouseWheelScroll(e:yfiles.input.Mouse2DEventArgs):void; + /** + * Callback method that is called when a mouse button has been pressed. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addMouse2DPressedListener Mouse2DPressed} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Mouse2DEventArgs Mouse 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Mouse2DEventArgs} e the mouse event describing the action + * @see {@link yfiles.canvas.CanvasControl#onMouse2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DExited} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DReleased} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DDragged} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DClicked} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DWheelTurned} + * @see {@link yfiles.canvas.CanvasControl#addMouse2DPressedListener Mouse2DPressed} + */ + onMouse2DPressed(e:yfiles.input.Mouse2DEventArgs):void; + /** + * Callback method that is called when the mouse has been moved and + * no button has been pressed. If a button has been pressed the + * {@link yfiles.canvas.CanvasControl#onMouse2DDragged} method would have been called. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addMouse2DMovedListener Mouse2DMoved} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Mouse2DEventArgs Mouse 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Mouse2DEventArgs} e the mouse event describing the action + * @see {@link yfiles.canvas.CanvasControl#onMouse2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DExited} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DPressed} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DReleased} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DDragged} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DClicked} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DWheelTurned} + * @see {@link yfiles.canvas.CanvasControl#addMouse2DMovedListener Mouse2DMoved} + */ + onMouse2DMoved(e:yfiles.input.Mouse2DEventArgs):void; + /** + * Callback method that is called when the mouse enters the control. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addMouse2DEnteredListener Mouse2DEntered} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Mouse2DEventArgs Mouse 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Mouse2DEventArgs} e the mouse event describing the action + * @see {@link yfiles.canvas.CanvasControl#onMouse2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DExited} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DPressed} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DReleased} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DDragged} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DClicked} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DWheelTurned} + * @see {@link yfiles.canvas.CanvasControl#addMouse2DEnteredListener Mouse2DEntered} + */ + onMouse2DEntered(e:yfiles.input.Mouse2DEventArgs):void; + /** + * Callback method that is called when the mouse exits the control. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addMouse2DExitedListener Mouse2DExited} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Mouse2DEventArgs Mouse 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Mouse2DEventArgs} e the mouse event describing the action + * @see {@link yfiles.canvas.CanvasControl#onMouse2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DExited} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DPressed} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DReleased} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DDragged} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DClicked} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DWheelTurned} + * @see {@link yfiles.canvas.CanvasControl#addMouse2DExitedListener Mouse2DExited} + */ + onMouse2DExited(e:yfiles.input.Mouse2DEventArgs):void; + /** + * Callback method that is called when the mouse gets dragged. + * Moving the mouse while at least one button is pressed is considered + * dragging. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addMouse2DDraggedListener Mouse2DDragged} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Mouse2DEventArgs Mouse 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Mouse2DEventArgs} e the mouse event describing the action + * @see {@link yfiles.canvas.CanvasControl#onMouse2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DExited} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DPressed} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DReleased} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DClicked} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DWheelTurned} + * @see {@link yfiles.canvas.CanvasControl#addMouse2DDraggedListener Mouse2DDragged} + */ + onMouse2DDragged(e:yfiles.input.Mouse2DEventArgs):void; + /** + * Callback method that is called when the mouse has been clicked. + * This callback will be called after the {@link yfiles.canvas.CanvasControl#onMouse2DReleased} + * method has been invoked and only if the mouse has not been moved + * by a great amount since the last {@link yfiles.canvas.CanvasControl#onMouse2DPressed} event. + * This method will raise the {@link yfiles.canvas.CanvasControl#addMouse2DClickedListener Mouse2DClicked} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Mouse2DEventArgs Mouse 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Mouse2DEventArgs} e the mouse event describing the action + * @see {@link yfiles.canvas.CanvasControl#onMouse2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DExited} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DPressed} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DReleased} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DDragged} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DWheelTurned} + * @see {@link yfiles.canvas.CanvasControl#addMouse2DClickedListener Mouse2DClicked} + */ + onMouse2DClicked(e:yfiles.input.Mouse2DEventArgs):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when a finger has been put on the + * touch screen. + */ + addTouch2DDownListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when a finger has been put on the + * touch screen. + */ + removeTouch2DDownListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when a finger has been removed from + * the touch screen. + */ + addTouch2DUpListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when a finger has been removed from + * the touch screen. + */ + removeTouch2DUpListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when a finger has been moved on + * the touch screen. + */ + addTouch2DMovedListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when a finger has been moved on + * the touch screen. + */ + removeTouch2DMovedListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when a finger on the touch screen + * has entered the canvas. + */ + addTouch2DEnteredListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when a finger on the touch screen + * has entered the canvas. + */ + removeTouch2DEnteredListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when a finger on the touch screen + * has exited the canvas. + */ + addTouch2DExitedListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when a finger on the touch screen + * has exited the canvas. + */ + removeTouch2DExitedListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when the touch capture has been lost. + */ + addTouch2DLostCaptureListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when the touch capture has been lost. + */ + removeTouch2DLostCaptureListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when the user performed a tap + * gesture with a finger on the touch screen. + * This happens if down and up happens at the same position. + */ + addTouch2DTappedListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when the user performed a tap + * gesture with a finger on the touch screen. + * This happens if down and up happens at the same position. + */ + removeTouch2DTappedListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when the user performed a long press + * gesture with a finger on the touch screen. + * This happens if the finger is held in the same position for the duration + * specified in {@link yfiles.canvas.CanvasControl#longPressTime} after a {@link yfiles.canvas.CanvasControl#addTouch2DDownListener Touch2DDown}. + */ + addTouch2DLongPressedListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * An event that delivers {@link yfiles.input.Touch2DEventArgs} in world coordinates + * using double precision floating points when the user performed a long press + * gesture with a finger on the touch screen. + * This happens if the finger is held in the same position for the duration + * specified in {@link yfiles.canvas.CanvasControl#longPressTime} after a {@link yfiles.canvas.CanvasControl#addTouch2DDownListener Touch2DDown}. + */ + removeTouch2DLongPressedListener(value:(sender:Object,te:yfiles.input.Touch2DEventArgs)=> void):void; + /** + * Callback method that is called when a finger has been put on the touch screen. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addTouch2DDownListener Touch2DDown} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Touch2DEventArgs Touch 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Touch2DEventArgs} e the touch event describing the action + * @see {@link yfiles.canvas.CanvasControl#onTouch2DUp} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DExited} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLongPress} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DTapped} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLostCapture} + * @see {@link yfiles.canvas.CanvasControl#addTouch2DDownListener Touch2DDown} + */ + onTouch2DDown(e:yfiles.input.Touch2DEventArgs):void; + /** + * Callback method that is called when a finger has been moved on + * the touch screen. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addTouch2DMovedListener Touch2DMoved} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Touch2DEventArgs Touch 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Touch2DEventArgs} e the touch event describing the action + * @see {@link yfiles.canvas.CanvasControl#onTouch2DDown} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DUp} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DExited} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLongPress} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DTapped} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLostCapture} + * @see {@link yfiles.canvas.CanvasControl#addTouch2DMovedListener Touch2DMoved} + */ + onTouch2DMoved(e:yfiles.input.Touch2DEventArgs):void; + /** + * Callback method that is called when a finger has been removed from + * the surface of the touch screen. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addTouch2DUpListener Touch2DUp} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Touch2DEventArgs Touch 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Touch2DEventArgs} e the touch event describing the action + * @see {@link yfiles.canvas.CanvasControl#onTouch2DDown} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DExited} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLongPress} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DTapped} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLostCapture} + * @see {@link yfiles.canvas.CanvasControl#addTouch2DUpListener Touch2DUp} + */ + onTouch2DUp(e:yfiles.input.Touch2DEventArgs):void; + /** + * Callback method that is called when a finger on the touch screen + * enters the control. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addTouch2DEnteredListener Touch2DEntered} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Touch2DEventArgs Touch 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Touch2DEventArgs} e the touch event describing the action + * @see {@link yfiles.canvas.CanvasControl#onTouch2DDown} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DUp} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DExited} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLongPress} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DTapped} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLostCapture} + * @see {@link yfiles.canvas.CanvasControl#addTouch2DEnteredListener Touch2DEntered} + */ + onTouch2DEntered(e:yfiles.input.Touch2DEventArgs):void; + /** + * Callback method that is called when a finger on the touch screen + * exits the control. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addTouch2DExitedListener Touch2DExited} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Touch2DEventArgs Touch 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Touch2DEventArgs} e the touch event describing the action + * @see {@link yfiles.canvas.CanvasControl#onTouch2DDown} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DUp} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLongPress} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DTapped} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLostCapture} + * @see {@link yfiles.canvas.CanvasControl#addTouch2DExitedListener Touch2DExited} + */ + onTouch2DExited(e:yfiles.input.Touch2DEventArgs):void; + /** + * Callback method that is called when the touch capture is lost. + * This method will trigger the {@link yfiles.canvas.CanvasControl#addTouch2DLostCaptureListener Touch2DLostCapture} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Touch2DEventArgs Touch 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Touch2DEventArgs} e the touch event describing the action + * @see {@link yfiles.canvas.CanvasControl#onTouch2DDown} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DUp} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DExited} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLongPress} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DTapped} + * @see {@link yfiles.canvas.CanvasControl#addTouch2DLostCaptureListener Touch2DLostCapture} + */ + onTouch2DLostCapture(e:yfiles.input.Touch2DEventArgs):void; + /** + * Callback method that is called when a tap gesture has been performed with + * a finger on the touch screen. + * This callback will be called after the {@link yfiles.canvas.CanvasControl#onTouch2DUp} + * method has been invoked and only if the finger has not been moved + * by a great amount since the last {@link yfiles.canvas.CanvasControl#onTouch2DDown} event. + * This method will raise the {@link yfiles.canvas.CanvasControl#addTouch2DTappedListener Touch2DTapped} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Touch2DEventArgs Touch 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Touch2DEventArgs} e the touch event describing the action + * @see {@link yfiles.canvas.CanvasControl#onTouch2DDown} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DUp} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DExited} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLongPress} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLostCapture} + * @see {@link yfiles.canvas.CanvasControl#addTouch2DTappedListener Touch2DTapped} + */ + onTouch2DTapped(e:yfiles.input.Touch2DEventArgs):void; + /** + * Callback method that is called when a long press gesture has been + * performed with a finger on the touch screen. + * This callback will be called after the {@link yfiles.canvas.CanvasControl#onTouch2DDown} + * method has been invoked after a specified amount of + * {@link yfiles.canvas.CanvasControl#longPressTime time} and only if the finger has not + * been moved by a great amount. + * This method will raise the {@link yfiles.canvas.CanvasControl#addTouch2DLongPressedListener Touch2DLongPressed} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * {@link yfiles.input.Touch2DEventArgs Touch 2D Events} use the world coordinate + * system rather than the view-coordinate system of the control itself. + * @param {yfiles.input.Touch2DEventArgs} e the touch event describing the action + * @see {@link yfiles.canvas.CanvasControl#onTouch2DDown} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DUp} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DExited} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DTapped} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLostCapture} + * @see {@link yfiles.canvas.CanvasControl#addTouch2DLongPressedListener Touch2DLongPressed} + * @see {@link yfiles.canvas.CanvasControl#longPressTime} + */ + onTouch2DLongPress(e:yfiles.input.Touch2DEventArgs):void; + /** + * Gets a list of the active {@link yfiles.input.Touch2DDevice}s at the time of invocation. + * Note that this is not a live view, but rather a snapshot. + * @return {yfiles.model.IListEnumerable.} A snapshot of the currently active {@link yfiles.input.Touch2DDevice} instances, which may be empty. + */ + getCurrentTouchDevices():yfiles.model.IListEnumerable; + /** + * Checks if at least one finger is on the touch screen. + * @return {boolean} True if there is at least one {@link yfiles.input.Touch2DDevice touch device} + * that is down on the screen. + */ + isDeviceDown():boolean; + /** + * Gets the last {@link yfiles.input.Mouse2DEventArgs mouse event} + * triggered by this instance. + * @see {@link yfiles.canvas.CanvasControl#onMouse2DEntered} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DExited} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DPressed} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DReleased} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DDragged} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DWheelTurned} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DClicked} + */ + lastMouse2DEvent:yfiles.input.Mouse2DEventArgs; + /** + * Returns the internal list of currently installed {@link yfiles.input.IInputMode Input Modes}. + *

+ * This is a mutable list. To install new instances simply {@link yfiles.collections.ICollection#add add} them + * to the list and {@link yfiles.collections.ICollection#remove remove} them to uninstall them. + *

+ *

+ * Note that the content of this list is not related to the {@link yfiles.canvas.CanvasControl#inputMode} property, i.e. the value + * of that property is not automatically synchronized with this list and vice versa. If you want to use just a single + * {@link yfiles.input.IInputMode} instance, using the {@link yfiles.canvas.CanvasControl#inputMode} property is usually the better choice. + *

+ * @see {@link yfiles.canvas.CanvasControl#inputMode} + */ + inputModes:yfiles.collections.IList; + /** + * Event that is raised when the {@link yfiles.canvas.CanvasControl#inputMode} property is changed. + * @see {@link yfiles.canvas.CanvasControl#inputMode} + * @see {@link yfiles.canvas.CanvasControl#inputModes} + */ + addInputModeChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that is raised when the {@link yfiles.canvas.CanvasControl#inputMode} property is changed. + * @see {@link yfiles.canvas.CanvasControl#inputMode} + * @see {@link yfiles.canvas.CanvasControl#inputModes} + */ + removeInputModeChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Specifies the single {@link yfiles.input.IInputMode} instance that shall + * be installed for this canvas. + *

+ * Note that this property is not related to the {@link yfiles.canvas.CanvasControl#inputModes} collection, i.e. the value + * of this property is not automatically synchronized with that list and vice versa. + *

+ * @see {@link yfiles.canvas.CanvasControl#inputModes} + */ + inputMode:yfiles.input.IInputMode; + /** + * Callback that is invoked when the {@link yfiles.canvas.CanvasControl#inputMode} property changes. + * This will raise the {@link yfiles.canvas.CanvasControl#addInputModeChangedListener InputModeChanged} event. + * @param {yfiles.system.EventArgs} eventArgs the event arguments + * @see {@link yfiles.canvas.CanvasControl#inputMode} + * @see {@link yfiles.canvas.CanvasControl#inputModes} + */ + onInputModeChanged(eventArgs:yfiles.system.EventArgs):void; + /** + * Specifies the radius of the area around the mouse in view coordinates in which a + * {@link yfiles.drawing.IHitTestable} may lie to be considered a valid hit. + * This value + * can be queried from within the {@link yfiles.drawing.IHitTestable} implementation from the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * property. + * The default value is 3.0d + */ + hitTestRadius:number; + /** + * Event that is raised when the {@link yfiles.canvas.CanvasControl#hitTestRadius} property changes. + */ + addHitTestRadiusChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that is raised when the {@link yfiles.canvas.CanvasControl#hitTestRadius} property changes. + */ + removeHitTestRadiusChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Callback method that raised the {@link yfiles.canvas.CanvasControl#addHitTestRadiusChangedListener HitTestRadiusChanged} event. + * @param {yfiles.system.EventArgs} eventArgs + */ + onHitTestRadiusChanged(eventArgs:yfiles.system.EventArgs):void; + /** + * Gets or sets the zoom factor for this canvas control. + * A zoom level of 1.0f + * will make each unit in world-coordinate space appear exactly one unit in screen coordinates + * wide. The default is 1.0f. + * If this property is written, the canvas will zoom to the new value while keeping the center + * of view at the same world coordinates. + *

+ * The valid range is bounded by {@link yfiles.canvas.CanvasControl#minimumZoom} and {@link yfiles.canvas.CanvasControl#maximumZoom} + *

+ * @see {@link yfiles.canvas.CanvasControl#onZoomChanged} + * @see {@link yfiles.canvas.CanvasControl#addZoomChangedListener ZoomChanged} + * @see {@link yfiles.canvas.CanvasControl#minimumZoom} + * @see {@link yfiles.canvas.CanvasControl#maximumZoom} + */ + zoom:number; + /** + * Callback that is invoked when the {@link yfiles.canvas.CanvasControl#zoom} property changes. + * This method raises the {@link yfiles.canvas.CanvasControl#addZoomChangedListener ZoomChanged} event. + * @param {yfiles.system.EventArgs} eventArgs + */ + onZoomChanged(eventArgs:yfiles.system.EventArgs):void; + /** + * This event will be raised if the value of the {@link yfiles.canvas.CanvasControl#zoom} property + * has been changed. + */ + addZoomChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * This event will be raised if the value of the {@link yfiles.canvas.CanvasControl#zoom} property + * has been changed. + */ + removeZoomChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Gets or sets the minimum zoom factor for this canvas control. + * This property sets a lower bound for the allowed values of the {@link yfiles.canvas.CanvasControl#zoom} property. + * If this property is written, the canvas will zoom to the new value while keeping the center + * of view at the same world coordinates. + * The default is 0.01d but values as small as 0.0000001d are possible. + * @see {@link yfiles.canvas.CanvasControl#zoom} + * @see {@link yfiles.canvas.CanvasControl#maximumZoom} + */ + minimumZoom:number; + /** + * Get or set the maximum zoom level that is valid for {@link yfiles.canvas.CanvasControl#zoom}. + * Default value is 1000d + */ + maximumZoom:number; + /** + * Gets or sets the current view point. + * The view point is the point in world + * coordinates that is mapped to the top left corner point in the current viewport. + * Setting this point to another value will redispatch the last mouse event as the mouse + * will appear to have been moved or dragged in the world coordinate system. + */ + viewPoint:yfiles.geometry.PointD; + /** + * Callback method that is triggered when the view port has changed. + * The view port is the visible portion of the world rectangle in the + * world coordinate system. + * This method raises the {@link yfiles.canvas.CanvasControl#addViewportChangedListener ViewportChanged} event. + * @param {yfiles.system.PropertyChangedEventArgs} eventArgs The event argument. + * @see {@link yfiles.canvas.CanvasControl#viewport} + * @see {@link yfiles.canvas.CanvasControl#addViewportChangedListener ViewportChanged} + */ + onViewportChanged(eventArgs:yfiles.system.PropertyChangedEventArgs):void; + /** + * Returns the currently visible viewing region in world coordinates. + * @see {@link yfiles.canvas.CanvasControl#viewPoint} + * @see {@link yfiles.canvas.CanvasControl#zoom} + */ + viewport:yfiles.geometry.RectD; + /** + * Yields the size of the content of this control (i.e. the size without the scroll bars). + */ + innerSize:yfiles.geometry.SizeD; + /** + * Gets or sets a value indicating whether printing related command bindings are enabled. + * By default this feature is enabled. + *

+ * This property enables/disables the following commands: + *

    + *
  • {@link yfiles.system.ApplicationCommands#PRINT}
  • + *
  • {@link yfiles.system.ApplicationCommands#PRINT_PREVIEW}
  • + *
+ *

+ * Value: true if the commands are enabled; otherwise, false. + */ + printCommandsEnabled:boolean; + /** + * Helper method that ensures that the view port limit as returned by the {@link yfiles.canvas.CanvasControl#viewportLimiter} + * are obeyed. + * This method will {@link yfiles.canvas.CanvasControl#zoomToRectD} the limited bounds if necessary. + * @see {@link yfiles.canvas.CanvasControl#viewportLimiter} + */ + coerceViewportLimits():void; + cleanUp():void; + /** + * Retrieves the {@link yfiles.support.LookupChain} that can be used + * do decorate the {@link yfiles.support.ILookup#lookup} call + * in the {@link yfiles.canvas.CanvasControl#inputModeContext}. + */ + inputModeContextLookupChain:yfiles.support.LookupChain; + /** + * Returns an implementation of {@link yfiles.canvas.ICanvasContext} that describes the + * state of this canvas control. + * @see {@link yfiles.drawing.IHitTestable} + * @see {@link yfiles.drawing.IBoundsProvider} + */ + canvasContext:yfiles.canvas.ICanvasContext; + /** + * Gets or sets the world coordinate at the center of the control. + * This can be used to move the view port. + */ + center:yfiles.geometry.PointD; + /** + * Gets or sets a property that causes the control to automatically pan the view + * when the mouse gets dragged outside of the bounds of the control. + */ + autoDrag:boolean; + /** + * An event that gets triggered when the {@link yfiles.canvas.CanvasControl#autoDrag} property + * is changed. + * @see {@link yfiles.canvas.CanvasControl#onAutoDragChanged} + */ + addAutoDragChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * An event that gets triggered when the {@link yfiles.canvas.CanvasControl#autoDrag} property + * is changed. + * @see {@link yfiles.canvas.CanvasControl#onAutoDragChanged} + */ + removeAutoDragChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Called when {@link yfiles.canvas.CanvasControl#autoDrag} property has changed. + */ + onAutoDragChanged(eventArgs:yfiles.system.EventArgs):void; + /** + * Invalidates the control at the given world coordinates. + * @param {yfiles.geometry.RectD} worldRect the region in the world coordinate system to invalidate + */ + invalidateWorld(worldRect:yfiles.geometry.RectD):void; + /** + * Raises the {@link yfiles.canvas.Control} event and adjusts the scrollbars. + */ + onSizeChanged(args:yfiles.canvas.CanvasControl.SizeChangedEventArgs):void; + /** + * Calls {@link yfiles.canvas.CanvasControl#updateVisual} if the control has been previously {@link yfiles.canvas.CanvasControl#invalidate}d. + * Subclasses overriding this method need to make sure to call the base class implementation. + * @see {@link yfiles.canvas.CanvasControl#addUpdatingVisualListener UpdatingVisual} + * @see {@link yfiles.canvas.CanvasControl#addUpdatedVisualListener UpdatedVisual} + */ + onRender():void; + /** + * Invalidates this instance and marks it as in need for {@link yfiles.canvas.CanvasControl#updateVisual an update}. + * Calling this method is fast and will only mark the control for a future, asynchronously executed + * call to {@link yfiles.canvas.CanvasControl#updateVisual}. + */ + invalidate():void; + /** + * Updates the visual tree that displays the contents of this control. + *

+ * Calling this method will synchronously update the visual tree and the SVG DOM and Canvas rendering. + *

+ *

+ * This method will determine the {@link yfiles.canvas.ICanvasObject#dirty} canvas objects + * using the {@link yfiles.canvas.ICanvasObjectDescriptor#isDirty} method and + * will {@link yfiles.drawing.IVisualCreator#createVisual create} or + * {@link yfiles.drawing.IVisualCreator#updateVisual update} the visuals that + * make up the visual tree. + *

+ *

+ * Note that most of the time this method does not need to be called by client code. + * Instead calling {@link yfiles.canvas.CanvasControl#invalidate} or {@link yfiles.canvas.ICanvasObject#invalidate} + * will ultimately trigger the execution of this method. However invalidation calls will be coalesced + * and the actual execution of the update will be delayed until the next event dispatch. + *

+ */ + updateVisual():void; + /** + * Raises the {@link yfiles.canvas.CanvasControl#addPrepareRenderContextListener PrepareRenderContext}. + * @param {yfiles.canvas.PrepareRenderContextEventArgs} args The event arguments to raise. + * @see {@link yfiles.canvas.CanvasControl#addPrepareRenderContextListener PrepareRenderContext} + */ + raisePrepareRenderContextEvent(args:yfiles.canvas.PrepareRenderContextEventArgs):void; + /** + * Creates an appropriate {@link yfiles.drawing.IRenderContext render context} + * that can be used to {@link yfiles.drawing.IVisualCreator#createVisual create visuals} + * using {@link yfiles.drawing.IVisualCreator} implementations. + * This method is a convenience method to obtain a context for special visual creator + * implementations and normally needs not be used by application + * developers. + * @return {yfiles.drawing.IRenderContext} A new context instance that is bound to this instance. + */ + createRenderContext():yfiles.drawing.IRenderContext; + /** + * Creates an {@link yfiles.drawing.IRenderContext render context} with a new + * {@link yfiles.canvas.CanvasControl#defsManager} independent of the defs section belonging to + * this instance. + * This method is a convenience method to obtain a context for special visual creator + * implementations and normally needs not be used by application + * developers. Especially, this method can be used to retrieve a context for + * rendering the canvas content using {@link yfiles.canvas.CanvasControl#createVisualContent}. + * @return {yfiles.drawing.IRenderContext} A new context instance with an independent defs section + * that is bound to this instance. + */ + createStandaloneRenderContext():yfiles.drawing.IRenderContext; + /** + * Raises the {@link yfiles.canvas.CanvasControl#addUpdatedVisualListener UpdatedVisual}. + * @see {@link yfiles.canvas.CanvasControl#addUpdatedVisualListener UpdatedVisual} + */ + raiseUpdatedVisualEvent():void; + /** + * Event that will be triggered after the {@link yfiles.canvas.CanvasControl#updateVisual visual tree has been updated}. + */ + addUpdatedVisualListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered after the {@link yfiles.canvas.CanvasControl#updateVisual visual tree has been updated}. + */ + removeUpdatedVisualListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Raises the {@link yfiles.canvas.CanvasControl#addUpdatingVisualListener UpdatingVisual}. + * @see {@link yfiles.canvas.CanvasControl#addUpdatingVisualListener UpdatingVisual} + */ + raiseUpdatingVisualEvent():void; + /** + * Event that will be triggered before the {@link yfiles.canvas.CanvasControl#updateVisual visual tree is updated}. + */ + addUpdatingVisualListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered before the {@link yfiles.canvas.CanvasControl#updateVisual visual tree is updated}. + */ + removeUpdatingVisualListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Enumerates over all possible {@link yfiles.canvas.ICanvasObject} instances in the tree. + * @return {yfiles.collections.IEnumerator.} An enumerator for all {@link yfiles.canvas.ICanvasObject}s in the tree. + */ + enumerateCanvasObjects():yfiles.collections.IEnumerator; + /** + * Enumerates over all possible {@link yfiles.canvas.ICanvasObject} instances in the tree below the given group. + * @return {yfiles.collections.IEnumerator.} An enumerator for all {@link yfiles.canvas.ICanvasObject}s in the tree below the given group. + */ + enumerateCanvasObjectsInGroup(group:yfiles.canvas.ICanvasObjectGroup):yfiles.collections.IEnumerator; + /** + * Enumerates all hit elements in the canvas below the given group. + * Hit testing is performed using the {@link yfiles.canvas.ICanvasObjectDescriptor#getHitTestable} + * instance returned for each visible {@link yfiles.canvas.ICanvasObject} in the current scene graph. + * @param {yfiles.geometry.PointD} location the coordinates to perform the hit test at + * @param {yfiles.canvas.ICanvasObjectGroup} root the root of the scene graph to use + * @return {yfiles.collections.IEnumerator.} a live enumeration of the elements that are hit + * @see {@link yfiles.drawing.IHitTestable} + * @see {@link yfiles.canvas.CanvasControl#hitTestRadius} + */ + enumerateHitsAtRoot(location:yfiles.geometry.PointD,root:yfiles.canvas.ICanvasObjectGroup):yfiles.collections.IEnumerator; + /** + * Enumerates all hit elements in the canvas below the given group that are accepted by a given filter. + * Hit testing is performed using the {@link yfiles.canvas.ICanvasObjectDescriptor#getHitTestable} + * instance returned for each visible {@link yfiles.canvas.ICanvasObject} in the current scene graph. + * @param {yfiles.geometry.PointD} location the coordinates to perform the hit test at + * @param {yfiles.canvas.ICanvasObjectGroup} root the root of the scene graph to use + * @param {function(yfiles.canvas.ICanvasObject):boolean} filter The predicate that decides whether a given canvas object should be considered for testing at all or null. + * @return {yfiles.collections.IEnumerator.} a live enumeration of the elements that are hit + * @see {@link yfiles.drawing.IHitTestable} + * @see {@link yfiles.canvas.CanvasControl#hitTestRadius} + */ + enumerateFilteredHitsAtRoot(location:yfiles.geometry.PointD,root:yfiles.canvas.ICanvasObjectGroup,filter:(obj:yfiles.canvas.ICanvasObject)=>boolean):yfiles.collections.IEnumerator; + /** + * Enumerates all hit elements in the canvas below the given group that are accepted by a given filter using a specific {@link yfiles.canvas.ICanvasContext} as the argument to + * the {@link yfiles.drawing.IHitTestable#isHit} method. + * Hit testing is performed using the {@link yfiles.canvas.ICanvasObjectDescriptor#getHitTestable} + * instance returned for each visible {@link yfiles.canvas.ICanvasObject} in the current scene graph. + * @param {yfiles.geometry.PointD} location the coordinates to perform the hit test at + * @param {yfiles.canvas.ICanvasObjectGroup} root the root of the scene graph to use + * @param {function(yfiles.canvas.ICanvasObject):boolean} filter The predicate that decides whether a given canvas object should be considered for testing at all or null. + * @param {yfiles.canvas.ICanvasContext} context The context instance to pass to {@link yfiles.drawing.IHitTestable#isHit}. + * @return {yfiles.collections.IEnumerator.} a live enumeration of the elements that are hit + * @see {@link yfiles.drawing.IHitTestable} + */ + enumerateFilteredHitsAtRootWithContext(location:yfiles.geometry.PointD,root:yfiles.canvas.ICanvasObjectGroup,filter:(obj:yfiles.canvas.ICanvasObject)=>boolean,context:yfiles.canvas.ICanvasContext):yfiles.collections.IEnumerator; + /** + * Enumerates all hit elements in the canvas. + * Hit testing is performed using the {@link yfiles.canvas.ICanvasObjectDescriptor#getHitTestable} + * instance returned for each visible {@link yfiles.canvas.ICanvasObject} in the current scene graph. + * @param {yfiles.geometry.PointD} location the coordinates to perform the hit test at + * @return {yfiles.collections.IEnumerator.} a live enumeration of the elements that are hit + * @see {@link yfiles.drawing.IHitTestable} + * @see {@link yfiles.canvas.CanvasControl#hitTestRadius} + * @see {@link yfiles.canvas.CanvasControl#enumerateHitsAtRoot} + */ + enumerateHits(location:yfiles.geometry.PointD):yfiles.collections.IEnumerator; + /** + * Gets the root of the scene graph. This group cannot be {@link yfiles.canvas.ICanvasObject#remove removed}. + */ + root:yfiles.canvas.ICanvasObjectGroup; + /** + * Adds an element to the root of the internal scene graph. + * The descriptor will be queried for the various + * implementations for the given userObject at rendering time. + * The element will be added to the end of the rendering list and will + * thus display on top of the rest of the scene graph. + * @return {yfiles.canvas.ICanvasObject} A handle that can be used to control the rendering order and to later remove + * the element from the scene graph. + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasObjectDescriptor#DYNAMIC_DIRTY_INSTANCE} + * @see {@link yfiles.canvas.CanvasControl#addToGroup} + */ + add(userObject:Object,descriptor:yfiles.canvas.ICanvasObjectDescriptor):yfiles.canvas.ICanvasObject; + /** + * Adds an {@link yfiles.drawing.IVisualCreator} instance to the scene graph using + * {@link yfiles.canvas.CanvasObjectDescriptor#INSTANCE} as the {@link yfiles.canvas.ICanvasObjectDescriptor}. + * This method is equivalent to calling {@link yfiles.canvas.CanvasControl#add} with + * CanvasObjectDescriptor.Instance as the second argument and a non-null first argument. + * @param {yfiles.drawing.IVisualCreator} visualCreator the creator instance to use + * @return {yfiles.canvas.ICanvasObject} the handle for the newly created scene graph element + * @throws {yfiles.system.ArgumentNullException} If the creator is null. + * @see {@link yfiles.canvas.CanvasControl#add} + * @see {@link yfiles.canvas.CanvasControl#addCreatorToGroup} + */ + addCreator(visualCreator:yfiles.drawing.IVisualCreator):yfiles.canvas.ICanvasObject; + /** + * Adds a new {@link yfiles.canvas.ICanvasObjectGroup} to the root + * of the current scene graph. This can be used to build groups of + * {@link yfiles.canvas.ICanvasObject} instances that can be moved within the scene graph + * or whose {@link yfiles.canvas.ICanvasObject#visible visibility} can be controlled easily. + * @return {yfiles.canvas.ICanvasObjectGroup} the handle for the newly created group + */ + addGroup():yfiles.canvas.ICanvasObjectGroup; + /** + * Adds a new {@link yfiles.canvas.ICanvasObjectGroup} instance to the scene graph at the root + * level with the specified {@link yfiles.canvas.IGroupAction}. + * @param {yfiles.canvas.IGroupAction} action the action of the group + * @return {yfiles.canvas.ICanvasObjectGroup} the handle for the newly created group + */ + addGroupWithAction(action:yfiles.canvas.IGroupAction):yfiles.canvas.ICanvasObjectGroup; + /** + * Adds a new {@link yfiles.canvas.ICanvasObjectGroup} to the specified group + * in the current scene graph. This can be used to build groups of + * {@link yfiles.canvas.ICanvasObject} instances that can be moved within the scene graph + * or whose {@link yfiles.canvas.ICanvasObject#visible visibility} can be controlled easily. + * @param {yfiles.canvas.ICanvasObjectGroup} group the group to add the new group to + * @return {yfiles.canvas.ICanvasObjectGroup} the handle for the newly created group + */ + addGroupToGroup(group:yfiles.canvas.ICanvasObjectGroup):yfiles.canvas.ICanvasObjectGroup; + /** + * Adds a new {@link yfiles.canvas.ICanvasObjectGroup} instance to the scene graph to + * the provided group with + * the specified {@link yfiles.canvas.IGroupAction}. + * @param {yfiles.canvas.ICanvasObjectGroup} group the group to add the new group to + * @param {yfiles.canvas.IGroupAction} action the action of the group + * @return {yfiles.canvas.ICanvasObjectGroup} the handle for the newly created group + */ + addGroupToGroupWithAction(group:yfiles.canvas.ICanvasObjectGroup,action:yfiles.canvas.IGroupAction):yfiles.canvas.ICanvasObjectGroup; + /** + * Adds an {@link yfiles.drawing.IVisualCreator} instance to the scene graph to the specified group using + * {@link yfiles.canvas.CanvasObjectDescriptor#INSTANCE} as the {@link yfiles.canvas.ICanvasObjectDescriptor}. + * This method is equivalent to calling {@link yfiles.canvas.CanvasControl#addToGroup} with + * CanvasObjectDescriptor.Instance as the second argument and a non-null first argument. + * @param {yfiles.drawing.IVisualCreator} visualCreator the visual creator instance to use + * @return {yfiles.canvas.ICanvasObject} the handle for the newly created scene graph element + * @throws {yfiles.system.ArgumentNullException} If the visual creator is null. + * @param {yfiles.canvas.ICanvasObjectGroup} group The group to add the visual creator to. + */ + addCreatorToGroup(visualCreator:yfiles.drawing.IVisualCreator,group:yfiles.canvas.ICanvasObjectGroup):yfiles.canvas.ICanvasObject; + /** + * Adds an element to the internal scene graph to the specified group. + * The descriptor will be queried for the various + * implementations for the given userObject at rendering time. + * @return {yfiles.canvas.ICanvasObject} A handle that can be used to control the rendering order and to later remove + * the element from the scene graph. + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasObjectDescriptor#DYNAMIC_DIRTY_INSTANCE} + */ + addToGroup(userObject:Object,descriptor:yfiles.canvas.ICanvasObjectDescriptor,group:yfiles.canvas.ICanvasObjectGroup):yfiles.canvas.ICanvasObject; + /** + * Gets the element that corresponds to this visual. + * Usually this will be an SVG element or the root of an SVG document fragment. + */ + svgElement:Element; + /** + * Returns an HTML element that can be used to show arbitrary HTML content + * like overlays, fly-outs, or pop-ups on top of this + * {@link yfiles.canvas.CanvasControl}. + * A HTML element that was added to the overlay panel is drawn + * above the content of the CanvasControl but below its scrollbars. In + * contrast to labels or other model items, the element keeps its size when + * the canvas is zoomed. It should be placed with the CSS + * position: absolute to prevent multiple overlay elements to + * interfere with each other. + *

+ * HTML elements can be added to and removed from the overlay panel at any + * time. In addition to this, you can use a convenience feature of the + * constructor ForDiv(div) to add elements to the overlay + * panel. This constructor copies all child elements of the given + * div element to its overlay panel. + *

+ */ + overlayPanel:HTMLElement; + /** + * Gets or sets the value of the drag time. This value indicates the amount of + * time that may pass before a mouse movement is considered a + * drag when the mouse stays within its {@link yfiles.canvas.CanvasControl#dragSize} area. + * The higher the value the later a mouse movement will be recognized as a drag. + * This influences the click-sensitivity, since a mouse button release is only + * considered a click if there was no drag since the last mouse button press. + * The default value is 300 milliseconds. + * @see {@link yfiles.canvas.CanvasControl#dragSize} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DDragged} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DClicked} + */ + dragTime:yfiles.system.TimeSpan; + /** + * Gets or sets the value of the double tap time. + * This value indicates the amount of + * time that may pass within which two subsequent touch taps are considered + * multi taps. + * The higher the value the easier it will be to double-tap. + * The default value is 500 milliseconds. + * @see {@link yfiles.canvas.CanvasControl#doubleTapSize} + */ + doubleTapTime:yfiles.system.TimeSpan; + /** + * Gets or sets the value of the long press time. This value indicates the amount of + * time that may pass before a touch down is considered a + * long press when the pointer stays within its {@link yfiles.canvas.CanvasControl#dragSize} area. + * The higher the value the later a touch pointer movement will be recognized as a long press. + * The default value is 1000 milliseconds. + * @see {@link yfiles.canvas.CanvasControl#dragSize} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DDown} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DMoved} + * @see {@link yfiles.canvas.CanvasControl#onTouch2DLongPress} + */ + longPressTime:yfiles.system.TimeSpan; + /** + * Gets or sets the area in view coordinates the mouse may stay in before a + * movement is considered a drag. If the mouse is moved within this area longer than + * {@link yfiles.canvas.CanvasControl#dragTime} milliseconds, the movement will be considered a drag, nevertheless. + * The larger the area the later a mouse movement will be recognized as a drag. + * This influences the click-sensitivity, since a mouse button release is only + * considered a click if there was no drag since the last mouse button press. + * The default value is (5, 5). + * @see {@link yfiles.canvas.CanvasControl#dragSize} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DDragged} + * @see {@link yfiles.canvas.CanvasControl#onMouse2DClicked} + */ + dragSize:yfiles.geometry.SizeD; + /** + * Gets or sets the area in view coordinates the touch pointer needs to stay in before multiple + * taps are considered multiple single taps instead of multi-taps. + * If the touch pointer stays within this within than + * {@link yfiles.canvas.CanvasControl#doubleTapTime}, multiple taps will be considered double or multi-taps. + * The default value is (20, 20). + * @see {@link yfiles.canvas.CanvasControl#doubleTapTime} + */ + doubleTapSize:yfiles.geometry.SizeD; + /** + * Called when the {@link yfiles.canvas.CanvasControl#dragSize} property has changed. + * @param {yfiles.system.EventArgs} args the event parameter + */ + onDragSizeChanged(args:yfiles.system.EventArgs):void; + /** + * Called when the {@link yfiles.canvas.CanvasControl#dragTime} property has changed. + * @param {yfiles.system.EventArgs} args the event parameter + */ + onDragTimeChanged(args:yfiles.system.EventArgs):void; + /** + * Gets or sets the factor by which the zoom level changes when the mouse wheel is turned. + * The default value is 1.2. + */ + mouseWheelZoomFactor:number; + /** + * Callback that is triggered when the value of the {@link yfiles.canvas.CanvasControl#mouseWheelZoomFactor} property + * has been changed. + * @param {yfiles.system.EventArgs} args the event arguments + * @see {@link yfiles.canvas.CanvasControl#addMouseWheelZoomFactorChangedListener MouseWheelZoomFactorChanged} + */ + onMouseWheelZoomFactorChanged(args:yfiles.system.EventArgs):void; + /** + * This event will be raised if the value of the {@link yfiles.canvas.CanvasControl#mouseWheelZoomFactor} property + * has been changed. + */ + addMouseWheelZoomFactorChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * This event will be raised if the value of the {@link yfiles.canvas.CanvasControl#mouseWheelZoomFactor} property + * has been changed. + */ + removeMouseWheelZoomFactorChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Gets or sets the factor by which the view is scrolled by when the mouse wheel is turned. + * The default value is 0.1. + */ + mouseWheelScrollFactor:number; + /** + * Callback that is triggered when the value of the {@link yfiles.canvas.CanvasControl#mouseWheelScrollFactor} property + * has been changed. + * @param {yfiles.system.EventArgs} args the event arguments + * @see {@link yfiles.canvas.CanvasControl#addMouseWheelScrollFactorChangedListener MouseWheelScrollFactorChanged} + */ + onMouseWheelScrollFactorChanged(args:yfiles.system.EventArgs):void; + /** + * This event will be raised if the value of the {@link yfiles.canvas.CanvasControl#mouseWheelScrollFactor} property + * has been changed. + */ + addMouseWheelScrollFactorChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * This event will be raised if the value of the {@link yfiles.canvas.CanvasControl#mouseWheelScrollFactor} property + * has been changed. + */ + removeMouseWheelScrollFactorChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Tries to gain the focus if the control is enabled. + * This will transform the mouse event to a {@link yfiles.input.Mouse2DEventArgs} and + * invoke the {@link yfiles.canvas.CanvasControl#onMouse2DPressed} method. + * @param {yfiles.input.MouseEventArgs} e the event argument + * @see Overrides {@link yfiles.canvas.Control#onMouseDown} + */ + onMouseDown(e:yfiles.input.MouseEventArgs):void; + /** + * This will transform the mouse event to a {@link yfiles.input.Mouse2DEventArgs} and + * invoke the {@link yfiles.canvas.CanvasControl#onMouse2DEntered} method. + * @param {yfiles.input.MouseEventArgs} e the event argument + * @see Overrides {@link yfiles.canvas.Control#onMouseEnter} + */ + onMouseEnter(e:yfiles.input.MouseEventArgs):void; + /** + * This will transform the mouse event to a {@link yfiles.input.Mouse2DEventArgs} event and + * invoke the {@link yfiles.canvas.CanvasControl#onMouse2DExited} method. + * @param {yfiles.input.MouseEventArgs} e the event argument + * @see Overrides {@link yfiles.canvas.Control#onMouseLeave} + */ + onMouseLeave(e:yfiles.input.MouseEventArgs):void; + /** + * Sets up args and optionally starts or stops auto dragging. + */ + onDragOver(args:yfiles.system.DragEventArgs):void; + /** + * Stops auto-dragging. + */ + onDragLeave(e:yfiles.system.EventArgs):void; + /** + * Sets up args and optionally stops auto dragging. + */ + onDragDrop(args:yfiles.system.DragEventArgs):void; + /** + * This will transform the mouse event to a {@link yfiles.input.Mouse2DEventArgs} event and + * invoke the {@link yfiles.canvas.CanvasControl#onMouse2DMoved} or {@link yfiles.canvas.CanvasControl#onMouse2DDragged} methods. + * This method will not necessarily trigger drag events immediately. This depends on the values + * of {@link yfiles.canvas.CanvasControl#dragTime} and {@link yfiles.canvas.CanvasControl#dragSize}. + * @param {yfiles.input.MouseEventArgs} e the event argument + * @see Overrides {@link yfiles.canvas.Control#onMouseMove} + */ + onMouseMove(e:yfiles.input.MouseEventArgs):void; + /** + * This will transform the mouse event to a {@link yfiles.input.Mouse2DEventArgs} event and + * invoke the {@link yfiles.canvas.CanvasControl#onMouse2DReleased} and possibly {@link yfiles.canvas.CanvasControl#onMouse2DClicked} methods. + * This method will not necessarily trigger the click event. This depends on the values + * of {@link yfiles.input.SystemInformation#doubleClickSize} and {@link yfiles.input.SystemInformation#doubleClickTimeSpan} as well + * as if there has been a drag event delivered since the last mouse press. + * @param {yfiles.input.MouseEventArgs} e the event argument + * @see {@link yfiles.canvas.CanvasControl#onMouseDown} + * @see {@link yfiles.canvas.CanvasControl#onMouseMove} + * @see Overrides {@link yfiles.canvas.Control#onMouseUp} + */ + onMouseUp(e:yfiles.input.MouseEventArgs):void; + /** + * Gets or sets the auto drag insets. + * If the mouse is being dragged within the insets of the control specified using this property, + * the control will automatically scroll. + * Value: The new auto drag insets. + * @see {@link yfiles.canvas.CanvasControl#autoDrag} + */ + autoDragInsets:yfiles.geometry.InsetsD; + /** + * Event that gets raised when the {@link yfiles.canvas.CanvasControl#autoDragInsets} property was changed. + */ + addAutoDragInsetsChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that gets raised when the {@link yfiles.canvas.CanvasControl#autoDragInsets} property was changed. + */ + removeAutoDragInsetsChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Raises the {@link yfiles.canvas.CanvasControl#addAutoDragInsetsChangedListener AutoDragInsetsChanged} event. + * @param {yfiles.system.EventArgs} args The {@link yfiles.system.EventArgs} instance containing the event data. + */ + onAutoDragInsetsChanged(args:yfiles.system.EventArgs):void; + /** + * Redispatches a previously fired Mouse2DEvent appropriately, e.g. if the + * view port has changed. + * This is needed to supply {@link yfiles.input.IInputMode} implementations with + * the necessary events even if the mouse has not actually been moved. + */ + redispatchMouse2DEvent():void; + /** + * This will transform the mouse event to a {@link yfiles.input.Mouse2DEventArgs} event and + * invoke the {@link yfiles.canvas.CanvasControl#onMouse2DWheelTurned} method. + * This method will not necessarily trigger drag events immediately. This depends on the values + * of {@link yfiles.canvas.CanvasControl#dragTime} and {@link yfiles.canvas.CanvasControl#dragSize}. + * @param {yfiles.input.MouseEventArgs} e the event argument + * @see Overrides {@link yfiles.canvas.Control#onMouseWheel} + */ + onMouseWheel(e:yfiles.input.MouseEventArgs):void; + /** + * This will transform the mouse event to a {@link yfiles.input.Mouse2DEventArgs} event and + * invoke the {@link yfiles.canvas.CanvasControl#onMouse2DLostCapture} method. + * @param {yfiles.input.MouseEventArgs} e the event argument + * @see Overrides {@link yfiles.canvas.Control#onMouseCaptureLost} + */ + onMouseCaptureLost(e:yfiles.input.MouseEventArgs):void; + onTouchDown(e:yfiles.system.TouchEventArgs):void; + onTouchMove(e:yfiles.system.TouchEventArgs):void; + onTouchUp(e:yfiles.system.TouchEventArgs):void; + onTouchEnter(e:yfiles.system.TouchEventArgs):void; + onTouchLeave(e:yfiles.system.TouchEventArgs):void; + onTouchCaptureLost(e:yfiles.system.TouchEventArgs):void; + /** + * Converts view coordinates (expressed in the control's coordinate system) to world coordinates. + * @param {yfiles.geometry.PointD} viewPoint the coordinates in pixels relative to the controls upper left corner + * @return {yfiles.geometry.PointD} returns the coordinates in the world coordinate system + */ + toWorldCoordinates(viewPoint:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Converts world coordinates to view coordinates expressed in the control's coordinate system. + * @return {yfiles.geometry.PointD} returns the coordinates in pixels relative to the controls upper left corner + * @param {yfiles.geometry.PointD} worldPoint the coordinates in the world coordinate system + */ + toViewCoordinates(worldPoint:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Creates the graphical content for this Control. + * This method will create the visual content using the world coordinate system. + * @param {yfiles.drawing.IRenderContext} renderContext The context to use. + * @return {yfiles.drawing.Visual} A compound Visual that represents the contents of this control. + */ + createVisualContent(renderContext:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * Converts view coordinates from the control's coordinate system to the document's coordinate system. + * @param {yfiles.geometry.PointD} localPoint The coordinates to convert. + * @return {yfiles.geometry.PointD} The coordinates in the document's coordinate system. + */ + localToGlobal(localPoint:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Converts view coordinates from the document's coordinate system to the control's coordinate system. + * @param {yfiles.geometry.PointD} localPoint The coordinates to convert. + * @return {yfiles.geometry.PointD} The coordinates in the control's coordinate system. + */ + globalToLocal(localPoint:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * This will transform the key event to a {@link yfiles.input.CompoundKeyEventArgs} event and + * invoke the {@link yfiles.canvas.CanvasControl#onCompoundKeyPressed} methods as well as redispatch the last mouse + * event. + * @see {@link yfiles.canvas.CanvasControl#redispatchMouse2DEvent} + * @param {yfiles.input.KeyEventArgs} e the event argument + * @see Overrides {@link yfiles.canvas.Control#onKeyDown} + */ + onKeyDown(e:yfiles.input.KeyEventArgs):void; + /** + * This will transform the key event to a {@link yfiles.input.CompoundKeyEventArgs} event and + * invoke the {@link yfiles.canvas.CanvasControl#onCompoundKeyTyped} methods as well as redispatch the last mouse + * event. + * @see {@link yfiles.canvas.CanvasControl#redispatchMouse2DEvent} + * @param {yfiles.input.KeyEventArgs} e the event argument + * @see Overrides {@link yfiles.canvas.Control#onKeyPress} + */ + onKeyPress(e:yfiles.input.KeyEventArgs):void; + /** + * This will transform the key event to a {@link yfiles.input.CompoundKeyEventArgs} event and + * invoke the {@link yfiles.canvas.CanvasControl#onCompoundKeyReleased} methods as well as redispatch the last mouse + * event. + * @see {@link yfiles.canvas.CanvasControl#redispatchMouse2DEvent} + * @param {yfiles.input.KeyEventArgs} e the event argument + * @see Overrides {@link yfiles.canvas.Control#onKeyUp} + */ + onKeyUp(e:yfiles.input.KeyEventArgs):void; + /** + * Event that will be triggered before the visual tree is painted + * to prepare the {@link yfiles.drawing.IRenderContext}. + */ + addPrepareRenderContextListener(value:(src:Object,args:yfiles.canvas.PrepareRenderContextEventArgs)=> void):void; + /** + * Event that will be triggered before the visual tree is painted + * to prepare the {@link yfiles.drawing.IRenderContext}. + */ + removePrepareRenderContextListener(value:(src:Object,args:yfiles.canvas.PrepareRenderContextEventArgs)=> void):void; + /** + * Collects all canvas object instances that are hit at the given coordinate set. + * @param {yfiles.geometry.PointD} location the coordinates of the query in the world coordinate system + * @param {function(yfiles.canvas.ICanvasObject):boolean} ef the collector callback + */ + collectCanvasObjects(location:yfiles.geometry.PointD,ef:(co:yfiles.canvas.ICanvasObject)=>boolean):void; + /** + * Returns the top most canvas object instance that is hit at the given coordinate set. + * This will return the canvas object that is painted last at the given position. + * @param {yfiles.geometry.PointD} location the coordinates of the query in the world coordinate system + */ + getCanvasObject(location:yfiles.geometry.PointD):yfiles.canvas.ICanvasObject; + /** + * Returns a list of all canvas objects in hit order at the given world coordinate location. + * The order of the elements in the list is the natural hit test order, i.e. elements + * painted on top of others will be reported first in the list. + * @param {yfiles.geometry.PointD} location the coordinates of the query in the world coordinate system + * @return {yfiles.collections.IList.} a list of canvas object that are hit in reverse painting order + */ + getCanvasObjects(location:yfiles.geometry.PointD):yfiles.collections.IList; + /** + * Compares two {@link yfiles.canvas.ICanvasObject} instances that are live in this canvas. + * The comparison will yield values greater than zero if and only if + * the second object is rendered after the first one. + * @param {yfiles.canvas.ICanvasObject} canvasObject1 the first object to compare + * @param {yfiles.canvas.ICanvasObject} canvasObject2 the second object to compare + * @return {number} + * 0 if canvasObject1 == canvasObject2 + * >0 if canvasObject1 is painted before canvasObject2 + * <0 if canvasObject1 is painted after canvasObject2 + */ + compare(canvasObject1:yfiles.canvas.ICanvasObject,canvasObject2:yfiles.canvas.ICanvasObject):number; + /** + * Updates the {@link yfiles.canvas.CanvasControl#contentRect} to encompass the bounds + * by all elements in the current scene graph. + * This method will traverse all {@link yfiles.canvas.ICanvasObject#visible visible} elements + * in the scene graph and query their {@link yfiles.canvas.ICanvasObjectDescriptor#getBoundsProvider bounds} + * The resulting bounds will be set to the content rectangle. + * @see {@link yfiles.drawing.IBoundsProvider} + * @see {@link yfiles.canvas.CanvasControl#contentRect} + * @see {@link yfiles.canvas.CanvasControl#updateContentRectWithMargins} + */ + updateContentRect():void; + /** + * Updates the {@link yfiles.canvas.CanvasControl#contentRect} to encompass the bounds + * by all elements in the current scene graph plus the given margins. + * This method will traverse all {@link yfiles.canvas.ICanvasObject#visible visible} elements + * in the scene graph below {@link yfiles.canvas.CanvasControl#root} and query their {@link yfiles.canvas.ICanvasObjectDescriptor#getBoundsProvider bounds} + * The resulting bounds will be set to the content rectangle plus the provided margins. + * @see {@link yfiles.drawing.IBoundsProvider} + * @see {@link yfiles.canvas.CanvasControl#contentRect} + * @see {@link yfiles.canvas.CanvasControl#updateContentRectWithMarginsForGroup} + */ + updateContentRectWithMargins(margins:yfiles.geometry.InsetsD):void; + /** + * Updates the {@link yfiles.canvas.CanvasControl#contentRect} to encompass the bounds + * by all elements in the current scene graph plus the given margins. + * This method will traverse all {@link yfiles.canvas.ICanvasObject#visible visible} elements + * in the scene graph and query their {@link yfiles.canvas.ICanvasObjectDescriptor#getBoundsProvider bounds} + * The resulting bounds will be set to the content rectangle plus the provided margins. + * @see {@link yfiles.drawing.IBoundsProvider} + * @see {@link yfiles.canvas.CanvasControl#contentRect} + */ + updateContentRectWithMarginsForGroup(margins:yfiles.geometry.InsetsD,canvasObjectGroup:yfiles.canvas.ICanvasObjectGroup):void; + /** + * Adjusts the view port to fully encompass the {@link yfiles.canvas.CanvasControl#contentRect}. + * The zoom level will not be greater than 1.0d (see the remarks). + * If the view port is limited by the {@link yfiles.canvas.CanvasControl#viewportLimiter} + * the zoom level might be greater than 1.0d to + * respect the limits. + * @see {@link yfiles.canvas.CanvasControl#updateContentRect} + * @see {@link yfiles.canvas.CanvasControl#zoom} + * @see {@link yfiles.canvas.CanvasControl#zoomToWithCenter} + */ + fitContent():void; + /** + * Sets the zoom level and view port center to the given values. + * @param {yfiles.geometry.PointD} center the new center of the view port in world coordinates + * @param {number} zoom the new zoom level + */ + zoomToWithCenter(center:yfiles.geometry.PointD,zoom:number):void; + /** + * Ensures that the provided bounds are visible in this control by adjusting the viewport correspondingly. + * @param {yfiles.geometry.RectD} bounds The bounds to make visible. + */ + ensureVisible(bounds:yfiles.geometry.RectD):void; + /** + * Sets the zoom level and view port center so that the given rectangle in world coordinates + * fits the viewport. + * @param {yfiles.geometry.RectD} bounds The coordinates of the rectangle to zoom to. + */ + zoomToRectD(bounds:yfiles.geometry.RectD):void; + /** + * Gets or sets the InputModeContext property. + * This context object is passed to {@link yfiles.input.IInputMode} instances during {@link yfiles.input.IInputMode#install installation} + * and removal. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.canvas.CanvasControl#createInputModeContext} will be called. + * Upon change the {@link yfiles.canvas.CanvasControl#onInputModeContextChanged} method will be called. + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Event that will be triggered if the {@link yfiles.canvas.CanvasControl#inputModeContext} property has been changed. + */ + addInputModeContextChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Event that will be triggered if the {@link yfiles.canvas.CanvasControl#inputModeContext} property has been changed. + */ + removeInputModeContextChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Called when the {@link yfiles.canvas.CanvasControl#inputModeContext} property value changes + * and after initialization of the field. + * Triggers the {@link yfiles.canvas.CanvasControl#addInputModeContextChangedListener InputModeContextChanged} event. + * @param {yfiles.input.IInputModeContext} oldInputModeContext the old value, which may be null the first time + * @param {yfiles.input.IInputModeContext} newInputModeContext the new value + */ + onInputModeContextChanged(oldInputModeContext:yfiles.input.IInputModeContext,newInputModeContext:yfiles.input.IInputModeContext):void; + /** + * Factory method for the {@link yfiles.canvas.CanvasControl#inputModeContext} property. This method will be called + * upon first access to the {@link yfiles.canvas.CanvasControl#inputModeContext} property. + * @return {yfiles.input.IInputModeContext} a new instance of {@link yfiles.canvas.CanvasControl#inputModeContext} that has this instance set as it's + * {@link yfiles.input.IInputModeContext#canvasControl} and uses this instance's + * {@link yfiles.canvas.CanvasControl#inputModeContextLookup} callback to satisfy requests. + */ + createInputModeContext():yfiles.input.IInputModeContext; + /** + * Callback that is used by the default implementation of {@link yfiles.canvas.CanvasControl#inputModeContext} + * to resolve {@link yfiles.support.ILookup#lookup} calls. + * @param {yfiles.lang.Class} type The Type to query + * @return {Object} The result of the query. + * @see {@link yfiles.input.IInputModeContext} + */ + inputModeContextLookup(type:yfiles.lang.Class):Object; + /** + * Gets the {@link yfiles.drawing.Visual} that is currently visualizing the given {@link yfiles.canvas.ICanvasObject}. + * Note that depending on the current state of the viewport and the control no such instance may be available and + * instead this method will yield null. However if a visual is currently being displayed for + * the given canvas object, it will be returned. This method should be used with care. Manipulation of the given instance should normally + * be done through the corresponding {@link yfiles.drawing.IVisualCreator} that created the visual in the first place. + * This method rather serves as a utility method for UI testing frameworks and similar use cases. + * @param {yfiles.canvas.ICanvasObject} canvasObject The canvas object. + * @return {yfiles.drawing.Visual} The {@link yfiles.drawing.Visual} that is currently used by the canvasObject. + */ + getVisual(canvasObject:yfiles.canvas.ICanvasObject):yfiles.drawing.Visual; + /** + * Convenience method that calculates the bounds for a given canvas object in the scene graph. + * This method queries the descriptor for the {@link yfiles.drawing.IBoundsProvider} for the user object + * and returns the result. + * @param {yfiles.canvas.ICanvasObject} canvasObject the canvas object to query the bounds from + * @return {yfiles.geometry.RectD} the non-null bounds + */ + getBounds(canvasObject:yfiles.canvas.ICanvasObject):yfiles.geometry.RectD; + /** + * Convenience method that calculates the hit tests a given canvas object in the scene graph. + * This method queries the descriptor for the {@link yfiles.drawing.IHitTestable} for the user object + * and returns the result of the hit test query. If there is no IHitTestable returned + * by the descriptor this method returns false. + * @param {yfiles.canvas.ICanvasObject} canvasObject the canvas object to query the bounds from + * @return {boolean} whether the canvas object is hit at the given coordinates + * @param {yfiles.geometry.PointD} location the coordinates of the query in the world coordinate system + */ + isHit(canvasObject:yfiles.canvas.ICanvasObject,location:yfiles.geometry.PointD):boolean; + /** + * Convenience method that retrieves the {@link yfiles.drawing.IVisualCreator} for a + * given {@link yfiles.canvas.ICanvasObject}. + * @param {yfiles.canvas.ICanvasObject} canvasObject the canvas object to query the visual creator + * implementation from + * @return {yfiles.drawing.IVisualCreator} an instance of the visual creator interface + * @see {@link yfiles.canvas.ICanvasObjectDescriptor#getVisualCreator} + * @see {@link yfiles.drawing.VoidVisualCreator#INSTANCE} + */ + getVisualCreator(canvasObject:yfiles.canvas.ICanvasObject):yfiles.drawing.IVisualCreator; + /** + * Invalidate the Control using the bounds provided by the canvas object. + * @param {yfiles.canvas.ICanvasObject} canvasObject the canvas object to query the bounds from + * @see {@link yfiles.canvas.ICanvasObjectDescriptor#getBoundsProvider} + * @see {@link yfiles.canvas.CanvasControl#invalidateWorld} + * @see {@link yfiles.canvas.CanvasControl#invalidate} + */ + invalidateCanvasObject(canvasObject:yfiles.canvas.ICanvasObject):void; + /** + * Assures that the {@link yfiles.canvas.CanvasControl#contentRect content rectangle} encompasses the given + * rectangle. + * Note that this will not change the view port, it will only change the scroll bars if necessary. + * @param {yfiles.geometry.RectD} boundsToInclude the rectangle that should be included in the content rectangle + */ + growContentRect(boundsToInclude:yfiles.geometry.RectD):void; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Gets or sets a value indicating whether navigation related command bindings are enabled. + * By default this feature is enabled. + *

+ * This property enables/disables the following commands: + *

    + *
  • {@link yfiles.system.NavigationCommands#INCREASE_ZOOM}NavigationCommands.IncreaseZoom
  • + *
  • {@link yfiles.system.NavigationCommands#ZOOM}NavigationCommands.Zoom
  • + *
  • {@link yfiles.system.NavigationCommands#DECREASE_ZOOM}NavigationCommands.DecreaseZoom
  • + *
  • {@link yfiles.system.ComponentCommands#SCROLL_PAGE_DOWN}ComponentCommands.ScrollPageDown
  • + *
  • {@link yfiles.system.ComponentCommands#SCROLL_PAGE_UP}ComponentCommands.ScrollPageUp
  • + *
  • {@link yfiles.system.ComponentCommands#SCROLL_PAGE_LEFT}ComponentCommands.ScrollPageLeft
  • + *
  • {@link yfiles.system.ComponentCommands#SCROLL_PAGE_RIGHT}ComponentCommands.ScrollPageRight
  • + *
+ *

+ * Value: true if the commands are enabled; otherwise, false. + */ + navigationCommandsEnabled:boolean; + /** + * Gets the resources for this instance. + * Resources are named instances of objects that can be retrieved by other parts of the infrastructure + * that deal with this instance, either directly or indirectly. + * @see {@link yfiles.system.ApplicationResources} + * @see {@link yfiles.system.ResourceKey} + */ + resourceMap:yfiles.collections.IDictionary; + } + export module CanvasControl{ + export interface SizeChangedDetectionMode_Interface{} + /** + * This event occurs when the size of a control is changed. + */ + export interface SizeChangedEventArgs extends yfiles.system.EventArgs{ + /** + * Gets or sets the element whose size was changed. + * Value: + * The source of the event. + */ + source:HTMLElement; + /** + * Gets or sets the old size of the control. + * Value: + * The old size of the control. + */ + oldSize:yfiles.geometry.SizeD; + } + } + var CanvasControl:{ + $class:yfiles.lang.Class; + /** + * Gets or sets the interval of the size changed timer. + * Value: + * The interval of the size changed timer in milliseconds. + * @see {@link yfiles.canvas.CanvasControl#addSizeChangedListener SizeChanged} + * @see {@link yfiles.canvas.CanvasControl#sizeChangedDetection} + */ + sizeChangedTimerInterval:number; + SizeChangedDetectionMode:{ + NONE:yfiles.canvas.CanvasControl.SizeChangedDetectionMode_Interface; + SENSOR:yfiles.canvas.CanvasControl.SizeChangedDetectionMode_Interface; + TIMER:yfiles.canvas.CanvasControl.SizeChangedDetectionMode_Interface; + }; + /** + * This will instantiate and initialize a CanvasControl with default + * properties and with the provided div element. The canvas will be empty with no associated {@link yfiles.canvas.CanvasControl#inputModes}. + */ + ForDiv:{ + new (div:HTMLDivElement):yfiles.canvas.CanvasControl; + }; + /** + * This will instantiate and initialize a CanvasControl with default + * properties. The canvas will be empty with no associated {@link yfiles.canvas.CanvasControl#inputModes}. + * This constructor creates a new div element that needs to be added to the DOM manually. + */ + new ():yfiles.canvas.CanvasControl; + /** + * This will instantiate and initialize a CanvasControl with default + * properties using the div that was specified by its id. + * The canvas will be empty with no associated {@link yfiles.canvas.CanvasControl#inputModes}. + */ + ForId:{ + new (id:string):yfiles.canvas.CanvasControl; + }; + /** + * A {@link yfiles.system.RoutedUICommand} that invokes {@link yfiles.canvas.CanvasControl#fitContent} if executed. + */ + FIT_CONTENT_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that invokes {@link yfiles.canvas.CanvasControl#updateContentRect} if executed. + */ + UPDATE_CONTENT_RECT_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that invokes a feedback on certain user actions if executed. + */ + INPUT_FEEDBACK_COMMAND:yfiles.system.RoutedUICommand; + /** + * Creates a {@link yfiles.drawing.ArrangeVisual} from a {@link yfiles.drawing.DataTemplate} and set + * its location to origin. + * @param {yfiles.drawing.DataTemplate} template The template to create the visual from. + * @param {yfiles.geometry.PointD} origin The location at which the visual should be placed. + * @param {yfiles.canvas.ICanvasContext} ctx The context. + * @return {yfiles.drawing.ArrangeVisual} The {@link yfiles.drawing.ArrangeVisual} created, or null. + */ + createVisualFromTemplate(template:yfiles.drawing.DataTemplate,origin:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):yfiles.drawing.ArrangeVisual; + setTemplateLocation(visual:yfiles.drawing.Visual,viewCoordinates:yfiles.geometry.PointD):void; + }; + export enum MouseWheelBehavior{ + /** + * The mouse wheel has no effect. + */ + NONE, + /** + * The mouse wheel changes the zoom factor. + */ + ZOOM, + /** + * The mouse wheel scrolls the view. + */ + SCROLL, + /** + * Can be combined with {@link yfiles.canvas.MouseWheelBehavior#ZOOM} or {@link yfiles.canvas.MouseWheelBehavior#SCROLL} to perform the action only when the control has focus. + */ + ONLY_WHEN_FOCUSED + } + /** + * The event arguments for the {@link yfiles.canvas.CanvasControl#addPrepareRenderContextListener PrepareRenderContext} event. + * This event argument can be used to modify the {@link yfiles.canvas.PrepareRenderContextEventArgs#context} + * during {@link yfiles.canvas.CanvasControl#createVisualContent} + * and {@link yfiles.canvas.CanvasControl#updateVisual} + * @see {@link yfiles.canvas.CanvasControl#addPrepareRenderContextListener PrepareRenderContext} + */ + export interface PrepareRenderContextEventArgs extends yfiles.system.RoutedEventArgs{ + /** + * Gets or sets the context. + * Value: The context that can be modified, wrapped, or exchanged by the event handlers. + * This value may not be null. + * @throws {yfiles.system.ArgumentNullException} If the argument is null. + */ + context:yfiles.drawing.IRenderContext; + } + var PrepareRenderContextEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.canvas.PrepareRenderContextEventArgs} class. + * @param {yfiles.drawing.IRenderContext} context The initial context which can be modified by the event handlers + * using the {@link yfiles.canvas.PrepareRenderContextEventArgs#context} property. + */ + new (context:yfiles.drawing.IRenderContext):yfiles.canvas.PrepareRenderContextEventArgs; + }; + /** + * Provides a simple convenience implementations of {@link yfiles.canvas.ICanvasObjectDescriptor} + * that casts the user object to the required interface. + */ + export interface CanvasObjectDescriptor extends Object,yfiles.canvas.ICanvasObjectDescriptor{ + /** + * Returns an implementation of {@link yfiles.drawing.IHitTestable} that can determine whether + * the rendering of the user object has been hit at a given coordinate. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to do the hit testing for + * @return {yfiles.drawing.IHitTestable} an implementation or null if the rendering cannot be hit tested + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getHitTestable}. + */ + getHitTestable(forUserObject:Object):yfiles.drawing.IHitTestable; + /** + * Returns an implementation of {@link yfiles.drawing.IVisualCreator} that will create + * the {@link yfiles.drawing.Visual} tree for the user object. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to create a Visual for + * @return {yfiles.drawing.IVisualCreator} an implementation or null if nothing shall be rendered + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getVisualCreator}. + */ + getVisualCreator(forUserObject:Object):yfiles.drawing.IVisualCreator; + /** + * Determines whether the given canvas object is deemed dirty and needs + * updating. + * @param {yfiles.canvas.ICanvasObject} canvasObject The object to check. + * @param {yfiles.canvas.ICanvasContext} context The context that will be used for the update. + * @return {boolean} Whether an update is needed. + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#isDirty}. + */ + isDirty(canvasObject:yfiles.canvas.ICanvasObject,context:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns an implementation of {@link yfiles.drawing.IBoundsProvider} that can determine the visible bounds + * of the rendering of the user object. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to query the bounds for + * @return {yfiles.drawing.IBoundsProvider} an implementation or null if the bounds are not known, in which + * case the bounds are treated as infinite + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getBoundsProvider}. + */ + getBoundsProvider(forUserObject:Object):yfiles.drawing.IBoundsProvider; + /** + * Returns an implementation of {@link yfiles.drawing.IVisibilityTest} that can determine if the + * rendering of the user object would be visible in a given context. + * This method may always return the same instance. By contract clients will + * not cache instances returned but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to query the bounds for + * @return {yfiles.drawing.IVisibilityTest} an implementation or null if the bounds are not known, in which + * case the bounds are treated as infinite + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getVisibilityTest}. + */ + getVisibilityTest(forUserObject:Object):yfiles.drawing.IVisibilityTest; + } + var CanvasObjectDescriptor:{ + $class:yfiles.lang.Class; + /** + * An implementation that tries to cast the user object to the required interface. + * This implementation will respect the {@link yfiles.canvas.ICanvasObject#dirty} flag. + */ + DYNAMIC_DIRTY_INSTANCE:yfiles.canvas.ICanvasObjectDescriptor; + /** + * An implementation that tries to cast the user object to the required interface. + * This implementation will treat always {@link yfiles.drawing.IVisualCreator#updateVisual update the Visual} + * and will effectively ignore + * the {@link yfiles.canvas.ICanvasObject#dirty} flag. + */ + INSTANCE:yfiles.canvas.ICanvasObjectDescriptor; + /** + * An implementation that tries to lookup the instance from the user object if it is an {@link yfiles.support.ILookup}. + * This implementation will respect the {@link yfiles.canvas.ICanvasObject#dirty} flag. + */ + DYNAMIC_DIRTY_LOOKUP:yfiles.canvas.ICanvasObjectDescriptor; + /** + * An implementation that tries to lookup the instance from the user object if it is an {@link yfiles.support.ILookup}. + * This implementation will treat always {@link yfiles.drawing.IVisualCreator#updateVisual update the Visual} + * and will effectively ignore + * the {@link yfiles.canvas.ICanvasObject#dirty} flag. + */ + LOOKUP:yfiles.canvas.ICanvasObjectDescriptor; + /** + * An implementation that will cast the {@link yfiles.canvas.ICanvasObject#userObject} to {@link yfiles.canvas.CanvasObjectDescriptor#VISUAL} + * and use that to insert into the scene graph. + */ + VISUAL:yfiles.canvas.ICanvasObjectDescriptor; + /** + * A void implementation of the {@link yfiles.drawing.IVisualCreator} interface. + * Instead of returning a null reference, this instance can be used instead. + */ + NULL_VISUAL_CREATOR:yfiles.drawing.IVisualCreator; + }; + /** + * Interface for instances that provide means to register + * event listeners that deal with the modification of a Canvas Object Tree. + */ + export interface ICanvasObjectTreeEventSource extends Object{ + /** + * Triggered whenever a canvas object has been added to the canvas object tree. + */ + addCanvasObjectAddedListener(value:(sender:Object,co:yfiles.canvas.ICanvasObject)=> void):void; + /** + * Triggered whenever a canvas object has been added to the canvas object tree. + */ + removeCanvasObjectAddedListener(value:(sender:Object,co:yfiles.canvas.ICanvasObject)=> void):void; + /** + * Triggered whenever a canvas object has moved in the canvas object tree. + */ + addCanvasObjectMovedListener(value:(sender:Object,co:yfiles.canvas.ICanvasObject,oldParent:yfiles.canvas.ICanvasObjectGroup,oldPredecessor:yfiles.canvas.ICanvasObject)=> void):void; + /** + * Triggered whenever a canvas object has moved in the canvas object tree. + */ + removeCanvasObjectMovedListener(value:(sender:Object,co:yfiles.canvas.ICanvasObject,oldParent:yfiles.canvas.ICanvasObjectGroup,oldPredecessor:yfiles.canvas.ICanvasObject)=> void):void; + /** + * Triggered whenever a canvas object has been removed from the canvas object tree. + */ + addCanvasObjectRemovedListener(value:(sender:Object,co:yfiles.canvas.ICanvasObject,parent:yfiles.canvas.ICanvasObjectGroup)=> void):void; + /** + * Triggered whenever a canvas object has been removed from the canvas object tree. + */ + removeCanvasObjectRemovedListener(value:(sender:Object,co:yfiles.canvas.ICanvasObject,parent:yfiles.canvas.ICanvasObjectGroup)=> void):void; + /** + * Triggered before a canvas object is removed from the tree. + */ + addCanvasObjectRemovingListener(value:(sender:Object,co:yfiles.canvas.ICanvasObject,parent:yfiles.canvas.ICanvasObjectGroup)=> void):void; + /** + * Triggered before a canvas object is removed from the tree. + */ + removeCanvasObjectRemovingListener(value:(sender:Object,co:yfiles.canvas.ICanvasObject,parent:yfiles.canvas.ICanvasObjectGroup)=> void):void; + /** + * Triggered whenever a canvas object has been {@link yfiles.canvas.ICanvasObject#invalidate invalidated.}. + */ + addCanvasObjectInvalidatedListener(value:(sender:Object,canvasObject:yfiles.canvas.ICanvasObject)=> void):void; + /** + * Triggered whenever a canvas object has been {@link yfiles.canvas.ICanvasObject#invalidate invalidated.}. + */ + removeCanvasObjectInvalidatedListener(value:(sender:Object,canvasObject:yfiles.canvas.ICanvasObject)=> void):void; + } + var ICanvasObjectTreeEventSource:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A dummy {@link yfiles.canvas.ICanvasContext} implementation. + * The {@link yfiles.canvas.CanvasContext#DEFAULT} instance can be used if one needs to + * query e.g. an {@link yfiles.drawing.IBoundsProvider} instance without a specific + * {@link yfiles.canvas.CanvasControl} + */ + export interface CanvasContext extends Object,yfiles.canvas.ICanvasContext{ + /** + * Returns the zoom level. + * @see Specified by {@link yfiles.canvas.ICanvasContext#zoom}. + */ + zoom:number; + /** + * Returns the zoom hit test radius. + * @see Specified by {@link yfiles.canvas.ICanvasContext#hitTestRadius}. + */ + hitTestRadius:number; + /** + * Adds an element to the defs section of the document, if it has not been added yet. + * @param {yfiles.drawing.IDefsSupport} defsSupport The instance that is used to create and update the element and to query if the element is still referenced + * @return {string} The id of the element with which it can be referenced using + * an url reference. + * @see Specified by {@link yfiles.canvas.ICanvasContext#getDefsId}. + */ + getDefsId(defsSupport:yfiles.drawing.IDefsSupport):string; + /** + * This implementation always yields null. + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + } + var CanvasContext:{ + $class:yfiles.lang.Class; + /** + * Provides a default immutable context with a hit radius of 3 and a zoom level of 1. + */ + DEFAULT:yfiles.canvas.ICanvasContext; + /** + * Provides a default immutable context with a specified hit radius and a zoom level. + * @param {number} zoom the zoom level + * @param {number} hitTestRadius the hit test radius + */ + new (zoom:number,hitTestRadius:number):yfiles.canvas.CanvasContext; + }; + export enum ScrollBarVisibility{ + /** + * Never display the scroll bar, even if not all of the content is visible. + */ + NEVER, + /** + * Display the scroll bar when needed. This is the default behavior in most applications. + */ + AS_NEEDED, + /** + * Always display the scroll bar. If it is not needed, i.e. if all content is already displaying, + * the scroll bar will remain visible but cannot be moved. + */ + ALWAYS + } + /** + * The interface for the cursors used in {@link yfiles.canvas.CanvasCursor}. + */ + export interface ICanvasCursor extends Object{ + /** + * Gets the system cursor to display for the given context. + * @param {yfiles.canvas.Control} context The context to get the cursor for. + * @return {string} The system cursor to display. + * @see Specified by {@link yfiles.canvas.ICanvasCursor#getSystemCursor}. + */ + getSystemCursor(context:yfiles.canvas.Control):string; + } + var ICanvasCursor:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Default implementation of the {@link yfiles.canvas.ICanvasCursor} interface + * that provides a set of default cursors. + */ + export interface CanvasCursor extends Object,yfiles.canvas.ICanvasCursor{ + /** + * Returns the CSS text representation for the cursor and its alternatives. + * @param {yfiles.canvas.Control} context The context to use for looking up the resource. + * @return {string} The CSS text representation for the cursor. + * @see Specified by {@link yfiles.canvas.ICanvasCursor#getSystemCursor}. + */ + getSystemCursor(context:yfiles.canvas.Control):string; + } + var CanvasCursor:{ + $class:yfiles.lang.Class; + /** + * Gets the arrow cursor. + * Value: The arrow cursor. + */ + ARROW:yfiles.canvas.ICanvasCursor; + /** + * Gets the hand cursor. + * Value: The hand cursor. + */ + HAND:yfiles.canvas.ICanvasCursor; + /** + * Gets a cursor that indicates that an edge at the east will be moved. + * Depending on the browser this might just be a horizontal resize cursor. + * Value: The east resize cursor. + */ + SIZE_E:yfiles.canvas.ICanvasCursor; + /** + * Gets a cursor that indicates that an edge at the north will be moved. + * Depending on the browser this might just be a vertical resize cursor. + * Value: The north resize cursor. + */ + SIZE_N:yfiles.canvas.ICanvasCursor; + /** + * Gets a cursor that indicates that edges at the north and east will be moved. + * Depending on the browser this might just be the diagonal resize cursor for NE to SW resizes. + * Value: The north-east resize cursor. + */ + SIZE_NE:yfiles.canvas.ICanvasCursor; + /** + * Gets a cursor that indicates that edges at the north and west will be moved. + * Depending on the browser this might just be the diagonal resize cursor for NW to SE resizes. + * Value: The north-west resize cursor. + */ + SIZE_NW:yfiles.canvas.ICanvasCursor; + /** + * Gets a cursor that indicates that the edge at the south will be moved. + * Depending on the browser this might just be a vertical resize cursor. + * Value: The south resize cursor. + */ + SIZE_S:yfiles.canvas.ICanvasCursor; + /** + * Gets a cursor that indicates that edges at the south and east will be moved. + * Depending on the browser this might just be the diagonal resize cursor for NW to SE resizes. + * Value: The south-east resize cursor. + */ + SIZE_SE:yfiles.canvas.ICanvasCursor; + /** + * Gets a cursor that indicates that edges at the south and west will be moved. + * Depending on the browser this might just be the diagonal resize cursor for NE to SW resizes. + * Value: The south-west resize cursor. + */ + SIZE_SW:yfiles.canvas.ICanvasCursor; + /** + * Gets a cursor that indicates that the edge at the west will be moved. + * Depending on the browser this might just be a horizontal resize cursor. + * Value: The west resize cursor. + */ + SIZE_W:yfiles.canvas.ICanvasCursor; + /** + * Gets the vertical resize cursor. + * Value: The vertical resize cursor. + */ + SIZE_N_S:yfiles.canvas.ICanvasCursor; + /** + * Gets the diagonal resize cursor for NW to SE resizes. + * Value: The diagonal resize cursor for NW to SE resizes. + */ + SIZE_NW_SW:yfiles.canvas.ICanvasCursor; + /** + * Gets the diagonal resize cursor for NE to SW resizes. + * Value: The diagonal resize cursor for NE to SW resizes. + */ + SIZE_NE_SW:yfiles.canvas.ICanvasCursor; + /** + * Gets the horizontal resize cursor. + * Value: The horizontal resize cursor. + */ + SIZE_W_E:yfiles.canvas.ICanvasCursor; + /** + * Gets the I beam cursor. + * Value: The I beam cursor. + */ + I_BEAM:yfiles.canvas.ICanvasCursor; + /** + * Gets the invisible cursor. + * Value: The invisible cursor. + */ + NONE:yfiles.canvas.ICanvasCursor; + /** + * Gets the wait cursor. + * Value: The wait cursor. + */ + WAIT:yfiles.canvas.ICanvasCursor; + /** + * Gets the cross cursor. + * Value: The cross cursor. + */ + CROSS:yfiles.canvas.ICanvasCursor; + /** + * Gets the size all cursor. + * Value: The size all cursor. + */ + SIZE_ALL:yfiles.canvas.ICanvasCursor; + /** + * Gets a cursor that indicates that help is available for the object under the cursor. + * Value: The help cursor. + */ + HELP:yfiles.canvas.ICanvasCursor; + /** + * Gets a cursor that indicates progress. + * Value: The help cursor. + */ + PROGRESS:yfiles.canvas.ICanvasCursor; + /** + * Initializes a new instance of the {@link yfiles.canvas.CanvasCursor} class using the provided url and an alternative. + * @param {string} url The url should point to a file in the ".cur" format with a size of at most 32x32 pixels to ensure compatibility across browsers. + * @param {yfiles.canvas.ICanvasCursor} alternative Cursors can be chained but the last alternative needs to be one of the predefined cursors. + */ + FromNameAndCursor:{ + new (url:string,alternative:yfiles.canvas.ICanvasCursor):yfiles.canvas.CanvasCursor; + }; + }; + export enum GridSnapType{ + /** + * There is no grid snapping at all. + */ + NONE, + /** + * Elements shall be snapped to horizontal grid lines. + */ + HORIZONTAL_LINES, + /** + * Elements shall be snapped to vertical grid lines. + */ + VERTICAL_LINES, + /** + * Elements shall be snapped to horizontal and vertical grid lines. + */ + LINES, + /** + * Elements shall be snapped to grid points. + */ + GRID_POINTS, + /** + * Elements shall be snapped to horizontal and vertical grid lines as well as to grid points. + */ + ALL + } + /** + * A static class that provides helpful methods for interacting with an HTML5 canvas element. + */ + export interface CanvasExtensions extends Object{ + } + var CanvasExtensions:{ + $class:yfiles.lang.Class; + /** + * Sets the typeface. + * @param {Object} context The context. + * @param {yfiles.system.Typeface} typeface The typeface. + */ + setTypeface(context:Object,typeface:yfiles.system.Typeface):void; + /** + * Translates the value of the {@link yfiles.system.FontWeight} to a string that can be used with the canvas. + * @param {yfiles.system.FontWeight} fontWeight The font weight. + * @return {string} + */ + fontWeightToString(fontWeight:yfiles.system.FontWeight):string; + }; + /** + * Helper class for {@link yfiles.canvas.CanvasControl} that manages the defs section of the SVG document. + * This class is used internally by {@link yfiles.canvas.CanvasControl} and operates on instances of {@link yfiles.drawing.IDefsSupport}. + * @see {@link yfiles.canvas.CanvasControl#defsManager} + */ + export interface DefsManager extends Object{ + /** + * Gets or sets the interval for the timer to trigger the cleanup event. + * By default this is 10 seconds. + */ + cleanupTimerInterval:yfiles.system.TimeSpan; + /** + * Gets or sets the prefix to use for the {@link yfiles.canvas.DefsManager#generateUniqueDefsId unique ids}. + * By default this is ygc<number> + */ + customPrefix:string; + /** + * Generates an id that is globally unique among all {@link yfiles.canvas.DefsManager} instances. + * This id should be used for the "id" attribute of DOM nodes. + * @return {string} A globally unique id. + */ + generateUniqueDefsId():string; + /** + * Yields the defs element this instance is managing. + */ + defs:SVGDefsElement; + /** + * Triggers the clean up for svg defs on the provided control. + * @param {yfiles.canvas.CanvasControl} canvasControl + */ + cleanupDefs(canvasControl:yfiles.canvas.CanvasControl):void; + } + var DefsManager:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.canvas.DefsManager} class. + * @param {SVGDefsElement} defsElement The defs element of the svg document that will be managed by this instance. + */ + new (defsElement:SVGDefsElement):yfiles.canvas.DefsManager; + }; + /** + * This class describes a grid by providing the grid's origin as well as the horizontal and vertical + * spacing between the grid points. + * It is used by the {@link yfiles.input.IGridConstraintProvider} as well as by the GridSnapResultVisualCreator<T> + * @see {@link yfiles.input.IGridConstraintProvider} + */ + export interface GridInfo extends Object{ + /** + * Gets or sets the horizontal spacing between grid points in the world coordinate system. + */ + horizontalSpacing:number; + /** + * Gets or sets the vertical spacing between grid points in the world coordinate system. + */ + verticalSpacing:number; + /** + * Gets or sets the canonic origin of the grid. + */ + origin:yfiles.geometry.PointD; + } + var GridInfo:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using "25" as the grid spacing. + */ + new ():yfiles.canvas.GridInfo; + /** + * Creates a new instance using the given the grid spacing. + * @param {number} gridSpacing The horizontal and vertical spacing between the grid points. + */ + FromGridSpacing:{ + new (gridSpacing:number):yfiles.canvas.GridInfo; + }; + /** + * Creates a new instance using the given horizontal and vertical grid spacing as well as the given origin. + * @param {number} horizontalSpacing The horizontal spacing between the grid points. + * @param {number} verticalSpacing The vertical spacing between the grid points. + * @param {yfiles.geometry.PointD} origin The canonic origin of the grid. + */ + FromHorizontalSpacingVerticalSpacingAndOrigin:{ + new (horizontalSpacing:number,verticalSpacing:number,origin:yfiles.geometry.PointD):yfiles.canvas.GridInfo; + }; + }; + /** + * This interface describes the context for many operations performed + * on items in a {@link yfiles.canvas.CanvasControl}. + * This interface extends the {@link yfiles.support.ILookup} interface to + * provide {@link yfiles.support.ILookup#lookup dynamic lookup capability}. + */ + export interface ICanvasContext extends Object,yfiles.support.ILookup{ + /** + * Returns the current zoom level, i.e. the ratio of world coordinates to + * screen pixels. + * @see Specified by {@link yfiles.canvas.ICanvasContext#zoom}. + */ + zoom:number; + /** + * The radius for hit tests and marquee selection tests in world coordinates. + * This value already takes the zoom level into account. + * @see Specified by {@link yfiles.canvas.ICanvasContext#hitTestRadius}. + */ + hitTestRadius:number; + /** + * Adds an element to the defs section of the document, if it has not been added yet. + * @param {yfiles.drawing.IDefsSupport} defsSupport The instance that is used to create and update the element and to query if the element is still referenced + * @return {string} The id of the element with which it can be referenced using + * an url reference. + * @see Specified by {@link yfiles.canvas.ICanvasContext#getDefsId}. + */ + getDefsId(defsSupport:yfiles.drawing.IDefsSupport):string; + } + var ICanvasContext:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This is the interface implemented by the composite building blocks of a scene graph + * in a {@link yfiles.canvas.CanvasControl}. + * It is meant to group multiple {@link yfiles.canvas.ICanvasObject} + * instances as a logic unit. The interface is not meant to be implemented + * by application programmers. Instances implementing this interface + * can be retrieved from the factory methods in the canvas control. + * The interface extends the {@link yfiles.model.IListEnumerable} interface to allow + * for easy iteration and determination of the size of the group. + */ + export interface ICanvasObjectGroup extends Object,yfiles.canvas.ICanvasObject,yfiles.model.IListEnumerable{ + /** + * Gets the group action associated with this group instance or null. + * Group actions can be used as callbacks during the traversal of the visual tree. + * @see Specified by {@link yfiles.canvas.ICanvasObjectGroup#groupAction}. + */ + groupAction:yfiles.canvas.IGroupAction; + /** + * Returns the first item in the rendering list of this group or null. This is the item + * that will be rendered first, i.e. behind all of the other items in the rendering list. + * @see {@link yfiles.model.IListEnumerable} + * @see {@link yfiles.collections.IEnumerable#getEnumerator} + * @see Specified by {@link yfiles.canvas.ICanvasObjectGroup#first}. + */ + first:yfiles.canvas.ICanvasObject; + /** + * Returns the last item in the rendering list of this group or null. This is the item + * that will be on top of all other items in the list. + * @see Specified by {@link yfiles.canvas.ICanvasObjectGroup#last}. + */ + last:yfiles.canvas.ICanvasObject; + } + var ICanvasObjectGroup:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An action interface for {@link yfiles.canvas.ICanvasObjectGroup}s + * that can be triggered during the scene graph traversal. + * @see {@link yfiles.canvas.ICanvasObjectGroup#groupAction} + */ + export interface IGroupAction extends Object{ + /** + * Called before the children of the group are visited. + * @param {yfiles.canvas.ICanvasObjectGroup} group The group that is visited. + * @param {yfiles.canvas.ICanvasContext} canvasContext The context that is used. + * @see Specified by {@link yfiles.canvas.IGroupAction#preVisit}. + */ + preVisit(group:yfiles.canvas.ICanvasObjectGroup,canvasContext:yfiles.canvas.ICanvasContext):void; + /** + * Called after the children of the group have been visited. + * @param {yfiles.canvas.ICanvasObjectGroup} group The group that was visited. + * @param {yfiles.canvas.ICanvasContext} canvasContext The context that is used. + * @see Specified by {@link yfiles.canvas.IGroupAction#postVisit}. + */ + postVisit(group:yfiles.canvas.ICanvasObjectGroup,canvasContext:yfiles.canvas.ICanvasContext):void; + } + var IGroupAction:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This is the interface implemented by the basic building blocks of a scene graph + * in a {@link yfiles.canvas.CanvasControl}. + * The interface is not meant to be implemented by application programmers. + * Instead, instances implementing this interface + * can be retrieved from the factory methods in the canvas control. + */ + export interface ICanvasObject extends Object{ + /** + * Gets or sets the visibility state of this instance. + * If an ICanvasObject is not visible, it will not be considered for hit tests. + * @see Specified by {@link yfiles.canvas.ICanvasObject#visible}. + */ + visible:boolean; + /** + * Gets or sets a flag that indicates whether {@link yfiles.canvas.ICanvasObject} needs to be updated + * during the next call to {@link yfiles.canvas.CanvasControl#updateVisual}. + * Note that it is up to the implementation of the {@link yfiles.canvas.ICanvasObjectDescriptor} + * to determine the actual dirty state of this instance. {@link yfiles.canvas.ICanvasObjectDescriptor#isDirty} + * can use any strategy to indicate dirtiness. The {@link yfiles.canvas.CanvasControl} will reset + * this flag during {@link yfiles.canvas.CanvasControl#updateVisual} to false if + * the visual is created or updated. + * Value: true if dirty; otherwise, false. + * @see Specified by {@link yfiles.canvas.ICanvasObject#dirty}. + */ + dirty:boolean; + /** + * Gets or sets the parent group of this instance. + * @see Specified by {@link yfiles.canvas.ICanvasObject#group}. + */ + group:yfiles.canvas.ICanvasObjectGroup; + /** + * Gets or sets the user object associated with this instance. + * The user object will be used by the {@link yfiles.canvas.ICanvasObject#descriptor} during + * rendering, hit testing, and bounds calculation + * @see Specified by {@link yfiles.canvas.ICanvasObject#userObject}. + */ + userObject:Object; + /** + * Gets or sets the descriptor instance that interprets the {@link yfiles.canvas.ICanvasObject#userObject} + * during rendering, hit testing, and bounds calculation. + * @see Specified by {@link yfiles.canvas.ICanvasObject#descriptor}. + */ + descriptor:yfiles.canvas.ICanvasObjectDescriptor; + /** + * Moves this instance to the end of the group rendering list, so that it will be painted + * in front of all other items in the same group. + * As a convenience, this + * method returns the current instance so that calls can be conveniently chained, e.g. object.ToFront().Lower() + * @return {yfiles.canvas.ICanvasObject} this so that calls can be chained. + * @see Specified by {@link yfiles.canvas.ICanvasObject#toFront}. + */ + toFront():yfiles.canvas.ICanvasObject; + /** + * Moves this instance to the beginning of the group rendering list, so that it will be painted + * behind all other items in the same group. + * As a convenience, this + * method returns the current instance so that calls can be conveniently chained, e.g. object.ToBack().Raise().Raise() + * @return {yfiles.canvas.ICanvasObject} this so that calls can be chained. + * @see Specified by {@link yfiles.canvas.ICanvasObject#toBack}. + */ + toBack():yfiles.canvas.ICanvasObject; + /** + * Moves this instance one step closer to the end of the group rendering list, so that it will + * be painted on top of its current successor. + * As a convenience, this + * method returns the current instance so that calls can be conveniently chained, e.g. object.Raise().Raise().Raise() + * @return {yfiles.canvas.ICanvasObject} this so that calls can be chained. + * @see Specified by {@link yfiles.canvas.ICanvasObject#raise}. + */ + raise():yfiles.canvas.ICanvasObject; + /** + * Moves this instance one step closer to the beginning of the group rendering list, so that it will + * be painted behind its current predecessor. + * As a convenience, this + * method returns the current instance so that calls can be conveniently chained, e.g. object.Lower().Lower() + * @return {yfiles.canvas.ICanvasObject} this so that calls can be chained. + * @see Specified by {@link yfiles.canvas.ICanvasObject#lower}. + */ + lower():yfiles.canvas.ICanvasObject; + /** + * Moves this instance exactly behind the reference item in the referenced item's group + * rendering list, so that it will + * be painted directly on top of the given reference. + *

+ * As a convenience, this + * method returns the current instance so that calls can be conveniently chained, e.g. object.After(other).Raise() + *

+ *

+ * Observe that this instance will change into the referenced item's group if needed. + *

+ * @return {yfiles.canvas.ICanvasObject} this so that calls can be chained. + * @see Specified by {@link yfiles.canvas.ICanvasObject#after}. + */ + after(reference:yfiles.canvas.ICanvasObject):yfiles.canvas.ICanvasObject; + /** + * Moves this instance exactly before the reference item in the referenced item's group + * rendering list, so that it will + * be painted directly behind the given reference. + *

+ * As a convenience, this + * method returns the current instance so that calls can be conveniently chained, e.g. object.Before(other).Lower() + *

+ *

+ * Observe that this instance will change into the referenced item's group if needed. + *

+ * @return {yfiles.canvas.ICanvasObject} this so that calls can be chained. + * @see Specified by {@link yfiles.canvas.ICanvasObject#before}. + */ + before(reference:yfiles.canvas.ICanvasObject):yfiles.canvas.ICanvasObject; + /** + * Gets the next item in the list of rendered items that is owned by this element's {@link yfiles.canvas.ICanvasObject#group}. + * The returned item will be rendered after this item is rendered. If this item is + * the last one in the list, this method returns null. + * @return + * null if this item is last in the rendering list of its group + * or the next item otherwise. + * @see Specified by {@link yfiles.canvas.ICanvasObject#next}. + */ + next:yfiles.canvas.ICanvasObject; + /** + * Gets the previous item in the list of rendered items that is owned by this element's {@link yfiles.canvas.ICanvasObject#group}. + * The returned item will be rendered directly before this item is rendered. If this item is + * the first one in the list, this method returns null. + * @return + * null if this item is first in the rendering list of its group + * or the previous item otherwise. + * @see Specified by {@link yfiles.canvas.ICanvasObject#previous}. + */ + previous:yfiles.canvas.ICanvasObject; + /** + * Marks this item as in need of validation. + * If this item is currently visible in a CanvasControl, + * the control will be invalidated. + * @see Specified by {@link yfiles.canvas.ICanvasObject#invalidate}. + */ + invalidate():void; + /** + * Removes this item from the scene graph it currently belongs to. + * @see Specified by {@link yfiles.canvas.ICanvasObject#remove}. + */ + remove():void; + } + var ICanvasObject:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Central interface used by the {@link yfiles.canvas.CanvasControl} to render elements from + * the scene graph. + * Implementations will be queried using the user object obtained from + * {@link yfiles.canvas.ICanvasObject#userObject} for the corresponding + * implementations of the various aspects of the user object. + * Implementations of this interface need to be provided by the application + * programmer to the canvas control's various Add... methods. + * @see {@link yfiles.canvas.CanvasObjectDescriptor} + */ + export interface ICanvasObjectDescriptor extends Object{ + /** + * Returns an implementation of {@link yfiles.drawing.IVisualCreator} that will create + * the {@link yfiles.drawing.Visual} tree for the user object. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to create a Visual for + * @return {yfiles.drawing.IVisualCreator} an implementation or null if nothing shall be rendered + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getVisualCreator}. + */ + getVisualCreator(forUserObject:Object):yfiles.drawing.IVisualCreator; + /** + * Determines whether the given canvas object is deemed dirty and needs + * updating. + * @param {yfiles.canvas.ICanvasObject} canvasObject The object to check. + * @param {yfiles.canvas.ICanvasContext} context The context that will be used for the update. + * @return {boolean} Whether an update is needed. + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#isDirty}. + */ + isDirty(canvasObject:yfiles.canvas.ICanvasObject,context:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns an implementation of {@link yfiles.drawing.IBoundsProvider} that can determine the visible bounds + * of the rendering of the user object. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to query the bounds for + * @return {yfiles.drawing.IBoundsProvider} an implementation or null if the bounds are not known, in which + * case the bounds are treated as infinite + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getBoundsProvider}. + */ + getBoundsProvider(forUserObject:Object):yfiles.drawing.IBoundsProvider; + /** + * Returns an implementation of {@link yfiles.drawing.IVisibilityTest} that can determine if the + * rendering of the user object would be visible in a given context. + * This method may always return the same instance. By contract clients will + * not cache instances returned but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to query the bounds for + * @return {yfiles.drawing.IVisibilityTest} an implementation or null if the bounds are not known, in which + * case the bounds are treated as infinite + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getVisibilityTest}. + */ + getVisibilityTest(forUserObject:Object):yfiles.drawing.IVisibilityTest; + /** + * Returns an implementation of {@link yfiles.drawing.IHitTestable} that can determine whether + * the rendering of the user object has been hit at a given coordinate. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to do the hit testing for + * @return {yfiles.drawing.IHitTestable} an implementation or null if the rendering cannot be hit tested + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getHitTestable}. + */ + getHitTestable(forUserObject:Object):yfiles.drawing.IHitTestable; + } + var ICanvasObjectDescriptor:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class sets up an {@link yfiles.drawing.IRenderContext} + * object for exporting the contents of a {@link yfiles.canvas.CanvasControl} (see {@link yfiles.canvas.SvgExport#setup}). + * Also it provides ready-to-use methods to export the canvas contents to a + * standalone SVG. + *
    + *
  • It is possible to export only a part of the contents, see {@link yfiles.canvas.SvgExport#worldBounds}.
  • + *
  • The size of the target graphics is controlled by the {@link yfiles.canvas.SvgExport#scale}. Instead of + * setting the {@link yfiles.canvas.SvgExport#scale} explicitly, it is also possible to set it implicitly for + * a given target width or height, see {@link yfiles.canvas.SvgExport#setScaleForWidth} and + * {@link yfiles.canvas.SvgExport#setScaleForHeight}.
  • + *
+ */ + export interface SvgExport extends Object{ + /** + * Gets or sets the bounds of the content to export in world coordinates. + */ + worldBounds:yfiles.geometry.RectD; + /** + * Gets or sets the scale for the export. + * A scale of 1 preserves the + * original size, a scale of 0.5 results in a target image with half the original size + * and so on. + *

+ * This value has to be strictly greater than 0. Its default value is 1.0 + *

+ */ + scale:number; + /** + * Gets or sets the {@link yfiles.canvas.ICanvasContext#zoom} property to use during the creation of the visualization. + * In contrast to the {@link yfiles.canvas.SvgExport#scale} property, which works on the output graphics, this property determines + * what zoom value is to be assumed on the canvas when creating the visual. + * This can affect the rendering of zoom dependent visuals. + *

+ * This value has to be strictly greater than 0. Its default value is 1.0 + *

+ */ + zoom:number; + /** + * Gets or sets the margins for the exported image. + * The margins are added to the content. This means that an image + * with non-zero margins is larger than the {@link yfiles.canvas.SvgExport#worldBounds} even if + * the {@link yfiles.canvas.SvgExport#scale} is 1.0. The margins are not scaled. They + * are interpreted to be in units (pixels for bitmaps) for the resulting image. + * The default is an empty margin instance. + */ + margin:yfiles.geometry.InsetsD; + /** + * Gets the resulting width of the target image with respect to {@link yfiles.canvas.SvgExport#worldBounds}, + * {@link yfiles.canvas.SvgExport#scale} and {@link yfiles.canvas.SvgExport#margin}. + */ + viewWidth:number; + /** + * Gets the resulting height of the target image with respect to {@link yfiles.canvas.SvgExport#worldBounds}, + * {@link yfiles.canvas.SvgExport#scale} and {@link yfiles.canvas.SvgExport#margin}. + */ + viewHeight:number; + /** + * Determines whether children of the {@link yfiles.canvas.CanvasControl}'s defs section that + * aren't known to the {@link yfiles.canvas.DefsManager} should be copied to the exported SVG. + */ + copyDefsElements:boolean; + /** + * Determines whether all images are encoded to Base64 in {@link yfiles.canvas.SvgExport#exportSvgAsync}. + * Override {@link yfiles.canvas.SvgExport#shouldEncodeImageBase64} to control the encoding for each image separately. + * @see {@link yfiles.canvas.SvgExport#exportSvgAsync} + * @see {@link yfiles.canvas.SvgExport#shouldEncodeImageBase64} + */ + encodeImagesBase64:boolean; + /** + * Determines whether all SVG images should be inlined in the SVG element in {@link yfiles.canvas.SvgExport#exportSvgAsync}. + * Override {@link yfiles.canvas.SvgExport#shouldInlineSvgImage} to control the inlining for each image separately. + * @see {@link yfiles.canvas.SvgExport#exportSvgAsync} + * @see {@link yfiles.canvas.SvgExport#shouldInlineSvgImage} + */ + inlineSvgImages:boolean; + /** + * Returns the value to set the {@link yfiles.canvas.SvgExport#scale} to in order to achieve the given + * target width (without {@link yfiles.canvas.SvgExport#margin}). + * @param {number} width the width of the target image + * @return {number} the scale value to use + * @see {@link yfiles.canvas.SvgExport#setScaleForWidth} + */ + getScaleForWidth(width:number):number; + /** + * Returns the value to set the {@link yfiles.canvas.SvgExport#scale} to in order to achieve the given + * target height (without {@link yfiles.canvas.SvgExport#margin}). + * @param {number} height the height of the target image + * @return {number} the scale value to use + * @see {@link yfiles.canvas.SvgExport#setScaleForHeight} + */ + getScaleForHeight(height:number):number; + /** + * Sets the {@link yfiles.canvas.SvgExport#scale} such that the target image has the given width + * (without {@link yfiles.canvas.SvgExport#margin}). + * @param {number} width the target width without margin + */ + setScaleForWidth(width:number):void; + /** + * Sets the {@link yfiles.canvas.SvgExport#scale} such that the target image has the given height + * (without {@link yfiles.canvas.SvgExport#margin}). + * @param {number} height the target height without margin + */ + setScaleForHeight(height:number):void; + /** + * Returns an initialized {@link yfiles.drawing.IRenderContext} and changes the given + * transform and the clip bounds such that a part of the given + * {@link yfiles.canvas.CanvasControl} instance can be exported to an image. + * @param {yfiles.canvas.CanvasControl} canvas The {@link yfiles.canvas.CanvasControl} instance to export. + * @param {yfiles.geometry.Matrix2D} transform The transform to use for the visual to paint in the world coordinate system. + * @param {yfiles.geometry.RectD} clip The clip to set on the visual in order not to paint beyond the margins. + * @return {yfiles.drawing.IRenderContext} An {@link yfiles.drawing.IRenderContext} to use. + */ + setup(canvas:yfiles.canvas.CanvasControl,transform:{value:yfiles.geometry.Matrix2D;},clip:{value:yfiles.geometry.RectD;}):yfiles.drawing.IRenderContext; + /** + * Exports the contents of the {@link yfiles.canvas.CanvasControl} to a single, + * standalone SVG element. + * + * The asynchronous version of this method, , is capable of encoding and + * inlining images that are embedded in the SVG. + * + * @param {yfiles.canvas.CanvasControl} canvas The canvas to be exported. + * @return {Element} An SVG element with the canvas contents. + */ + exportSvg(canvas:yfiles.canvas.CanvasControl):Element; + /** + * Exports the contents of the {@link yfiles.canvas.CanvasControl} to a single, standalone SVG + * element. + * In addition, images are inlined into the SVG using base64 encoding if + * {@link yfiles.canvas.SvgExport#encodeImagesBase64} is set to true. Image inlining can be + * controlled for each image individually by overwriting the predicate method + * {@link yfiles.canvas.SvgExport#shouldEncodeImageBase64}. + *

+ * SVG image elements are replaced with a copy of the referenced SVG element if + * {@link yfiles.canvas.SvgExport#inlineSvgImages} is set to true. Image encoding can be + * controlled for each image individually by overwriting the predicate method + * {@link yfiles.canvas.SvgExport#shouldInlineSvgImage}. + *

+ * @param {yfiles.canvas.CanvasControl} canvas The canvas to be exported. + * @param {function(Element)} callback The callback to execute when the export is done. + */ + exportSvgAsync(canvas:yfiles.canvas.CanvasControl,callback:(obj:Element)=> void):void; + /** + * Predicate method that specifies whether an SVG image should be inlined. + * This implementation returns the value of {@link yfiles.canvas.SvgExport#inlineSvgImages} for all values of + * image. + * @param {SVGImageElement} image The image to be inlined. + * @return {boolean} Whether the given image should be inlined. + */ + shouldInlineSvgImage(image:SVGImageElement):boolean; + /** + * Prepares the imported SVG element before it is placed in the DOM as a replacement for the + * original image. + * This method can be used to modify the element is placed in the DOM. This specific + * implementation copies the values of the x, y, width, height and preserveAspectRatio + * attributes from the original image element to the imported SVG element. In addition, the SVG + * is wrapped in a g element to support the transform of the original image. + * @param {Element} importedSvg The root element of the SVG file that's referenced by the original + * image element. + * @param {SVGImageElement} originalImage The original image element that will be replaced. + * @return {Element} The element that's actually placed in the DOM as a replacement of the + * originalImage. + * @see {@link yfiles.canvas.SvgExport#inlineSvgImages} + * @see {@link yfiles.canvas.SvgExport#exportSvgAsync} + * @see {@link yfiles.canvas.SvgExport#shouldInlineSvgImage} + */ + prepareInlinedImage(importedSvg:Element,originalImage:SVGImageElement):Element; + /** + * Predicate method that specifies whether an image should be encoded to base64. + * This implementation returns the value of {@link yfiles.canvas.SvgExport#encodeImagesBase64} for all values of + * image. + * @param {SVGImageElement} image The image to be encoded. + * @return {boolean} Whether the given image should be encoded. + */ + shouldEncodeImageBase64(image:SVGImageElement):boolean; + } + var SvgExport:{ + $class:yfiles.lang.Class; + /** + * Creates a new {@link yfiles.canvas.SvgExport} instance for the given world bounds. + * The {@link yfiles.canvas.SvgExport#scale} is set to 1.0. + * @param {yfiles.geometry.RectD} worldBounds the bounds of the content to export, + * see {@link yfiles.canvas.SvgExport#worldBounds} + */ + new (worldBounds:yfiles.geometry.RectD):yfiles.canvas.SvgExport; + /** + * Creates a new {@link yfiles.canvas.SvgExport} instance for the given world bounds and scale. + * @param {yfiles.geometry.RectD} worldBounds the bounds of the content to export, + * see {@link yfiles.canvas.SvgExport#worldBounds} + * @param {number} scale the scale, see {@link yfiles.canvas.SvgExport#scale} + */ + FromWorldBoundsAndScale:{ + new (worldBounds:yfiles.geometry.RectD,scale:number):yfiles.canvas.SvgExport; + }; + /** + * Serializes the given SVG element to a string. + * This method adds SVG namespace and xlink namespace declarations and replaces href with + * xlink:href. + * @param {Element} svg The SVG element to export. + * @return {string} A string representation of the SVG. + */ + exportSvgString(svg:Element):string; + /** + * Encodes the given SVG document as Data URI. + * This method escapes non-Latin1 characters, does a base64 encoding, and returns the result as + * data URI. + * @param {string} svgXml A string containing the SVG document. + * @return {string} A data URI of the SVG document. + */ + encodeSvgDataUrl(svgXml:string):string; + }; + /** + * A container that can hold a number of child {@link yfiles.drawing.Visual}s that works well within + * a {@link yfiles.canvas.CanvasControl}. + * Use this container if you need to return + * a container instance from within a {@link yfiles.drawing.IVisualCreator} implementation. + */ + export interface CanvasContainer extends yfiles.drawing.ArrangeVisual{ + /** + * Gets the element that corresponds to this visual. + * Usually this will be an SVG element or the root of an SVG document fragment. + */ + svgElement:Element; + /** + * Gets or sets a transform that is applied to the children of the container. + * Value: The transform. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#transform} + */ + transform:yfiles.geometry.Matrix2D; + /** + * Adds another {@link yfiles.drawing.Visual} to the children collection of this instance. + * @param {yfiles.drawing.Visual} child The child to add. + */ + add(child:yfiles.drawing.Visual):void; + /** + * Removes a previously added {@link yfiles.drawing.Visual} from the children collection of this instance. + * @param {yfiles.drawing.Visual} child The child to remove. + */ + remove(child:yfiles.drawing.Visual):void; + /** + * Provides read and write access to the list of children. + * Value: The children. + */ + children:yfiles.collections.IList; + /** + * Helper method that sets the attached {@link yfiles.canvas.CanvasContainer#transform} to match rect. + * This is a bridge method that delegates to {@link yfiles.system.UIElementExtensions#setCanvasArrangeRect}. + * @param {yfiles.geometry.RectD} rect The rectangle to set. + */ + setCanvasArrangeRect(rect:yfiles.geometry.RectD):void; + } + var CanvasContainer:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.canvas.CanvasContainer} class. + */ + new ():yfiles.canvas.CanvasContainer; + }; + /** + * Helper class used by {@link yfiles.canvas.CanvasControl} to limit the interactive movement of the viewport. + * The {@link yfiles.canvas.CanvasControl#viewportLimiter} instance should be consulted whenever the user + * tries to change the viewport. Using method {@link yfiles.canvas.ViewportLimiter#limitViewport} the desired viewport can be validated by the + * implementation. + * Note that setting the {@link yfiles.canvas.CanvasControl#zoom} property or {@link yfiles.canvas.CanvasControl#viewPoint} property will + * not be influenced by implementations of this class. It is up to the caller to perform verification. + * @see {@link yfiles.canvas.ViewportLimiter#bounds} + */ + export interface ViewportLimiter extends Object{ + /** + * Inspects the desired or suggested new viewport for the given control and returns a valid viewport to use. + * @param {yfiles.canvas.CanvasControl} canvasControl The canvas control on which the viewport should be applied. + * @param {yfiles.geometry.RectD} suggestedViewport The suggested viewport. + * @return {yfiles.geometry.RectD} The viewport that should be used. + */ + limitViewport(canvasControl:yfiles.canvas.CanvasControl,suggestedViewport:yfiles.geometry.RectD):yfiles.geometry.RectD; + /** + * Gets the to bounds that should be honored for the upcoming call. + * This method is used as callback by {@link yfiles.canvas.ViewportLimiter#limitViewport} for each request. + * The default implementation just yields {@link yfiles.canvas.ViewportLimiter#bounds}. + * @param {yfiles.canvas.CanvasControl} canvasControl The canvas control. + * @param {yfiles.geometry.RectD} suggestedViewport The suggested viewport. + * @return {yfiles.geometry.RectD} The bounds to honor or null. + */ + getBounds(canvasControl:yfiles.canvas.CanvasControl,suggestedViewport:yfiles.geometry.RectD):yfiles.geometry.RectD; + /** + * Gets or sets a value indicating whether both dimensions of {@link yfiles.canvas.ViewportLimiter#bounds} + * need to be honored. + * Value: + * true if both dimensions need to be honored, otherwise false. + */ + honorBothDimensions:boolean; + /** + * Gets or sets the maximal allowed navigable bounds for the viewport. + * Value: + * The bounds or null. This value will be used by the default implementation of + * {@link yfiles.canvas.ViewportLimiter#limitViewport} to crop the desired viewport to. + */ + bounds:yfiles.geometry.RectD; + } + var ViewportLimiter:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.canvas.ViewportLimiter} class. + */ + new ():yfiles.canvas.ViewportLimiter; + }; + /** + * A collection of simultaneous {@link yfiles.canvas.IAnimation}s. + */ + export interface CompositeAnimation extends Object,yfiles.canvas.IAnimation{ + /** + * Adds an animation to this {@link yfiles.canvas.CompositeAnimation} instance. + * @param {yfiles.canvas.IAnimation} child The {@link yfiles.canvas.IAnimation} to add. + */ + addChild(child:yfiles.canvas.IAnimation):void; + /** + * Initializes all child animations. + * @see Specified by {@link yfiles.canvas.IAnimation#initialize}. + */ + initialize():void; + /** + * Animates all child animations. + * @param {number} time the relative animation time [0,1] + * @see Specified by {@link yfiles.canvas.IAnimation#animate}. + */ + animate(time:number):void; + /** + * Calls {@link yfiles.canvas.IAnimation#cleanup} for all child animations and + * removes all child animations from this instance. + * @see Specified by {@link yfiles.canvas.IAnimation#cleanup}. + */ + cleanup():void; + /** + * Returns the maximum of the preferred durations of the child animations + * or 0, if there are no child animations. + * @see Specified by {@link yfiles.canvas.IAnimation#preferredDuration}. + */ + preferredDuration:yfiles.system.TimeSpan; + } + var CompositeAnimation:{ + $class:yfiles.lang.Class; + /** + * Creates an instance of {@link yfiles.canvas.CompositeAnimation}. + * @param {yfiles.collections.IEnumerable.} children The child animations. + */ + WithAnimations:{ + new (children:yfiles.collections.IEnumerable):yfiles.canvas.CompositeAnimation; + }; + /** + * Creates an empty {@link yfiles.canvas.CompositeAnimation}. + * Use {@link yfiles.canvas.CompositeAnimation#addChild} to add an animation. + */ + new ():yfiles.canvas.CompositeAnimation; + }; + /** + * Decorator for {@link yfiles.canvas.IAnimation} instances to allow for ease in + * and ease out animation effects. + *

+ * The duration of the ease in and ease out is + * determined by a mapping [0,1] -> [0,1]. The mapping has to be + * increasing to preserve the order of the frames in the decorated animation. + * In general, we consider continuously differentiable functions f + * where integral of f' equals 1 a suitable choice for the mapping. + *

+ */ + export interface EasedAnimation extends Object,yfiles.canvas.IAnimation{ + /** + * Initializes the base animation. + * @see Specified by {@link yfiles.canvas.IAnimation#initialize}. + */ + initialize():void; + /** + * Animates the base animation with ease in and ease out. + * @param {number} time The animation time [0,1]. + * @see Specified by {@link yfiles.canvas.IAnimation#animate}. + */ + animate(time:number):void; + /** + * Invokes Cleanup() on the base animation. + * @see Specified by {@link yfiles.canvas.IAnimation#cleanup}. + */ + cleanup():void; + /** + * The preferred duration for the base animation. + * @see Specified by {@link yfiles.canvas.IAnimation#preferredDuration}. + */ + preferredDuration:yfiles.system.TimeSpan; + } + var EasedAnimation:{ + $class:yfiles.lang.Class; + /** + * Creates an EasedAnimation for the given base animation. + * @param {yfiles.canvas.IAnimation} baseAnimation The decorated animation. + */ + FromAnimation:{ + new (baseAnimation:yfiles.canvas.IAnimation):yfiles.canvas.EasedAnimation; + }; + /** + * Creates an EasedAnimation for the given base animation. + * @param {yfiles.canvas.IAnimation} baseAnimation The decorated animation. + * @param {number} easeIn The ratio for the ease-in time [0,1]. + * @param {number} easeOut The ratio for the ease-out time [0,1]. + */ + FromAnimationEaseInAndEaseOut:{ + new (baseAnimation:yfiles.canvas.IAnimation,easeIn:number,easeOut:number):yfiles.canvas.EasedAnimation; + }; + }; + /** + * Base class for all GUI components. + * Classes which extend from {@link yfiles.canvas.Control} can handle mouse, touch and keyboard input, + * can receive the focus of the user and are capable of receiving drop events. + */ + export interface Control extends yfiles.drawing.ArrangeVisual,yfiles.system.IDropTarget{ + /** + * Initializes the specified div. + * @param {HTMLDivElement} div The div. + */ + initialize(div:HTMLDivElement):void; + /** + * Cleans up the Div element by removing any connection from the element to the {@link yfiles.canvas.Control} instance. + */ + cleanUp():void; + /** + * Gets the drop target. + * @see Specified by {@link yfiles.system.IDropTarget#dropTarget}. + */ + dropTarget:yfiles.system.DropTarget; + /** + * Gets or sets a value indicating whether dropping an object on the {@link yfiles.canvas.Control} is allowed. + * Value: + * true if dropping is allowed; otherwise, false. + */ + allowDrop:boolean; + /** + * Occurs when a drag gesture enters the {@link yfiles.canvas.Control}. + */ + addDragEnterListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Occurs when a drag gesture enters the {@link yfiles.canvas.Control}. + */ + removeDragEnterListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Occurs when a drag gesture is moved over the {@link yfiles.canvas.Control}. + */ + addDragOverListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Occurs when a drag gesture is moved over the {@link yfiles.canvas.Control}. + */ + removeDragOverListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Occurs when a drop gesture occurs over the {@link yfiles.canvas.Control}. + */ + addDropListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Occurs when a drop gesture occurs over the {@link yfiles.canvas.Control}. + */ + removeDropListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Occurs when the drag gesture is leaving the bounds of the {@link yfiles.canvas.Control}. + */ + addDragLeaveListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Occurs when the drag gesture is leaving the bounds of the {@link yfiles.canvas.Control}. + */ + removeDragLeaveListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Invokes the drag handler. + * @param {function(Object, yfiles.system.DragEventArgs)} handler The handler. + * @param {Object} target The target. + * @param {yfiles.system.DragEventArgs} args The {@link yfiles.system.DragEventArgs} instance containing the event data. + */ + invokeDragHandler(handler:(sender:Object,e:yfiles.system.DragEventArgs)=> void,target:Object,args:yfiles.system.DragEventArgs):void; + /** + * Occurs when the {@link yfiles.canvas.Control} got the focus. + */ + addGotFocusListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when the {@link yfiles.canvas.Control} got the focus. + */ + removeGotFocusListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when the {@link yfiles.canvas.Control} lost the focus. + */ + addLostFocusListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when the {@link yfiles.canvas.Control} lost the focus. + */ + removeLostFocusListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + preventFocusScrolling:boolean; + /** + * Focuses the Div element that is backing this instance. + */ + focus():void; + /** + * Focuses the Div element that is backing this instance, retaining + * the scroll position of all parent elements. + * Called in {@link yfiles.canvas.Control#focus}, if {@link yfiles.canvas.Control#preventFocusScrolling} + * id set to true and control is not yet focused. + *

+ * Some browsers like IE9 automatically scroll parents of the + * focused element to ensure the element's visibility. This is an + * accessibility feature which cannot be disabled. Hence, we remember all + * scroll positions of the parents and restore them after the Div has been + * focused. + *

+ */ + focusRetainingScrollPosition():void; + /** + * Gets or sets a value indicating whether this {@link yfiles.canvas.Control} is focused. + * Value: + * true if focused; otherwise, false. + */ + focused:boolean; + /** + * Gets or sets the mouse cursor. + * Value: + * The mouse cursor. + */ + cursor:string; + /** + * Gets the div element that represents this {@link yfiles.canvas.Control}. + */ + div:HTMLDivElement; + /** + * Gets the SVG element that corresponds to this object. + * @see Overrides {@link yfiles.drawing.Visual#svgElement} + */ + svgElement:Element; + /** + * Gets the size of the control. + */ + size:yfiles.geometry.SizeD; + /** + * Gets the actual width. + */ + actualWidth:number; + /** + * Gets the actual height. + */ + actualHeight:number; + /** + * Gets or sets the width. + * Value: + * The width. + */ + width:number; + /** + * Gets or sets the height. + * Value: + * The height. + */ + height:number; + /** + * Gets a value indicating whether this {@link yfiles.canvas.Control} is displayed from right to left. + * Value: + * true if this {@link yfiles.canvas.Control} is displayed from right to left; otherwise, false. + */ + rightToLeft:boolean; + /** + * Gets or sets a value indicating whether this {@link yfiles.canvas.Control} is enabled. + * Value: + * true if enabled; otherwise, false. + */ + enabled:boolean; + /** + * Gets or sets a value indicating whether this {@link yfiles.canvas.Control} is visible. + * Value: + * true if visible; otherwise, false. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#visible} + */ + visible:boolean; + /** + * Gets the dispatcher. + */ + dispatcher:yfiles.system.Dispatcher; + /** + * Gets or sets a value indicating whether all keyboard input is captured. + * Value: + * true if all keyboard input is captured; otherwise, false. + */ + captureAllKeyboardInput:boolean; + /** + * Gets or sets a value indicating whether all pointer input is captured. + * Value: + * true if all pointer input is captured; otherwise, false. + */ + captureAllPointerInput:boolean; + /** + * Gets or sets a value that specifies whether the default keyboard event handling of the + * browser should be prevented by this control. + *

+ * If this property is enabled, preventDefault() is called on all keyboard events that + * occur on this control. + *

+ *

+ * By default, preventDefault is called on all keyboard events that trigger an + * interaction in this control. Therefore, the default value of this property is false + * and it should only be enabled if the browser's default behavior interferes with the + * interaction of this control. + *

+ * Value: + * true if the default event handling of the browser should be prevented; otherwise, + * false. + */ + preventKeyboardDefault:boolean; + /** + * Gets or sets a value that specifies whether the default mouse, touch, and pointer event + * handling of the browser should be prevented by this control. + *

+ * If this property is enabled, preventDefault() is called on all mouse, touch, and + * pointer events that occur on the control (except contextmenu and + * wheel/mousewheel). The default value of this property is true since we + * assume that all pointer interaction on this control is indeed intended for this control. + *

+ *

+ * The behavior for contextmenu is controlled by the separate property + * {@link yfiles.canvas.Control#preventContextMenuDefault}. The behavior for wheel/mousewheel + * can be specified with the property {@link yfiles.canvas.MouseWheelBehavior}. + *

+ * Value: + * true if the default event handling of the browser should be prevented; otherwise, + * false. + */ + preventPointerDefault:boolean; + /** + * Gets or sets a value that specifies whether the browser's default context menu should be + * prevented by this control. + *

+ * If this property is enabled, preventDefault() is called on the context menu events + * that occur on the control. + *

+ * Value: + * true if the default context menu should be prevented; otherwise, + * false. + */ + preventContextMenuDefault:boolean; + /** + * Gets or sets a value that specifies whether the mouse, touch, and pointer event propagation + * should be stopped by this control. + *

+ * If this property is enabled, stopPropagation() is called on all mouse, touch, and + * pointer events that occur on the control (except contextmenu and + * wheel/mousewheel). If the event propagation is stopped, the event flow is + * interrupted. The event will not bubble to the parent element. + *

+ *

+ * The default is false. Typically, there is no need to enable this property. + *

+ * Value: + * true if the event propagation should be stopped; otherwise, false. + */ + stopPointerPropagation:boolean; + /** + * Calls evt.preventDefault() if {@link yfiles.canvas.Control#preventKeyboardDefault} or + * are enabled. + *

+ * This method is queried for each keyboard event that occurs on this instance. By overriding + * this method, the browser's default behavior can effectively be controlled for every single + * event. + *

+ * @param {Event} evt The event. + */ + maybePreventKeyboardDefault(evt:Event):void; + /** + * Calls evt.preventDefault() if {@link yfiles.canvas.Control#preventPointerDefault} or + * are enabled. + *

+ * This method is queried for each mouse, touch or pointer event that occurs on this instance. + * By overriding this method, the browser's default behavior can effectively be controlled for + * every single event. + *

+ * @param {Event} evt The event. + */ + maybePreventPointerDefault(evt:Event):void; + /** + * Calls evt.stopPropagation() if {@link yfiles.canvas.Control#stopPointerPropagation} is enabled. + *

+ * This method is queried for each mouse, touch or pointer event that occurs on this instance + * (except contextmenu and wheel/mousewheel). + *

+ *

+ * By overriding this method, the event propagation can effectively be controlled for every + * single event. + *

+ * @param {Event} evt The event. + */ + maybeStopPointerPropagation(evt:Event):void; + /** + * Called when a mouse event occurs. + * @param {function(yfiles.input.MouseEventArgs)} handler The handler. + * @param {yfiles.input.MouseEventArgs} args The {@link yfiles.input.MouseEventArgs} instance containing the event data. + */ + onMouseEvent(handler:(obj:yfiles.input.MouseEventArgs)=> void,args:yfiles.input.MouseEventArgs):void; + /** + * Called when a keyboard event occurs. + * @param {function(KeyboardEvent)} handler The handler. + * @param {KeyboardEvent} evt The native keyboard event. + */ + onEvent(handler:(obj:KeyboardEvent)=> void,evt:KeyboardEvent):void; + /** + * Called when a touch event occurs. + * @param {function(yfiles.system.TouchEventArgs)} handler The handler. + * @param {yfiles.system.TouchEventArgs} args The {@link yfiles.system.TouchEventArgs} instance containing the event data. + */ + onTouchEventArgs(handler:(obj:yfiles.system.TouchEventArgs)=> void,args:yfiles.system.TouchEventArgs):void; + /** + * Called when a native touch event occurs. + * @param {function(SVGElement)} handler The handler. + * @param {SVGElement} evt The evt. + */ + onTouchEvent(handler:(obj:SVGElement)=> void,evt:SVGElement):void; + /** + * Invoked when the mouse is pressed over the control. + * @param {yfiles.input.MouseEventArgs} args The {@link yfiles.input.MouseEventArgs} instance containing the event data. + */ + onMouseDown(args:yfiles.input.MouseEventArgs):void; + /** + * Invoked when the mouse is released on the control. + * @param {yfiles.input.MouseEventArgs} args The {@link yfiles.input.MouseEventArgs} instance containing the event data. + */ + onMouseUp(args:yfiles.input.MouseEventArgs):void; + /** + * Invoked when the mouse leaves the bounds of the control. + * @param {yfiles.input.MouseEventArgs} args The {@link yfiles.input.MouseEventArgs} instance containing the event data. + */ + onMouseLeave(args:yfiles.input.MouseEventArgs):void; + /** + * Invoked when the mouse enters the bounds of the control. + * @param {yfiles.input.MouseEventArgs} args The {@link yfiles.input.MouseEventArgs} instance containing the event data. + */ + onMouseEnter(args:yfiles.input.MouseEventArgs):void; + /** + * Invoked when the mouse wheel is turned over the control. + * @param {yfiles.input.MouseEventArgs} args The {@link yfiles.input.MouseEventArgs} instance containing the event data. + */ + onMouseWheel(args:yfiles.input.MouseEventArgs):void; + /** + * Invoked when the mouse is moved within the bounds of the control. + * @param {yfiles.input.MouseEventArgs} args The {@link yfiles.input.MouseEventArgs} instance containing the event data. + */ + onMouseMove(args:yfiles.input.MouseEventArgs):void; + /** + * Invoked when the mouse capture is lost. + * @see {@link yfiles.canvas.Control#mouseCaptureEnabled} + * @param {yfiles.input.MouseEventArgs} args The {@link yfiles.input.MouseEventArgs} instance containing the event data. + */ + onMouseCaptureLost(args:yfiles.input.MouseEventArgs):void; + /** + * Whether or not this control receives mouse input after the mouse is dragged out of its bounding area. + * If enabled, this control receives mouse events when the mouse is moved out of its bounding area while a mouse + * button is pressed, until the button is release (the mouse up event is the last event this control listens to). + */ + mouseCaptureEnabled:boolean; + /** + * Whether or not {@link yfiles.canvas.Control#mouseCaptureEnabled} is set to true and a mouse button is + * currently pressed, that is, this control has effectively captured the mouse. + */ + hasMouseCapture:boolean; + /** + * Stops the mouse capture and returns to normal event capturing. + * When {@link yfiles.canvas.Control#mouseCaptureEnabled} is set to true and a mouse down + * event is received, the control starts capturing all mouse events by registering handlers on the document element. + * Mouse capturing is normally stopped when the mouse button is released. Mouse capture can be manually stopped + * by calling this function. + */ + stopMouseCapture():void; + /** + * Invoked when a touch device is pressed on the control. + * @param {yfiles.system.TouchEventArgs} e The {@link yfiles.system.TouchEventArgs} instance containing the event data. + */ + onTouchDown(e:yfiles.system.TouchEventArgs):void; + /** + * Invoked when a touch device is moved across the control. + * @param {yfiles.system.TouchEventArgs} e The {@link yfiles.system.TouchEventArgs} instance containing the event data. + */ + onTouchMove(e:yfiles.system.TouchEventArgs):void; + /** + * Invoked when a touch device is removed from the control. + * @param {yfiles.system.TouchEventArgs} e The {@link yfiles.system.TouchEventArgs} instance containing the event data. + */ + onTouchUp(e:yfiles.system.TouchEventArgs):void; + /** + * Invoked when a touch device enters this control. + * Not supported by current versions of iOS and Android. + * @param {yfiles.system.TouchEventArgs} e The touch event argument. + */ + onTouchEnter(e:yfiles.system.TouchEventArgs):void; + /** + * Invoked when a touch device leaves this control. + * Not supported by current versions of iOS and Android. + * @param {yfiles.system.TouchEventArgs} e The touch event argument. + */ + onTouchLeave(e:yfiles.system.TouchEventArgs):void; + /** + * Invoked after this control has lost the pointer capture. + * @param {yfiles.system.TouchEventArgs} e The touch event argument. + */ + onTouchCaptureLost(e:yfiles.system.TouchEventArgs):void; + addKeyDownListener(value:(sender:Object,e:yfiles.input.KeyEventArgs)=> void):void; + removeKeyDownListener(value:(sender:Object,e:yfiles.input.KeyEventArgs)=> void):void; + addKeyUpListener(value:(sender:Object,e:yfiles.input.KeyEventArgs)=> void):void; + removeKeyUpListener(value:(sender:Object,e:yfiles.input.KeyEventArgs)=> void):void; + addKeyPressListener(value:(sender:Object,e:yfiles.input.KeyEventArgs)=> void):void; + removeKeyPressListener(value:(sender:Object,e:yfiles.input.KeyEventArgs)=> void):void; + /** + * Invoked when a key is pressed down while the control has the focus. + * @param {yfiles.input.KeyEventArgs} e The {@link yfiles.input.KeyEventArgs} instance containing the event data. + */ + onKeyDown(e:yfiles.input.KeyEventArgs):void; + /** + * Invoked when a printable key is pressed while the control has the focus. + * @param {yfiles.input.KeyEventArgs} e The {@link yfiles.input.KeyEventArgs} instance containing the event data. + */ + onKeyPress(e:yfiles.input.KeyEventArgs):void; + /** + * Invoked when a key is released while the control has the focus. + * @param {yfiles.input.KeyEventArgs} e The {@link yfiles.input.KeyEventArgs} instance containing the event data. + */ + onKeyUp(e:yfiles.input.KeyEventArgs):void; + /** + * Checks if this control's {@link yfiles.canvas.Control#div} is a child of window.document. + * @return {boolean} true if this control is part of the DOM tree. + */ + existsInDom():boolean; + /** + * Tries to find the resource in the resource dictionaries + * of the control and its ancestors. + * This is a bridge method that delegates to {@link yfiles.system.UIElementExtensions#tryFindResource}. + * @param {Object} resourceKey The resource key to use as the key. + * @return {Object} The result or null. + */ + tryFindResource(resourceKey:Object):Object; + /** + * Determines whether the specified element is visible. + * This is a bridge method that delegates to {@link yfiles.system.UIElementExtensions#isVisible}. + * @return {boolean} + * true if the specified element is visible; otherwise, false. + */ + isVisible():boolean; + /** + * Determines whether the specified source has the keyboard focus. + * This is a bridge method that delegates to {@link yfiles.system.UIElementExtensions#isKeyboardFocused}. + * @return {boolean} + * true if the element is the currently focused element; otherwise, false. + */ + isKeyboardFocused():boolean; + /** + * Determines whether the keyboard focus is within the visual tree of the specified element. + * This is a bridge method that delegates to {@link yfiles.system.UIElementExtensions#isKeyboardFocusWithin}. + * @return {boolean} + * true if keyboard focus is within the subtree; otherwise, false. + */ + isKeyboardFocusWithin():boolean; + } + var Control:{ + $class:yfiles.lang.Class; + /** + * The {@link yfiles.system.DependencyProperty} that is used to register the {@link yfiles.canvas.Control} instance with the div element + * which represents it visually. + */ + CONTROL_PROPERTY:yfiles.system.DependencyProperty; + /** + * Initializes a new instance of the {@link yfiles.canvas.Control} class. + */ + new ():yfiles.canvas.Control; + /** + * Initializes a new instance of the {@link yfiles.canvas.Control} class and sets the specified Div element. + * @param {HTMLDivElement} div The Div element this control uses. + */ + FromDiv:{ + new (div:HTMLDivElement):yfiles.canvas.Control; + }; + }; + /** + * An interface for animation. + *

Instances of classes implementing this interface change their + * state according to a relative animation time. The animation time is a + * double between 0 for the start of the animation and 1 for the end of + * the animation.

+ *

+ *

    + *
  • An animated object is first created using the constructor of + * a subclass.
  • + *
  • Immediately before the animation a client calls {@link yfiles.canvas.IAnimation#initialize}.
  • + *
  • To change the state of the animated object a client does a series of + * calls to {@link yfiles.canvas.IAnimation#animate}, usually with an increasing relative time parameter.
  • + *
  • If the animation is done, the client calls {@link yfiles.canvas.IAnimation#cleanup} once.
  • + *
  • While {@link yfiles.canvas.IAnimation#animate} uses a relative time scheme, there might be an absolute + * time value for the preferred duration of the whole sequence of animation steps. Since + * an IAnimation instance has no control on the number of {@link yfiles.canvas.IAnimation#animate} calls or the + * intervals between them, the preferred duration is only a hint on how long the animation + * should take. Clients can ask for that hint using {@link yfiles.canvas.IAnimation#preferredDuration} and + * try to find a suitable sequence of {@link yfiles.canvas.IAnimation#animate} calls in order to fulfill the preference. + *
  • + *
+ *

+ */ + export interface IAnimation extends Object{ + /** + * Initializes the animation. Call this method once before subsequent + * calls to {@link yfiles.canvas.IAnimation#animate}. + * @see Specified by {@link yfiles.canvas.IAnimation#initialize}. + */ + initialize():void; + /** + * Does the animation according to the relative animation time. + * The animation starts with the time 0 and ends with time 1. + * @param {number} time the animation time [0,1] + * @see Specified by {@link yfiles.canvas.IAnimation#animate}. + */ + animate(time:number):void; + /** + * Cleans up after an animation has finished. + * @see Specified by {@link yfiles.canvas.IAnimation#cleanup}. + */ + cleanup():void; + /** + * Gets the preferred duration of the animation. + * @see Specified by {@link yfiles.canvas.IAnimation#preferredDuration}. + */ + preferredDuration:yfiles.system.TimeSpan; + } + var IAnimation:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Animates a mutable point along a {@link yfiles.drawing.GeneralPath}. + */ + export interface GeneralPathAnimation extends Object,yfiles.canvas.IAnimation{ + /** + * Does nothing. + * @see Specified by {@link yfiles.canvas.IAnimation#initialize}. + */ + initialize():void; + /** + * Sets the position of the animated point to the relative position on the general path + * as given by the time parameter. + * @param {number} time The relative animation time [0,1]. + * @see Specified by {@link yfiles.canvas.IAnimation#animate}. + */ + animate(time:number):void; + /** + * Does nothing. + * @see Specified by {@link yfiles.canvas.IAnimation#cleanup}. + */ + cleanup():void; + /** + * Returns the preferred duration in milliseconds. + * @see Specified by {@link yfiles.canvas.IAnimation#preferredDuration}. + */ + preferredDuration:yfiles.system.TimeSpan; + } + var GeneralPathAnimation:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of class {@link yfiles.canvas.GeneralPathAnimation}. + * @param {yfiles.geometry.IPointSetter} point The mutable point to animate. + * @param {yfiles.drawing.GeneralPath} path The animation path. + * @param {yfiles.system.TimeSpan} preferredDuration The preferred duration in milliseconds. + */ + new (point:yfiles.geometry.IPointSetter,path:yfiles.drawing.GeneralPath,preferredDuration:yfiles.system.TimeSpan):yfiles.canvas.GeneralPathAnimation; + }; + /** + * Animates changing the viewport bounds and the zoom factor for a {@link yfiles.canvas.CanvasControl}. + */ + export interface ViewportAnimation extends Object,yfiles.canvas.IAnimation{ + /** + * Gets or sets the target world bounds. + */ + targetBounds:yfiles.geometry.RectD; + /** + * Whether to respect the {@link yfiles.canvas.CanvasControl#viewportLimiter} of the {@link yfiles.canvas.CanvasControl} + * whose {@link yfiles.canvas.CanvasControl#viewport} is animated. + * Default is false. + * Value: true if the {@link yfiles.canvas.CanvasControl#viewportLimiter} should be considered, otherwise false. + */ + considerViewportLimiter:boolean; + /** + * Gets or sets the preferred duration of the animation. + * @see Specified by {@link yfiles.canvas.IAnimation#preferredDuration}. + */ + preferredDuration:yfiles.system.TimeSpan; + /** + * Gets or sets the maximum zoom level to use after the animation. + * The default is {@link Number#POSITIVE_INFINITY}. + * Value: The maximum target zoom. + */ + maximumTargetZoom:number; + /** + * Initializes this animation. + * This has to be called once before any calls to {@link yfiles.canvas.ViewportAnimation#animate}. + * An instance of {@link yfiles.canvas.ViewportAnimation} can be reused after an animation by setting + * new {@link yfiles.canvas.ViewportAnimation#targetBounds} or a new {@link yfiles.canvas.ViewportAnimation#preferredDuration} and calling Initialize() + * again. + * @see Specified by {@link yfiles.canvas.IAnimation#initialize}. + */ + initialize():void; + /** + * Gets or sets the scroll bar visibility that will be used during the animation. + * Value: The scroll bar visibility to use during animation. The default is hidden. + */ + scrollBarVisibility:yfiles.canvas.ScrollBarVisibility; + /** + * Gets or sets the margins in view coordinate dimensions to use at the target zoom level. + * Value: The target view margins. The default is (0,0,0,0) + */ + targetViewMargins:yfiles.geometry.InsetsD; + /** + * Does the animation according to the relative animation time. + * The animation starts with the time 0 and ends with time 1. + * @param {number} time the animation time [0,1] + * @see Specified by {@link yfiles.canvas.IAnimation#animate}. + */ + animate(time:number):void; + /** + * Effectively applies the view point value. + */ + applyViewPoint(focus:yfiles.geometry.PointD):void; + /** + * Effectively applies the center point value. + */ + applyCenterPoint(focus:yfiles.geometry.PointD):void; + /** + * Effectively applies the zoom value. + */ + applyZoom(value:number):void; + /** + * Cancels this viewport animation so that subsequent calls to {@link yfiles.canvas.ViewportAnimation#animate} or {@link yfiles.canvas.ViewportAnimation#cleanup} + * won't affect the viewport anymore. + */ + cancel():void; + /** + * Cleans up after the animation. + * @see Specified by {@link yfiles.canvas.IAnimation#cleanup}. + */ + cleanup():void; + } + var ViewportAnimation:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of {@link yfiles.canvas.ViewportAnimation}. + * @param {yfiles.canvas.CanvasControl} canvasControl The canvas control. + * @param {yfiles.geometry.RectD} targetBounds The target world bounds for the animation. + * @param {yfiles.system.TimeSpan} preferredDuration The preferred duration. + */ + new (canvasControl:yfiles.canvas.CanvasControl,targetBounds:yfiles.geometry.RectD,preferredDuration:yfiles.system.TimeSpan):yfiles.canvas.ViewportAnimation; + }; + } + export module circular{ + export enum PartitionLayoutStyle{ + /** + * Place each node of a partition on the boundary of a circle. + * This style is very fast, but the results may need much space. + * This parameter can be set with {@link yfiles.circular.CircularLayouter#partitionLayoutStyle} + */ + CYCLE, + /** + * Create semi-compact layout for each partition. + * This style places nodes in the inside and the border + * of a circle and arranges them in an organic manner, leading to more compact + * layout. Only nodes with connections into other partitions are guaranteed to lie on the boundary of + * the resulting disk. + * This style may come with a performance penalty. + * This parameter can be set with {@link yfiles.circular.CircularLayouter#partitionLayoutStyle} + */ + DISK, + /** + * Create most compact layout for each partition. + * This style creates an organic circular layout for each partition. Even nodes that connect + * into different partitions may be placed in the inside of the resulting disk. + * This style may come with a performance penalty. + * This parameter can be set with {@link yfiles.circular.CircularLayouter#partitionLayoutStyle} + */ + ORGANIC + } + /** + * Circular style layouter. + * This layouter either places all nodes on or inside a circle + * or partitions the graph in disjoint node sets each of + * which will be laid out separately. The exact behavior for the layout of these partitions + * can be controlled via {@link yfiles.circular.CircularLayouter#partitionLayoutStyle}. The partition policy + * can be set with {@link yfiles.circular.CircularLayouter#layoutStyle}. + * The separate partitions themselves + * are arranged using a {@link yfiles.tree.BalloonLayouter}. + * Here is a sample output of the layouter using {@link yfiles.circular.LayoutStyle#BCC_COMPACT} as partition policy + * and {@link yfiles.circular.PartitionLayoutStyle#CYCLE} as layout style for the partitions. + *
+ */ + export interface CircularLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * Specifies whether or not node labels are taken into account when calculating + * node positions (thereby preventing possible node/node label or + * node label/node label overlaps). + */ + considerNodeLabels:boolean; + /** + * Specifies whether or not, in the underlying tree, the children of a node are placed on a common radius. + * Disabling this feature may produce more compact layout results. + */ + placeChildrenOnCommonRadius:boolean; + /** + * Specifies whether or not to take the coordinates of the input diagram + * into account when arranging the nodes of the partitions and the partitions themselves. + * If enabled: + *
    + *
  • For complex partitions (those consisting of more than one node), the layouter + * tries to keep peripheral nodes and maintain their circular order around the center of the disk/circle. + * Other partitions that connect to this node are moved accordingly, if possible.
  • + *
  • For multiple partitions that connect to the same node, the layouter tries to keep their + * circular order around this node. This only works as expected for {@link yfiles.circular.LayoutStyle#BCC_COMPACT} + * as partition policy, since otherwise the underlying tree structure is not well defined
  • + *
+ * Switching between different partition policies or group layout styles can lead to unexpected results. + * By default this feature is disabled. + */ + fromSketchMode:boolean; + /** + * The maximal deviation angle allowed for an edge. + * The deviation angle for an edge is the difference between + * its optimal radiation angle away from the parent cycle and its + * actual radiation angle. + *

+ * By default a maximal deviation angle of 90 degrees is applied. + *

+ *

+ * Note that using a small maximal deviation angle may significantly increase the length of edges. + * The same is true for small preferred child wedges set on the used BalloonLayouter instance, + * see method {@link yfiles.circular.CircularLayouter#balloonLayouter}. + *

+ */ + maximalDeviationAngle:number; + /** + * The global layout style for this layouter. + * Allowed layout styles are {@link yfiles.circular.LayoutStyle#SINGLE_CYCLE}, {@link yfiles.circular.LayoutStyle#BCC_ISOLATED}, + * {@link yfiles.circular.LayoutStyle#BCC_COMPACT} and {@link yfiles.circular.LayoutStyle#CIRCULAR_CUSTOM_GROUPS} + * By default {@link yfiles.circular.LayoutStyle#BCC_COMPACT} is used as layout style + */ + layoutStyle:yfiles.circular.LayoutStyle; + /** + * The SingleCycleLayouter used for laying out single node cycles + * Configuring that layouter has effects upon single cycle layouts. + */ + singleCycleLayouter:yfiles.circular.SingleCycleLayouter; + /** + * The BalloonLayouter used for arranging the partitions + * Configuring that layouter has effect upon the partition arrangement + * within the overall layout. + */ + balloonLayouter:yfiles.tree.BalloonLayouter; + /** + * The layout style for the arrangement of each partition. + * Default is {@link yfiles.circular.PartitionLayoutStyle#CYCLE} + */ + partitionLayoutStyle:yfiles.circular.PartitionLayoutStyle; + /** + * Always returns true. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Core layout routine. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * Calculates a layout for the given graph. + * The given graph will not be copied during the + * layout process and the layout will be + * immediately applied to the given graph. + * This method is not side effect free in the sense that + * the order of edges or nodes in the input graph + * may change during the layout process. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(layoutGraph:yfiles.layout.LayoutGraph):void; + } + var CircularLayouter:{ + $class:yfiles.lang.Class; + /** + * Used for publishing the final circle information. + * If the {@link yfiles.algorithms.IDataProvider} associated to this key is also a + * {@link yfiles.algorithms.IDataAcceptor}, the integer circle id of each node is stored using + * the acceptor's {@link yfiles.algorithms.IDataAcceptor#setInt setInt} method. + * Otherwise, the provider's values should be of type + * {@link yfiles.algorithms.IIntValueSettable} whose + * {@link yfiles.algorithms.IIntValueSettable#value setValue} method + * is used to store the integer circle id of each node. + */ + CIRCLE_ID_HOLDER_DP_KEY:Object; + /** + * This key is used to identify custom groups. + */ + CIRCULAR_CUSTOM_GROUPS_DP_KEY:Object; + /** + * Create a new instance of this layouter. + * The default values are: + *
    + *
  • Partition policy: {@link yfiles.circular.LayoutStyle#BCC_COMPACT}
  • + *
  • Partition layout style: {@link yfiles.circular.PartitionLayoutStyle#CYCLE}
  • + *
+ */ + new ():yfiles.circular.CircularLayouter; + }; + export enum LayoutStyle{ + /** + * Layout style specifier. In this layout style the nodes within a + * biconnected component of the input graph are treated as separate + * partitions. If a node belongs to more biconnected components, + * it will be assigned to the one that seems to be more suitable. + * This parameter can be set with {@link yfiles.circular.CircularLayouter#layoutStyle} + */ + BCC_COMPACT, + /** + * Layout style specifier. In this layout style the nodes within a + * biconnected component of the input graph are treated as separate + * partitions. + * If a node belongs to more biconnected components, + * it will form an isolated partition and will be laid out + * in between all of it's biconnected component cycles. + * This parameter can be set with {@link yfiles.circular.CircularLayouter#layoutStyle} + */ + BCC_ISOLATED, + /** + * Layout style specifier. In this layout style the user can specify groups that + * will each form a separate partition. To specify groups, a {@link yfiles.algorithms.IDataProvider} with key + * {@link yfiles.circular.CircularLayouter#CIRCULAR_CUSTOM_GROUPS_DP_KEY} must be registered. + * This parameter can be set with {@link yfiles.circular.CircularLayouter#layoutStyle} + */ + CIRCULAR_CUSTOM_GROUPS, + /** + * Layout style specifier. In this layout style all nodes of the input graph + * will be put on or inside a single cycle. + * This parameter can be set with {@link yfiles.circular.CircularLayouter#layoutStyle} + */ + SINGLE_CYCLE + } + /** + * A layouter that places the nodes of a graph on a cycle. + * Here is an sample output of the layouter with activated automatic radius + * determination. + *
+ */ + export interface SingleCycleLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * The angle for the first node. + * Getter:Default value is 0.0 + * Setter:The angle is measured in rad and world coordinates, i.e. 0 is east, + * Pi/4 south etc. + * Note: This setting is ignored when the SingleCycleLayouter is used in connection with + * {@link yfiles.circular.CircularLayouter}. + */ + initialAngle:number; + /** + * Specifies whether or not to take the coordinates of the input diagram + * into account when arranging the nodes. + * If this features is enabled, the original circular order of peripheral nodes around + * an estimated circle center is preserved. + * By default this feature is disabled. + */ + fromSketchModeEnabled:boolean; + /** + * The distance to keep between the nodes on the cycle + * Default value is 30.0. + * Default value is 30.0. + */ + minimalNodeDistance:number; + /** + * The fixed radius for the cycle on which the nodes of the graph + * will be placed. + * The fixed radius is ignored if the automatic radius feature + * is activated. + * Default value is 200.0. + */ + fixedRadius:number; + /** + * The minimal radius for the cycle on which the nodes are placed. + * This feature is considered if the radius is detected automatically. + * Default value is 5.0. + */ + minimalRadius:number; + /** + * Specifies whether or not to choose the cycle radius automatically. + * If enabled a radius will be chosen such that the adjacent nodes on the circle + * will be approximately {@link yfiles.circular.SingleCycleLayouter#minimalNodeDistance} apart. + * If this feature is deactivated the radius specified via + * {@link yfiles.circular.SingleCycleLayouter#fixedRadius} will be applied. + * By default this feature is enabled. + */ + automaticRadius:boolean; + /** + * The node sequencer used to determine the order of nodes + * around a cycle. + */ + nodeSequencer:yfiles.algorithms.INodeSequencer; + /** + * The radius last applied by this layouter. + */ + lastAppliedRadius:number; + /** + * Always returns true. + * Yes we can handle anything! + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Core layout routine. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + } + var SingleCycleLayouter:{ + $class:yfiles.lang.Class; + new ():yfiles.circular.SingleCycleLayouter; + }; + } + export module collections{ + /** + * The data for an {@link yfiles.collections.INotifyCollectionChanged#addCollectionChangedListener CollectionChanged} event. + */ + export interface NotifyCollectionChangedEventArgs extends yfiles.system.EventArgs{ + /** + * The kind of change. + */ + action:yfiles.collections.NotifyCollectionChangedAction; + /** + * A list of the changed items. + */ + newItems:yfiles.objectcollections.IList; + /** + * A list of replaced, removed or moved items. + */ + oldItems:yfiles.objectcollections.IList; + /** + * The starting index at which the change occurred. + */ + newStartingIndex:number; + /** + * The starting index of the elements which were replaced, removed or moved. + */ + oldStartingIndex:number; + } + var NotifyCollectionChangedEventArgs:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + * @param {yfiles.collections.NotifyCollectionChangedAction} action The action which describes the change. + */ + FromAction:{ + new (action:yfiles.collections.NotifyCollectionChangedAction):yfiles.collections.NotifyCollectionChangedEventArgs; + }; + /** + * Creates a new instance. + * @param {yfiles.collections.NotifyCollectionChangedAction} action The action which describes the change. + * @param {yfiles.objectcollections.IList} changedItems The changed items. + */ + FromActionAndChangedItems:{ + new (action:yfiles.collections.NotifyCollectionChangedAction,changedItems:yfiles.objectcollections.IList):yfiles.collections.NotifyCollectionChangedEventArgs; + }; + /** + * Creates a new instance. + * @param {yfiles.collections.NotifyCollectionChangedAction} action The action which describes the change. + * @param {Object} obj The (only) object which was changed. + */ + FromActionAndItem:{ + new (action:yfiles.collections.NotifyCollectionChangedAction,obj:Object):yfiles.collections.NotifyCollectionChangedEventArgs; + }; + /** + * Creates a new instance. + * @param {yfiles.collections.NotifyCollectionChangedAction} action The action which describes the change. + * @param {yfiles.objectcollections.IList} newItems The items which were changed. + * @param {yfiles.objectcollections.IList} oldItems The items which were removed or replaced. + */ + FromActionNewItemsAndOldItems:{ + new (action:yfiles.collections.NotifyCollectionChangedAction,newItems:yfiles.objectcollections.IList,oldItems:yfiles.objectcollections.IList):yfiles.collections.NotifyCollectionChangedEventArgs; + }; + /** + * Creates a new instance. + * @param {yfiles.collections.NotifyCollectionChangedAction} action The action which describes the change. + * @param {Object} o The (only) object which was changed. + * @param {number} i The index at which the change occurred. + */ + FromActionItemsAndIndex:{ + new (action:yfiles.collections.NotifyCollectionChangedAction,o:Object,i:number):yfiles.collections.NotifyCollectionChangedEventArgs; + }; + /** + * Creates a new instance. + * @param {yfiles.collections.NotifyCollectionChangedAction} action The action which describes the change. + * @param {Object} o1 The (only) object which was changed. + * @param {Object} o2 The (only) object which was replaced or removed. + */ + FromActionAndItems:{ + new (action:yfiles.collections.NotifyCollectionChangedAction,o1:Object,o2:Object):yfiles.collections.NotifyCollectionChangedEventArgs; + }; + /** + * Creates a new instance. + * @param {yfiles.collections.NotifyCollectionChangedAction} action The action which describes the change. + * @param {yfiles.objectcollections.IList} newItems The new items. + * @param {yfiles.objectcollections.IList} oldItems The items which were removed or replaced. + * @param {number} i The index at which the change started. + */ + FromActionNewItemsOldItemsAndIndex:{ + new (action:yfiles.collections.NotifyCollectionChangedAction,newItems:yfiles.objectcollections.IList,oldItems:yfiles.objectcollections.IList,i:number):yfiles.collections.NotifyCollectionChangedEventArgs; + }; + /** + * Creates a new instance. + * @param {yfiles.collections.NotifyCollectionChangedAction} action The action which describes the change. + * @param {yfiles.objectcollections.IList} newItems The changed items. + * @param {number} i1 The starting index after the change. + * @param {number} i2 The starting index before the change. + */ + FromActionNewItemsAndIndices:{ + new (action:yfiles.collections.NotifyCollectionChangedAction,newItems:yfiles.objectcollections.IList,i1:number,i2:number):yfiles.collections.NotifyCollectionChangedEventArgs; + }; + /** + * Creates a new instance. + * @param {yfiles.collections.NotifyCollectionChangedAction} action The action which describes the change. + * @param {Object} o The (only) object which was changed. + * @param {number} i1 The index of the object after the change. + * @param {number} i2 The index of the object before the change. + */ + FromActionItemsAndIndices:{ + new (action:yfiles.collections.NotifyCollectionChangedAction,o:Object,i1:number,i2:number):yfiles.collections.NotifyCollectionChangedEventArgs; + }; + /** + * Creates a new instance. + * @param {yfiles.collections.NotifyCollectionChangedAction} action The action which describes the change. + * @param {Object} newItem The object after the change. + * @param {Object} oldItem The object which was removed or replaced. + * @param {number} i The index of the object which was changed. + */ + FromActionNewItemOldItemAndIndex:{ + new (action:yfiles.collections.NotifyCollectionChangedAction,newItem:Object,oldItem:Object,i:number):yfiles.collections.NotifyCollectionChangedEventArgs; + }; + }; + export enum NotifyCollectionChangedAction{ + /** + * One or more elements were added. + */ + ADD, + /** + * One or more elements were removed. + */ + REMOVE, + /** + * One or more elements were replaced. + */ + REPLACE, + /** + * One or more elements were moved. + */ + MOVE, + /** + * The collection was reset. + */ + RESET + } + /** + * Provides a method to compare two objects of the same type. + */ + export interface IComparer extends Object{ + /** + * Compares two objects of type T. + * @param {T} x The first object. + * @param {T} y The second object. + * @return {number}
    + *
  • -1: x is less than y
  • + *
  • 0: x is equal to y
  • + *
  • 1: x is greater than y
  • + *
+ * @see Specified by {@link yfiles.collections.IComparer#compare}. + */ + compare(x:T,y:T):number; + } + var IComparer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for collections which dispatch an {@link yfiles.collections.INotifyCollectionChanged#addCollectionChangedListener event} when the collection changes. + */ + export interface INotifyCollectionChanged extends Object{ + /** + * Dispatched when the collection changed. + */ + addCollectionChangedListener(value:(sender:Object,e:yfiles.collections.NotifyCollectionChangedEventArgs)=> void):void; + /** + * Dispatched when the collection changed. + */ + removeCollectionChangedListener(value:(sender:Object,e:yfiles.collections.NotifyCollectionChangedEventArgs)=> void):void; + } + var INotifyCollectionChanged:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Defines ways to iterate over the items contained in this type by providing a method to get an {@link yfiles.objectcollections.IEnumerator}. + */ + export interface IEnumerable extends Object,yfiles.objectcollections.IEnumerable{ + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Whether the given value is contained in the enumerable. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#enumeratorContains}. + * @param {T} value The value to search for. + * @return {boolean} true if the enumerable contains the given value. + */ + enumerableContains(value:T):boolean; + /** + * Returns the element at the given index in the enumerable. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#elementAt}. + * @param {number} index The index of the element to return. + * @return {T} The element at the given index. + * @throws {yfiles.system.ArgumentException} If the index is not within the enumerable's range. + */ + getElementAt(index:number):T; + /** + * Iterates over the enumerable and invokes the action for each element passing the value as an argument. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#forEach}. + * @param {function(T)} action The delegate to call. + */ + forEach(action:(obj:T)=> void):void; + /** + * Iterates over the enumerable and invokes the action for each element passing the value and index as arguments. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#forEachWithIndex}. + * @param {function(T, number)} action The delegate to call. + */ + forEachWithIndex(action:(arg1:T,arg2:number)=> void):void; + /** + * Returns the number of elements contained in the enumerable. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#count}. + * @return {number} The number of elements contained in the enumerable. + */ + getElementCount():number; + /** + * Returns the first element of the enumerable. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#getFirstElement}. + * @return {T} The first element of the enumerable. + * @throws {yfiles.system.ArgumentNullException} If the given enumerable is null. + * @throws {yfiles.system.InvalidOperationException} If the enumerable is empty. + */ + getFirstElement():T; + /** + * Returns the first element of the enumerable which matches a given filter. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#getFirstElementWithPredicate}. + * @param {function(T):boolean} predicate A function with the signature function(element):boolean which returns + * true if the given element should be returned + * @return {T} The first matching element of the enumerable. + * @throws {yfiles.system.ArgumentNullException} If the given enumerable is null. + * @throws {yfiles.system.InvalidOperationException} If the enumerable does not contain a matching element. + */ + getFirstElementWithPredicate(predicate:(arg:T)=>boolean):T; + /** + * Returns the first element of the enumerable or the default for the enumerable's element type if the enumerable is empty. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#getFirstElementOrDefault}. + * @return {T} The first element of the enumerable or the default value for TSource. + * @throws {yfiles.system.ArgumentNullException} If the given enumerable is null. + */ + getFirstElementOrDefault():T; + /** + * Returns the first element of the enumerable which matches a given filter + * or the default for the enumerable's element type if there is no such element. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#getFirstElementOrDefaultWithPredicate}. + * @param {function(T):boolean} predicate A function with the signature function(element):boolean which returns + * true if the given element should be returned + * @return {T} The first element of the enumerable or the default value for TSource. + * @throws {yfiles.system.ArgumentNullException} If the given enumerable is null. + */ + getFirstElementOrDefaultWithPredicate(predicate:(arg:T)=>boolean):T; + /** + * Returns the last element of the enumerable or the default for the enumerable's element type if the enumerable is empty. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#getLastElementOrDefault}. + * @return {T} The last element of the enumerable or the default value for TSource. + * @throws {yfiles.system.ArgumentNullException} If the given enumerable is null. + */ + getLastElementOrDefault():T; + /** + * Returns the last element of the enumerable. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#getLastElement}. + * @return {T} The last element of the enumerable. + * @throws {yfiles.system.ArgumentNullException} If the given enumerable is null. + * @throws {yfiles.system.InvalidOperationException} If the enumerable is empty. + */ + getLastElement():T; + /** + * Returns an enumerable which only contains elements of the source enumerable which match a given predicate. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#where}. + * @param {function(Object):boolean} predicate A function with the signature function(element):boolean which returns + * true if the given element should be included in the resulting enumerable. + * @return {yfiles.collections.IEnumerable.} An enumerable which contains the elements of the source enumeration which match the given predicate. + */ + getMatchingElements(predicate:(arg:Object)=>boolean):yfiles.collections.IEnumerable; + /** + * Creates a flattened view of a given enumerable using the given selector function which returns + * an enumerable for each element of the source enumerable. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#selectMany}. + * @param {function(T):yfiles.collections.IEnumerable.} selector A function with the signature function(element):IEnumerable which returns + * an enumerable for each element of the source enumerable. + * @return {yfiles.collections.IEnumerable.} A flattened view of the given enumerable. The enumerables which are returned by the selector + * method for each element are concatenated in the result. + */ + getMultiProjection(selector:(arg:T)=>yfiles.collections.IEnumerable):yfiles.collections.IEnumerable; + /** + * Creates an array with the values of the enumerable. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#toArray}. + * @return {T[]} An array with the enumerable's elements. + */ + getEnumerableAsArray():T[]; + /** + * Creates a {@link yfiles.collections.List} with the values of the enumerable. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#toList}. + * @return {yfiles.collections.List.} An {@link yfiles.collections.List} with the enumerable's elements. + */ + getEnumerableAsList():yfiles.collections.List; + /** + * Calculates the sum of the elements of the enumerable. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#sum}. + * @param {function(T):number} selector A function with the signature function(element):Number + * which returns a numeric value for the given element. + * @return {number} The sum of the elements of the enumerable. + */ + getElementSum(selector:(arg:T)=>number):number; + /** + * Whether the enumerable contains any elements. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#notEmpty}. + * @return {boolean} Whether the enumerable contains any elements. + * @throws {yfiles.system.ArgumentNullException} e is null. + */ + enumerableContainsElements():boolean; + /** + * Whether the enumerable contains any elements matching the given predicate. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#any}. + * @param {function(T):boolean} predicate A function with the signature function(element):boolean + * which returns true if the element matches a condition. + * @return {boolean} Whether the enumerable contains any elements matching the given predicate. + * @throws {yfiles.system.ArgumentNullException} e is null. + * @throws {yfiles.system.ArgumentNullException} predicate is null. + */ + enumerableContainsMatch(predicate:(arg:T)=>boolean):boolean; + /** + * Whether all elements of the enumerable match the given predicate. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#every}. + * @param {function(T):boolean} predicate A function with the signature function(element):boolean + * which returns true if the element matches a condition. + * @return {boolean} Whether all elements of the enumerable match the given predicate. + * @throws {yfiles.system.ArgumentNullException} e is null. + * @throws {yfiles.system.ArgumentNullException} predicate is null. + */ + enumerableMatchesAll(predicate:(arg:T)=>boolean):boolean; + /** + * Projects each element of the enumeration into a new element. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#selectWithSelector}. + * @param {function(T):TResult} selector A function with the signature function(element):TResult + * which converts each element into a new element of the type TResult. + * @return {yfiles.collections.IEnumerable.} A projection of the original enumerable. + */ + getProjection(selector:(arg:T)=>TResult):yfiles.collections.IEnumerable; + /** + * Projects each element of the enumeration into a new element. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#select}. + * @param {function(T, number):TResult} selector A function with the signature function(element, index):TResult + * which converts each element into a new element of the type TResult depending on the element's index. + * @return {yfiles.collections.IEnumerable.} A projection of the original enumerable. + */ + getProjectionWithIndex(selector:(arg1:T,arg2:number)=>TResult):yfiles.collections.IEnumerable; + /** + * Returns an enumerable which contains the elements of the original enumerable in reverse order. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#reverse}. + * @return {yfiles.collections.IEnumerable.} An enumerable which contains the elements of the original enumerable in reverse order. + */ + getReversedEnumerable():yfiles.collections.IEnumerable; + /** + * Returns elements from an enumerable as long as the given predicate is true. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#takeWhile}. + * @param {function(T):boolean} predicate A function with the signature function(element):boolean + * which returns true as long as the elements should be added to the returned enumerable. + * @return {yfiles.collections.IEnumerable.} A subset of the original enumerable. + */ + getTakeWhileEnumerable(predicate:(arg:T)=>boolean):yfiles.collections.IEnumerable; + /** + * Applies an func function over the enumerable's elements. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#aggregate}. + * @param {TAccumulate} seed The start value for the accumulator. + * @param {function(TAccumulate, T):TAccumulate} func A function with the signature function(seed,element):TAccumulate which + * "adds" (accumulates) a value depending on the element to the seed value and returns the result. + * @return {TAccumulate} The final value of the accumulator. + */ + getAggregation(seed:TAccumulate,func:(arg1:TAccumulate,arg2:T)=>TAccumulate):TAccumulate; + } + var IEnumerable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Provides methods to iterate over a collection or list of elements of the same type. + */ + export interface IEnumerator extends Object,yfiles.system.IDisposable,yfiles.objectcollections.IEnumerator{ + /** + * Moves this enumerator to the next element. + * A newly created enumerator's {@link yfiles.collections.IEnumerator#current current position} is before the first element. Thus, this method + * must be called before first access to the {@link yfiles.collections.IEnumerator#current} property. The same applies to the state after + * calling {@link yfiles.collections.IEnumerator#reset}. + * @return {boolean} true if the enumerator was moved to a valid position + * @see Specified by {@link yfiles.collections.IEnumerator#moveNext}. + */ + moveNext():boolean; + /** + * Resets the enumerator to its starting state. + * In other words: sets the current position before the first element. + * @see Specified by {@link yfiles.collections.IEnumerator#reset}. + */ + reset():void; + /** + * Gets the element at the enumerator's current position. + * This value is undefined if the enumerator is in initial state (after creation or {@link yfiles.collections.IEnumerator#reset}) or has been moved past the + * end of the represented collection. + * @see Specified by {@link yfiles.collections.IEnumerator#current}. + */ + current:T; + } + var IEnumerator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An object which can compare other objects and calculate their hash codes. + * If two objects are equal, then they should have the same hash code. If they have the same + * hash code, they don't need to be equal. + */ + export interface IEqualityComparer extends Object{ + /** + * Whether the given objects are equal. + * @param {T} x The first object to compare. + * @param {T} y The second object to compare. + * @return {boolean} true if both objects are equal. + * @see Specified by {@link yfiles.collections.IEqualityComparer#itemsEqual}. + */ + itemsEqual(x:T,y:T):boolean; + /** + * Returns the hash code for the given object. + * For best performance when used in an {@link yfiles.objectcollections.IDictionary}, the hash code should + * be well distributed, i.e. there should be as many different hash codes for the targeted set of keys as possible. + * @param {T} obj The object to get the hash code for. + * @return {number} The hash code for the given object. + * @see Specified by {@link yfiles.collections.IEqualityComparer#getHashCode}. + */ + getHashCode(obj:T):number; + } + var IEqualityComparer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A read-only collection whose elements are of the same type. + */ + export interface ReadOnlyCollection extends Object,yfiles.collections.IList{ + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * Whether this collection is read-only. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:T[],arrayIndex:number):void; + /** + * Removes all items from this collection. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Removes the given item from this collection. + * @param {T} item The item to remove. + * @return {boolean} Whether the item was removed from the collection. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:T):boolean; + /** + * Adds the given item to the collection. + * @param {T} item + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:T):void; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @return {boolean} true if the given item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:T):boolean; + /** + * The index of the given item in the list. + * @param {T} item The item to search for. + * @return {number} The index of the given item in the list. -1 if the item is not in the list. + * @see Specified by {@link yfiles.collections.IList#indexOf}. + */ + indexOf(item:T):number; + /** + * Inserts the given item at the given index. + * @param {number} index The index to insert the item at. + * @param {T} item The item to insert. + * @see Specified by {@link yfiles.collections.IList#insert}. + */ + insert(index:number,item:T):void; + /** + * Removes the item at the given index from the list. + * @param {number} index The index of the item to remove. + * @see Specified by {@link yfiles.collections.IList#removeAt}. + */ + removeAt(index:number):void; + /** + * Gets or sets the item at the given index. + * @param {number} index The index of the item to access. + * @return {T} The item at the given index. + * @see Specified by {@link yfiles.collections.IList#get}. + */ + get(index:number):T; + /** + * Gets or sets the item at the given index. + * @param {number} index The index of the item to access. + * @return {T} The item at the given index. + * @see Specified by {@link yfiles.collections.IList#get}. + */ + set(index:number,value:T):void; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + } + var ReadOnlyCollection:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance which wraps the given list. + * @param {yfiles.collections.IList.} wrapped The list to wrap. + */ + new (wrapped:yfiles.collections.IList):yfiles.collections.ReadOnlyCollection; + }; + /** + * Abstract base class for {@link yfiles.collections.IEqualityComparer} implementations. + */ + export interface EqualityComparer extends Object,yfiles.collections.IEqualityComparer{ + /** + * Whether the given objects are equal. + * @param {T} x The first object to compare. + * @param {T} y The second object to compare. + * @return {boolean} true if both objects are equal. + * @see Specified by {@link yfiles.collections.IEqualityComparer#itemsEqual}. + */ + itemsEqual(x:T,y:T):boolean; + /** + * Returns the hash code for the given object. + * For best performance when used in an {@link yfiles.objectcollections.IDictionary}, the hash code should + * be well distributed, i.e. there should be as many different hash codes for the targeted set of keys as possible. + * @param {T} obj The object to get the hash code for. + * @return {number} The hash code for the given object. + * @see Specified by {@link yfiles.collections.IEqualityComparer#getHashCode}. + */ + getHashCode(obj:T):number; + } + var EqualityComparer:{ + $class:yfiles.lang.Class; + /** + * The default {@link yfiles.collections.IEqualityComparer} implementation which relies on an object's + * capabilities to compare itself to others and to calculate its own hash code. + */ + DEFAULT:yfiles.collections.IEqualityComparer; + }; + /** + * A collection of value objects which are mapped to key objects and can be queried using their keys. + * The keys must have a well defined hashCode method that must not change between registering a value for the key + * and retrieving a value using the key. + * Thus it is advisable to use stable, i.e. immutable, objects as the key. + */ + export interface IDictionary extends Object,yfiles.collections.ICollection>{ + /** + * Adds the given key / value pair to this dictionary. + * @param {TKey} key The key to which the given value should be mapped. + * @param {TValue} value The value which should be mapped to the given key. + * @see Specified by {@link yfiles.collections.IDictionary#addKeyValue}. + */ + addKeyValue(key:TKey,value:TValue):void; + /** + * Whether this dictionary's key collection contains the given key. + * @param {TKey} key The key to search for. + * @return {boolean} true if this dictionary contains the given key. + * @see Specified by {@link yfiles.collections.IDictionary#containsKey}. + */ + containsKey(key:TKey):boolean; + /** + * Removes the key/value pair which is represented by the given key. + * @param {TKey} key The key of the key/value pair to remove. + * @return {boolean} true if a key/value pair with the given key was removed from this collection. + * @see Specified by {@link yfiles.collections.IDictionary#removeKey}. + */ + removeKey(key:TKey):boolean; + /** + * Tries to get the value of the key/value pair with the given key. + * @param {TKey} key The key of the key/value pair to search for. + * @param {TValue} value A reference to store the value in if a key/value pair with the given key can be found. If not, this + * dictionary's default value is stored. + * @return {boolean} true if a key/value pair with the given key can be found. + * @see Specified by {@link yfiles.collections.IDictionary#tryGetValue}. + */ + tryGetValue(key:TKey,value:{value:TValue;}):boolean; + /** + * A {@link yfiles.collections.ICollection} of the keys of this dictionary. + * @see Specified by {@link yfiles.collections.IDictionary#keys}. + */ + keys:yfiles.collections.ICollection; + /** + * Gets or sets the value of the key/value pair with the given key. + * Setter: if there is already a key/value pair with the given key in the dictionary its value will be overridden. If not + * a new key/value pair will be added. + * Getter: if there is no key/value pair with the given key in this dictionary an exception will be thrown. + * @param {TKey} key + * @return {TValue} + * @throws {yfiles.system.KeyNotFoundException} (Getter only): The given key cannot be found in this dictionary. + * @see Specified by {@link yfiles.collections.IDictionary#get}. + */ + get(key:TKey):TValue; + /** + * Gets or sets the value of the key/value pair with the given key. + * Setter: if there is already a key/value pair with the given key in the dictionary its value will be overridden. If not + * a new key/value pair will be added. + * Getter: if there is no key/value pair with the given key in this dictionary an exception will be thrown. + * @param {TKey} key + * @return {TValue} + * @throws {yfiles.system.KeyNotFoundException} (Getter only): The given key cannot be found in this dictionary. + * @see Specified by {@link yfiles.collections.IDictionary#get}. + */ + put(key:TKey,value:TValue):void; + /** + * A {@link yfiles.collections.ICollection} of the values of this dictionary. + * @see Specified by {@link yfiles.collections.IDictionary#values}. + */ + values:yfiles.collections.ICollection; + } + var IDictionary:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The key/value pair of a {@link yfiles.collections.IDictionary}. + */ + export interface KeyValuePair extends Object{ + /** + * The key for this key/value pair. + */ + key:TKey; + /** + * The value for this key/value pair. + */ + value:TValue; + /** + * The next key/value pair. + */ + next:yfiles.collections.KeyValuePair; + } + var KeyValuePair:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with the given key and value. + * @param {TKey} key The key for this pair. + * @param {TValue} value The value for this pair. + */ + With:{ + new (key:TKey,value:TValue):yfiles.collections.KeyValuePair; + }; + /** + * Creates a new instance with the given key and value and another + * next to append to this instance. + * @param {TKey} key The key for this pair. + * @param {TValue} value The value for this pair. + * @param {yfiles.collections.KeyValuePair.} next The key/value pair to append. + */ + WithKeyValueAndNext:{ + new (key:TKey,value:TValue,next:yfiles.collections.KeyValuePair):yfiles.collections.KeyValuePair; + }; + }; + /** + * Defines methods to manipulate a collection of objects with the same type. + */ + export interface ICollection extends Object,yfiles.collections.IEnumerable{ + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * Whether this collection is read-only. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:T[],arrayIndex:number):void; + /** + * Removes all items from this collection. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Removes the given item from this collection. + * @param {T} item The item to remove. + * @return {boolean} Whether the item was removed from the collection. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:T):boolean; + /** + * Adds the given item to the collection. + * @param {T} item + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:T):void; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @return {boolean} true if the given item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:T):boolean; + } + var ICollection:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A read-write collection of objects of the same type. + */ + export interface IList extends Object,yfiles.collections.ICollection{ + /** + * The index of the given item in the list. + * @param {T} item The item to search for. + * @return {number} The index of the given item in the list. -1 if the item is not in the list. + * @see Specified by {@link yfiles.collections.IList#indexOf}. + */ + indexOf(item:T):number; + /** + * Inserts the given item at the given index. + * @param {number} index The index to insert the item at. + * @param {T} item The item to insert. + * @see Specified by {@link yfiles.collections.IList#insert}. + */ + insert(index:number,item:T):void; + /** + * Removes the item at the given index from the list. + * @param {number} index The index of the item to remove. + * @see Specified by {@link yfiles.collections.IList#removeAt}. + */ + removeAt(index:number):void; + /** + * Gets or sets the item at the given index. + * @param {number} index The index of the item to access. + * @return {T} The item at the given index. + * @see Specified by {@link yfiles.collections.IList#get}. + */ + get(index:number):T; + /** + * Gets or sets the item at the given index. + * @param {number} index The index of the item to access. + * @return {T} The item at the given index. + * @see Specified by {@link yfiles.collections.IList#get}. + */ + set(index:number,value:T):void; + } + var IList:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Default implementation of {@link yfiles.collections.IList}. + * This implementation provides fast random indexed access. However, removing or adding elements + * from the beginning or in the middle of the list will slower. + */ + export interface List extends Object,yfiles.collections.IList,yfiles.objectcollections.IList{ + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an enumerator which allows to iterate over this list's elements. + * @return {yfiles.collections.List.Enumerator.} An enumerator for this list. + */ + getListEnumerator():yfiles.collections.List.Enumerator; + /** + * Adds the given item to the collection. + * @param {T} item + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:T):void; + /** + * Removes all items from this collection. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @return {boolean} true if the given item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:T):boolean; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:T[],arrayIndex:number):void; + /** + * Removes the given item from this collection. + * @param {T} item The item to remove. + * @return {boolean} Whether the item was removed from the collection. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:T):boolean; + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * Whether this collection is read-only. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * The index of the given item in the list. + * @param {T} item The item to search for. + * @return {number} The index of the given item in the list. -1 if the item is not in the list. + * @see Specified by {@link yfiles.collections.IList#indexOf}. + */ + indexOf(item:T):number; + /** + * Inserts the given item at the given index. + * @param {number} index The index to insert the item at. + * @param {T} item The item to insert. + * @see Specified by {@link yfiles.collections.IList#insert}. + */ + insert(index:number,item:T):void; + /** + * Removes the item at the given index from the list. + * @param {number} index The index of the item to remove. + * @see Specified by {@link yfiles.collections.IList#removeAt}. + */ + removeAt(index:number):void; + /** + * Gets or sets the object at the given index. + * @param {number} index The index of the object to access. + * @return {Object} The object at the given index. + * @see Specified by {@link yfiles.objectcollections.IList#getObject}. + */ + getObject(index:number):Object; + /** + * Gets or sets the object at the given index. + * @param {number} index The index of the object to access. + * @return {Object} The object at the given index. + * @see Specified by {@link yfiles.objectcollections.IList#getObject}. + */ + setObject(index:number,value:Object):void; + /** + * Gets or sets the item at the given index. + * @param {number} index The index of the item to access. + * @return {T} The item at the given index. + * @see Specified by {@link yfiles.collections.IList#get}. + */ + get(index:number):T; + /** + * Gets or sets the item at the given index. + * @param {number} index The index of the item to access. + * @return {T} The item at the given index. + * @see Specified by {@link yfiles.collections.IList#get}. + */ + set(index:number,value:T):void; + /** + * Adds the given object at the end of the list. + * @param {Object} value The object to add. + * @return {number} The index of the added object. + * @see Specified by {@link yfiles.objectcollections.IList#addWithValue}. + */ + addWithValue(value:Object):number; + /** + * Whether this list contains the given object. + * @param {Object} value The object to search for. + * @return {boolean} true if the given object is contained in the list. + * @see Specified by {@link yfiles.objectcollections.IList#containsValue}. + */ + containsValue(value:Object):boolean; + /** + * Determines the index of the given item in the {@link yfiles.objectcollections.IList}. + * @param {Object} item The object to get the index for + * @return {number} The index of the given item. -1 if the item is not in the list. + * @see Specified by {@link yfiles.objectcollections.IList#indexOfItem}. + */ + indexOfItem(value:Object):number; + /** + * Inserts the given item at the given index. + * @param {number} index The index at which the item should be inserted. + * @param {Object} item The item to insert. + * @see Specified by {@link yfiles.objectcollections.IList#insertAt}. + */ + insertAt(index:number,value:Object):void; + /** + * Removes the given object from the list. + * @param {Object} value The object to remove. + * @see Specified by {@link yfiles.objectcollections.IList#removeValue}. + */ + removeValue(value:Object):void; + /** + * Copies the elements of this collection into the given array starting at the given arrayIndex. + * @param {Object} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.objectcollections.ICollection#copyTo}. + */ + copyTo(array:Object,index:number):void; + /** + * @see Specified by {@link yfiles.objectcollections.ICollection#syncRoot}. + */ + syncRoot:Object; + /** + * @see Specified by {@link yfiles.objectcollections.ICollection#isSynchronized}. + */ + isSynchronized:boolean; + /** + * Whether the collection has a fixed size. + * @see Specified by {@link yfiles.objectcollections.IList#isFixedSize}. + */ + isFixedSize:boolean; + /** + * Adds the elements of the given collection to this list. + * @param {yfiles.collections.IEnumerable.} collection The collection to add. + */ + addRange(collection:yfiles.collections.IEnumerable):void; + /** + * Returns a read-only representation of this list. + * @return {yfiles.collections.ReadOnlyCollection.} A read-only representation of this list. + */ + asReadOnly():yfiles.collections.ReadOnlyCollection; + /** + * Searches the (sorted) list for the given item. + * This search is done as a binary search, therefore the list must be sorted. The given comparer is used to compare + * the elements to each other. + * @param {T} item The item to search for. + * @param {yfiles.collections.IComparer.} comparer The comparer to use for comparing the elements. + * @return {number} The index of the item in the list. -1 if the item is not found. + */ + binarySearch(item:T,comparer:yfiles.collections.IComparer):number; + capacity:number; + /** + * Searches the list for the first element for which match returns true. + * @param {function(T):boolean} match A predicate function with the signature function(o:Object):boolean which returns + * true if o matches the conditions of the element to search for. + * @return {T} The first element for which match returns true or the default value for T + * if there is no such element in the list. + */ + find(match:(obj:T)=>boolean):T; + /** + * Searches the list for the first element for which match returns true and returns its index. + * @param {function(T):boolean} match A predicate function with the signature function(o:Object):boolean which returns + * true if o matches the conditions of the element to search for. + * @return {number} The index of the first element for which match returns true or -1 + * if there is no such element in the list. + */ + findIndex(match:(obj:T)=>boolean):number; + /** + * Removes all elements for which match returns true. + * @param {function(T):boolean} match A predicate function with the signature function(o:Object):boolean which returns + * true if o matches the conditions of the element to search for. + * @return {number} The number of elements which were removed. + */ + removeAll(match:(obj:T)=>boolean):number; + /** + * Removes a given count of elements starting from the given index. + * @param {number} index The index of the first element to remove. + * @param {number} count The number of elements to remove. + */ + removeRange(index:number,count:number):void; + /** + * Reverses the order of the elements in the list. + */ + reverse():void; + /** + * Sorts all elements in list using the default comparer. + */ + naturalSort():void; + /** + * Sorts all elements in the list using the given comparer. + * @param {yfiles.collections.IComparer.} comparer The comparer to use. + */ + sort(comparer:yfiles.collections.IComparer):void; + sortWithComparison(comparison:(arg1:Object,arg2:Object)=>number):void; + /** + * Copies the elements of this list into an array. + * @return {T[]} An array containing the elements of this list. + */ + toArray():T[]; + /** + * Copies the elements of the {@link yfiles.collections.List} to the given array. + * @param {T[]} array + */ + copyToArray(array:T[]):void; + } + export module List{ + /** + * An {@link yfiles.collections.IEnumerator} which allows to iterate over the elements of this list. + */ + export interface Enumerator extends Object,yfiles.collections.IEnumerator{ + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Moves this enumerator to the next element. + * A newly created enumerator's {@link yfiles.objectcollections.IEnumerator#currentObject current position} is before the first element. Thus, this method + * must be called before first access to the {@link yfiles.objectcollections.IEnumerator#currentObject} property. The same applies to the state after + * calling {@link yfiles.objectcollections.IEnumerator#reset}. + * @return {boolean} true if the enumerator was moved to a valid position + * @see Specified by {@link yfiles.objectcollections.IEnumerator#moveNext}. + */ + moveNext():boolean; + /** + * Resets the enumerator to its starting state. + * In other words: sets the current position before the first element. + * @see Specified by {@link yfiles.objectcollections.IEnumerator#reset}. + */ + reset():void; + /** + * Gets the element at the enumerator's current position. + * This value is undefined if the enumerator is in initial state (after creation or {@link yfiles.collections.IEnumerator#reset}) or has been moved past the + * end of the represented collection. + * @see Specified by {@link yfiles.collections.IEnumerator#current}. + */ + current:T; + } + } + var List:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + */ + new ():yfiles.collections.List; + /** + * Creates a new instance with the given initialCapacity. + * @param {number} initialCapacity The initial capacity of the list. Not used here. + */ + WithCapacity:{ + new (initialCapacity:number):yfiles.collections.List; + }; + /** + * Creates a new instance and fills it with the elements of the given enumerable. + * @param {yfiles.collections.IEnumerable.} enumerable The enumerable to fill the list with. + */ + FromEnumerable:{ + new (enumerable:yfiles.collections.IEnumerable):yfiles.collections.List; + }; + /** + * Creates a new list with the given array. + * @param {T[]} array The array to create a list from. + * @return {yfiles.collections.List.} A list backed by the given array. + */ + fromArray(array:T[]):yfiles.collections.List; + Enumerator:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance for the given list. + * @param {yfiles.collections.List.} list The list to iterate over. + */ + new (list:yfiles.collections.List):yfiles.collections.List; + }; + }; + /** + * An {@link yfiles.collections.ICollection} that obeys the 'set' semantics. + * An item can only be contained once in the same set. + * This implementation is based on hash values and equality checks and + * does support null elements. + */ + export interface HashSet extends Object,yfiles.collections.ICollection{ + /** + * Adds the given item to this set. + * If the item is already contained in this set, it will not be added. Besides the return type, this method and + * {@link yfiles.collections.HashSet#addIfNew} do the same. + * @param {T} item The item to add. + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:T):void; + /** + * Adds the given item to this set. + * If the item is already contained in this set, it will not be added. Besides the return type, this method and + * {@link yfiles.collections.HashSet#add} do the same. + * @param {T} item The item to add. + * @return {boolean} true if the item was added; false if the item was already contained in this set. + */ + addIfNew(item:T):boolean; + /** + * Removes all items from this collection. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @return {boolean} true if the given item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:T):boolean; + /** + * Adds a range of elements to this set. + */ + addRange(elements:yfiles.collections.IEnumerable):void; + /** + * Adds a range of elements to this set. + */ + addRangeWithEnumerator(elements:yfiles.collections.IEnumerator):void; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:T[],arrayIndex:number):void; + /** + * Removes the given item from this collection. + * @param {T} item The item to remove. + * @return {boolean} Whether the item was removed from the collection. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:T):boolean; + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * Whether this collection is read-only. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Adds all items from the enumerable to this instance. + * @param {yfiles.collections.IEnumerable.} enumerable The enumerable. + */ + unionWith(enumerable:yfiles.collections.IEnumerable):void; + } + var HashSet:{ + $class:yfiles.lang.Class; + /** + * Creates a new empty hash set. + */ + new ():yfiles.collections.HashSet; + /** + * Creates a new hash set using the elements to initialize the set. + */ + FromEnumerable:{ + new (elements:yfiles.collections.IEnumerable):yfiles.collections.HashSet; + }; + /** + * Creates a new hash set using the elements to initialize the set. + */ + FromEnumerator:{ + new (elements:yfiles.collections.IEnumerator):yfiles.collections.HashSet; + }; + }; + /** + * The default implementation for {@link yfiles.collections.IDictionary}. + */ + export interface Dictionary extends Object,yfiles.collections.IDictionary,yfiles.collections.ICollection>,yfiles.collections.IEnumerable>,yfiles.objectcollections.IDictionary,yfiles.objectcollections.ICollection,yfiles.objectcollections.IEnumerable{ + /** + * Removes the key/value pair which is represented by the given key. + * @param {Object} key The key of the key/value pair to remove. + * @see Specified by {@link yfiles.objectcollections.IDictionary#removeWithKey}. + */ + removeWithKey(key:Object):void; + /** + * Gets or sets the {@link Object} with the specified key. + * @see Specified by {@link yfiles.objectcollections.IDictionary#getObject}. + */ + getObject(key:Object):Object; + /** + * Gets or sets the {@link Object} with the specified key. + * @see Specified by {@link yfiles.objectcollections.IDictionary#getObject}. + */ + putObject(key:Object,value:Object):void; + /** + * Returns an enumerator that iterates through a collection. + * @return {yfiles.collections.IEnumerator.>} An yfiles.system.IEnumerator object that can be used to iterate through the collection. + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator>; + /** + * Returns an enumerator that iterates through a collection. + * @return {yfiles.objectcollections.IDictionaryEnumerator} An yfiles.system.IEnumerator object that can be used to iterate through the collection. + * @see Specified by {@link yfiles.objectcollections.IDictionary#getDictionaryEnumerator}. + */ + getDictionaryEnumerator():yfiles.objectcollections.IDictionaryEnumerator; + /** + * Returns an enumerator that iterates through a collection. + * @return {yfiles.objectcollections.IEnumerator} An yfiles.system.IEnumerator object that can be used to iterate through the collection. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Copies the elements of this collection into the given array starting at the given arrayIndex. + * @param {Object} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.objectcollections.ICollection#copyTo}. + */ + copyTo(array:Object,index:number):void; + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * @see Specified by {@link yfiles.objectcollections.ICollection#syncRoot}. + */ + syncRoot:Object; + /** + * @see Specified by {@link yfiles.objectcollections.ICollection#isSynchronized}. + */ + isSynchronized:boolean; + /** + * Whether this collection is read-only. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Whether this dictionary has a fixed size. + * @see Specified by {@link yfiles.objectcollections.IDictionary#isFixedSize}. + */ + isFixedSize:boolean; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:yfiles.collections.KeyValuePair[],arrayIndex:number):void; + /** + * Whether this dictionary's key collection contains the given value. + * @param {Object} value The value to search for. + * @return {boolean} true if this dictionary contains the given value. + * @see Specified by {@link yfiles.objectcollections.IDictionary#containsWithValue}. + */ + containsWithValue(key:Object):boolean; + /** + * Adds the given key / value pair to this dictionary. + * @param {Object} key The key to which the given value should be mapped. + * @param {Object} value The value which should be mapped to the given key. + * @see Specified by {@link yfiles.objectcollections.IDictionary#addWithKeyAndValue}. + */ + addWithKeyAndValue(key:Object,value:Object):void; + /** + * Removes all items from this collection. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Removes the given item from this collection. + * @param {T} item The item to remove. + * @return {boolean} Whether the item was removed from the collection. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:yfiles.collections.KeyValuePair):boolean; + /** + * Adds the given item to the collection. + * @param {T} item + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:yfiles.collections.KeyValuePair):void; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @return {boolean} true if the given item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:yfiles.collections.KeyValuePair):boolean; + /** + * Adds the given key / value pair to this dictionary. + * @param {TKey} key The key to which the given value should be mapped. + * @param {TValue} value The value which should be mapped to the given key. + * @see Specified by {@link yfiles.collections.IDictionary#addKeyValue}. + */ + addKeyValue(key:TKey,value:TValue):void; + /** + * Whether this dictionary's key collection contains the given key. + * @param {TKey} key The key to search for. + * @return {boolean} true if this dictionary contains the given key. + * @see Specified by {@link yfiles.collections.IDictionary#containsKey}. + */ + containsKey(key:TKey):boolean; + /** + * Whether this dictionary contains the given value. + * @param {TValue} value The value to search for. + * @return {boolean} true if this dictionary contains the given value. + */ + containsValue(value:TValue):boolean; + /** + * Removes the key/value pair which is represented by the given key. + * @param {TKey} key The key of the key/value pair to remove. + * @return {boolean} true if a key/value pair with the given key was removed from this collection. + * @see Specified by {@link yfiles.collections.IDictionary#removeKey}. + */ + removeKey(key:TKey):boolean; + /** + * Tries to get the value of the key/value pair with the given key. + * @param {TKey} key The key of the key/value pair to search for. + * @param {TValue} value A reference to store the value in if a key/value pair with the given key can be found. If not, this + * dictionary's default value is stored. + * @return {boolean} true if a key/value pair with the given key can be found. + * @see Specified by {@link yfiles.collections.IDictionary#tryGetValue}. + */ + tryGetValue(key:TKey,value:{value:TValue;}):boolean; + /** + * A {@link yfiles.collections.ICollection} of the keys of this dictionary. + * @see Specified by {@link yfiles.collections.IDictionary#keys}. + */ + keys:yfiles.collections.ICollection; + /** + * Gets or sets the value of the key/value pair with the given key. + * Setter: if there is already a key/value pair with the given key in the dictionary its value will be overridden. If not + * a new key/value pair will be added. + * Getter: if there is no key/value pair with the given key in this dictionary an exception will be thrown. + * @param {TKey} key + * @return {TValue} + * @throws {yfiles.system.KeyNotFoundException} (Getter only): The given key cannot be found in this dictionary. + * @see Specified by {@link yfiles.collections.IDictionary#get}. + */ + get(key:TKey):TValue; + /** + * Gets or sets the value of the key/value pair with the given key. + * Setter: if there is already a key/value pair with the given key in the dictionary its value will be overridden. If not + * a new key/value pair will be added. + * Getter: if there is no key/value pair with the given key in this dictionary an exception will be thrown. + * @param {TKey} key + * @return {TValue} + * @throws {yfiles.system.KeyNotFoundException} (Getter only): The given key cannot be found in this dictionary. + * @see Specified by {@link yfiles.collections.IDictionary#get}. + */ + put(key:TKey,value:TValue):void; + /** + * A {@link yfiles.collections.ICollection} of the values of this dictionary. + * @see Specified by {@link yfiles.collections.IDictionary#values}. + */ + values:yfiles.collections.ICollection; + } + export module Dictionary{ + /** + * The {@link yfiles.objectcollections.IDictionaryEnumerator} implementation for {@link yfiles.collections.Dictionary}. + */ + export interface DictionaryEnumerator extends Object,yfiles.objectcollections.IDictionaryEnumerator,yfiles.collections.IEnumerator>{ + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Moves this enumerator to the next element. + * A newly created enumerator's {@link yfiles.objectcollections.IEnumerator#currentObject current position} is before the first element. Thus, this method + * must be called before first access to the {@link yfiles.objectcollections.IEnumerator#currentObject} property. The same applies to the state after + * calling {@link yfiles.objectcollections.IEnumerator#reset}. + * @return {boolean} true if the enumerator was moved to a valid position + * @see Specified by {@link yfiles.objectcollections.IEnumerator#moveNext}. + */ + moveNext():boolean; + /** + * Resets the enumerator to its starting state. + * In other words: sets the current position before the first element. + * @see Specified by {@link yfiles.objectcollections.IEnumerator#reset}. + */ + reset():void; + /** + * Gets the element at the enumerator's current position. + * This value is undefined if the enumerator is in initial state (after creation or {@link yfiles.collections.IEnumerator#reset}) or has been moved past the + * end of the represented collection. + * @see Specified by {@link yfiles.collections.IEnumerator#current}. + */ + current:yfiles.collections.KeyValuePair; + /** + * The key of the {@link yfiles.objectcollections.IEnumerator#currentObject current key/value pair}. + * @see Specified by {@link yfiles.objectcollections.IDictionaryEnumerator#key}. + */ + key:Object; + /** + * The value of the {@link yfiles.objectcollections.IEnumerator#currentObject current key/value pair}. + * @see Specified by {@link yfiles.objectcollections.IDictionaryEnumerator#value}. + */ + value:Object; + } + /** + * The key {@link yfiles.collections.ICollection collection} of a {@link yfiles.collections.Dictionary}. + */ + export interface DictionaryKeyCollection extends Object,yfiles.collections.ICollection{ + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * Whether this collection is read-only. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:TKey[],arrayIndex:number):void; + /** + * Removes all items from this collection. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Removes the given item from this collection. + * @param {T} item The item to remove. + * @return {boolean} Whether the item was removed from the collection. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:TKey):boolean; + /** + * Adds the given item to the collection. + * @param {T} item + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:TKey):void; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @return {boolean} true if the given item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:TKey):boolean; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Gets an enumerator which iterates over the keys in this collection. + * @return {yfiles.collections.Dictionary.DictionaryKeyEnumerator.} An enumerator which iterates over the keys in this collection. + */ + getKeyCollectionEnumerator():yfiles.collections.Dictionary.DictionaryKeyEnumerator; + } + /** + * An {@link yfiles.collections.IEnumerator} which iterates over the keys of a {@link yfiles.collections.Dictionary.DictionaryKeyCollection}. + */ + export interface DictionaryKeyEnumerator extends Object,yfiles.collections.IEnumerator{ + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Moves this enumerator to the next element. + * A newly created enumerator's {@link yfiles.objectcollections.IEnumerator#currentObject current position} is before the first element. Thus, this method + * must be called before first access to the {@link yfiles.objectcollections.IEnumerator#currentObject} property. The same applies to the state after + * calling {@link yfiles.objectcollections.IEnumerator#reset}. + * @return {boolean} true if the enumerator was moved to a valid position + * @see Specified by {@link yfiles.objectcollections.IEnumerator#moveNext}. + */ + moveNext():boolean; + /** + * Resets the enumerator to its starting state. + * In other words: sets the current position before the first element. + * @see Specified by {@link yfiles.objectcollections.IEnumerator#reset}. + */ + reset():void; + /** + * Gets the element at the enumerator's current position. + * This value is undefined if the enumerator is in initial state (after creation or {@link yfiles.collections.IEnumerator#reset}) or has been moved past the + * end of the represented collection. + * @see Specified by {@link yfiles.collections.IEnumerator#current}. + */ + current:TKey; + } + /** + * A collection of the values of a {@link yfiles.collections.Dictionary}. + */ + export interface DictionaryValueCollection extends Object,yfiles.collections.ICollection{ + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * Whether this collection is read-only. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:TValue[],arrayIndex:number):void; + /** + * Removes all items from this collection. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Removes the given item from this collection. + * @param {T} item The item to remove. + * @return {boolean} Whether the item was removed from the collection. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:TValue):boolean; + /** + * Adds the given item to the collection. + * @param {T} item + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:TValue):void; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @return {boolean} true if the given item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:TValue):boolean; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Gets an enumerator which iterates over the values in this collection. + * @return {yfiles.collections.Dictionary.DictionaryValueEnumerator.} An enumerator which iterates over the values in this collection. + */ + getValueCollectionEnumerator():yfiles.collections.Dictionary.DictionaryValueEnumerator; + } + /** + * An {@link yfiles.collections.IEnumerator} which iterates over the values of a {@link yfiles.collections.Dictionary.DictionaryValueCollection}. + */ + export interface DictionaryValueEnumerator extends Object,yfiles.collections.IEnumerator{ + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Moves this enumerator to the next element. + * A newly created enumerator's {@link yfiles.objectcollections.IEnumerator#currentObject current position} is before the first element. Thus, this method + * must be called before first access to the {@link yfiles.objectcollections.IEnumerator#currentObject} property. The same applies to the state after + * calling {@link yfiles.objectcollections.IEnumerator#reset}. + * @return {boolean} true if the enumerator was moved to a valid position + * @see Specified by {@link yfiles.objectcollections.IEnumerator#moveNext}. + */ + moveNext():boolean; + /** + * Resets the enumerator to its starting state. + * In other words: sets the current position before the first element. + * @see Specified by {@link yfiles.objectcollections.IEnumerator#reset}. + */ + reset():void; + /** + * Gets the element at the enumerator's current position. + * This value is undefined if the enumerator is in initial state (after creation or {@link yfiles.collections.IEnumerator#reset}) or has been moved past the + * end of the represented collection. + * @see Specified by {@link yfiles.collections.IEnumerator#current}. + */ + current:TValue; + /** + * The current value of this enumerator. + */ + currentDictionaryObject:Object; + } + } + var Dictionary:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + */ + new ():yfiles.collections.Dictionary; + /** + * Creates a new instance with the given initial capacity. + * The actual capacity is ignored since it doesn't matter for this implementation. + * @param {number} capacity The initial capacity of this dictionary. + */ + WithCapacity:{ + new (capacity:number):yfiles.collections.Dictionary; + }; + /** + * Creates a new instance with the given {@link yfiles.collections.IEqualityComparer} to compare the keys. + * @param {yfiles.collections.IEqualityComparer.} equalityComparer The {@link yfiles.collections.IEqualityComparer} used to compare the keys. + */ + WithEqualityComparer:{ + new (equalityComparer:yfiles.collections.IEqualityComparer):yfiles.collections.Dictionary; + }; + DictionaryEnumerator:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance for the given dictionary. + * @param {yfiles.collections.Dictionary.} dict The dictionary to iterate over. + */ + new (dict:yfiles.collections.Dictionary):yfiles.collections.Dictionary; + }; + DictionaryKeyCollection:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance for the given dictionary. + * @param {yfiles.collections.Dictionary.} dict The dictionary to create this key collection for. + */ + new (dict:yfiles.collections.Dictionary):yfiles.collections.Dictionary; + }; + DictionaryKeyEnumerator:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance which is backed by the given {@link yfiles.collections.Dictionary.DictionaryEnumerator}. + * @param {yfiles.collections.Dictionary.DictionaryEnumerator.} dict The {@link yfiles.collections.Dictionary.DictionaryEnumerator} which is used as backing enumerator. + */ + new (dict:yfiles.collections.Dictionary.DictionaryEnumerator):yfiles.collections.Dictionary; + }; + DictionaryValueCollection:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance for the given dictionary. + * @param {yfiles.collections.Dictionary.} dict The dictionary to create this value collection for. + */ + new (dict:yfiles.collections.Dictionary):yfiles.collections.Dictionary; + }; + DictionaryValueEnumerator:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance which is backed by the given {@link yfiles.collections.Dictionary.DictionaryEnumerator}. + * @param {yfiles.collections.Dictionary.DictionaryEnumerator.} dict The {@link yfiles.collections.Dictionary.DictionaryEnumerator} which is used to iterate over a dictionary's values. + */ + new (dict:yfiles.collections.Dictionary.DictionaryEnumerator):yfiles.collections.Dictionary; + }; + }; + /** + * Provides static helper methods which facilitate the handling of {@link yfiles.collections.IEnumerable enumerables}. + */ + export interface EnumerableExtensions extends Object{ + } + var EnumerableExtensions:{ + $class:yfiles.lang.Class; + /** + * Whether the given value is contained in the enumerable. + * The {@link yfiles.collections.EqualityComparer#DEFAULT default equality comparer} is used to compare + * the enumerable's contents with the given value. + * @param {yfiles.collections.IEnumerable.} e The enumerable to search. + * @param {TSource} value The value to search for. + * @return {boolean} true if the enumerable contains the given value. + */ + enumeratorContains(e:yfiles.collections.IEnumerable,value:TSource):boolean; + /** + * Returns the element at the given index in the enumerable. + * @param {yfiles.collections.IEnumerable.} e The enumerable to search. + * @param {number} index The index of the element to return. + * @return {TSource} The element at the given index. + * @throws {yfiles.system.ArgumentException} If the index is not within the enumerable's range. + */ + elementAt(e:yfiles.collections.IEnumerable,index:number):TSource; + /** + * Iterates over the enumerable and invokes the action for each element passing the value as an argument. + * @param {yfiles.collections.IEnumerable.} e The enumerable to iterate over. + * @param {function(T)} action The delegate to call. + */ + forEach(e:yfiles.collections.IEnumerable,action:(obj:T)=> void):void; + /** + * Iterates over the enumerable and invokes the action for each element passing the value and index as arguments. + * @param {yfiles.collections.IEnumerable.} e The enumerable to iterate over. + * @param {function(T, number)} action The delegate to call. + */ + forEachWithIndex(e:yfiles.collections.IEnumerable,action:(arg1:T,arg2:number)=> void):void; + /** + * Returns the number of elements contained in the enumerable. + * @param {yfiles.collections.IEnumerable.} e The enumerable to count. + * @return {number} The number of elements contained in the enumerable. + */ + count(e:yfiles.collections.IEnumerable):number; + /** + * Returns the first element of the enumerable. + * @param {yfiles.collections.IEnumerable.} e The enumerable to return the first element for. + * @return {TSource} The first element of the enumerable. + * @throws {yfiles.system.ArgumentNullException} If the given enumerable is null. + * @throws {yfiles.system.InvalidOperationException} If the enumerable is empty. + */ + getFirstElement(e:yfiles.collections.IEnumerable):TSource; + /** + * Returns the first element of the enumerable which matches a given filter. + * @param {yfiles.collections.IEnumerable.} e The enumerable to return the first element for. + * @param {function(TSource):boolean} predicate A function with the signature function(element):boolean which returns + * true if the given element should be returned + * @return {TSource} The first matching element of the enumerable. + * @throws {yfiles.system.ArgumentNullException} If the given enumerable is null. + * @throws {yfiles.system.InvalidOperationException} If the enumerable does not contain a matching element. + */ + getFirstElementWithPredicate(e:yfiles.collections.IEnumerable,predicate:(arg:TSource)=>boolean):TSource; + /** + * Returns the first element of the enumerable or the default for the enumerable's element type if the enumerable is empty. + * @param {yfiles.collections.IEnumerable.} e The enumerable to return the first element for. + * @return {TSource} The first element of the enumerable or the default value for TSource. + * @throws {yfiles.system.ArgumentNullException} If the given enumerable is null. + */ + getFirstElementOrDefault(e:yfiles.collections.IEnumerable):TSource; + /** + * Returns the first element of the enumerable which matches a given filter + * or the default for the enumerable's element type if there is no such element. + * @param {yfiles.collections.IEnumerable.} e The enumerable to return the first element for. + * @param {function(TSource):boolean} predicate A function with the signature function(element):boolean which returns + * true if the given element should be returned + * @return {TSource} The first element of the enumerable or the default value for TSource. + * @throws {yfiles.system.ArgumentNullException} If the given enumerable is null. + */ + getFirstElementOrDefaultWithPredicate(e:yfiles.collections.IEnumerable,predicate:(arg:TSource)=>boolean):TSource; + /** + * Returns the last element of the enumerable or the default for the enumerable's element type if the enumerable is empty. + * @param {yfiles.collections.IEnumerable.} e The enumerable to return the last element for. + * @return {TSource} The last element of the enumerable or the default value for TSource. + * @throws {yfiles.system.ArgumentNullException} If the given enumerable is null. + */ + getLastElementOrDefault(e:yfiles.collections.IEnumerable):TSource; + /** + * Returns the last element of the enumerable. + * @param {yfiles.collections.IEnumerable.} e The enumerable to return the last element for. + * @return {TSource} The last element of the enumerable. + * @throws {yfiles.system.ArgumentNullException} If the given enumerable is null. + * @throws {yfiles.system.InvalidOperationException} If the enumerable is empty. + */ + getLastElement(e:yfiles.collections.IEnumerable):TSource; + /** + * Converts a untyped enumerable into an enumerable with the given type. + * The source enumerable may contain elements which are not of the given type. + * Those elements will not be contained in the returned enumerable. + * @param {yfiles.objectcollections.IEnumerable} e The enumerable to convert. + * @return {yfiles.collections.IEnumerable.} A typed enumerable. + */ + ofType(type:yfiles.lang.Class,e:yfiles.objectcollections.IEnumerable):yfiles.collections.IEnumerable; + /** + * Returns an enumerable which only contains elements of the source enumerable which match a given predicate. + * @param {yfiles.collections.IEnumerable.} e The source enumerable. + * @param {function(Object):boolean} predicate A function with the signature function(element):boolean which returns + * true if the given element should be included in the resulting enumerable. + * @return {yfiles.collections.IEnumerable.} An enumerable which contains the elements of the source enumeration which match the given predicate. + */ + where(e:yfiles.collections.IEnumerable,predicate:(arg:Object)=>boolean):yfiles.collections.IEnumerable; + /** + * Creates a flattened view of a given enumerable using the given selector function which returns + * an enumerable for each element of the source enumerable. + * @param {yfiles.collections.IEnumerable.} e The source enumerable. + * @param {function(TSource):yfiles.collections.IEnumerable.} selector A function with the signature function(element):IEnumerable which returns + * an enumerable for each element of the source enumerable. + * @return {yfiles.collections.IEnumerable.} A flattened view of the given enumerable. The enumerables which are returned by the selector + * method for each element are concatenated in the result. + */ + selectMany(e:yfiles.collections.IEnumerable,selector:(arg:TSource)=>yfiles.collections.IEnumerable):yfiles.collections.IEnumerable; + /** + * Creates an array with the values of the enumerable. + * @param {yfiles.collections.IEnumerable.} e The source enumerable to create the array from. + * @return {TSource[]} An array with the enumerable's elements. + */ + toArray(e:yfiles.collections.IEnumerable):TSource[]; + /** + * Creates a {@link yfiles.collections.List} with the values of the enumerable. + * @param {yfiles.collections.IEnumerable.} e The source enumerable to create the {@link yfiles.collections.List} from. + * @return {yfiles.collections.List.} An {@link yfiles.collections.List} with the enumerable's elements. + */ + toList(e:yfiles.collections.IEnumerable):yfiles.collections.List; + /** + * Calculates the sum of the elements of the enumerable. + * @param {yfiles.collections.IEnumerable.} e The enumerable to calculate the sum for. + * @param {function(TSource):number} selector A function with the signature function(element):Number + * which returns a numeric value for the given element. + * @return {number} The sum of the elements of the enumerable. + */ + sum(e:yfiles.collections.IEnumerable,selector:(arg:TSource)=>number):number; + /** + * Casts the elements of the enumerable to the specified type and returns a typed {@link yfiles.collections.IEnumerable}. + * This method is kept for compatibility reasons. + * As JavaScript does not require casting this method returns the original enumerable. + * @param {yfiles.objectcollections.IEnumerable} source The enumerable to cast the elements. + * @return {yfiles.collections.IEnumerable.} This implementation returns the original enumerable. + */ + cast(source:yfiles.objectcollections.IEnumerable):yfiles.collections.IEnumerable; + /** + * Whether the enumerable contains any elements. + * @param {yfiles.collections.IEnumerable.} e The enumerable to search. + * @return {boolean} Whether the enumerable contains any elements. + * @throws {yfiles.system.ArgumentNullException} e is null. + */ + notEmpty(e:yfiles.collections.IEnumerable):boolean; + /** + * Whether the enumerable contains any elements matching the given predicate. + * @param {yfiles.collections.IEnumerable.} e The enumerable to search. + * @param {function(TSource):boolean} predicate A function with the signature function(element):boolean + * which returns true if the element matches a condition. + * @return {boolean} Whether the enumerable contains any elements matching the given predicate. + * @throws {yfiles.system.ArgumentNullException} e is null. + * @throws {yfiles.system.ArgumentNullException} predicate is null. + */ + any(e:yfiles.collections.IEnumerable,predicate:(arg:TSource)=>boolean):boolean; + /** + * Whether all elements of the enumerable match the given predicate. + * @param {yfiles.collections.IEnumerable.} e The enumerable to search. + * @param {function(TSource):boolean} predicate A function with the signature function(element):boolean + * which returns true if the element matches a condition. + * @return {boolean} Whether all elements of the enumerable match the given predicate. + * @throws {yfiles.system.ArgumentNullException} e is null. + * @throws {yfiles.system.ArgumentNullException} predicate is null. + */ + every(e:yfiles.collections.IEnumerable,predicate:(arg:TSource)=>boolean):boolean; + /** + * Projects each element of the enumeration into a new element. + * @param {yfiles.collections.IEnumerable.} source The enumerable to create the projection for. + * @param {function(TSource):TResult} selector A function with the signature function(element):TResult + * which converts each element into a new element of the type TResult. + * @return {yfiles.collections.IEnumerable.} A projection of the original enumerable. + */ + selectWithSelector(source:yfiles.collections.IEnumerable,selector:(arg:TSource)=>TResult):yfiles.collections.IEnumerable; + /** + * Projects each element of the enumeration into a new element. + * @param {yfiles.collections.IEnumerable.} source The enumerable to create the projection for. + * @param {function(TSource, number):TResult} selector A function with the signature function(element, index):TResult + * which converts each element into a new element of the type TResult depending on the element's index. + * @return {yfiles.collections.IEnumerable.} A projection of the original enumerable. + */ + select(source:yfiles.collections.IEnumerable,selector:(arg1:TSource,arg2:number)=>TResult):yfiles.collections.IEnumerable; + /** + * Returns an enumerable which contains the elements of the original enumerable in reverse order. + * @param {yfiles.collections.IEnumerable.} source The enumerable to revert. + * @return {yfiles.collections.IEnumerable.} An enumerable which contains the elements of the original enumerable in reverse order. + */ + reverse(source:yfiles.collections.IEnumerable):yfiles.collections.IEnumerable; + /** + * Returns elements from an enumerable as long as the given predicate is true. + * @param {yfiles.collections.IEnumerable.} source The enumerable to search. + * @param {function(TSource):boolean} predicate A function with the signature function(element):boolean + * which returns true as long as the elements should be added to the returned enumerable. + * @return {yfiles.collections.IEnumerable.} A subset of the original enumerable. + */ + takeWhile(source:yfiles.collections.IEnumerable,predicate:(arg:TSource)=>boolean):yfiles.collections.IEnumerable; + /** + * Applies an func function over the enumerable's elements. + * @param {yfiles.collections.IEnumerable.} source The enumeration to accumulate. + * @param {TAccumulate} seed The start value for the accumulator. + * @param {function(TAccumulate, TSource):TAccumulate} func A function with the signature function(seed,element):TAccumulate which + * "adds" (accumulates) a value depending on the element to the seed value and returns the result. + * @return {TAccumulate} The final value of the accumulator. + */ + aggregate(source:yfiles.collections.IEnumerable,seed:TAccumulate,func:(arg1:TAccumulate,arg2:TSource)=>TAccumulate):TAccumulate; + }; + } + export module drawing{ + /** + * An abstract generic implementation of an {@link yfiles.drawing.IStyleRenderer} + * that can be used to install an {@link yfiles.model.IModelItem} with + * a corresponding {@link yfiles.drawing.IVisualStyle} and a concrete + * style implementation. + *

+ * This class itself implements the {@link yfiles.drawing.IBoundsProvider}, {@link yfiles.drawing.IHitTestable}, + * {@link yfiles.drawing.IMarqueeTestable}, and most importantly the {@link yfiles.drawing.IVisualCreator} interfaces. + * When queried for these interfaces, it will call the {@link yfiles.drawing.AbstractStyleRenderer#configure} method and return + * itself according to the flyweight design pattern. + *

+ *

+ * The parameterization makes it possible to reuse this class for all kinds of {@link yfiles.model.IModelItem items} + * and their respective {@link yfiles.drawing.IVisualStyle styles}. The TStyle parameter + * is useful for subclasses that deal with a subset of visual styles. + *

+ */ + export interface AbstractStyleRenderer,TStyle> extends Object,yfiles.drawing.IBoundsProvider,yfiles.drawing.IVisibilityTest,yfiles.drawing.IMarqueeTestable,yfiles.drawing.IHitTestable,yfiles.support.ILookup,yfiles.drawing.IVisualCreator,yfiles.drawing.IStyleRenderer,yfiles.model.IModelItemInstaller{ + /** + * The style that it currently assigned to this renderer instance. + */ + styleF:TStyle; + /** + * The item that is currently assigned to this renderer instance. + */ + itemF:TModelItem; + /** + * Hit tests the {@link yfiles.drawing.AbstractStyleRenderer#itemF} using the {@link yfiles.drawing.AbstractStyleRenderer#styleF}. + * Implementations should inspect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * and take the value into account when performing hit tests. + * This allows the user to hit elements even if the zoom level is very + * small and allows for accurate hit tests at greater zoom levels. + * @param {yfiles.geometry.PointD} p the coordinates in world coordinate system + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Tests the {@link yfiles.drawing.AbstractStyleRenderer#itemF} using the {@link yfiles.drawing.AbstractStyleRenderer#styleF} for an intersection. + * @param {yfiles.geometry.RectD} box the box describing the marquee's bounds + * @param {yfiles.canvas.ICanvasContext} ctx the current canvas context + * @return {boolean} + * true if the item is considered to be captured by the marquee + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Calls {@link yfiles.drawing.AbstractStyleRenderer#configure} and test the {@link yfiles.drawing.AbstractStyleRenderer#itemF} using the {@link yfiles.drawing.AbstractStyleRenderer#styleF} for a visible intersection with the clip bounds. + * This simple implementation uses {@link yfiles.drawing.AbstractStyleRenderer#getBounds} to determine the visibility. + * Subclasses may choose to override this behavior for improved performance but need to make sure to call {@link yfiles.drawing.AbstractStyleRenderer#configure} + * if they depend on a configured instance. + * @param {yfiles.geometry.RectD} clip the clip bounds + * @param {yfiles.canvas.ICanvasContext} ctx the current canvas context + * @return {boolean} + * true if the item may be painted within the clip bounds. + * @see {@link yfiles.drawing.AbstractStyleRenderer#getVisibilityTest} + * @see Specified by {@link yfiles.drawing.IVisibilityTest#isVisible}. + */ + isVisible(clip:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns the bounds for the {@link yfiles.drawing.AbstractStyleRenderer#itemF} using the {@link yfiles.drawing.AbstractStyleRenderer#styleF} during painting. + * Implementations can use the scratch rectangle to put their + * results in and return it as the result of the operation. + * Client has to always provide a non-null instance as + * a parameter. They may however decide to return an internally + * cached or dynamically created {@link yfiles.geometry.IRectangle} implementation and + * disregard the scratch parameter. + * If calculating the bounds is too expensive or the painting is not + * bound to a certain area, this method may return null + * or {@link yfiles.geometry.ImmutableRectangle#INFINITE}. + * If nothing is painted, this method should return an empty rectangle, where + * either or both the width and height is non-positive or + * {@link yfiles.geometry.ImmutableRectangle#EMPTY}. + * @param {yfiles.canvas.ICanvasContext} ctx the context to calculate the bounds for + * @return {yfiles.geometry.RectD} + * the bounds or null to indicate an unbound area + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Gets the ICanvasObjectDescriptor to use for new installations. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.drawing.AbstractStyleRenderer#createStyleDescriptor} will be called. + * @see {@link yfiles.drawing.AbstractStyleRenderer#install} + */ + styleDescriptor:yfiles.canvas.ICanvasObjectDescriptor; + /** + * Factory method for the StyleDescriptor property. This method will be called + * upon first access to the {@link yfiles.drawing.AbstractStyleRenderer#styleDescriptor} property. + * @return {yfiles.canvas.ICanvasObjectDescriptor} an ICanvasObjectDescriptor instance that will delegate to this instance's methods + */ + createStyleDescriptor():yfiles.canvas.ICanvasObjectDescriptor; + /** + * Installs the model in the canvas at the given group using the {@link yfiles.drawing.AbstractStyleRenderer#styleDescriptor}. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,modelItem:TModelItem):void; + /** + * Called by the various descriptor getters to initialize the style. + * Sets the {@link yfiles.drawing.AbstractStyleRenderer#styleF} field to the given argument. + * @param {TStyle} style the style to use for the subsequent calls + */ + setStyle(style:TStyle):void; + /** + * Called by the various descriptor getters to initialize the item. + * Sets the {@link yfiles.drawing.AbstractStyleRenderer#itemF} field to the given argument. + * @param {TModelItem} item the item to use for the subsequent calls + */ + setItem(item:TModelItem):void; + /** + * Gets the currently configured style. + */ + style:TStyle; + /** + * Gets the currently configured item. + */ + item:TModelItem; + /** + * Prepares this instance for subsequent calls after the + * style and item have been initialized. + * Upon invocation the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} fields have + * been populated by the {@link yfiles.drawing.AbstractStyleRenderer#getVisualCreator}, + * {@link yfiles.drawing.AbstractStyleRenderer#getBoundsProvider}, {@link yfiles.drawing.AbstractStyleRenderer#getHitTestable}, or + * {@link yfiles.drawing.AbstractStyleRenderer#getMarqueeTestable} methods. + */ + configure():void; + /** + * Configures the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} parameters, + * calls {@link yfiles.drawing.AbstractStyleRenderer#configure} and returns this. + * @param {TModelItem} item The item to retrieve the {@link yfiles.drawing.IVisualCreator} for. The value will + * be stored in the {@link yfiles.drawing.AbstractStyleRenderer#itemF} field by {@link yfiles.drawing.AbstractStyleRenderer#setItem}. + * @param {TModelStyle} style The style to associate with the item. The value will + * be stored in the {@link yfiles.drawing.AbstractStyleRenderer#styleF} field by {@link yfiles.drawing.AbstractStyleRenderer#setStyle}. + * @return {yfiles.drawing.IVisualCreator} this + * @see {@link yfiles.drawing.AbstractStyleRenderer#createVisual} + * @see {@link yfiles.drawing.AbstractStyleRenderer#updateVisual} + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getVisualCreator}. + */ + getVisualCreator(item:TModelItem,style:TModelStyle):yfiles.drawing.IVisualCreator; + /** + * Abstract method that creates the {@link yfiles.drawing.Visual} as part of the + * {@link yfiles.drawing.IVisualCreator} interface. + * Subclasses need to implement this method to make it useful. + * @param {yfiles.drawing.IRenderContext} ctx The context for the creation of the visual. + * @return {yfiles.drawing.Visual} The visual to use in the scene graph. + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * Simple implementation of an update strategy as part of the {@link yfiles.drawing.IVisualCreator} + * interface. + * This implementation discards the oldVisual and simply delegates + * to {@link yfiles.drawing.AbstractStyleRenderer#createVisual}. + * Subclasses should override this method and try to reuse the oldVisual + * for performance reasons. + * @param {yfiles.drawing.IRenderContext} ctx The context to use for the rendering. + * @param {yfiles.drawing.Visual} oldVisual The visual that has been created by this instance + * the last time {@link yfiles.drawing.AbstractStyleRenderer#createVisual} was called. + * @return {yfiles.drawing.Visual} The updated visual, this can either be oldVisual or a newly + * created {@link yfiles.drawing.Visual} instance. + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Configures the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} parameters, + * calls {@link yfiles.drawing.AbstractStyleRenderer#configure} and returns this. + * @param {TModelItem} item The item to retrieve the bounds provider for. The value will + * be stored in the {@link yfiles.drawing.AbstractStyleRenderer#itemF} field by {@link yfiles.drawing.AbstractStyleRenderer#setItem}. + * @param {TModelStyle} style The style to associate with the item. The value will + * be stored in the {@link yfiles.drawing.AbstractStyleRenderer#styleF} field by {@link yfiles.drawing.AbstractStyleRenderer#setStyle}. + * @return {yfiles.drawing.IBoundsProvider} this + * @see {@link yfiles.drawing.AbstractStyleRenderer#getBounds} + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getBoundsProvider}. + */ + getBoundsProvider(item:TModelItem,style:TModelStyle):yfiles.drawing.IBoundsProvider; + /** + * Configures the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} parameters, + * calls {@link yfiles.drawing.AbstractStyleRenderer#configure} and returns this. + * @param {TModelItem} item The item to query hit test with. The value will + * be stored in the {@link yfiles.drawing.AbstractStyleRenderer#itemF} field by {@link yfiles.drawing.AbstractStyleRenderer#setItem}. + * @param {TModelStyle} style The style to associate with the item. The value will + * be stored in the {@link yfiles.drawing.AbstractStyleRenderer#styleF} field by {@link yfiles.drawing.AbstractStyleRenderer#setStyle}. + * @return {yfiles.drawing.IHitTestable} this + * @see {@link yfiles.drawing.AbstractStyleRenderer#isHit} + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getHitTestable}. + */ + getHitTestable(item:TModelItem,style:TModelStyle):yfiles.drawing.IHitTestable; + /** + * Configures the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} parameters, + * calls {@link yfiles.drawing.AbstractStyleRenderer#configure} and returns this. + * @param {TModelItem} item The item to query marquee intersection tests. The value will + * be stored in the {@link yfiles.drawing.AbstractStyleRenderer#itemF} field by {@link yfiles.drawing.AbstractStyleRenderer#setItem}. + * @param {TModelStyle} style The style to associate with the item. The value will + * be stored in the {@link yfiles.drawing.AbstractStyleRenderer#styleF} field by {@link yfiles.drawing.AbstractStyleRenderer#setStyle}. + * @return {yfiles.drawing.IMarqueeTestable} this + * @see {@link yfiles.drawing.AbstractStyleRenderer#isInBox} + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getMarqueeTestable}. + */ + getMarqueeTestable(item:TModelItem,style:TModelStyle):yfiles.drawing.IMarqueeTestable; + /** + * Configures the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} parameters, + * does not call {@link yfiles.drawing.AbstractStyleRenderer#configure} and returns this. + * Unlike most of the other methods this implementation does not call + * {@link yfiles.drawing.AbstractStyleRenderer#configure}. If the subclass implementation depends on this + * instance to be configured, it needs to call Configure in + * {@link yfiles.drawing.AbstractStyleRenderer#isVisible}. + * @param {TModelItem} item The item to query visibility tests. The value will + * be stored in the {@link yfiles.drawing.AbstractStyleRenderer#itemF} field by {@link yfiles.drawing.AbstractStyleRenderer#setItem}. + * @param {TModelStyle} style The style to associate with the item. The value will + * be stored in the {@link yfiles.drawing.AbstractStyleRenderer#styleF} field by {@link yfiles.drawing.AbstractStyleRenderer#setStyle}. + * @return {yfiles.drawing.IVisibilityTest} this + * @see {@link yfiles.drawing.AbstractStyleRenderer#isVisible} + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getVisibilityTest}. + */ + getVisibilityTest(item:TModelItem,style:TModelStyle):yfiles.drawing.IVisibilityTest; + /** + * Configures the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} parameters, + * does not call {@link yfiles.drawing.AbstractStyleRenderer#configure} and returns this. + * As this method may be called often it will not automatically call {@link yfiles.drawing.AbstractStyleRenderer#configure}, + * instead subclasses should ensure that in the {@link yfiles.drawing.AbstractStyleRenderer#lookup} method call they should + * call {@link yfiles.drawing.AbstractStyleRenderer#configure} only if needed, i.e. if they decide to return this or + * an instance that depends on a correctly configured this. + * @param {TModelItem} item The item to query the context for. The value will + * be stored in the {@link yfiles.drawing.AbstractStyleRenderer#itemF} field by {@link yfiles.drawing.AbstractStyleRenderer#setItem}. + * @param {TModelStyle} style The style to associate with the item. The value will + * be stored in the {@link yfiles.drawing.AbstractStyleRenderer#styleF} field by {@link yfiles.drawing.AbstractStyleRenderer#setStyle}. + * @return {yfiles.support.ILookup} this + * @see {@link yfiles.drawing.AbstractStyleRenderer#lookup} + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getContext}. + */ + getContext(item:TModelItem,style:TModelStyle):yfiles.support.ILookup; + /** + * Implements the {@link yfiles.support.ILookup} interface. + * This method will be used by default if {@link yfiles.drawing.AbstractStyleRenderer#getContext} has been queried for a lookup implementation. + * Note that it cannot be assumed that {@link yfiles.drawing.AbstractStyleRenderer#configure} has already been invoked. However, normally {@link yfiles.drawing.AbstractStyleRenderer#itemF} + * and {@link yfiles.drawing.AbstractStyleRenderer#styleF} will be correctly configured if invoked directly after GetContext. + * Subclass implementations should make sure to configure this instance before they return this as a result + * of a successful lookup. + * This implementation will check if type.IsInstanceOfType(this) and will call {@link yfiles.drawing.AbstractStyleRenderer#configure} + * on success and return this. + * @param {yfiles.lang.Class} type The type to query for. + * @return {Object} An implementation or null. + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + } + var AbstractStyleRenderer:{ + $class:yfiles.lang.Class; + new ,TStyle>(styleType:yfiles.lang.Class):yfiles.drawing.AbstractStyleRenderer; + }; + /** + * The visualization of a snap line that snaps an object between two other objects + * so that the distances to the enclosing objects are equal. + */ + export interface InBetweenSnapLineVisual extends yfiles.drawing.SnapLineVisual{ + /** + * Gets or sets the location of the one end of the first outer line. + */ + outerLine1From:yfiles.geometry.PointD; + /** + * Gets or sets the location of the one end of the first outer line. + */ + outerLine1To:yfiles.geometry.PointD; + /** + * Gets or sets the location of the one end of the second outer line. + */ + outerLine2From:yfiles.geometry.PointD; + /** + * Gets or sets the location of the other end of the second outer line. + */ + outerLine2To:yfiles.geometry.PointD; + /** + * Gets or sets the location of the one end of the first inner line. + */ + innerLine1From:yfiles.geometry.PointD; + /** + * Gets or sets the location of the other end of the first inner line. + */ + innerLine1To:yfiles.geometry.PointD; + /** + * Gets or sets the location of the one end of the second inner line. + */ + innerLine2From:yfiles.geometry.PointD; + /** + * Gets or sets the location of the other end of the second inner line. + */ + innerLine2To:yfiles.geometry.PointD; + /** + * Gets or sets the location of the one end of first distance indicator. + */ + distanceIndicator1From:yfiles.geometry.PointD; + /** + * Gets or sets the location of the other end of first distance indicator. + */ + distanceIndicator1To:yfiles.geometry.PointD; + /** + * Gets or sets the location of the one end of second distance indicator. + */ + distanceIndicator2From:yfiles.geometry.PointD; + /** + * Gets or sets the location of the other end of second distance indicator. + */ + distanceIndicator2To:yfiles.geometry.PointD; + /** + * Updates the Visual using the values of the passed snapResult in the given context. + * @param {yfiles.drawing.IRenderContext} context The current render context. + * @param {yfiles.input.SnapResult} snapResult The {@link yfiles.input.SnapResult} that shall be visualized. + */ + updateValues(context:yfiles.drawing.IRenderContext,result:yfiles.input.SnapResult):void; + /** + * Gets the specific resource key that is used for this rendering. + * The resource key is set in {@link yfiles.drawing.InBetweenSnapLineVisual#updateValues}. + * Subclasses might use this property to get the resource key for this control. + */ + key:yfiles.system.ResourceKey; + } + var InBetweenSnapLineVisual:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.InBetweenSnapLineVisual; + }; + /** + * A template for a snap line visualization that is shows a fixed distance to a certain obstacle. + */ + export interface FixedDistanceSnapLineVisual extends yfiles.drawing.SnapLineVisual{ + /** + * Gets or sets the one end of the source line. + */ + sourceLineFrom:yfiles.geometry.PointD; + /** + * Gets or sets the other end of the source line. + */ + sourceLineTo:yfiles.geometry.PointD; + /** + * Gets or sets the source point that induced the snapping. + */ + sourcePoint:yfiles.geometry.PointD; + /** + * Gets or sets the one end of the target line. + */ + targetLineFrom:yfiles.geometry.PointD; + /** + * Gets or sets the other end of the target line. + */ + targetLineTo:yfiles.geometry.PointD; + /** + * Gets or sets the target point that induced the snapping. + */ + targetPoint:yfiles.geometry.PointD; + /** + * Gets or sets the location of the one end of the distance indicator. + */ + distanceIndicatorFrom:yfiles.geometry.PointD; + /** + * Gets or sets the location of the other end of the distance indicator. + */ + distanceIndicatorTo:yfiles.geometry.PointD; + /** + * Updates the Visual using the values of the passed snapResult in the given context. + * @param {yfiles.drawing.IRenderContext} context The current render context. + * @param {yfiles.input.SnapResult} snapResult The {@link yfiles.input.SnapResult} that shall be visualized. + */ + updateValues(context:yfiles.drawing.IRenderContext,result:yfiles.input.SnapResult):void; + /** + * Gets the specific resource key that is used for this rendering. + * The resource key is set in {@link yfiles.drawing.FixedDistanceSnapLineVisual#updateValues}. + * Subclasses might use this property to get the resource key for this control. + */ + key:yfiles.system.ResourceKey; + } + var FixedDistanceSnapLineVisual:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.FixedDistanceSnapLineVisual; + }; + /** + * Abstract base class for {@link yfiles.drawing.IVisualStyle}s that uses + * {@link yfiles.drawing.ITaggedStyleBase} like interfaces. + */ + export interface TemplateStyleBase extends Object,yfiles.system.INotifyPropertyChanged{ + /** + * Occurs when a property value changes. + */ + addPropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Occurs when a property value changes. + */ + removePropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Gets or sets the tag that is associated with this style instance. + * Value: The tag associated with this style instance. + * The various {@link yfiles.drawing.IStyleRenderer} implementations can + * use this tag to make it accessible in the context of the + * instantiated templates and controls. + * The framework does not make any assumptions about the value of this property. It is there + * for convenient use in the process of data binding the templates. + * This property supports {@link yfiles.system.INotifyPropertyChanged property change notification} + * and can thus be data bound easily. + * @see Specified by {@link yfiles.drawing.ITaggedStyleBase#styleTag}. + */ + styleTag:Object; + /** + * Gets or sets an implementation of {@link yfiles.support.IContextLookup} that can be used to satisfy queries + * that are made to the implementation which is returned by calls to + * {@link yfiles.drawing.IStyleRenderer#getContext} that are made on the {@link yfiles.drawing.IStyleRenderer} + * that is associated with this style instance. + * Value: The context implementation. + * This can be used to conveniently customize the lookup behavior of the style renderers that + * are associated with this instance. E.g. it is possible to provide customized implementations of {@link yfiles.model.ISelectionInstaller}, + * {@link yfiles.input.IHighlightInstaller}, {@link yfiles.input.IHandleProvider}, {@link yfiles.input.ISizeConstraintProvider}, and {@link yfiles.drawing.IInsetsProvider}. + * Simple style implementations can use {@link yfiles.support.Lookups#EMPTY_CONTEXT_LOOKUP} but may not use null for this property. + * The default value is {@link yfiles.support.Lookups#EMPTY_CONTEXT_LOOKUP} + * @see Specified by {@link yfiles.drawing.ITaggedStyleBase#contextLookup}. + */ + contextLookup:yfiles.support.IContextLookup; + /** + * Gets or sets the implementation of the {@link yfiles.drawing.IUserTagProvider} + * interface that can yield + * a user specified tag object for each item that will be assigned this style. + * Value: The implementation to use for yielding and storing the tag associated with items. + * Most implementations of the {@link yfiles.drawing.IStyleRenderer} that are associated + * with concrete subclasses of this class will provide access to the user + * tag that can be queried using this interface. + * @see {@link yfiles.drawing.common.VoidUserTagProvider} + * @see {@link yfiles.drawing.TagOwnerUserTagProvider} + * @see {@link yfiles.drawing.MapperBasedUserTagProvider} + * @see Specified by {@link yfiles.drawing.ITaggedStyleBase#userTagProvider}. + */ + userTagProvider:yfiles.drawing.IUserTagProvider; + /** + * Raises the {@link yfiles.drawing.TemplateStyleBase#addPropertyChangedListener PropertyChanged} event. + * @param {yfiles.system.PropertyChangedEventArgs} ea The {@link yfiles.system.PropertyChangedEventArgs} instance containing the event data. + */ + onPropertyChanged(ea:yfiles.system.PropertyChangedEventArgs):void; + /** + * Gets the tag for the specified item and context. + * Most {@link yfiles.drawing.IStyleRenderer} implementations + * will use this method to perform the actual query. + * This implementation delegates to the {@link yfiles.drawing.TemplateStyleBase#userTagProvider} to satisfy the request. + * @param {TModelItem} forItem The item to query the tag for. + * @param {yfiles.support.ILookup} context The context, which can be used to query additional services from. + * @return {Object} The tag associated with the item or null. + */ + getTag(forItem:TModelItem,context:yfiles.support.ILookup):Object; + /** + * Sets the new tag on the specified item in the given context. + * Most {@link yfiles.drawing.IStyleRenderer} implementations + * will use this method to delegate writes to the tag property to. + * This implementation delegates to the {@link yfiles.drawing.TemplateStyleBase#userTagProvider} to satisfy the request. + * @param {TModelItem} forItem The item to set the new tag for. + * @param {Object} newTag The new value. + * @param {yfiles.support.ILookup} context The context, which can be used to query additional services from. + * @return {boolean} Whether the tag was stored successfully with the item. + */ + setTag(forItem:TModelItem,newTag:Object,context:yfiles.support.ILookup):boolean; + /** + * Performs a shallow clone of this instance, except for the value of {@link yfiles.drawing.TemplateStyleBase#styleTag} + * which is cloned, too, if it can be cloned. + * @return {Object} A clone of this instance. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var TemplateStyleBase:{ + $class:yfiles.lang.Class; + /** + * Constructs a new instance of this style with default values. + */ + new ():yfiles.drawing.TemplateStyleBase; + /** + * Loads all template script elements that have not been parsed, yet, and + * creates the respective {@link yfiles.drawing.TemplateCache} objects. + * This method can be called to perform the template loading at a certain + * point in time, for example during application startup. By default, a + * template is loaded lazily when the first visual using this template is built. + */ + loadAllTemplates():void; + }; + /** + * A Visual representing a {@link yfiles.input.SnapResult}. + * The {@link yfiles.input.SnapResult} to visualize and the current render context have to be passed to the {@link yfiles.drawing.SnapLineVisual#updateValues} + * method so that any custom properties can be initialized. + * Some subclasses may have additional information stored as Content that can be used for the visualization. + */ + export interface SnapLineVisual extends yfiles.canvas.CanvasContainer{ + /** + * Gets or sets the main pen to use for rendering the snap line. + * Value: The pen, which may be null in which case the {@link yfiles.canvas.CanvasControl} + * from will be queried for the pen using the {@link yfiles.input.SnapLine#SNAP_LINE_PEN_KEY}. + * @see {@link yfiles.drawing.SnapLineVisual#getPen} + */ + pen:yfiles.system.Pen; + /** + * Gets the pen to use for the rendering. + * If {@link yfiles.drawing.SnapLineVisual#pen} is null, then + * @param {yfiles.drawing.IRenderContext} context The context to obtain the pen from if {@link yfiles.drawing.SnapLineVisual#pen} is null. + * @return {yfiles.system.Pen} The pen to use or null. + * @see {@link yfiles.input.SnapLine#SNAP_LINE_PEN_KEY} + */ + getPen(context:yfiles.drawing.IRenderContext):yfiles.system.Pen; + /** + * Gets or sets the size to use for rendering this visualization. + * Value: The size. The interpretation of this value depends on the implementation. + */ + size:number; + /** + * Updates the Visual using the values of the passed snapResult in the given context. + * @param {yfiles.drawing.IRenderContext} context The current render context. + * @param {yfiles.input.SnapResult} snapResult The {@link yfiles.input.SnapResult} that shall be visualized. + */ + updateValues(context:yfiles.drawing.IRenderContext,snapResult:yfiles.input.SnapResult):void; + } + var SnapLineVisual:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this class. + */ + new ():yfiles.drawing.SnapLineVisual; + }; + /** + * The interface for an {@link yfiles.drawing.IPortStyle} implementation that can be rendered + * by {@link yfiles.drawing.TemplatePortStyleRenderer}. + * This style implementation provides the ability to use a templating + * mechanism to create the rendering for nodes. Implementations can use SVG templates for data and template binding. + *
+ * Related Information in the Developers Guide: + *

+ * More information on the templating mechanism can be found in the section Render Templates and Data Binding Support. + *

+ * @see {@link yfiles.drawing.TemplatePortStyle} + */ + export interface ITemplatePortStyle extends Object,yfiles.drawing.ITaggedStyleBase,yfiles.drawing.IPortStyle{ + /** + * Factory method that is called by the {@link yfiles.drawing.TemplatePortStyleRenderer} to create the + * visual that will be used to display the port. + * The callee expects to receive a fully functional {@link yfiles.drawing.PortTemplateContext#initializeFrom initialized} + * instance. + * @param {yfiles.drawing.IRenderContext} ctx The context for which the visual should be created. + * @param {yfiles.graph.IPort} port The port that will be rendered. + * @return {yfiles.drawing.PortTemplateContext} The initialized visual. + * @see Specified by {@link yfiles.drawing.ITemplatePortStyle#createTemplateContext}. + */ + createTemplateContext(ctx:yfiles.drawing.IRenderContext,port:yfiles.graph.IPort):yfiles.drawing.PortTemplateContext; + /** + * Yields the shape of the outline of the port style which can then + * be used to calculate {@link yfiles.drawing.IHitTestable hit tests}, + * {@link yfiles.drawing.IMarqueeTestable marquee intersections}, etc. + * A value of null indicates that the default (rectangular) + * shape should not be changed. + * @see Specified by {@link yfiles.drawing.ITemplatePortStyle#outlineShape}. + */ + outlineShape:yfiles.drawing.GeneralPath; + /** + * Gets the {@link yfiles.geometry.SizeD} of the rendering of the port that will be displayed using a + * {@link yfiles.drawing.ITemplatePortStyle#createTemplateContext visual created by this instance}. + * This size will be used to arrange the port template correctly. + * @see Specified by {@link yfiles.drawing.ITemplatePortStyle#renderSize}. + */ + renderSize:yfiles.geometry.SizeD; + } + var ITemplatePortStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A snap line visualization that shows a line and optionally highlights some special points. + * The main usage of this class is snapping of an edge label to a edge segment. In this case, + * this class draws a line parallel to the edge segment and highlights the source, center and target + * snap points on that line. + */ + export interface EdgeSegmentSnapLineVisual extends yfiles.drawing.SnapLineVisual{ + /** + * Gets or sets the starting point of the snap line. + * Value: The starting point. + */ + lineFrom:yfiles.geometry.PointD; + /** + * Gets or sets the end point of the snap line. + * Value: The end point. + */ + lineTo:yfiles.geometry.PointD; + /** + * Gets or sets a position representing the source element that created the {@link yfiles.input.SnapLine}. + * Value: The source point. + */ + sourcePoint:yfiles.geometry.PointD; + /** + * Gets or sets the snapped position of the moved element that snapped to the {@link yfiles.input.SnapLine}. + * Value: The source point. + */ + targetPoint:yfiles.geometry.PointD; + /** + * Gets or sets the source point to use for rendering the location indicator of the source point. + * Value: The source point. + */ + fromPoint:yfiles.geometry.PointD; + /** + * Gets or sets the target point to use for rendering the location indicator of the target point. + * Value: The source point. + */ + toPoint:yfiles.geometry.PointD; + /** + * Updates the Visual using the values of the passed snapResult in the given context. + * @param {yfiles.drawing.IRenderContext} context The current render context. + * @param {yfiles.input.SnapResult} snapResult The {@link yfiles.input.SnapResult} that shall be visualized. + */ + updateValues(context:yfiles.drawing.IRenderContext,result:yfiles.input.SnapResult):void; + /** + * Gets the resource key to use for this control. + * The resource key is set in {@link yfiles.drawing.EdgeSegmentSnapLineVisual#updateValues}. + * Subclasses might use this property to get the resource key for this control. + * Value: The value that has been obtained from the {@link yfiles.input.SnapLine#resourceKey} property. + */ + key:yfiles.system.ResourceKey; + } + var EdgeSegmentSnapLineVisual:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.EdgeSegmentSnapLineVisual; + }; + /** + * Represents the visualization of a {@link yfiles.input.SnapResult} that can be visualized using a single snap line. + */ + export interface SingleLineSnapLineVisual extends yfiles.drawing.SnapLineVisual{ + /** + * Gets or sets the starting position of the visualizing snap line. + * Value: The starting point. + */ + lineFrom:yfiles.geometry.PointD; + /** + * Gets or sets the ending position of the visualizing snap line. + * Value: The end point. + */ + lineTo:yfiles.geometry.PointD; + /** + * Gets or sets a position representing the source element that created the {@link yfiles.input.SnapLine}. + * Value: The source point. + */ + sourcePoint:yfiles.geometry.PointD; + /** + * Gets or sets the snapped point of the moved object that snapped to the {@link yfiles.input.SnapLine}. + * Value: The source point. + */ + targetPoint:yfiles.geometry.PointD; + /** + * Updates the Visual using the values of the passed snapResult in the given context. + * @param {yfiles.drawing.IRenderContext} context The current render context. + * @param {yfiles.input.SnapResult} snapResult The {@link yfiles.input.SnapResult} that shall be visualized. + */ + updateValues(context:yfiles.drawing.IRenderContext,result:yfiles.input.SnapResult):void; + /** + * Gets the resource key to use for this control. + * The resource key is set in {@link yfiles.drawing.SingleLineSnapLineVisual#updateValues}. + * Subclasses might use this property to get the resource key for this control. + * Value: The value that has been obtained from the {@link yfiles.input.SnapLine#resourceKey} property. + */ + key:yfiles.system.ResourceKey; + } + var SingleLineSnapLineVisual:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.SingleLineSnapLineVisual; + }; + /** + * Interface that is used by {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer} + * to describe the way a node should be styled to support a collapse/expand button. + * {@link yfiles.drawing.CollapsibleNodeStyleDecorator} is a convenient default implementation of this interface. + * This style can be used to decorate any existing {@link yfiles.drawing.INodeStyle} to support + * the {@link yfiles.graph.IFoldedGraph#expand} and {@link yfiles.graph.IFoldedGraph#collapse} + * operations that are provided by the {@link yfiles.graph.IFoldingManager} implementations visually and interactively. + */ + export interface ICollapsibleNodeStyleDecorator extends Object,yfiles.drawing.INodeStyle{ + /** + * The wrapped node style that will be used to perform the actual rendering of the node. + * @see Specified by {@link yfiles.drawing.ICollapsibleNodeStyleDecorator#wrapped}. + */ + wrapped:yfiles.drawing.INodeStyle; + /** + * An {@link yfiles.graph.ILabelModelParameter} that determines the placement of the button for toggling the + * expanded state. + * The {@link yfiles.graph.ILabelModelParameter} should {@link yfiles.graph.ILabelModelParameter#supports support} + * labels bound to an {@link yfiles.graph.INode} because the button will be positioned as if it was an {@link yfiles.graph.ILabel} + * owned by the {@link yfiles.graph.INode} that uses this style. + * @see Specified by {@link yfiles.drawing.ICollapsibleNodeStyleDecorator#buttonLocationParameter}. + */ + buttonLocationParameter:yfiles.graph.ILabelModelParameter; + /** + * Yields the insets to use for the {@link yfiles.drawing.IInsetsProvider} that will be reported + * by the {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer}'s {@link yfiles.support.ILookup}. + * This effectively influences the way the bounds of a group node are being calculated. + * The default {@link yfiles.drawing.IGroupBoundsCalculator} implementation will use these insets to + * determine the minimum size of a group node given a set of contained nodes. + * @see Specified by {@link yfiles.drawing.ICollapsibleNodeStyleDecorator#insets}. + */ + insets:yfiles.geometry.InsetsD; + } + var ICollapsibleNodeStyleDecorator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Simple default implementation of the {@link yfiles.drawing.ICollapsibleNodeStyleDecorator} interface. + *

+ * This style uses the {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer} to adorn an existing + * {@link yfiles.drawing.INodeStyle} with a Button that can then be used + * to trigger the {@link yfiles.input.GraphCommands#TOGGLE_GROUP_STATE_COMMAND}. + *

+ *

+ * The collapse button can be styled using the CSS class selectors 'yfiles-collapsebutton', + * 'yfiles-collapsebutton-checked' and 'yfiles-collapsebutton-unchecked'. + *

+ * @see {@link yfiles.drawing.ICollapsibleNodeStyleDecorator} + * @see {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer} + */ + export interface CollapsibleNodeStyleDecorator extends Object,yfiles.drawing.ICollapsibleNodeStyleDecorator{ + /** + * An {@link yfiles.graph.ILabelModelParameter} that determines the placement of the button for toggling the + * expanded state. + * The {@link yfiles.graph.ILabelModelParameter} should {@link yfiles.graph.ILabelModelParameter#supports support} + * labels bound to an {@link yfiles.graph.INode} because the button will be positioned as if it was an {@link yfiles.graph.ILabel} + * owned by the {@link yfiles.graph.INode} that uses this style. + * @see Specified by {@link yfiles.drawing.ICollapsibleNodeStyleDecorator#buttonLocationParameter}. + */ + buttonLocationParameter:yfiles.graph.ILabelModelParameter; + /** + * Yields the insets to use for the {@link yfiles.drawing.IInsetsProvider} that will be reported + * by the {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer}'s {@link yfiles.support.ILookup}. + * This effectively influences the way the bounds of a group node are being calculated. + * The default {@link yfiles.drawing.IGroupBoundsCalculator} implementation will use these insets to + * determine the minimum size of a group node given a set of contained nodes. + * @see Specified by {@link yfiles.drawing.ICollapsibleNodeStyleDecorator#insets}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Adds the visual representation of item + * to the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * @param {yfiles.graph.INode} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.INode):void; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given node and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(node, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.INodeStyle#renderer}. + */ + renderer:yfiles.drawing.INodeStyleRenderer; + /** + * The wrapped node style that will be used to perform the actual rendering of the node. + * @see Specified by {@link yfiles.drawing.ICollapsibleNodeStyleDecorator#wrapped}. + */ + wrapped:yfiles.drawing.INodeStyle; + } + var CollapsibleNodeStyleDecorator:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.CollapsibleNodeStyleDecorator} class. + * The {@link yfiles.drawing.CollapsibleNodeStyleDecorator#wrapped} property will be initialized with a {@link yfiles.drawing.ShapeNodeStyle}. + */ + new ():yfiles.drawing.CollapsibleNodeStyleDecorator; + /** + * Initializes a new instance of the {@link yfiles.drawing.CollapsibleNodeStyleDecorator} class. + * using the provided style for the {@link yfiles.drawing.CollapsibleNodeStyleDecorator#wrapped} property. + * @param {yfiles.drawing.INodeStyle} decoratedStyle The decorated style. + */ + WithStyle:{ + new (decoratedStyle:yfiles.drawing.INodeStyle):yfiles.drawing.CollapsibleNodeStyleDecorator; + }; + /** + * Initializes a new instance of the {@link yfiles.drawing.CollapsibleNodeStyleDecorator} class. + * using the provided style for the {@link yfiles.drawing.CollapsibleNodeStyleDecorator#wrapped} property and the provided renderer. + * @param {yfiles.drawing.INodeStyle} decoratedStyle The decorated style. + * @param {yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer} renderer The renderer. + */ + WithStyleAndRenderer:{ + new (decoratedStyle:yfiles.drawing.INodeStyle,renderer:yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer):yfiles.drawing.CollapsibleNodeStyleDecorator; + }; + }; + /** + * Generic mutable implementation of an {@link yfiles.drawing.IGeneralPathNodeStyle}. + */ + export interface GeneralPathNodeStyle extends Object,yfiles.drawing.IGeneralPathNodeStyle{ + /** + * Get the path that defines the boundary of the shape. + * The path must be defined in such a way that <0,0> will + * be at the top left of a node's {@link yfiles.graph.INode#layout} + * and <1,1> will be at the lower right. + * The path will be scaled accordingly during the painting. + * @see Specified by {@link yfiles.drawing.IGeneralPathNodeStyle#path}. + */ + path:yfiles.drawing.GeneralPath; + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given node and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(node, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.INodeStyle#renderer}. + */ + renderer:yfiles.drawing.INodeStyleRenderer; + /** + * Gets the {@link yfiles.drawing.IGeneralPathNodeStyle#brush} that is used to draw the shape. + * @see Specified by {@link yfiles.drawing.IGeneralPathNodeStyle#brush}. + */ + brush:yfiles.system.Brush; + /** + * Gets the {@link yfiles.drawing.IGeneralPathNodeStyle#pen} that is used to draw the shape. + * @see Specified by {@link yfiles.drawing.IGeneralPathNodeStyle#pen}. + */ + pen:yfiles.system.Pen; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.INode):void; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var GeneralPathNodeStyle:{ + $class:yfiles.lang.Class; + /** + * Create a new instance that uses a simple rectangular path + * a default renderer implementation. + */ + new ():yfiles.drawing.GeneralPathNodeStyle; + /** + * Create a new instance that uses the specified path and + * a default renderer implementation. + * @param {yfiles.drawing.GeneralPath} path The path that defines the boundary of this style. + */ + WithPath:{ + new (path:yfiles.drawing.GeneralPath):yfiles.drawing.GeneralPathNodeStyle; + }; + /** + * Create a new style instance with a default renderer implementation and + * the given values for all other parameters. + * @param {yfiles.drawing.GeneralPath} path The path that defines the boundary of this style. + * @param {yfiles.system.Brush} brush The initial brush for this style + * @param {yfiles.system.Pen} pen The initial pen for this style + */ + WithPenAndBrush:{ + new (path:yfiles.drawing.GeneralPath,pen:yfiles.system.Pen,brush:yfiles.system.Brush):yfiles.drawing.GeneralPathNodeStyle; + }; + /** + * Create a new instance that uses the specified path and + * a custom renderer instance. + * @param {yfiles.drawing.GeneralPath} path The path that defines the boundary of this style. + * @param {yfiles.drawing.GeneralPathNodeStyleRenderer} renderer Custom renderer instance for this style + */ + WithRenderer:{ + new (path:yfiles.drawing.GeneralPath,renderer:yfiles.drawing.GeneralPathNodeStyleRenderer):yfiles.drawing.GeneralPathNodeStyle; + }; + /** + * Create a new style instance with a custom renderer implementation and + * the given values for all other parameters. + * @param {yfiles.drawing.GeneralPath} path The path that defines the boundary of this style. + * @param {yfiles.system.Brush} brush The initial brush for this style + * @param {yfiles.system.Pen} pen The initial pen for this style + * @param {yfiles.drawing.GeneralPathNodeStyleRenderer} renderer Custom renderer instance for this style. + */ + WithRendererPenAndBrush:{ + new (renderer:yfiles.drawing.GeneralPathNodeStyleRenderer,path:yfiles.drawing.GeneralPath,pen:yfiles.system.Pen,brush:yfiles.system.Brush):yfiles.drawing.GeneralPathNodeStyle; + }; + }; + /** + * An {@link yfiles.drawing.IStyleRenderer} implementation that can handle {@link yfiles.drawing.IGeneralPathNodeStyle} + * instances. + */ + export interface GeneralPathNodeStyleRenderer extends yfiles.drawing.AbstractNodeStyleRenderer{ + /** + * Prepares this instance for subsequent calls after the + * style and item have been initialized. + * Upon invocation the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} fields have + * been populated by the {@link yfiles.drawing.AbstractStyleRenderer#getVisualCreator}, + * {@link yfiles.drawing.AbstractStyleRenderer#getBoundsProvider}, {@link yfiles.drawing.AbstractStyleRenderer#getHitTestable}, or + * {@link yfiles.drawing.AbstractStyleRenderer#getMarqueeTestable} methods. + */ + configure():void; + /** + * This method is called by the framework to create a {@link yfiles.drawing.Visual} + * that will be included into the {@link yfiles.drawing.IRenderContext}. + * {@link yfiles.canvas.CanvasControl} uses this interface through the {@link yfiles.canvas.ICanvasObjectDescriptor} + * to populate the visual canvas object tree. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used. + * @return {yfiles.drawing.Visual} The visual to include in the canvas object visual tree. This may be null. + * @see {@link yfiles.drawing.IVisualCreator#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * This method updates or replaces a previously created {@link yfiles.drawing.Visual} for inclusion + * in the {@link yfiles.drawing.IRenderContext}. + * The {@link yfiles.canvas.CanvasControl} uses this method to give implementations a chance to + * update an existing Visual that has previously been created by the same instance during a call + * to {@link yfiles.drawing.IVisualCreator#createVisual}. Implementation may update the oldVisual + * and return that same reference, or create a new visual and return the new instance or null. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used in. + * @param {yfiles.drawing.Visual} oldVisual The visual instance that had been returned the last time the {@link yfiles.drawing.IVisualCreator#createVisual} + * method was called on this instance. + * @return {yfiles.drawing.Visual} oldVisual, if this instance modified the visual, or a new visual that should replace the + * existing one in the canvas object visual tree. + * @see {@link yfiles.drawing.IVisualCreator#createVisual} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasControl} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Determines if something has been hit at the given coordinates + * in the world coordinate system. + * Implementations should inspect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * and take the value into account when performing hit tests. + * This allows the user to hit elements even if the zoom level is very + * small and allows for accurate hit tests at greater zoom levels. + * @param {yfiles.geometry.PointD} p the coordinates in world coordinate system + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * This callback returns true if the corresponding + * item is considered to intersect the given rectangular box. + * This method may return false if the item cannot be + * selected using a selection marquee or optionally if the + * item is only partially contained within the box. + * Implementations should respect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * if marquee selections should behave differently on different zoom levels. + * @param {yfiles.geometry.RectD} box the box describing the marquee's bounds + * @param {yfiles.canvas.ICanvasContext} ctx the current canvas context + * @return {boolean} true if the item is considered to be captured by the marquee + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns a tight rectangular area where the whole rendering + * would fit into. + * If calculating the bounds is too expensive or the painting is not + * bound to a certain area, this method may return {@link yfiles.geometry.RectD#INFINITE}. + * If nothing is painted, this method should return an empty rectangle, where + * either or both the width and height is non-positive or + * {@link yfiles.geometry.RectD#EMPTY}. + * @param {yfiles.canvas.ICanvasContext} ctx the context to calculate the bounds for + * @return {yfiles.geometry.RectD} the bounds or {@link yfiles.geometry.RectD#EMPTY} to indicate an unbound area + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Returns the intersection for the given line with this shape's geometry. + * @param {yfiles.geometry.PointD} inner The first point of the line that is inside the shape. + * @param {yfiles.geometry.PointD} outer The second point of the line that is outside the shape. + * @return {yfiles.geometry.PointD} The coordinates of the intersection point, if an intersection was found. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getIntersection}. + */ + getIntersection(inner:yfiles.geometry.PointD,outer:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Checks whether the given coordinate is deemed to lie within the shape's geometric bounds. + * @param {yfiles.geometry.PointD} point The point to test. + * @return {boolean} True if the point lies within the shape. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#isInside}. + */ + isInside(point:yfiles.geometry.PointD):boolean; + /** + * Returns the outline of the shape or null. + * @return {yfiles.drawing.GeneralPath} The outline or null if no outline can be provided. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getOutline}. + */ + getOutline():yfiles.drawing.GeneralPath; + } + var GeneralPathNodeStyleRenderer:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.GeneralPathNodeStyleRenderer} class. + */ + new ():yfiles.drawing.GeneralPathNodeStyleRenderer; + }; + /** + * Interface for node styles that can show predefined shapes of type + * {@link yfiles.drawing.ShapeNodeShape}. + * This style can be used together with {@link yfiles.drawing.ShapeNodeStyleRenderer} + * instances + */ + export interface IShapeNodeStyle extends Object,yfiles.drawing.INodeStyle{ + /** + * Gets the for this style. + * @see Specified by {@link yfiles.drawing.IShapeNodeStyle#pen}. + */ + pen:yfiles.system.Pen; + /** + * Gets the for this style. + * @see Specified by {@link yfiles.drawing.IShapeNodeStyle#brush}. + */ + brush:yfiles.system.Brush; + /** + * Gets the shape for this style. + * @see Specified by {@link yfiles.drawing.IShapeNodeStyle#shape}. + */ + shape:yfiles.drawing.ShapeNodeShape; + } + var IShapeNodeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * {@link yfiles.drawing.INodeStyleRenderer} implementation that can be used in conjunction with + * {@link yfiles.drawing.ICollapsibleNodeStyleDecorator} instances. + */ + export interface CollapsibleNodeStyleDecoratorRenderer extends yfiles.drawing.AbstractNodeStyleRenderer{ + /** + * Creates the visual for the given context. + * This method calls {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#createButton} to create the button visual. + * It will then use the {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#getButtonLocationParameter} to determine the placement + * of the button and call {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle} to create the visual for the actual node. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#createVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * This method updates or replaces a previously created {@link yfiles.drawing.Visual} for inclusion + * in the {@link yfiles.drawing.IRenderContext}. + * The {@link yfiles.canvas.CanvasControl} uses this method to give implementations a chance to + * update an existing Visual that has previously been created by the same instance during a call + * to {@link yfiles.drawing.IVisualCreator#createVisual}. Implementation may update the oldVisual + * and return that same reference, or create a new visual and return the new instance or null. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used in. + * @param {yfiles.drawing.Visual} oldVisual The visual instance that had been returned the last time the {@link yfiles.drawing.IVisualCreator#createVisual} + * method was called on this instance. + * @return {yfiles.drawing.Visual} oldVisual, if this instance modified the visual, or a new visual that should replace the + * existing one in the canvas object visual tree. + * @see {@link yfiles.drawing.IVisualCreator#createVisual} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasControl} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Creates the button visual. + * This method is called from {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#createVisual} to create the + * button. Custom implementations can override this method to use a custom + * button visualization. + *

+ * This implementation calls {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#toggleGroupState} to add the + * command. The created button is automatically unchecked if the group node is + * {@link yfiles.graph.IFoldedGraph#isExpanded expanded} and vice versa. + *

+ * @param {yfiles.drawing.IRenderContext} ctx The context. + * @param {boolean} expanded Specifies whether the button visual is created + * for the expanded or the collapsed state. + * @param {yfiles.geometry.SizeD} size The button size. + */ + createButton(ctx:yfiles.drawing.IRenderContext,expanded:boolean,size:yfiles.geometry.SizeD):yfiles.drawing.Visual; + /** + * Updates the button visual. + * This method is called from {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#updateVisual} to update an + * existing button or to create a new one. Custom implementations can override + * this method to use a custom button visualization. + * @param {yfiles.drawing.IRenderContext} ctx The context. + * @param {boolean} expanded Specifies whether the button visual is updated + * for the expanded or the collapsed state. + * @param {yfiles.geometry.SizeD} size The button size. + * @param {yfiles.drawing.Visual} oldButton The old button visual. + */ + updateButton(ctx:yfiles.drawing.IRenderContext,expanded:boolean,size:yfiles.geometry.SizeD,oldButton:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Yields the {@link yfiles.drawing.ICollapsibleNodeStyleDecorator#buttonLocationParameter} + * for the current {@link yfiles.drawing.AbstractStyleRenderer#style}. + */ + getButtonLocationParameter():yfiles.graph.ILabelModelParameter; + /** + * Returns the size of new buttons. + * @return {yfiles.geometry.SizeD} The size of new buttons + */ + getButtonSize():yfiles.geometry.SizeD; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Callback that provides a customized {@link yfiles.model.ISelectionInstaller}. + * @return {yfiles.model.ISelectionInstaller} This implementation yields a {@link yfiles.drawing.RectangularSelectionInstaller} + * where the {@link yfiles.drawing.RectangularSelectionInstaller#clearFillProperty} is set to true. + */ + createSelectionInstaller():yfiles.model.ISelectionInstaller; + /** + * Delegates to the {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle} and checks the button. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#isHit} + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Delegates to the {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#isInBox} + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Delegates to the {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#isInside} + * @see Specified by {@link yfiles.drawing.IShapeGeometry#isInside}. + */ + isInside(point:yfiles.geometry.PointD):boolean; + /** + * Delegates to the {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#getOutline} + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getOutline}. + */ + getOutline():yfiles.drawing.GeneralPath; + /** + * Delegates to the {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle} and takes the button into account. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#getBounds} + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Delegates to the {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#isVisible} + * @see Specified by {@link yfiles.drawing.IVisibilityTest#isVisible}. + */ + isVisible(clip:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Delegates to the {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#getWrappedStyle}. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#getIntersection} + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getIntersection}. + */ + getIntersection(inner:yfiles.geometry.PointD,outer:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Yields the {@link yfiles.drawing.ICollapsibleNodeStyleDecorator#wrapped} property + * for the current {@link yfiles.drawing.AbstractStyleRenderer#style}. + */ + getWrappedStyle():yfiles.drawing.INodeStyle; + } + var CollapsibleNodeStyleDecoratorRenderer:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer} class. + */ + new ():yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer; + /** + * Adds the toggle group state command to the given button visual. + * This method adds event listeners for click and tap events to + * the given button visual that call {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#toggleGroupState}. + * It is called by {@link yfiles.drawing.CollapsibleNodeStyleDecoratorRenderer#createButton}. + * @param {yfiles.drawing.Visual} button The button visual to add the event listeners to. + * @param {yfiles.graph.INode} currentNode The group node whose state is to be toggled. + * @param {yfiles.drawing.IRenderContext} context The context. + */ + addToggleGroupStateCommand(button:yfiles.drawing.Visual,currentNode:yfiles.graph.INode,context:yfiles.drawing.IRenderContext):void; + }; + /** + * Interface for a polygonal {@link yfiles.drawing.IEdgeStyle}. + * The only additional property available for this style is {@link yfiles.drawing.IPolylineEdgeStyle#pen}. + */ + export interface IPolylineEdgeStyle extends Object,yfiles.drawing.IEdgeStyle,yfiles.drawing.IArrowOwner{ + /** + * Gets the for the line. + * @see Specified by {@link yfiles.drawing.IPolylineEdgeStyle#pen}. + */ + pen:yfiles.system.Pen; + /** + * Gets the smoothing length used for creating smooth bends. + * A value of 0.0d will disable smoothing. + * @see Specified by {@link yfiles.drawing.IPolylineEdgeStyle#smoothing}. + */ + smoothing:number; + } + var IPolylineEdgeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface for an {@link yfiles.drawing.ILabelStyle} implementation that can be rendered + * by a {@link yfiles.drawing.TemplateLabelStyleRenderer}. + * This style implementation provides the ability to use a templating + * mechanism to create the rendering for nodes. Implementations can use SVG templates for data and template binding. + *
+ * Related Information in the Developers Guide: + *

+ * More information on the templating mechanism can be found in the section Render Templates and Data Binding Support. + *

+ * @see {@link yfiles.drawing.TemplateLabelStyle} + */ + export interface ITemplateLabelStyle extends Object,yfiles.drawing.ITaggedStyleBase,yfiles.drawing.ILabelStyle{ + /** + * Factory method that is called by the {@link yfiles.drawing.TemplateLabelStyleRenderer} to create the + * visual that will be used to display the label. + * The callee expects to receive a fully functional {@link yfiles.drawing.LabelTemplateContext#initializeFrom initialized} + * instance. + * @param {yfiles.drawing.IRenderContext} ctx The context for which the visual should be created. + * @param {yfiles.graph.ILabel} label The label that will be rendered. + * @return {yfiles.drawing.LabelTemplateContext} The initialized visual. + * @see Specified by {@link yfiles.drawing.ITemplateLabelStyle#createTemplateContext}. + */ + createTemplateContext(ctx:yfiles.drawing.IRenderContext,label:yfiles.graph.ILabel):yfiles.drawing.LabelTemplateContext; + /** + * Yields the shape of the outline of the label style which can then + * be used to calculate {@link yfiles.drawing.IHitTestable hit tests}, + * {@link yfiles.drawing.IMarqueeTestable marquee intersections}, etc. + * A value of null indicates that the default (rectangular) + * shape should not be changed. + * @see Specified by {@link yfiles.drawing.ITemplateLabelStyle#outlineShape}. + */ + outlineShape:yfiles.drawing.GeneralPath; + /** + * Gets a value indicating whether the rendering should automatically be + * flipped (rotated by 180 degrees) + * if otherwise it would be rendered upside-down. + * Value: + * true if labels should be flipped automatically; otherwise, false. + * @see Specified by {@link yfiles.drawing.ITemplateLabelStyle#autoFlip}. + */ + autoFlip:boolean; + /** + * Gets or sets the preferred size of the labels that use this style. + * @see Specified by {@link yfiles.drawing.ITemplateLabelStyle#preferredSize}. + */ + preferredSize:yfiles.geometry.SizeD; + } + var ITemplateLabelStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A {@link yfiles.drawing.ITemplateLabelStyle} that uses an SVG snippet as template + * for the visualization of {@link yfiles.graph.ILabel}s. + * The {@link yfiles.drawing.TemplateLabelStyle#renderTemplateId} is used to determine the template that + * will be applied to the {@link yfiles.drawing.LabelTemplateContext}. + */ + export interface TemplateLabelStyle extends yfiles.drawing.TemplateStyleBase,yfiles.drawing.ITemplateLabelStyle,yfiles.system.INotifyPropertyChanged{ + /** + * Gets or sets the {@link String} that will be used to look up + * the template that is applied to the {@link yfiles.drawing.LabelTemplateContext}. + * Value: The resource key for the style or null. + */ + renderTemplateId:string; + /** + * Gets or sets the {@link yfiles.drawing.GeneralPath} of the outline of a label that will be displayed using the + * {@link yfiles.drawing.ITemplateLabelStyle#createTemplateContext created visual}. + * The shape will automatically arranged and transformed to have the bounds of the label. + * This shape will be used to satisfy requests to {@link yfiles.drawing.IMarqueeTestable#isInBox} and + * {@link yfiles.drawing.IHitTestable#isHit} and may be left null to indicate default (rectangular) + * behavior. + * @see Specified by {@link yfiles.drawing.ITemplateLabelStyle#outlineShape}. + */ + outlineShape:yfiles.drawing.GeneralPath; + /** + * Gets or sets a value indicating whether the rendering should automatically be + * flipped (rotated by 180 degrees) + * if otherwise it would be rendered upside-down. + * The default value is true. + * Value: + * true if labels should be flipped automatically; otherwise, false. + * @see Specified by {@link yfiles.drawing.ITemplateLabelStyle#autoFlip}. + */ + autoFlip:boolean; + /** + * Gets or sets the preferred size of the labels that use this style. + * @see Specified by {@link yfiles.drawing.ITemplateLabelStyle#preferredSize}. + */ + preferredSize:yfiles.geometry.SizeD; + /** + * Factory method that creates the {@link yfiles.drawing.TemplateLabelStyleRenderer renderer}. + * This method is used by the {@link yfiles.drawing.TemplateLabelStyle#templateStyleRenderer} property to initialize the backing field. + * @return {yfiles.drawing.TemplateLabelStyleRenderer} This implementation simply returns a new instance of {@link yfiles.drawing.TemplateLabelStyleRenderer}. + */ + createRenderer():yfiles.drawing.TemplateLabelStyleRenderer; + /** + * Convenience method that determines the preferred size of the label if this style was applied. + * @param {yfiles.graph.ILabel} label The label to determine the preferred size of. + * @param {yfiles.drawing.IRenderContext} context The context for which the size should be calculated. + * @return {yfiles.geometry.SizeD} The preferred size. + */ + getPreferredSize(label:yfiles.graph.ILabel,context:yfiles.drawing.IRenderContext):yfiles.geometry.SizeD; + /** + * Convenience getter that yields the {@link yfiles.drawing.TemplateLabelStyleRenderer} + * that is used by this instance. + * @see {@link yfiles.drawing.ILabelStyle#renderer} + */ + templateStyleRenderer:yfiles.drawing.TemplateLabelStyleRenderer; + /** + * Factory method that is called by the {@link yfiles.drawing.TemplateLabelStyleRenderer} to create the + * visual that will be used to display the label. + * The callee expects to receive a fully functional {@link yfiles.drawing.LabelTemplateContext#initializeFrom initialized} + * instance. + * @param {yfiles.drawing.IRenderContext} ctx The context for which the visual should be created. + * @param {yfiles.graph.ILabel} label The label that will be rendered. + * @return {yfiles.drawing.LabelTemplateContext} The initialized visual. + * @see Specified by {@link yfiles.drawing.ITemplateLabelStyle#createTemplateContext}. + */ + createTemplateContext(ctx:yfiles.drawing.IRenderContext,label:yfiles.graph.ILabel):yfiles.drawing.LabelTemplateContext; + /** + * Adds the visual representation of item + * to the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * @param {yfiles.graph.ILabel} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.ILabel):void; + } + var TemplateLabelStyle:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.TemplateLabelStyle} class. + */ + new ():yfiles.drawing.TemplateLabelStyle; + }; + /** + * A {@link yfiles.drawing.ITemplateLabelStyle} that uses an SVG snippet as + * template for the visualization of {@link yfiles.graph.ILabel}s. + *

+ * In contrast to {@link yfiles.drawing.TemplateLabelStyle}, the SVG template used + * by this style must be encoded as string and set to the + * {@link yfiles.drawing.StringTemplateLabelStyle#svgContent} property. + *

+ *

+ * It is vital that the {@link yfiles.drawing.StringTemplateLabelStyle#svgContent SVG snippet} does not + * declare the SVG namespace itself. Its content is parsed in a dummy namespace + * in order to avoid immediate validation of the result. The resulting SVG + * elements are automatically created in the SVG namespace before they are + * added to the DOM. + *

+ */ + export interface StringTemplateLabelStyle extends yfiles.drawing.TemplateStyleBase,yfiles.drawing.ITemplateLabelStyle,yfiles.system.INotifyPropertyChanged{ + /** + * Gets or sets the SVG content that is the template for the label + * visualization. + */ + svgContent:string; + /** + * Gets or sets the {@link yfiles.drawing.GeneralPath} of the outline of a label that will be displayed using the + * {@link yfiles.drawing.ITemplateLabelStyle#createTemplateContext created visual}. + * The shape will automatically arranged and transformed to have the bounds of the label. + * This shape will be used to satisfy requests to {@link yfiles.drawing.IMarqueeTestable#isInBox} and + * {@link yfiles.drawing.IHitTestable#isHit} and may be left null to indicate default (rectangular) + * behavior. + * @see Specified by {@link yfiles.drawing.ITemplateLabelStyle#outlineShape}. + */ + outlineShape:yfiles.drawing.GeneralPath; + /** + * Gets or sets a value indicating whether the rendering should automatically be + * flipped (rotated by 180 degrees) + * if otherwise it would be rendered upside-down. + * The default value is true. + * Value: + * true if labels should be flipped automatically; otherwise, false. + * @see Specified by {@link yfiles.drawing.ITemplateLabelStyle#autoFlip}. + */ + autoFlip:boolean; + /** + * Gets or sets the preferred size of the labels that use this style. + * @see Specified by {@link yfiles.drawing.ITemplateLabelStyle#preferredSize}. + */ + preferredSize:yfiles.geometry.SizeD; + /** + * Factory method that creates the {@link yfiles.drawing.TemplateLabelStyleRenderer renderer}. + * This method is used by the {@link yfiles.drawing.StringTemplateLabelStyle#templateStyleRenderer} property to initialize the backing field. + * @return {yfiles.drawing.TemplateLabelStyleRenderer} This implementation simply returns a new instance of {@link yfiles.drawing.TemplateLabelStyleRenderer}. + */ + createRenderer():yfiles.drawing.TemplateLabelStyleRenderer; + /** + * Convenience method that determines the preferred size of the label if this style was applied. + * @param {yfiles.graph.ILabel} label The label to determine the preferred size of. + * @param {yfiles.drawing.IRenderContext} context The context for which the size should be calculated. + * @return {yfiles.geometry.SizeD} The preferred size. + */ + getPreferredSize(label:yfiles.graph.ILabel,context:yfiles.drawing.IRenderContext):yfiles.geometry.SizeD; + /** + * Convenience getter that yields the {@link yfiles.drawing.TemplateLabelStyleRenderer} + * that is used by this instance. + * @see {@link yfiles.drawing.ILabelStyle#renderer} + */ + templateStyleRenderer:yfiles.drawing.TemplateLabelStyleRenderer; + /** + * Factory method that is called by the {@link yfiles.drawing.TemplateLabelStyleRenderer} to create the + * visual that will be used to display the label. + * The callee expects to receive a fully functional {@link yfiles.drawing.LabelTemplateContext#initializeFrom initialized} + * instance. + * @param {yfiles.drawing.IRenderContext} ctx The context for which the visual should be created. + * @param {yfiles.graph.ILabel} label The label that will be rendered. + * @return {yfiles.drawing.LabelTemplateContext} The initialized visual. + * @see Specified by {@link yfiles.drawing.ITemplateLabelStyle#createTemplateContext}. + */ + createTemplateContext(ctx:yfiles.drawing.IRenderContext,label:yfiles.graph.ILabel):yfiles.drawing.LabelTemplateContext; + /** + * Adds the visual representation of item + * to the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * @param {yfiles.graph.ILabel} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.ILabel):void; + } + var StringTemplateLabelStyle:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of this class. + */ + new ():yfiles.drawing.StringTemplateLabelStyle; + /** + * Initializes a new instance of this class and sets the given string + * as its {@link yfiles.drawing.StringTemplateLabelStyle#svgContent}. + * @param {string} svgContent The SVG snippet to use as template. + */ + WithSvgContent:{ + new (svgContent:string):yfiles.drawing.StringTemplateLabelStyle; + }; + }; + /** + * An implementation of the {@link yfiles.drawing.IPortStyleRenderer} interface that + * can render {@link yfiles.drawing.ITemplatePortStyle} instances. + * @see {@link yfiles.drawing.TemplatePortStyle} + */ + export interface TemplatePortStyleRenderer extends yfiles.drawing.AbstractStyleRenderer,yfiles.drawing.IPortStyleRenderer{ + /** + * Gets the center of the port. + * Value: The center coordinates. + */ + center:yfiles.geometry.PointD; + /** + * Creates the visual by delegating to {@link yfiles.drawing.ITemplatePortStyle#createTemplateContext} + * and then initializing the visual with the context. + * @param {yfiles.drawing.IRenderContext} ctx The context for the creation. + * @return {yfiles.drawing.Visual} The visual that is used for rendering the port. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#createVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * Arranges the port template visual according to the location of the port and the {@link yfiles.drawing.TemplatePortStyleRenderer#getRenderSize}. + * @param {yfiles.drawing.PortTemplateContext} portControl The port template visual. + */ + arrange(portControl:yfiles.drawing.PortTemplateContext):void; + /** + * Determines if something has been hit at the given coordinates + * in the world coordinate system. + * Implementations should inspect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * and take the value into account when performing hit tests. + * This allows the user to hit elements even if the zoom level is very + * small and allows for accurate hit tests at greater zoom levels. + * @param {yfiles.geometry.PointD} p the coordinates in world coordinate system + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * This callback returns true if the corresponding + * item is considered to intersect the given rectangular box. + * This method may return false if the item cannot be + * selected using a selection marquee or optionally if the + * item is only partially contained within the box. + * Implementations should respect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * if marquee selections should behave differently on different zoom levels. + * @param {yfiles.geometry.RectD} box the box describing the marquee's bounds + * @param {yfiles.canvas.ICanvasContext} ctx the current canvas context + * @return {boolean} true if the item is considered to be captured by the marquee + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns a tight rectangular area where the whole rendering + * would fit into. + * If calculating the bounds is too expensive or the painting is not + * bound to a certain area, this method may return {@link yfiles.geometry.RectD#INFINITE}. + * If nothing is painted, this method should return an empty rectangle, where + * either or both the width and height is non-positive or + * {@link yfiles.geometry.RectD#EMPTY}. + * @param {yfiles.canvas.ICanvasContext} ctx the context to calculate the bounds for + * @return {yfiles.geometry.RectD} the bounds or {@link yfiles.geometry.RectD#EMPTY} to indicate an unbound area + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Factory method for the StyleDescriptor property. This method will be called + * upon first access to the {@link yfiles.drawing.AbstractStyleRenderer#styleDescriptor} property. + * @return {yfiles.canvas.ICanvasObjectDescriptor} an ICanvasObjectDescriptor instance that will delegate to this instance's methods + */ + createStyleDescriptor():yfiles.canvas.ICanvasObjectDescriptor; + /** + * Prepares this instance for subsequent calls after the + * style and item have been initialized. + * Upon invocation the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} fields have + * been populated by the {@link yfiles.drawing.AbstractStyleRenderer#getVisualCreator}, + * {@link yfiles.drawing.AbstractStyleRenderer#getBoundsProvider}, {@link yfiles.drawing.AbstractStyleRenderer#getHitTestable}, or + * {@link yfiles.drawing.AbstractStyleRenderer#getMarqueeTestable} methods. + */ + configure():void; + /** + * Gets the size of the rendering from the style. + * @return {yfiles.geometry.SizeD} The {@link yfiles.drawing.ITemplatePortStyle#renderSize}. + */ + getRenderSize():yfiles.geometry.SizeD; + /** + * Updates the {@link yfiles.drawing.PortTemplateContext} correspondingly. + * @param {yfiles.drawing.IRenderContext} ctx The context for the creation. + * @param {yfiles.drawing.Visual} oldVisual The currently rendered visual. + * @return {yfiles.drawing.Visual} The visual that is used for rendering the port. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Delegates to the {@link yfiles.drawing.ITemplatePortStyle}'s + * {@link yfiles.drawing.ITaggedStyleBase#contextLookup}. + */ + lookupContext(style:yfiles.drawing.ITemplatePortStyle,port:yfiles.graph.IPort,type:yfiles.lang.Class):Object; + /** + * Gets the outline shape by delegating to {@link yfiles.drawing.ITemplatePortStyle#outlineShape}. + */ + getOutlineShape(style:yfiles.drawing.ITemplatePortStyle):yfiles.drawing.GeneralPath; + /** + * Calculates the preferred size for the given port and style. + * @param {yfiles.graph.IPort} port The port instance. + * @param {yfiles.drawing.ITemplatePortStyle} style The style instance to apply. + * @param {yfiles.drawing.IRenderContext} renderContext The render context which can be null. + * @return {yfiles.geometry.SizeD} The size that is calculated using a {@link yfiles.drawing.TemplatePortStyleRenderer#getPreferredSizeWithContext} call. + * @see {@link yfiles.drawing.TemplatePortStyleRenderer#getPreferredSizeWithContext} + */ + getPreferredSize(port:yfiles.graph.IPort,style:yfiles.drawing.ITemplatePortStyle,renderContext:yfiles.drawing.IRenderContext):yfiles.geometry.SizeD; + /** + * Gets the preferred size for the current configuration. + * @return {yfiles.geometry.SizeD} The preferred size. + */ + getPreferredSizeWithContext(renderContext:yfiles.drawing.IRenderContext):yfiles.geometry.SizeD; + } + var TemplatePortStyleRenderer:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.TemplatePortStyleRenderer; + }; + /** + * A {@link yfiles.drawing.ITemplatePortStyle} that uses an SVG snippet as template + * for the visualization of {@link yfiles.graph.IPort}s. + * The {@link yfiles.drawing.TemplatePortStyle#renderTemplateId} is used to determine the template that + * will be applied to the {@link yfiles.drawing.PortTemplateContext}. + * Note that the {@link yfiles.drawing.TemplatePortStyle#renderSize} should be specified to match the size of the visual's template. + */ + export interface TemplatePortStyle extends yfiles.drawing.TemplateStyleBase,yfiles.drawing.ITemplatePortStyle{ + /** + * Gets or sets the {@link String} that will be used to look up + * the template that is applied to the {@link yfiles.drawing.PortTemplateContext}. + * Value: The resource key for the style or null. + */ + renderTemplateId:string; + /** + * Gets or sets the {@link yfiles.geometry.Size} of the of a port that will be displayed using the + * {@link yfiles.drawing.ITemplatePortStyle#createTemplateContext created visual}. + * This size will be used to arrange the visual correctly. + * The default value is (5,5). + * @see Specified by {@link yfiles.drawing.ITemplatePortStyle#renderSize}. + */ + renderSize:yfiles.geometry.SizeD; + /** + * Gets or sets the {@link yfiles.drawing.GeneralPath} of the outline of a port that will be displayed using the + * {@link yfiles.drawing.ITemplatePortStyle#createTemplateContext created visual}. + * The shape will automatically be arranged and transformed to have the bounds of the port. + * This shape will be used to satisfy requests to {@link yfiles.drawing.IMarqueeTestable#isInBox} and + * {@link yfiles.drawing.IHitTestable#isHit} and may be left null to indicate default (rectangular) + * behavior. + * @see Specified by {@link yfiles.drawing.ITemplatePortStyle#outlineShape}. + */ + outlineShape:yfiles.drawing.GeneralPath; + /** + * Factory method that creates the {@link yfiles.drawing.TemplatePortStyleRenderer renderer}. + * This method is used by the {@link yfiles.drawing.TemplatePortStyle#templateStyleRenderer} property to initialize the backing field. + * @return {yfiles.drawing.TemplatePortStyleRenderer} This implementation simply returns a new instance of {@link yfiles.drawing.TemplatePortStyleRenderer}. + */ + createRenderer():yfiles.drawing.TemplatePortStyleRenderer; + /** + * Convenience getter that yields the {@link yfiles.drawing.TemplatePortStyleRenderer} + * that is used by this instance. + * @see {@link yfiles.drawing.IPortStyle#renderer} + */ + templateStyleRenderer:yfiles.drawing.TemplatePortStyleRenderer; + /** + * Convenience method that determines the preferred {@link yfiles.drawing.TemplatePortStyle#renderSize} of the port if this style was applied. + * @param {yfiles.graph.IPort} port The port to determine the preferred size of. + * @param {yfiles.drawing.IRenderContext} context The context for which the size should be calculated. + * @return {yfiles.geometry.SizeD} The preferred size. + */ + getPreferredSize(port:yfiles.graph.IPort,context:yfiles.drawing.IRenderContext):yfiles.geometry.SizeD; + /** + * Factory method that is called by the {@link yfiles.drawing.TemplatePortStyleRenderer} to create the + * visual that will be used to display the port. + * The callee expects to receive a fully functional {@link yfiles.drawing.PortTemplateContext#initializeFrom initialized} + * instance. + * @param {yfiles.drawing.IRenderContext} ctx The context for which the visual should be created. + * @param {yfiles.graph.IPort} port The port that will be rendered. + * @return {yfiles.drawing.PortTemplateContext} The initialized visual. + * @see Specified by {@link yfiles.drawing.ITemplatePortStyle#createTemplateContext}. + */ + createTemplateContext(ctx:yfiles.drawing.IRenderContext,port:yfiles.graph.IPort):yfiles.drawing.PortTemplateContext; + /** + * Adds the visual representation of item + * to the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * @param {yfiles.graph.IPort} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.IPort):void; + } + var TemplatePortStyle:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.TemplatePortStyle} class. + */ + new ():yfiles.drawing.TemplatePortStyle; + }; + /** + * An implementation of the {@link yfiles.drawing.IUserTagProvider} interface + * that can be used to satisfy requests for obtaining or setting the user tag + * by delegating to an {@link yfiles.model.IMapper}. + * The mapper instance is retrieved from the {@link yfiles.graph.IMapperRegistry} instance + * of the {@link yfiles.graph.IGraph} that is retrieved from the context + * that is passed in to {@link yfiles.drawing.MapperBasedUserTagProvider#getUserTag} and {@link yfiles.drawing.MapperBasedUserTagProvider#setUserTag} + */ + export interface MapperBasedUserTagProvider extends Object,yfiles.drawing.IUserTagProvider{ + /** + * The tag object that is used to get the mapper from the {@link yfiles.graph.IMapperRegistry#getMapper}. + */ + mapperRegistryTag:Object; + /** + * Gets the user tag that is associated with the given item. + * This code will {@link yfiles.support.ILookup#lookup query} the context + * for an implementation of {@link yfiles.graph.IGraph}, and will obtain from it the + * {@link yfiles.graph.IGraph#mapperRegistry}. Then it will use the {@link yfiles.drawing.MapperBasedUserTagProvider#mapperRegistryTag} property + * to query the {@link yfiles.graph.MapperRegistryExtensions#getObjectObjectMapper mapper} that has + * been registered using the tag. Finally the query for the user tag is delegated to the mapper. + * @param {yfiles.model.IModelItem} forItem The item to get the user associated data from. + * @param {yfiles.support.ILookup} context The context that will be queried for an {@link yfiles.graph.IGraph}. + * @return {Object} + * The tag that is associated with the item or null. + * @see Specified by {@link yfiles.drawing.IUserTagProvider#getUserTag}. + */ + getUserTag(forItem:yfiles.model.IModelItem,context:yfiles.support.ILookup):Object; + /** + * Tries to set the user tag that is associated with the given item. + * This code will {@link yfiles.support.ILookup#lookup query} the context + * for an implementation of {@link yfiles.graph.IGraph}, and will obtain from it the + * {@link yfiles.graph.IGraph#mapperRegistry}. Then it will use the {@link yfiles.drawing.MapperBasedUserTagProvider#mapperRegistryTag} property + * to query the {@link yfiles.graph.MapperRegistryExtensions#getObjectObjectMapper mapper} that has + * been registered using the tag. Finally the mapper will be used to store the user tag with the item. + * @param {yfiles.model.IModelItem} forItem The item to store the user associated data with. + * @param {Object} newTag The new value to store with the mapper. + * @param {yfiles.support.ILookup} context The context that will be queried for an {@link yfiles.graph.IGraph}. + * @return {boolean} + * Whether the mapper has been found and the value could be stored. + * @see Specified by {@link yfiles.drawing.IUserTagProvider#setUserTag}. + */ + setUserTag(forItem:yfiles.model.IModelItem,newTag:Object,context:yfiles.support.ILookup):boolean; + } + var MapperBasedUserTagProvider:{ + $class:yfiles.lang.Class; + }; + /** + * An implementation of the {@link yfiles.drawing.ILabelStyleRenderer} interface that + * can render {@link yfiles.drawing.ITemplateLabelStyle} instances. + * @see {@link yfiles.drawing.TemplateLabelStyle} + */ + export interface TemplateLabelStyleRenderer extends yfiles.drawing.ShapedLabelStyleRendererBase{ + /** + * Creates the visual by delegating to {@link yfiles.drawing.ITemplateLabelStyle#createTemplateContext} + * and then initializing the visual with the context. + * @param {yfiles.drawing.IRenderContext} ctx The context for the creation. + * @return {yfiles.drawing.Visual} The visual that is used for rendering the label. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#createVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * Updates the {@link yfiles.drawing.LabelTemplateContext} correspondingly. + * @param {yfiles.drawing.IRenderContext} ctx The context for the creation. + * @param {yfiles.drawing.Visual} oldVisual The currently rendered visual. + * @return {yfiles.drawing.Visual} The visual that is used for rendering the label. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Delegates to the {@link yfiles.drawing.ITemplateLabelStyle}'s + * {@link yfiles.drawing.ITaggedStyleBase#contextLookup}. + * @see Overrides {@link yfiles.drawing.ShapedLabelStyleRendererBase#lookupContext} + */ + lookupContext(style:yfiles.drawing.ITemplateLabelStyle,label:yfiles.graph.ILabel,type:yfiles.lang.Class):Object; + /** + * Gets the outline shape by delegating to {@link yfiles.drawing.ITemplateLabelStyle#outlineShape}. + * @see Overrides {@link yfiles.drawing.ShapedLabelStyleRendererBase#getOutlineShape} + */ + getOutlineShape(style:yfiles.drawing.ITemplateLabelStyle):yfiles.drawing.GeneralPath; + /** + * Gets the size of the preferred for the current configuration using the provided context. + * @param {yfiles.drawing.IRenderContext} ctx The CTX. + * @return {yfiles.geometry.SizeD} + * @see Overrides {@link yfiles.drawing.ShapedLabelStyleRendererBase#getPreferredSizeWithContext} + */ + getPreferredSizeWithContext(ctx:yfiles.drawing.IRenderContext):yfiles.geometry.SizeD; + /** + * Delegates to the {@link yfiles.drawing.ITemplateLabelStyle}'s + * {@link yfiles.drawing.ITemplateLabelStyle#autoFlip} property. + * @see Overrides {@link yfiles.drawing.ShapedLabelStyleRendererBase#isAutoFlip} + */ + isAutoFlip(style:yfiles.drawing.ITemplateLabelStyle):boolean; + } + var TemplateLabelStyleRenderer:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.TemplateLabelStyleRenderer; + }; + /** + * A {@link yfiles.drawing.ITemplateNodeStyle} that uses an SVG snippet as template + * for the visualization of {@link yfiles.graph.INode}s. + *

+ * In contrast to {@link yfiles.drawing.TemplateNodeStyle}, the SVG template used + * by this style must be encoded as string and set to the + * {@link yfiles.drawing.StringTemplateNodeStyle#svgContent} property. + *

+ *

+ * It is vital that the {@link yfiles.drawing.StringTemplateNodeStyle#svgContent SVG snippet} does not + * declare the SVG namespace itself. Its content is parsed in a dummy namespace + * in order to avoid immediate validation of the result. The resulting SVG + * elements are automatically created in the SVG namespace before they are + * added to the DOM. + *

+ */ + export interface StringTemplateNodeStyle extends yfiles.drawing.TemplateStyleBase,yfiles.drawing.ITemplateNodeStyle{ + /** + * Gets or sets the SVG content that is the template for the node + * visualization. + */ + svgContent:string; + /** + * Gets or sets the insets the {@link yfiles.drawing.IInsetsProvider} implementation for + * {@link yfiles.graph.INode} should yield for this instance. + * This is especially useful if this style is used for {@link yfiles.graph.IGroupedGraph group nodes}, + * as they require insets for the calculation of the bounds. The insets can be used + * to make sure that child nodes do not cover visual elements of the style inside the insets. + * The default value is an {@link yfiles.geometry.InsetsD} insets with 5 for all insets. + * @see {@link yfiles.drawing.IInsetsProvider} + * @see {@link yfiles.drawing.IStyleRenderer#getContext} + * @see Specified by {@link yfiles.drawing.ITemplateNodeStyle#insets}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Gets or sets the minimum size an {@link yfiles.input.ISizeConstraintProvider} implementation for + * {@link yfiles.graph.INode} should yield. + * @see {@link yfiles.input.ISizeConstraintProvider} + * @see Specified by {@link yfiles.drawing.ITemplateNodeStyle#minimumSize}. + */ + minimumSize:yfiles.geometry.SizeD; + /** + * Gets or sets the {@link yfiles.drawing.GeneralPath} of the outline of a node that will be displayed using the + * {@link yfiles.drawing.ITemplateNodeStyle#createTemplateContext created visual}. + * This shape will be used to satisfy requests to {@link yfiles.drawing.IMarqueeTestable#isInBox} and + * {@link yfiles.drawing.IHitTestable#isHit} and may be left null to indicate default (rectangular) + * behavior. + * @see Specified by {@link yfiles.drawing.ITemplateNodeStyle#outlineShape}. + */ + outlineShape:yfiles.drawing.GeneralPath; + /** + * Convenience method that determines the preferred size of the node if this style was applied. + * @param {yfiles.graph.INode} node The node to determine the preferred size of. Can be a live node or an {@link yfiles.graph.SimpleNode}. + * @param {yfiles.drawing.IRenderContext} context The context for which the size should be calculated. Can be obtained through {@link yfiles.canvas.CanvasControl#createRenderContext}. + * @return {yfiles.geometry.SizeD} The preferred size. + * @see {@link yfiles.canvas.CanvasControl#createRenderContext} + */ + getPreferredSize(node:yfiles.graph.INode,context:yfiles.drawing.IRenderContext):yfiles.geometry.SizeD; + /** + * Factory method that creates the {@link yfiles.drawing.TemplateNodeStyleRenderer renderer}. + * This method is used by the {@link yfiles.drawing.StringTemplateNodeStyle#templateStyleRenderer} property to initialize the backing field. + * @return {yfiles.drawing.TemplateNodeStyleRenderer} This implementation simply returns a new instance of {@link yfiles.drawing.TemplateNodeStyleRenderer} + */ + createRenderer():yfiles.drawing.TemplateNodeStyleRenderer; + /** + * Convenience getter that yields the {@link yfiles.drawing.TemplateNodeStyleRenderer} + * that is used by this instance. + * @see {@link yfiles.drawing.INodeStyle#renderer} + */ + templateStyleRenderer:yfiles.drawing.TemplateNodeStyleRenderer; + /** + * Factory method that is called by the {@link yfiles.drawing.TemplateNodeStyleRenderer} to create the + * visual that will be used to display the node. + * The callee expects to receive a fully functional {@link yfiles.drawing.NodeTemplateContext#initializeFrom initialized} + * instance. + * @param {yfiles.drawing.IRenderContext} ctx The context for which the visual should be created. + * @param {yfiles.graph.INode} node The node that will be rendered. + * @return {yfiles.drawing.NodeTemplateContext} The initialized visual. + * @see Specified by {@link yfiles.drawing.ITemplateNodeStyle#createTemplateContext}. + */ + createTemplateContext(ctx:yfiles.drawing.IRenderContext,node:yfiles.graph.INode):yfiles.drawing.NodeTemplateContext; + /** + * Adds the visual representation of item + * to the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * @param {yfiles.graph.INode} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.INode):void; + } + var StringTemplateNodeStyle:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of this class. + */ + new ():yfiles.drawing.StringTemplateNodeStyle; + /** + * Initializes a new instance of this class and sets the given string + * as its {@link yfiles.drawing.StringTemplateNodeStyle#svgContent}. + * @param {string} svgContent The SVG snippet to use as template. + */ + WithSvgContent:{ + new (svgContent:string):yfiles.drawing.StringTemplateNodeStyle; + }; + }; + /** + * An implementation of the {@link yfiles.drawing.INodeStyleRenderer} interface that + * can render {@link yfiles.drawing.ITemplateNodeStyle} instances. + * @see {@link yfiles.drawing.TemplateNodeStyle} + */ + export interface TemplateNodeStyleRenderer extends yfiles.drawing.ShapedNodeStyleRendererBase{ + /** + * Creates the visual by delegating to {@link yfiles.drawing.ITemplateNodeStyle#createTemplateContext}. + * @param {yfiles.drawing.IRenderContext} ctx The context for the creation. + * @return {yfiles.drawing.Visual} The visual that is used for rendering the node. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#createVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * Updates the {@link yfiles.drawing.NodeTemplateContext} correspondingly. + * @param {yfiles.drawing.IRenderContext} ctx The context for the creation. + * @param {yfiles.drawing.Visual} oldVisual The currently rendered visual. + * @return {yfiles.drawing.Visual} The visual that is used for rendering the node. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Gets the outline shape by delegating to {@link yfiles.drawing.ITemplateNodeStyle#outlineShape}. + * @see Overrides {@link yfiles.drawing.ShapedNodeStyleRendererBase#getOutlineShape} + */ + getOutlineShape(style:yfiles.drawing.ITemplateNodeStyle):yfiles.drawing.GeneralPath; + /** + * Gets the insets by delegating to {@link yfiles.drawing.ITemplateNodeStyle#insets}. + * @see Overrides {@link yfiles.drawing.ShapedNodeStyleRendererBase#getInsets} + */ + getInsets(style:yfiles.drawing.ITemplateNodeStyle):yfiles.geometry.InsetsD; + /** + * Gets the context by delegating to {@link yfiles.drawing.ITaggedStyleBase#contextLookup}. + * @see Overrides {@link yfiles.drawing.ShapedNodeStyleRendererBase#getContextLookup} + */ + getContextLookup(style:yfiles.drawing.ITemplateNodeStyle):yfiles.support.IContextLookup; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Gets the minimum size by delegating to {@link yfiles.drawing.ITemplateNodeStyle#minimumSize}. + */ + getMinimumSize(style:yfiles.drawing.ITemplateNodeStyle):yfiles.geometry.SizeD; + /** + * Calculates the preferred size given the current state of the renderer for the given context. + * @param {yfiles.drawing.IRenderContext} renderContext The render context for which the preferred size should be calculated. + * @return {yfiles.geometry.SizeD} The size as suggested by this renderer. + */ + getPreferredSizeWithContext(renderContext:yfiles.drawing.IRenderContext):yfiles.geometry.SizeD; + } + var TemplateNodeStyleRenderer:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.TemplateNodeStyleRenderer; + }; + /** + * The templatable {@link yfiles.drawing.ArrangeVisual} for {@link yfiles.graph.INode}s. + * This class is used by {@link yfiles.drawing.TemplateNodeStyleRenderer} which is responsible for displaying + * {@link yfiles.drawing.ITemplateNodeStyle}s. + */ + export interface NodeTemplateContext extends yfiles.drawing.GraphItemTemplateContextBase{ + /** + * Initializes this instance from the {@link yfiles.drawing.IRenderContext}. + * This method is called by {@link yfiles.drawing.TemplateNodeStyleRenderer}'s + * {@link yfiles.drawing.IVisualCreator#createVisual} implementation. + * @param {yfiles.drawing.IRenderContext} ctx The render context that is used for the rendering. + * @param {yfiles.graph.INode} node The node instance that is rendered by this visual. + * @param {yfiles.drawing.ITemplateNodeStyle} style The style instance that is associated with this visual. + */ + initializeFrom(ctx:yfiles.drawing.IRenderContext,node:yfiles.graph.INode,style:yfiles.drawing.ITemplateNodeStyle):void; + /** + * Updates this instance from the {@link yfiles.drawing.IRenderContext} after each invalidation of the {@link yfiles.canvas.CanvasControl}. + * This method is called by {@link yfiles.drawing.TemplateNodeStyleRenderer}'s + * {@link yfiles.drawing.IVisualCreator#updateVisual} implementation. + * @param {yfiles.drawing.IRenderContext} ctx The render context that is used for the rendering. + * @param {yfiles.graph.INode} node The node instance that is rendered by this visual. + * @param {yfiles.drawing.ITemplateNodeStyle} style The style instance that is associated with this visual. + */ + updateFor(ctx:yfiles.drawing.IRenderContext,node:yfiles.graph.INode,style:yfiles.drawing.ITemplateNodeStyle):void; + /** + * Updates the content property using the {@link yfiles.drawing.ITemplateNodeStyle}'s + * {@link yfiles.drawing.ITaggedStyleBase#userTagProvider}. + * @param {yfiles.drawing.ITemplateNodeStyle} style The style that is associated with this visual. + * @param {yfiles.graph.INode} node The node that is associated with this visual. + */ + updateContent(style:yfiles.drawing.ITemplateNodeStyle,node:yfiles.graph.INode):void; + /** + * The content of this instance. + */ + content:Object; + /** + * Arranges this visual using the {@link yfiles.graph.INode}'s {@link yfiles.graph.INode#layout}. + * @see {@link yfiles.system.UIElementExtensions#setCanvasArrangeRect} + * @param {yfiles.graph.INode} node The node to obtain the layout from. + */ + setArrangeRect(node:yfiles.graph.INode):void; + } + var NodeTemplateContext:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.NodeTemplateContext; + }; + /** + * The templatable {@link yfiles.drawing.ArrangeVisual} for {@link yfiles.graph.ILabel}s. + * This class is used by {@link yfiles.drawing.TemplateLabelStyleRenderer} which is responsible for displaying + * {@link yfiles.drawing.ITemplateLabelStyle}s. + */ + export interface LabelTemplateContext extends yfiles.drawing.GraphItemTemplateContextBase{ + /** + * Gets or sets a value indicating whether this instance has been flipped so that it points upwards. + * The {@link yfiles.drawing.TemplateLabelStyle#autoFlip} property determines whether segments should + * be rotated by 180 degrees if otherwise they would be rendered upside-down. This property indicates + * whether flipping has been applied. If this feature is disabled on the style, the value will always be + * false. + * Value: true if this instance is flipped by 180 degrees; otherwise, false. + */ + isFlipped:boolean; + /** + * Gets or sets a value indicating whether this instance is currently rendered upside down. + * The {@link yfiles.drawing.TemplateLabelStyle#autoFlip} property determines whether segments should + * be rotated by 180 degrees if otherwise they would be rendered upside-down. This property indicates + * whether flipping would need to be applied. If the feature is enabled on the style, the value will always be + * in sync with the IsFlipped property. + * Value: true if this instance needs to be flipped by 180 degrees in order to not be rendered upside-down; otherwise, false. + */ + isUpsideDown:boolean; + /** + * Gets or sets the label text property that is populated using the {@link yfiles.graph.ILabel}'s {@link yfiles.graph.ILabel#text} property. + * Value: The label text. + */ + labelText:string; + /** + * Called when the {@link yfiles.drawing.LabelTemplateContext#labelText} property has changed. + * This method calls {@link yfiles.drawing.LabelTemplateContext#writeBackLabelText} if the graph could be obtained from the {@link yfiles.drawing.GraphItemTemplateContextBase#canvas} property. + * @param {string} oldText The old text. + * @param {string} newText The new text. + */ + onLabelTextChanged(oldText:string,newText:string):void; + /** + * Callback that is used by {@link yfiles.drawing.LabelTemplateContext#onLabelTextChanged} to {@link yfiles.graph.IGraph#setLabelText write back the label text}. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {string} labelText The label text. + */ + writeBackLabelText(graph:yfiles.graph.IGraph,labelText:string):void; + /** + * Initializes this instance from the {@link yfiles.drawing.IRenderContext}. + * This method is called by {@link yfiles.drawing.TemplateLabelStyleRenderer}'s + * {@link yfiles.drawing.IVisualCreator#createVisual} implementation. + * @param {yfiles.drawing.IRenderContext} ctx The render context that is used for the rendering. + * @param {yfiles.graph.ILabel} label The label instance that is rendered by this visual. + * @param {yfiles.drawing.ITemplateLabelStyle} style The style instance that is associated with this visual. + */ + initializeFrom(ctx:yfiles.drawing.IRenderContext,label:yfiles.graph.ILabel,style:yfiles.drawing.ITemplateLabelStyle):void; + /** + * Updates this instance from the {@link yfiles.drawing.IRenderContext} after each invalidation of the {@link yfiles.canvas.CanvasControl}. + * This method is called by {@link yfiles.drawing.TemplateLabelStyleRenderer}'s + * {@link yfiles.drawing.IVisualCreator#updateVisual} implementation. + * @param {yfiles.drawing.IRenderContext} ctx The render context that is used for the rendering. + * @param {yfiles.graph.ILabel} label The label instance that is rendered by this visual. + * @param {yfiles.drawing.ITemplateLabelStyle} style The style instance that is associated with this visual. + */ + updateFor(ctx:yfiles.drawing.IRenderContext,label:yfiles.graph.ILabel,style:yfiles.drawing.ITemplateLabelStyle):void; + /** + * Updates the content property using the {@link yfiles.drawing.ITemplateLabelStyle}'s + * {@link yfiles.drawing.ITaggedStyleBase#userTagProvider}. + * @param {yfiles.drawing.ITemplateLabelStyle} style The style that is associated with this visual. + * @param {yfiles.graph.ILabel} label The label that is associated with this visual. + */ + updateContent(style:yfiles.drawing.ITemplateLabelStyle,label:yfiles.graph.ILabel):void; + /** + * The content of this instance. + */ + content:Object; + /** + * Sets the {@link yfiles.drawing.ArrangeVisual#bounds} + * property according to the {@link yfiles.graph.ILabel}'s {@link yfiles.graph.ILabel#layout}. + * @param {yfiles.graph.ILabel} label The label to obtain the layout from. + */ + setArrangeRect(label:yfiles.graph.ILabel):void; + } + var LabelTemplateContext:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.LabelTemplateContext; + }; + /** + * The interface for an {@link yfiles.drawing.INodeStyle} implementation that can be rendered + * by {@link yfiles.drawing.TemplateNodeStyleRenderer}. + * This style implementation provides the ability to use a templating + * mechanism to create the rendering for nodes. Implementations can use SVG templates for data and template binding. + *
+ * Related Information in the Developers Guide: + *

+ * More information on the templating mechanism can be found in the section Render Templates and Data Binding Support. + *

+ * @see {@link yfiles.drawing.TemplateNodeStyle} + */ + export interface ITemplateNodeStyle extends Object,yfiles.drawing.ITaggedStyleBase,yfiles.drawing.INodeStyle{ + /** + * Factory method that is called by the {@link yfiles.drawing.TemplateNodeStyleRenderer} to create the + * visual that will be used to display the node. + * The callee expects to receive a fully functional {@link yfiles.drawing.NodeTemplateContext#initializeFrom initialized} + * instance. + * @param {yfiles.drawing.IRenderContext} ctx The context for which the visual should be created. + * @param {yfiles.graph.INode} node The node that will be rendered. + * @return {yfiles.drawing.NodeTemplateContext} The initialized visual. + * @see Specified by {@link yfiles.drawing.ITemplateNodeStyle#createTemplateContext}. + */ + createTemplateContext(ctx:yfiles.drawing.IRenderContext,node:yfiles.graph.INode):yfiles.drawing.NodeTemplateContext; + /** + * Yields the insets an {@link yfiles.drawing.IInsetsProvider} implementation for + * {@link yfiles.graph.INode} should yield. + * This is especially useful if this style is used for {@link yfiles.graph.IGroupedGraph group nodes}, + * as they require insets for the calculation of the bounds. The insets can be used + * to make sure that child nodes do not cover the chrome of the style inside the insets. + * @see Specified by {@link yfiles.drawing.ITemplateNodeStyle#insets}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Yields the minimum size an {@link yfiles.input.ISizeConstraintProvider} implementation for + * {@link yfiles.graph.INode} should yield. + * @see Specified by {@link yfiles.drawing.ITemplateNodeStyle#minimumSize}. + */ + minimumSize:yfiles.geometry.SizeD; + /** + * Yields the shape of the outline of the node style which can then + * be used to calculate {@link yfiles.drawing.IHitTestable hit tests}, + * {@link yfiles.drawing.IMarqueeTestable marquee intersections}, etc. + * A value of null indicates that the default (rectangular) + * shape should not be changed. + * @see Specified by {@link yfiles.drawing.ITemplateNodeStyle#outlineShape}. + */ + outlineShape:yfiles.drawing.GeneralPath; + } + var ITemplateNodeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A {@link yfiles.drawing.ITemplateNodeStyle} that uses an SVG snippet as template + * for the visualization of {@link yfiles.graph.INode}s. + * The {@link yfiles.drawing.TemplateNodeStyle#renderTemplateId} is used to determine the template that + * will be applied to the {@link yfiles.drawing.Visual}. + */ + export interface TemplateNodeStyle extends yfiles.drawing.TemplateStyleBase,yfiles.drawing.ITemplateNodeStyle{ + /** + * Gets or sets the {@link String} that will be used to look up + * the template that is applied to the {@link yfiles.drawing.NodeTemplateContext}. + * Value: The resource key for the style or null. + */ + renderTemplateId:string; + /** + * Gets or sets the insets the {@link yfiles.drawing.IInsetsProvider} implementation for + * {@link yfiles.graph.INode} should yield for this instance. + * This is especially useful if this style is used for {@link yfiles.graph.IGroupedGraph group nodes}, + * as they require insets for the calculation of the bounds. The insets can be used + * to make sure that child nodes do not cover visual elements of the style inside the insets. + * The default value is an {@link yfiles.geometry.InsetsD} insets with 5 for all insets. + * @see {@link yfiles.drawing.IInsetsProvider} + * @see {@link yfiles.drawing.IStyleRenderer#getContext} + * @see Specified by {@link yfiles.drawing.ITemplateNodeStyle#insets}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Gets or sets the minimum size an {@link yfiles.input.ISizeConstraintProvider} implementation for + * {@link yfiles.graph.INode} should yield. + * @see {@link yfiles.input.ISizeConstraintProvider} + * @see Specified by {@link yfiles.drawing.ITemplateNodeStyle#minimumSize}. + */ + minimumSize:yfiles.geometry.SizeD; + /** + * Gets or sets the {@link yfiles.drawing.GeneralPath} of the outline of a node that will be displayed using the + * {@link yfiles.drawing.ITemplateNodeStyle#createTemplateContext created visual}. + * This shape will be used to satisfy requests to {@link yfiles.drawing.IMarqueeTestable#isInBox} and + * {@link yfiles.drawing.IHitTestable#isHit} and may be left null to indicate default (rectangular) + * behavior. + * @see Specified by {@link yfiles.drawing.ITemplateNodeStyle#outlineShape}. + */ + outlineShape:yfiles.drawing.GeneralPath; + /** + * Convenience method that determines the preferred size of the node if this style was applied. + * @param {yfiles.graph.INode} node The node to determine the preferred size of. Can be a live node or an {@link yfiles.graph.SimpleNode}. + * @param {yfiles.drawing.IRenderContext} context The context for which the size should be calculated. Can be obtained through {@link yfiles.canvas.CanvasControl#createRenderContext}. + * @return {yfiles.geometry.SizeD} The preferred size. + * @see {@link yfiles.canvas.CanvasControl#createRenderContext} + */ + getPreferredSize(node:yfiles.graph.INode,context:yfiles.drawing.IRenderContext):yfiles.geometry.SizeD; + /** + * Factory method that creates the {@link yfiles.drawing.TemplateNodeStyleRenderer renderer}. + * This method is used by the {@link yfiles.drawing.TemplateNodeStyle#templateStyleRenderer} property to initialize the backing field. + * @return {yfiles.drawing.TemplateNodeStyleRenderer} This implementation simply returns a new instance of {@link yfiles.drawing.TemplateNodeStyleRenderer} + */ + createRenderer():yfiles.drawing.TemplateNodeStyleRenderer; + /** + * Convenience getter that yields the {@link yfiles.drawing.TemplateNodeStyleRenderer} + * that is used by this instance. + * @see {@link yfiles.drawing.INodeStyle#renderer} + */ + templateStyleRenderer:yfiles.drawing.TemplateNodeStyleRenderer; + /** + * Factory method that is called by the {@link yfiles.drawing.TemplateNodeStyleRenderer} to create the + * visual that will be used to display the node. + * The callee expects to receive a fully functional {@link yfiles.drawing.NodeTemplateContext#initializeFrom initialized} + * instance. + * @param {yfiles.drawing.IRenderContext} ctx The context for which the visual should be created. + * @param {yfiles.graph.INode} node The node that will be rendered. + * @return {yfiles.drawing.NodeTemplateContext} The initialized visual. + * @see Specified by {@link yfiles.drawing.ITemplateNodeStyle#createTemplateContext}. + */ + createTemplateContext(ctx:yfiles.drawing.IRenderContext,node:yfiles.graph.INode):yfiles.drawing.NodeTemplateContext; + /** + * Adds the visual representation of item + * to the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * @param {yfiles.graph.INode} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.INode):void; + } + var TemplateNodeStyle:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of this class and sets the given key as + * {@link yfiles.drawing.TemplateNodeStyle#renderTemplateId}. + * @param {string} styleResourceKeyName The style resource key. + */ + WithKey:{ + new (styleResourceKeyName:string):yfiles.drawing.TemplateNodeStyle; + }; + /** + * Initializes a new instance of this class. + */ + new ():yfiles.drawing.TemplateNodeStyle; + }; + /** + * A {@link yfiles.drawing.ITemplatePortStyle} that uses an SVG snippet as template + * for the visualization of {@link yfiles.graph.IPort}s. + *

+ * In contrast to {@link yfiles.drawing.TemplatePortStyle}, the SVG template used + * by this style must be encoded as string and set to the + * {@link yfiles.drawing.StringTemplatePortStyle#svgContent} property. + * Note that the {@link yfiles.drawing.StringTemplatePortStyle#renderSize} should be specified to match the size of the visual's template. + *

+ *

+ * It is vital that the {@link yfiles.drawing.StringTemplatePortStyle#svgContent SVG snippet} does not + * declare the SVG namespace itself. Its content is parsed in a dummy namespace + * in order to avoid immediate validation of the result. The resulting SVG + * elements are automatically created in the SVG namespace before they are + * added to the DOM. + *

+ */ + export interface StringTemplatePortStyle extends yfiles.drawing.TemplateStyleBase,yfiles.drawing.ITemplatePortStyle{ + /** + * Gets or sets the SVG content that is the template for the port + * visualization. + */ + svgContent:string; + /** + * Gets or sets the {@link yfiles.geometry.Size} of the of a port that will be displayed using the + * {@link yfiles.drawing.ITemplatePortStyle#createTemplateContext created visual}. + * This size will be used to arrange the visual correctly. + * The default value is (5,5). + * @see Specified by {@link yfiles.drawing.ITemplatePortStyle#renderSize}. + */ + renderSize:yfiles.geometry.SizeD; + /** + * Gets or sets the {@link yfiles.drawing.GeneralPath} of the outline of a port that will be displayed using the + * {@link yfiles.drawing.ITemplatePortStyle#createTemplateContext created visual}. + * The shape will automatically be arranged and transformed to have the bounds of the port. + * This shape will be used to satisfy requests to {@link yfiles.drawing.IMarqueeTestable#isInBox} and + * {@link yfiles.drawing.IHitTestable#isHit} and may be left null to indicate default (rectangular) + * behavior. + * @see Specified by {@link yfiles.drawing.ITemplatePortStyle#outlineShape}. + */ + outlineShape:yfiles.drawing.GeneralPath; + /** + * Factory method that creates the {@link yfiles.drawing.TemplatePortStyleRenderer renderer}. + * This method is used by the {@link yfiles.drawing.StringTemplatePortStyle#templateStyleRenderer} property to initialize the backing field. + * @return {yfiles.drawing.TemplatePortStyleRenderer} This implementation simply returns a new instance of {@link yfiles.drawing.TemplatePortStyleRenderer}. + */ + createRenderer():yfiles.drawing.TemplatePortStyleRenderer; + /** + * Convenience getter that yields the {@link yfiles.drawing.TemplatePortStyleRenderer} + * that is used by this instance. + * @see {@link yfiles.drawing.IPortStyle#renderer} + */ + templateStyleRenderer:yfiles.drawing.TemplatePortStyleRenderer; + /** + * Convenience method that determines the preferred {@link yfiles.drawing.StringTemplatePortStyle#renderSize} of the port if this style was applied. + * @param {yfiles.graph.IPort} port The port to determine the preferred size of. + * @param {yfiles.drawing.IRenderContext} context The context for which the size should be calculated. + * @return {yfiles.geometry.SizeD} The preferred size. + */ + getPreferredSize(port:yfiles.graph.IPort,context:yfiles.drawing.IRenderContext):yfiles.geometry.SizeD; + /** + * Factory method that is called by the {@link yfiles.drawing.TemplatePortStyleRenderer} to create the + * visual that will be used to display the port. + * The callee expects to receive a fully functional {@link yfiles.drawing.PortTemplateContext#initializeFrom initialized} + * instance. + * @param {yfiles.drawing.IRenderContext} ctx The context for which the visual should be created. + * @param {yfiles.graph.IPort} port The port that will be rendered. + * @return {yfiles.drawing.PortTemplateContext} The initialized visual. + * @see Specified by {@link yfiles.drawing.ITemplatePortStyle#createTemplateContext}. + */ + createTemplateContext(ctx:yfiles.drawing.IRenderContext,port:yfiles.graph.IPort):yfiles.drawing.PortTemplateContext; + /** + * Adds the visual representation of item + * to the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * @param {yfiles.graph.IPort} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.IPort):void; + } + var StringTemplatePortStyle:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of this class. + */ + new ():yfiles.drawing.StringTemplatePortStyle; + /** + * Initializes a new instance of this class and sets the given string + * as its {@link yfiles.drawing.StringTemplatePortStyle#svgContent}. + * @param {string} svgContent The SVG snippet to use as template. + */ + WithSvgContent:{ + new (svgContent:string):yfiles.drawing.StringTemplatePortStyle; + }; + }; + /** + * Simple abstract base class of an {@link yfiles.drawing.ILabelStyleRenderer} that + * can be used to conveniently create custom label style implementations. + */ + export interface AbstractLabelStyleRenderer extends yfiles.drawing.AbstractStyleRenderer,yfiles.drawing.ILabelStyleRenderer{ + /** + * Holds the layout of the current label. + * This value is set during {@link yfiles.drawing.AbstractLabelStyleRenderer#configure} to the label's {@link yfiles.graph.ILabel#layout} + */ + layoutF:yfiles.geometry.IOrientedRectangle; + /** + * Retrieves the current {@link yfiles.graph.ILabel#layout}. + */ + layout:yfiles.geometry.IOrientedRectangle; + /** + * Determines if something has been hit at the given coordinates + * in the world coordinate system. + * Implementations should inspect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * and take the value into account when performing hit tests. + * This allows the user to hit elements even if the zoom level is very + * small and allows for accurate hit tests at greater zoom levels. + * @param {yfiles.geometry.PointD} p the coordinates in world coordinate system + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * This callback returns true if the corresponding + * item is considered to intersect the given rectangular box. + * This method may return false if the item cannot be + * selected using a selection marquee or optionally if the + * item is only partially contained within the box. + * Implementations should respect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * if marquee selections should behave differently on different zoom levels. + * @param {yfiles.geometry.RectD} box the box describing the marquee's bounds + * @param {yfiles.canvas.ICanvasContext} ctx the current canvas context + * @return {boolean} true if the item is considered to be captured by the marquee + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns a tight rectangular area where the whole rendering + * would fit into. + * If calculating the bounds is too expensive or the painting is not + * bound to a certain area, this method may return {@link yfiles.geometry.RectD#INFINITE}. + * If nothing is painted, this method should return an empty rectangle, where + * either or both the width and height is non-positive or + * {@link yfiles.geometry.RectD#EMPTY}. + * @param {yfiles.canvas.ICanvasContext} ctx the context to calculate the bounds for + * @return {yfiles.geometry.RectD} the bounds or {@link yfiles.geometry.RectD#EMPTY} to indicate an unbound area + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Uses the {@link yfiles.graph.ILabel#layout} to determine whether the clip intersects. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#isVisible} + * @see Specified by {@link yfiles.drawing.IVisibilityTest#isVisible}. + */ + isVisible(clip:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Factory method for the StyleDescriptor property. This method will be called + * upon first access to the {@link yfiles.drawing.AbstractStyleRenderer#styleDescriptor} property. + * @return {yfiles.canvas.ICanvasObjectDescriptor} an instance of {@link yfiles.drawing.LabelStyleDescriptor}. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#createStyleDescriptor} + */ + createStyleDescriptor():yfiles.canvas.ICanvasObjectDescriptor; + /** + * Calculates the preferred size given the current state of the renderer. + * @return {yfiles.geometry.SizeD} The size as suggested by this renderer. + */ + getPreferredSizeImpl():yfiles.geometry.SizeD; + /** + * Calculates the {@link yfiles.graph.ILabel#preferredSize preferred size} + * of a given label using the associated style. + * @param {yfiles.graph.ILabel} label The label to determine the preferred size for + * @param {yfiles.drawing.ILabelStyle} style The style instance that uses this instance as its + * {@link yfiles.drawing.ILabelStyle#renderer} + * @return {yfiles.geometry.SizeD} A size that can be used as the {@link yfiles.graph.ILabel#preferredSize} + * if this renderer paints the label using the associated style. + * @see Specified by {@link yfiles.drawing.ILabelStyleRenderer#getPreferredSize}. + */ + getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle):yfiles.geometry.SizeD; + /** + * Determines whether the label's style should automatically flip the painting contents if the + * {@link yfiles.drawing.AbstractLabelStyleRenderer#layout} is upside down. + * @return {boolean} This default implementation returns true, always. + */ + isAutoFlip():boolean; + /** + * Stores the {@link yfiles.graph.ILabel#layout} into {@link yfiles.drawing.AbstractLabelStyleRenderer#layoutF}. + * Subclasses should override this method, call the super implementation and configure their + * painting entities. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#configure} + */ + configure():void; + } + var AbstractLabelStyleRenderer:{ + $class:yfiles.lang.Class; + new (labelStyleType:yfiles.lang.Class):yfiles.drawing.AbstractLabelStyleRenderer; + }; + /** + * Abstract base class for {@link yfiles.drawing.IEdgeStyleRenderer}. + */ + export interface AbstractEdgeStyleRenderer extends yfiles.drawing.AbstractStyleRenderer,yfiles.drawing.IPathGeometry,yfiles.drawing.IEdgeStyleRenderer{ + /** + * Calculate and update the anchor and the source arrow's direction vector. + * @param {yfiles.drawing.IArrow} arrow The arrow to calculate the anchor for. + * @param {yfiles.geometry.PointD} anchorPoint The tip of the arrow. + * @param {yfiles.geometry.PointD} arrowDirection The direction vector of the arrow. + * @return {boolean} Whether an anchor has been successfully determined. + */ + getSourceArrowAnchor(arrow:yfiles.drawing.IArrow,anchorPoint:{value:yfiles.geometry.PointD;},arrowDirection:{value:yfiles.geometry.PointD;}):boolean; + /** + * Calculate and update the anchor and the target arrow's direction vector. + * @param {yfiles.drawing.IArrow} arrow The arrow to calculate the anchor for. + * @param {yfiles.geometry.PointD} anchorPoint The tip of the arrow. + * @param {yfiles.geometry.PointD} arrowDirection The direction vector of the arrow. + * @return {boolean} Whether an anchor has been successfully determined. + */ + getTargetArrowAnchor(arrow:yfiles.drawing.IArrow,anchorPoint:{value:yfiles.geometry.PointD;},arrowDirection:{value:yfiles.geometry.PointD;}):boolean; + /** + * Factory method for the StyleDescriptor property which creates a plain {@link yfiles.drawing.EdgeStyleDescriptor}. + * @return {yfiles.canvas.ICanvasObjectDescriptor} + * An ICanvasObjectDescriptor instance that will delegate to this instance's methods + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#createStyleDescriptor} + */ + createStyleDescriptor():yfiles.canvas.ICanvasObjectDescriptor; + /** + * Gets an implementation of the {@link yfiles.drawing.IPathGeometry} interface that can + * handle the provided edge and its associated style. + * @param {yfiles.graph.IEdge} edge The edge to provide an instance for + * @param {yfiles.drawing.IEdgeStyle} style The style to use for the painting + * @return {yfiles.drawing.IPathGeometry} this + * @see {@link yfiles.drawing.AbstractStyleRenderer#configure} + * @see {@link yfiles.drawing.AbstractEdgeStyleRenderer#getTangent} + * @see {@link yfiles.drawing.AbstractEdgeStyleRenderer#getTangentForIndex} + * @see {@link yfiles.drawing.AbstractEdgeStyleRenderer#getSegmentCount} + * @see {@link yfiles.drawing.AbstractEdgeStyleRenderer#getPath} + * @see Specified by {@link yfiles.drawing.IEdgeStyleRenderer#getPathGeometry}. + */ + getPathGeometry(edge:yfiles.graph.IEdge,style:yfiles.drawing.IEdgeStyle):yfiles.drawing.IPathGeometry; + /** + * Calculates the tangent on the edge's path at the given ratio point. + * This method is part of the {@link yfiles.drawing.IPathGeometry} interface, that is implemented by this class. + * This interface will be returned by {@link yfiles.drawing.AbstractEdgeStyleRenderer#getPathGeometry}. + * The result is provided through the various out parameters. If the method returns false, no valid result could be calculated and + * the values of the out parameters should be ignored. + * @param {number} ratio a value in [0,1] where 0 is the source's end and 1 is at the target's end of the visible edge path + * @param {yfiles.geometry.PointD} p The coordinates in world-coordinate space that denotes the tangent point. + * @param {yfiles.geometry.PointD} tangent The vector which is tangent to the edge's path at the point denoted by p. The tangent vector + * needs not necessarily be normalized. + * @return {boolean} + * true iff the values in the out parameters are valid. + * @see {@link yfiles.drawing.AbstractEdgeStyleRenderer#getPathGeometry} + * @see Specified by {@link yfiles.drawing.IPathGeometry#getTangent}. + */ + getTangent(ratio:number,p:{value:yfiles.geometry.PointD;},tangent:{value:yfiles.geometry.PointD;}):boolean; + /** + * Calculates the tangent on the edge's path at the given ratio point for the given segment. + * This method is part of the {@link yfiles.drawing.IPathGeometry} interface, that is implemented by this class. + * This interface will be returned by {@link yfiles.drawing.AbstractEdgeStyleRenderer#getPathGeometry}. + * The result is provided through the various out parameters. If the method returns false, no valid result could be calculated and + * the values of the out parameters should be ignored. + * @param {number} segmentIndex the segment to use for the calculation + * @param {number} ratio a value in [0,1] where 0 is the source's end and 1 is at the target's end of the segment + * @param {yfiles.geometry.PointD} p The coordinates in world-coordinate space that denotes the tangent point. + * @param {yfiles.geometry.PointD} tangent The vector which is tangent to the edge's path at the point denoted by p. The tangent vector + * needs not necessarily be normalized. + * @return {boolean} + * true iff the values in the out parameters are valid. + * @see {@link yfiles.drawing.AbstractEdgeStyleRenderer#getTangent} + * @see {@link yfiles.drawing.AbstractEdgeStyleRenderer#getSegmentCount} + * @see {@link yfiles.drawing.AbstractEdgeStyleRenderer#getPathGeometry} + * @see Specified by {@link yfiles.drawing.IPathGeometry#getTangentForIndex}. + */ + getTangentForIndex(segmentIndex:number,ratio:number,p:{value:yfiles.geometry.PointD;},tangent:{value:yfiles.geometry.PointD;}):boolean; + /** + * Returns the number of "segments" this edge's path consists of. + * This method is part of the {@link yfiles.drawing.IPathGeometry} interface, that is implemented by this class. + * This interface will be returned by {@link yfiles.drawing.AbstractEdgeStyleRenderer#getPathGeometry}. + * @return {number} + * the number of segments or -1 if there is no such thing as a segment for this edge. + * @see {@link yfiles.drawing.AbstractEdgeStyleRenderer#getPathGeometry} + * @see Specified by {@link yfiles.drawing.IPathGeometry#getSegmentCount}. + */ + getSegmentCount():number; + /** + * Returns a representation of the visible path of the edge in form of a {@link yfiles.drawing.GeneralPath}. + * This method is part of the {@link yfiles.drawing.IPathGeometry} interface, that is implemented by this class. + * This interface will be returned by {@link yfiles.drawing.AbstractEdgeStyleRenderer#getPathGeometry}. + * @return {yfiles.drawing.GeneralPath} + * An instance that describes the visible path or null if this is not applicable for the current geometry. + * @see {@link yfiles.drawing.AbstractEdgeStyleRenderer#getPathGeometry} + * @see Specified by {@link yfiles.drawing.IPathGeometry#getPath}. + */ + getPath():yfiles.drawing.GeneralPath; + } + var AbstractEdgeStyleRenderer:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.AbstractEdgeStyleRenderer} class. + * This method does nothing. + */ + new (edgeStyleType:yfiles.lang.Class):yfiles.drawing.AbstractEdgeStyleRenderer; + }; + /** + * The templatable {@link yfiles.drawing.ArrangeVisual} for {@link yfiles.graph.IPort}s. + * This class is used by {@link yfiles.drawing.TemplatePortStyleRenderer} which is responsible for displaying + * {@link yfiles.drawing.ITemplatePortStyle}s. + */ + export interface PortTemplateContext extends yfiles.drawing.GraphItemTemplateContextBase{ + /** + * Initializes this instance from the {@link yfiles.drawing.IRenderContext}. + * This method is called by {@link yfiles.drawing.TemplateNodeStyleRenderer}'s + * {@link yfiles.drawing.IVisualCreator#createVisual} implementation. + * @param {yfiles.drawing.IRenderContext} ctx The render context that is used for the rendering. + * @param {yfiles.graph.IPort} port The port instance that is rendered by this visual. + * @param {yfiles.drawing.ITemplatePortStyle} style The style instance that is associated with this visual. + */ + initializeFrom(ctx:yfiles.drawing.IRenderContext,port:yfiles.graph.IPort,style:yfiles.drawing.ITemplatePortStyle):void; + /** + * Updates this instance from the {@link yfiles.drawing.IRenderContext} after each invalidation of the {@link yfiles.canvas.CanvasControl}. + * This method is called by {@link yfiles.drawing.TemplateNodeStyleRenderer}'s + * {@link yfiles.drawing.IVisualCreator#updateVisual} implementation. + * @param {yfiles.drawing.IRenderContext} ctx The render context that is used for the rendering. + * @param {yfiles.graph.IPort} port The node instance that is rendered by this visual. + * @param {yfiles.drawing.ITemplatePortStyle} style The style instance that is associated with this visual. + */ + updateFor(ctx:yfiles.drawing.IRenderContext,port:yfiles.graph.IPort,style:yfiles.drawing.ITemplatePortStyle):void; + /** + * Updates the content property using the {@link yfiles.drawing.ITemplateNodeStyle}'s + * {@link yfiles.drawing.ITaggedStyleBase#userTagProvider}. + * @param {yfiles.drawing.ITemplatePortStyle} style The style that is associated with this visual. + * @param {yfiles.graph.IPort} port The node that is associated with this visual. + */ + updateContent(style:yfiles.drawing.ITemplatePortStyle,port:yfiles.graph.IPort):void; + /** + * The content of this instance. + */ + content:Object; + /** + * Sets the {@link yfiles.drawing.GraphItemTemplateContextBase#bounds} + * property according to the {@link yfiles.drawing.ITemplatePortStyle}'s {@link yfiles.drawing.ITemplatePortStyle#renderSize}. + * @param {yfiles.drawing.ITemplatePortStyle} style The port to obtain the layout from. + */ + setSize(style:yfiles.drawing.ITemplatePortStyle):void; + } + var PortTemplateContext:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.PortTemplateContext; + }; + /** + * Abstract base class for {@link yfiles.drawing.Visual}s that can be used + * to display {@link yfiles.model.IModelItem}s like {@link yfiles.graph.INode}, {@link yfiles.graph.ILabel}, etc. in a + * {@link yfiles.canvas.CanvasControl}. + * Non-abstract subclasses of this visual are used by {@link yfiles.drawing.INodeStyle} implementations and the like + * for the visualization of the rendering. + * @see {@link yfiles.drawing.TemplateNodeStyle} + */ + export interface GraphItemTemplateContextBase extends yfiles.drawing.ArrangeVisual,yfiles.system.INotifyPropertyChanged{ + /** + * Gets the element that corresponds to this visual. + * Usually this will be an SVG element or the root of an SVG document fragment. + */ + svgElement:Element; + /** + * Sets the {@link yfiles.drawing.GraphItemTemplateContextBase#svgElement} of this instance. + */ + setSvgElement(element:Element):void; + /** + * Gets or sets the bounds of this visual. + */ + bounds:yfiles.geometry.RectD; + /** + * Gets the width of the {@link yfiles.drawing.GraphItemTemplateContextBase#svgElement}. + */ + width:number; + /** + * Gets the height of the {@link yfiles.drawing.GraphItemTemplateContextBase#svgElement}. + */ + height:number; + visible:boolean; + /** + * Gets or sets the transformation matrix of this visual. + */ + transform:yfiles.geometry.Matrix2D; + /** + * Gets or sets the canvas instance this instance is used in. + * Value: The canvas control. + */ + canvas:yfiles.canvas.CanvasControl; + /** + * Called when the item selection state changes. + * @param {boolean} oldValue The old selection state. + * @param {boolean} newValue The new selection state. + * @see {@link yfiles.drawing.GraphItemTemplateContextBase#itemSelected} + */ + onItemSelectedChanged(oldValue:boolean,newValue:boolean):void; + /** + * Gets or sets a value indicating whether the item is currently selected. + * This state is bound to the {@link yfiles.graph.IGraphSelection} which is used in the + * {@link yfiles.drawing.GraphItemTemplateContextBase#canvas} this visual is being used in. + * Setting this value will write through to the {@link yfiles.graph.IGraphSelection}. + * Value: true if the item is selected; otherwise, false. + */ + itemSelected:boolean; + /** + * Called when the item focus state changes. + * @param {boolean} oldValue The old focus state. + * @param {boolean} newValue The new focus state. + * @see {@link yfiles.drawing.GraphItemTemplateContextBase#itemFocused} + */ + onItemFocusedChanged(oldValue:boolean,newValue:boolean):void; + /** + * Gets or sets a value indicating whether the item is the currently focused item + * in the {@link yfiles.canvas.GraphControl}. + * This state is bound to the {@link yfiles.canvas.GraphControl#currentItem} which is used in the + * {@link yfiles.drawing.GraphItemTemplateContextBase#canvas} this visual is being used in. + * Setting this value will write through to the {@link yfiles.canvas.GraphControl#currentItem}. + * Value: true if the item is focused; otherwise, false. + */ + itemFocused:boolean; + /** + * Called when the item highlight state changes. + * @param {boolean} oldValue The old highlight state. + * @param {boolean} newValue The new highlight state. + * @see {@link yfiles.drawing.GraphItemTemplateContextBase#itemHighlighted} + */ + onItemHighlightedChanged(oldValue:boolean,newValue:boolean):void; + /** + * Gets or sets a value indicating whether the item is currently highlighted. + * This state is bound to the {@link yfiles.model.HighlightPaintManager} which is used in the + * {@link yfiles.drawing.GraphItemTemplateContextBase#canvas} this visual is being used in. + * Setting this value will write through to the {@link yfiles.model.HighlightPaintManager}'s + * {@link yfiles.model.HighlightPaintManager#selectionModel} + * Value: true if the item is highlighted; otherwise, false. + */ + itemHighlighted:boolean; + /** + * Gets or sets the item that is rendered by this instance. + * Value: The item. + */ + item:TModelItem; + /** + * Gets or sets the style tag that is associated with the style that created this visual. + * This property can be used by implementers as a convenient property to pass data to the visual. + * Value: The style tag. + */ + styleTag:Object; + onPropertyChanged(propertyChangedEventArgs:yfiles.system.PropertyChangedEventArgs):void; + /** + * A property change event that is fired when a + * property of the item has been changed. + */ + addPropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * A property change event that is fired when a + * property of the item has been changed. + */ + removePropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + } + var GraphItemTemplateContextBase:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.GraphItemTemplateContextBase; + }; + /** + * Common interface for all {@link yfiles.drawing.IVisualStyle}s that use + * {@link yfiles.drawing.DataTemplate templating} techniques to skin the appearance of + * the items. + * This interface defines access to the {@link yfiles.drawing.IUIElementStyle#template} + * instances which will be used during the rendering to create the visual representation for + * the model item. + *
+ * Related Information in the Developers Guide: + *

+ * More information on the templating mechanism can be found in the section Render Templates and Data Binding Support. + *

+ */ + export interface IUIElementStyle extends Object,yfiles.drawing.ITaggedStyleBase{ + /** + * Provides the {@link yfiles.drawing.DataTemplate} that will be used to create the visual + * representation for the item that is assigned this style instance. + * @see Specified by {@link yfiles.drawing.IUIElementStyle#template}. + */ + template:yfiles.drawing.DataTemplate; + } + var IUIElementStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An abstract implementation of an {@link yfiles.drawing.INodeStyleRenderer} which must be parameterized + * using the concrete {@link yfiles.drawing.INodeStyle} interface used by subclasses. + * The most simple implementation needs to implement the + * {@link yfiles.drawing.AbstractStyleRenderer#createVisual} + * method only. + * This class additionally implements the {@link yfiles.drawing.IShapeGeometry} interface + * and will return itself when queried using the {@link yfiles.drawing.AbstractNodeStyleRenderer#getShapeGeometry} + * method. + */ + export interface AbstractNodeStyleRenderer extends yfiles.drawing.AbstractStyleRenderer,yfiles.drawing.IShapeGeometry,yfiles.drawing.INodeStyleRenderer{ + /** + * Factory method for the NodeStyleDescriptor property. This method will be called + * upon first access to the {@link yfiles.drawing.AbstractStyleRenderer#styleDescriptor} property. + * @return {yfiles.canvas.ICanvasObjectDescriptor} an instance of {@link yfiles.drawing.NodeStyleDescriptor}. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#createStyleDescriptor} + */ + createStyleDescriptor():yfiles.canvas.ICanvasObjectDescriptor; + /** + * Returns the {@link yfiles.graph.INode#layout} of the node this renderer is currently + * configured for. + * Returns item.Layout. + */ + layout:yfiles.geometry.IRectangle; + /** + * This is an empty implementation of the {@link yfiles.drawing.AbstractStyleRenderer#configure} + * method. Subclasses should override this. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#configure} + */ + configure():void; + /** + * Hit tests the {@link yfiles.drawing.AbstractStyleRenderer#item node} using the + * current {@link yfiles.drawing.AbstractStyleRenderer#style}. + * This implementation uses the {@link yfiles.drawing.AbstractNodeStyleRenderer#layout} to determine whether the node has been hit. + * The check is delegated to {@link yfiles.geometry.RectD#containsPointDEps} + * using {@link yfiles.canvas.ICanvasContext#hitTestRadius} as the last argument. + * @param {yfiles.geometry.PointD} p the coordinates in world coordinate system + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#isHit} + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Tests the {@link yfiles.drawing.AbstractStyleRenderer#item node} using the + * current {@link yfiles.drawing.AbstractStyleRenderer#style} for an intersection with the + * given box. + * This implementation uses the {@link yfiles.drawing.AbstractNodeStyleRenderer#layout} to determine whether the node is in the box. + * @param {yfiles.geometry.RectD} box the box describing the marquee's bounds + * @param {yfiles.canvas.ICanvasContext} ctx the current canvas context + * @return {boolean} + * true if the node is considered to be captured by the marquee + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#isInBox} + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Determines visibility by checking for an intersection with the {@link yfiles.drawing.AbstractNodeStyleRenderer#layout}. + * @param {yfiles.geometry.RectD} clip The current clip + * @param {yfiles.canvas.ICanvasContext} ctx The context. + * @return {boolean} Whether the {@link yfiles.drawing.AbstractNodeStyleRenderer#layout} is visible in the clip. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#isVisible} + * @see Specified by {@link yfiles.drawing.IVisibilityTest#isVisible}. + */ + isVisible(clip:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns the layout bounds as an upper bound for the painting bound. + * This implementation simply sets the {@link yfiles.drawing.AbstractNodeStyleRenderer#layout}'s bounds to the scratch variable + * and returns. + * @param {yfiles.canvas.ICanvasContext} ctx the context to calculate the bounds for + * @return {yfiles.geometry.RectD} + * the bounds or null to indicate an unbound area + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#getBounds} + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Configures the {@link yfiles.drawing.AbstractStyleRenderer#style} and + * {@link yfiles.drawing.AbstractStyleRenderer#item} parameters, + * calls {@link yfiles.drawing.AbstractNodeStyleRenderer#configure} and returns this. + * @param {yfiles.graph.INode} node The node to retrieve the shape geometry for. The value will + * be stored in the {@link yfiles.drawing.AbstractStyleRenderer#itemF} + * field by {@link yfiles.drawing.AbstractStyleRenderer#setItem}. + * @param {yfiles.drawing.INodeStyle} style The style to associate with the node. The value will + * be stored in the {@link yfiles.drawing.AbstractStyleRenderer#styleF} + * field by {@link yfiles.drawing.AbstractStyleRenderer#setStyle}. + * @return {yfiles.drawing.IShapeGeometry} this + * @see {@link yfiles.drawing.AbstractNodeStyleRenderer#isInside} + * @see {@link yfiles.drawing.AbstractNodeStyleRenderer#getIntersection} + * @see Specified by {@link yfiles.drawing.INodeStyleRenderer#getShapeGeometry}. + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):yfiles.drawing.IShapeGeometry; + /** + * Finds an intersection for the current + * {@link yfiles.drawing.AbstractStyleRenderer#itemF node} using the + * {@link yfiles.drawing.AbstractStyleRenderer#styleF}. + * This implementation returns the intersection for the {@link yfiles.drawing.AbstractNodeStyleRenderer#layout}. + * @return {yfiles.geometry.PointD} True if an intersection was actually found + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getIntersection}. + */ + getIntersection(inner:yfiles.geometry.PointD,outer:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Checks whether the given coordinate lies within the shape's geometric bounds. + * This implementation checks for containment in the {@link yfiles.drawing.AbstractNodeStyleRenderer#layout}. + * @return {boolean} + * True if the point lies within the geometry of the rendering. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#isInside}. + */ + isInside(point:yfiles.geometry.PointD):boolean; + /** + * Returns the outline of the shape using the node's {@link yfiles.drawing.AbstractNodeStyleRenderer#layout}. + * @return {yfiles.drawing.GeneralPath} + * The outline of the bounds of the node. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getOutline}. + */ + getOutline():yfiles.drawing.GeneralPath; + } + var AbstractNodeStyleRenderer:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.AbstractNodeStyleRenderer} class. + */ + new (nodeStyleType:yfiles.lang.Class):yfiles.drawing.AbstractNodeStyleRenderer; + }; + /** + * A generic {@link yfiles.model.IModelItemInstaller} for {@link yfiles.model.IModelItem}s that have + * a specific {@link yfiles.drawing.IVisualStyle} in their {@link yfiles.support.ILookup#lookup}. + */ + export interface StyleInstaller> extends Object,yfiles.model.IModelItemInstaller{ + /** + * Gets or sets a comparer that compares the items so that they are put into the correct order + * in the canvas tree. + * If this instance is set to null this feature is effectively turned off. + */ + comparer:yfiles.collections.IComparer; + /** + * Gets or sets the canvas group provider that will be used for installing the item. + * Value: The canvas group provider. + */ + canvasGroupProvider:yfiles.model.ICanvasGroupProvider; + /** + * Central method that performs the installation of an item's + * visual representation in the canvas using the TVisualStyle in the item's + * lookup. + * This implementation calls {@link yfiles.model.IModelItemInstaller#install} on the style instance + * obtained through the lookup. + * @param {TItem} item The item to install. + * @param {yfiles.model.IInstallerContext} context The canvas to {@link yfiles.model.IInstallerContext#addInstalled add installed} + * canvas objects for the item to. + * @return {void} + * All canvas objects this method has added to the canvas control. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:TItem):void; + } + var StyleInstaller:{ + $class:yfiles.lang.Class; + new >(itemType:yfiles.lang.Class,styleType:yfiles.lang.Class):yfiles.drawing.StyleInstaller; + }; + /** + * A label model for node labels that lie inside of the node's {@link yfiles.graph.INode#layout} + * bounds and have been stretched to fit the node's size. + * This label model supports 5 positions inside of the layout's bounds. + */ + export interface InteriorStretchLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{ + /** + * Gets or sets the insets to use within the node's {@link yfiles.graph.INode#layout}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Creates the parameter for the given position. + * @param {yfiles.drawing.InteriorStretchLabelModel.Position} position The position. + * @return {yfiles.graph.ILabelModelParameter} + */ + createParameter(position:yfiles.drawing.InteriorStretchLabelModel.Position_Interface):yfiles.graph.ILabelModelParameter; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,labelModel:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * Returns the insets this model would require for the node owner of the label if the the given label was used with + * the provided parameter. + * @param {yfiles.graph.ILabel} label The label to use. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use. + * @return {yfiles.geometry.InsetsD} The insets rectangle. + */ + getNodeInsets(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.InsetsD; + /** + * Returns the minimum size this model would require for the node owner of the label if the the given label was used with + * the provided parameter. + * @param {yfiles.graph.ILabel} label The label to use. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use. + * @return {yfiles.geometry.SizeD} The minimum size requirements for this label. + */ + getMinimumNodeSize(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.SizeD; + } + export module InteriorStretchLabelModel{ + export interface Position_Interface{} + } + var InteriorStretchLabelModel:{ + $class:yfiles.lang.Class; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instance's {@link yfiles.drawing.InteriorStretchLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + NORTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instance's {@link yfiles.drawing.InteriorStretchLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instance's {@link yfiles.drawing.InteriorStretchLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + SOUTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instance's {@link yfiles.drawing.InteriorStretchLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + WEST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instance's {@link yfiles.drawing.InteriorStretchLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + CENTER:yfiles.graph.ILabelModelParameter; + Position:{ + NORTH:yfiles.drawing.InteriorStretchLabelModel.Position_Interface; + EAST:yfiles.drawing.InteriorStretchLabelModel.Position_Interface; + SOUTH:yfiles.drawing.InteriorStretchLabelModel.Position_Interface; + WEST:yfiles.drawing.InteriorStretchLabelModel.Position_Interface; + CENTER:yfiles.drawing.InteriorStretchLabelModel.Position_Interface; + }; + /** + * Creates a new instance of this model with empty insets. + */ + new ():yfiles.drawing.InteriorStretchLabelModel; + }; + /** + * Interface used by {@link yfiles.drawing.IEdgeStyle} implementations + * that can be used to query the actual {@link yfiles.drawing.IVisualCreator}, {@link yfiles.drawing.IVisibilityTest}, + * {@link yfiles.drawing.IBoundsProvider}, {@link yfiles.drawing.IHitTestable}, and + * {@link yfiles.drawing.IMarqueeTestable} implementations for an item + * and an associated style. + * @see {@link yfiles.drawing.IStyleRenderer} + * @see {@link yfiles.drawing.IEdgeStyle} + * @see {@link yfiles.graph.IEdge} + */ + export interface IEdgeStyleRenderer extends Object,yfiles.drawing.IStyleRenderer{ + /** + * Gets an implementation of the {@link yfiles.drawing.IPathGeometry} interface that can + * handle the provided edge and its associated style. + * This method may return a flyweight implementation. + * @param {yfiles.graph.IEdge} edge The edge to provide an instance for + * @param {yfiles.drawing.IEdgeStyle} style The style to use for the painting + * @return {yfiles.drawing.IPathGeometry} An implementation that may be used to subsequently query geometry information from. + * Clients should not cache this instance and must always call + * this method immediately before using the value returned. This enables the + * use of the flyweight design pattern for implementations + * @see Specified by {@link yfiles.drawing.IEdgeStyleRenderer#getPathGeometry}. + */ + getPathGeometry(edge:yfiles.graph.IEdge,style:yfiles.drawing.IEdgeStyle):yfiles.drawing.IPathGeometry; + } + var IEdgeStyleRenderer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The generic base interface used by visual styles implementations. + * Visual styles are responsible for rendering {@link yfiles.model.IModelItem} + * instances in a {@link yfiles.canvas.CanvasControl}. + * It is up to the implementation to interpret the visual appearance of an + * item. + * This interface extends the {@link yfiles.model.IModelItemInstaller} + * interface for TModelItem to allow for installing the item into the + * {@link yfiles.canvas.CanvasControl}. + * This interface extends the {@link yfiles.system.ICloneable} interface. This allows clients + * to obtain a copy of the current state of this style. Note that unless noted otherwise + * the clones are shallow clones, so aggregated properties are shared between the clones. + * Immutable style implementations may return themselves, instead. + */ + export interface IVisualStyle extends Object,yfiles.model.IModelItemInstaller,yfiles.system.ICloneable{ + } + var IVisualStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A label model for node labels that lie inside of the node's {@link yfiles.graph.INode#layout} + * bounds. + * This label model supports nine positions inside of the layout's bounds. + */ + export interface InteriorLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{ + /** + * Gets or sets the insets to use within the node's {@link yfiles.graph.INode#layout}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Creates the parameter for the given position. + * @param {yfiles.drawing.InteriorLabelModel.Position} position The position. + * @return {yfiles.graph.ILabelModelParameter} + */ + createParameter(position:yfiles.drawing.InteriorLabelModel.Position_Interface):yfiles.graph.ILabelModelParameter; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns the insets this model would require for the node owner of the label if the the given label was used with + * the provided parameter. + * @param {yfiles.graph.ILabel} label The label to use. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use. + * @return {yfiles.geometry.InsetsD} The insets rectangle. + */ + getNodeInsets(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.InsetsD; + /** + * Returns the minimum size this model would require for the node owner of the label if the the given label was used with + * the provided parameter. + * @param {yfiles.graph.ILabel} label The label to use. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use. + * @return {yfiles.geometry.SizeD} The minimum size requirements for this label. + */ + getMinimumNodeSize(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.geometry.SizeD; + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,labelModel:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + } + export module InteriorLabelModel{ + export interface Position_Interface{} + } + var InteriorLabelModel:{ + $class:yfiles.lang.Class; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.InteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + NORTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.InteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.InteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + SOUTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.InteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + SOUTH_EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.InteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + SOUTH_WEST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.InteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + WEST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.InteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + NORTH_EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.InteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + NORTH_WEST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.InteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + CENTER:yfiles.graph.ILabelModelParameter; + Position:{ + NORTH:yfiles.drawing.InteriorLabelModel.Position_Interface; + EAST:yfiles.drawing.InteriorLabelModel.Position_Interface; + SOUTH:yfiles.drawing.InteriorLabelModel.Position_Interface; + WEST:yfiles.drawing.InteriorLabelModel.Position_Interface; + NORTH_EAST:yfiles.drawing.InteriorLabelModel.Position_Interface; + SOUTH_EAST:yfiles.drawing.InteriorLabelModel.Position_Interface; + NORTH_WEST:yfiles.drawing.InteriorLabelModel.Position_Interface; + SOUTH_WEST:yfiles.drawing.InteriorLabelModel.Position_Interface; + CENTER:yfiles.drawing.InteriorLabelModel.Position_Interface; + }; + /** + * Creates a new instance of this model with empty insets. + */ + new ():yfiles.drawing.InteriorLabelModel; + }; + /** + * The interface for the visual representation of an arrow that is normally + * used to decorate the visual representation of an {@link yfiles.graph.IEdge}. + * Instances of this class are used by {@link yfiles.drawing.IEdgeStyle} implementations. + */ + export interface IArrow extends Object{ + /** + * Returns the length of the arrow, i.e. the distance from the arrow's tip to + * the position where the visual representation of the edge's path should begin. + * @see Specified by {@link yfiles.drawing.IArrow#length}. + */ + length:number; + /** + * Gets the cropping length associated with this instance. + * This value is used by {@link yfiles.drawing.IEdgeStyle} implementations to let the + * edge appear to end shortly before its actual target. + * @see Specified by {@link yfiles.drawing.IArrow#cropLength}. + */ + cropLength:number; + /** + * Gets an {@link yfiles.drawing.IVisualCreator} implementation that will paint this arrow + * at the given location using the given direction for the given edge. + * @param {yfiles.graph.IEdge} edge the edge this arrow belongs to + * @param {boolean} atSource whether this will be the source arrow + * @param {yfiles.geometry.PointD} anchor the anchor point for the tip of the arrow + * @param {yfiles.geometry.PointD} direction the direction the arrow is pointing in + * @return {yfiles.drawing.IVisualCreator} an implementation of the {@link yfiles.drawing.IVisualCreator} interface that can + * subsequently be used to perform the actual painting. Clients will always call + * this method before using the implementation and may not cache the instance returned. + * This allows for applying the flyweight design pattern to implementations. + * @see Specified by {@link yfiles.drawing.IArrow#getPaintable}. + */ + getPaintable(edge:yfiles.graph.IEdge,atSource:boolean,anchor:yfiles.geometry.PointD,direction:yfiles.geometry.PointD):yfiles.drawing.IVisualCreator; + /** + * Gets an {@link yfiles.drawing.IBoundsProvider} implementation that can yield + * this arrow's bounds if painted at the given location using the + * given direction for the given edge. + * @param {yfiles.graph.IEdge} edge the edge this arrow belongs to + * @param {boolean} atSource whether this will be the source arrow + * @param {yfiles.geometry.PointD} anchor the anchor point for the tip of the arrow + * @param {yfiles.geometry.PointD} direction the direction the arrow is pointing in + * @return {yfiles.drawing.IBoundsProvider} an implementation of the {@link yfiles.drawing.IBoundsProvider} interface that can + * subsequently be used to query the bounds. Clients will always call + * this method before using the implementation and may not cache the instance returned. + * This allows for applying the flyweight design pattern to implementations. + * @see Specified by {@link yfiles.drawing.IArrow#getBoundsProvider}. + */ + getBoundsProvider(edge:yfiles.graph.IEdge,atSource:boolean,anchor:yfiles.geometry.PointD,direction:yfiles.geometry.PointD):yfiles.drawing.IBoundsProvider; + } + var IArrow:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Helper interface implemented by {@link yfiles.drawing.IEdgeStyle}s that use + * {@link yfiles.drawing.IArrow}s for displaying arrows. + */ + export interface IArrowOwner extends Object{ + /** + * Gets the visual arrow at the source end of edges that use this style. + * Arrow instances may be shared between multiple style instances. + * @see Specified by {@link yfiles.drawing.IArrowOwner#sourceArrow}. + */ + sourceArrow:yfiles.drawing.IArrow; + /** + * Gets the visual arrow at the target end of edges that use this style. + * Arrow instances may be shared between multiple style instances. + * @see Specified by {@link yfiles.drawing.IArrowOwner#targetArrow}. + */ + targetArrow:yfiles.drawing.IArrow; + } + var IArrowOwner:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * {@link yfiles.drawing.IVisualStyle} implementation for {@link yfiles.graph.IEdge} + * instances in an {@link yfiles.graph.IGraph}. + * Implementations are responsible for rendering {@link yfiles.graph.IEdge} + * instances in a {@link yfiles.canvas.CanvasControl}. + * It is up to the implementation to interpret the visual appearance of an + * edge. + * The framework uses the associated, possibly shared {@link yfiles.drawing.IEdgeStyle#renderer} + * to perform the actual rendering of this style for a given edge. + * This interface extends the {@link yfiles.system.ICloneable} interface. This allows clients + * to obtain a persistent copy of the current state of this style. + * Immutable style implementations may return themselves. + *
+ * Related Information in the Developers Guide: + *

+ * Working with styles (and their style renderers) is explained in detail in the section + * Visual Representation of Graph Elements. + *

+ * @see {@link yfiles.drawing.IArrowOwner} + */ + export interface IEdgeStyle extends Object,yfiles.drawing.IVisualStyle{ + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given edge and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(edge, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.IEdgeStyle#renderer}. + */ + renderer:yfiles.drawing.IEdgeStyleRenderer; + } + var IEdgeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An edge label model that allows placement of labels at a set of continuous positions + * along both sides of an edge or directly on the edge path. + * The set of positions can be influenced by specifying the density value that controls + * the spacing between adjacent label positions. + * Furthermore, it's possible to specify distance values that control the distance + * between label and edge and between label and nodes. + */ + export interface RotatedSliderEdgeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider,yfiles.graph.ILabelModelParameterFinder{ + /** + * Specifies whether the distance to the edge is interpreted relatively to the edge's path. + * Value: + * true if distance to the edge is interpreted relatively to the edge's path; otherwise, false. + * If enabled, the label is placed + * to the left of the edge segment (relative to the segment direction) if + * {@link yfiles.drawing.RotatedSliderEdgeLabelModel#distance} is less than 0 and to the right of the + * edge segment if {@link yfiles.drawing.RotatedSliderEdgeLabelModel#distance} is greater than 0. + *

+ * Otherwise, the label is placed below the edge segment (in + * geometric sense) if {@link yfiles.drawing.RotatedSliderEdgeLabelModel#distance} is less than 0 and + * above the edge segment if {@link yfiles.drawing.RotatedSliderEdgeLabelModel#distance} is greater than + * 0. + *

+ *

+ * The default value is true. + *

+ * @see {@link yfiles.drawing.RotatedSliderEdgeLabelModel#distance} + */ + distanceRelativeToEdge:boolean; + /** + * Specifies the distance between the label box and the edge path. + * Value: + * The distance between the label box and the edge path. + * The interpretation of positive/negative values depends on the property + * {@link yfiles.drawing.RotatedSliderEdgeLabelModel#distanceRelativeToEdge}. + * @see {@link yfiles.drawing.RotatedSliderEdgeLabelModel#distanceRelativeToEdge} + */ + distance:number; + /** + * Specifies whether edge labels are automatically rotated according to the angle of + * the corresponding reference edge segment. + * Value: + * true if edge labels are automatically rotated; otherwise, false. + * By default, this feature is enabled. + */ + autoRotationEnabled:boolean; + /** + * Specifies the rotation angle of all labels with this model. + * Value: + * The rotation angle of all labels with this model. + */ + angle:number; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * A model parameter that encodes the default position of this model's + * allowed edge label positions. + * Returns a model parameter that encodes the default position of this model's + * allowed edge label positions. + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * Returns an empty context. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An empty context. + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Creates a parameter that measures the provided segment index from the source side of the edge path. + * @param {number} segmentIndex The zero-based index of the segment beginning from the source side. + * @param {number} segmentRatio The ratio at which to place the label at the segment. A ratio of + * 0.0 will place the label at the source side of the segment, a ratio of 1.0 at the target + * side. Ratios < 0.0 or > 1.0 will be interpreted as absolute values in world coordinates. + * @return {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterFromSource(segmentIndex:number,segmentRatio:number):yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter that measures the provided segment index from the target side of the edge path. + * @param {number} segmentIndex The zero-based index of the segment beginning from the target side. + * @param {number} segmentRatio The ratio at which to place the label at the segment. A ratio of + * 0.0 will place the label at the target side of the segment, a ratio of 1.0 at the source + * side. Ratios < 0.0 or > 1.0 will be interpreted as absolute values in world coordinates. + * @return {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterFromTarget(segmentIndex:number,segmentRatio:number):yfiles.graph.ILabelModelParameter; + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,labelLayout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + } + var RotatedSliderEdgeLabelModel:{ + $class:yfiles.lang.Class; + /** + * Returns a new instance of RotatedSliderEdgeLabelModel. + */ + new ():yfiles.drawing.RotatedSliderEdgeLabelModel; + /** + * Initializes a new instance of the {@link yfiles.drawing.RotatedSliderEdgeLabelModel} class. + * @param {number} distance the distance to the edge. Set to 0 to create a centered model. + * @param {number} angle the angle of the label's rotation in radians. + * @param {boolean} distanceRelativeToEdge if set to true distance is interpreted relative to edge. + * @param {boolean} autoRotationEnabled if set to true auto rotation is enabled. + */ + WithParams:{ + new (distance:number,angle:number,distanceRelativeToEdge:boolean,autoRotationEnabled:boolean):yfiles.drawing.RotatedSliderEdgeLabelModel; + }; + }; + /** + * A node label model that knows only two possible positions. + * The label will be placed centered on top or below the node's {@link yfiles.graph.INode#layout} + * using a specifiable {@link yfiles.drawing.SandwichLabelModel#yOffset}. + */ + export interface SandwichLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{ + /** + * The distance between the node's {@link yfiles.graph.INode#layout} and + * the label's {@link yfiles.graph.ILabel#layout}. + */ + yOffset:number; + /** + * Creates a parameter for the north side of the node. + */ + createNorthParameter():yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter for the south side of the node. + */ + createSouthParameter():yfiles.graph.ILabelModelParameter; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + } + var SandwichLabelModel:{ + $class:yfiles.lang.Class; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.SandwichLabelModel#yOffset} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + NORTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.SandwichLabelModel#yOffset} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + SOUTH:yfiles.graph.ILabelModelParameter; + /** + * Initializes a new instance of the {@link yfiles.drawing.SandwichLabelModel} class with zero offset. + */ + new ():yfiles.drawing.SandwichLabelModel; + }; + /** + * A label model for edge labels that uses a ratio on the edge's path + * to determine the position of the label. + *

+ * This model allows for specifying the angle between the edge's path and the + * label's baseline. + *

+ *

+ * Note that {@link yfiles.drawing.RotatedSliderEdgeLabelModel} and {@link yfiles.drawing.RotatedSideSliderEdgeLabelModel} + * usually are a better alternative since they provide a continuous set of label candidates. + *

+ * @see {@link yfiles.drawing.RotatedSliderEdgeLabelModel} + * @see {@link yfiles.drawing.RotatedSideSliderEdgeLabelModel} + */ + export interface RotatingEdgeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{ + /** + * Gets or sets a property that determines the distance between the label's center + * and the anchor point on the edge's path. + * A distance of 0 makes the label appear centered on the edge's path. + * Depending on the value of the {@link yfiles.drawing.RotatingEdgeLabelModel#edgeRelativeDistance} + * property, the distance is interpreted differently: + * If the distance is interpreted relatively, a positive distance + * makes the label appear at the left hand of the edge. If + * the distance is interpreted absolutely, positive values make the label + * appear on top of the edge's path, while negative values make it appear + * below the path. + */ + distance:number; + /** + * Gets or sets a property that determines how the + * {@link yfiles.drawing.RotatingEdgeLabelModel#distance} value should be interpreted. + * If the distance is interpreted relatively, a positive distance + * makes the label appear at the left hand of the edge. If + * the distance is interpreted absolutely, positive values make the label + * appear on top of the edge's path, while negative values make it appear + * below the path. + */ + edgeRelativeDistance:boolean; + /** + * Gets or sets the angle of the label relative to the edge's path. + * An angle of 0 makes the label appear in parallel to the edge's path, + * whereas a positive angle rotates the label counter-clockwise away from the edge's path. + */ + angle:number; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Returns possible parameters for the given label and model. + * @param {yfiles.graph.ILabel} label The label for which to retrieve the parameters + * @param {yfiles.graph.ILabelModel} model must be this or at least of this type. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter for this model. + * This method creates a parameter that displays the label at the center of the edge path. + * @return {yfiles.graph.ILabelModelParameter} A parameter like in {@link yfiles.drawing.RotatingEdgeLabelModel#createRatio} with a ratio of 0.5d. + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter for this model using a ratio value between 0.0d + * and 1.0d. + * @param {number} ratio The ratio where the label should be placed along the edge's path. + * @return {yfiles.graph.ILabelModelParameter} A parameter that uses this model instance. + */ + createRatio(ratio:number):yfiles.graph.ILabelModelParameter; + } + var RotatingEdgeLabelModel:{ + $class:yfiles.lang.Class; + }; + /** + * A straightforward implementation of an {@link yfiles.graph.IPortLocationModel} + * for {@link yfiles.graph.IPort}s at {@link yfiles.graph.INode}s that determine the location + * dynamically using the {@link yfiles.graph.INode#layout}. + * Internally the location is stored as the ratio by which the {@link yfiles.geometry.ISize#width} + * and {@link yfiles.geometry.ISize#height} of the {@link yfiles.graph.INode#layout} need to be scaled to obtain the + * offset to the center of the node layout. + */ + export interface NodeScaledPortLocationModel extends Object,yfiles.graph.IPortLocationModel{ + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Determines the location of the port for the given parameter. + * @param {yfiles.graph.IPort} port The port to determine the location for. + * @param {yfiles.graph.IPortLocationModelParameter} parameter The parameter to use. The parameter can be expected to be created by this instance + * having the {@link yfiles.graph.IPortLocationModelParameter#model} property set to this instance.. + * @return {yfiles.geometry.PointD} The calculated location of the port. + * @see Specified by {@link yfiles.graph.IPortLocationModel#getLocation}. + */ + getLocation(port:yfiles.graph.IPort,parameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.PointD; + /** + * Creates a parameter that uses the given relative offsets. + * The offsets will be scaled by the node layout's size and + * added to the node center to determine the port location. + * @param {yfiles.geometry.PointD} relativeOffsets The relative offsets. + * @return {yfiles.graph.IPortLocationModelParameter} A new parameter that matches the specification. + */ + createScaledParameter(relativeOffsets:yfiles.geometry.PointD):yfiles.graph.IPortLocationModelParameter; + /** + * Creates a parameter for the given {@link yfiles.graph.INode} that will + * exactly match the given absolute world coordinates. + * @param {yfiles.graph.INode} owner The owner to use for determining the offsets. + * @param {yfiles.geometry.PointD} location The absolute world coordinates location of the port. + * @return {yfiles.graph.IPortLocationModelParameter} A parameter that exactly matches the location + * unless the node's width and height is non-positive. + */ + createAbsoluteParameter(owner:yfiles.graph.INode,location:yfiles.geometry.PointD):yfiles.graph.IPortLocationModelParameter; + /** + * Creates the parameter for the given {@link yfiles.graph.INode} that will + * exactly match the given relative location. + * @param {yfiles.graph.INode} owner The owner to use for determining the offsets. + * @param {yfiles.geometry.PointD} relativeLocation The location of the port relative to the center of the node. + * @return {yfiles.graph.IPortLocationModelParameter} A parameter that exactly matches the relativeLocation + * unless the node's width and height is non-positive. + */ + createOffsetParameter(owner:yfiles.graph.INode,relativeLocation:yfiles.geometry.PointD):yfiles.graph.IPortLocationModelParameter; + /** + * Factory method that creates a parameter for the given port that tries to match the provided location + * in absolute world coordinates. + * @param {yfiles.graph.IPortOwner} portOwner The port owner that will own the port for which the parameter shall be created. + * @param {yfiles.geometry.PointD} location The location in the world coordinate system that should be matched as best as possible. + * @return {yfiles.graph.IPortLocationModelParameter} A new instance that can be used to describe the location of an {@link yfiles.graph.IPort} at the given + * portOwner. + * @see Specified by {@link yfiles.graph.IPortLocationModel#createParameter}. + */ + createParameter(portOwner:yfiles.graph.IPortOwner,location:yfiles.geometry.PointD):yfiles.graph.IPortLocationModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of port + * and parameter. + * @param {yfiles.graph.IPort} port The port to use in the context. + * @param {yfiles.graph.IPortLocationModelParameter} parameter The parameter to use for the port in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the port/parameter combination. + * @see Specified by {@link yfiles.graph.IPortLocationModel#getContext}. + */ + getContext(port:yfiles.graph.IPort,parameter:yfiles.graph.IPortLocationModelParameter):yfiles.support.ILookup; + } + var NodeScaledPortLocationModel:{ + $class:yfiles.lang.Class; + /** + * A read only immutable instance of the {@link yfiles.drawing.NodeScaledPortLocationModel}. + */ + INSTANCE:yfiles.drawing.NodeScaledPortLocationModel; + /** + * A read only immutable singleton instance of a {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter scaled parameter} + * that locates the port at the center of the node layout. + * This is the same as {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter creating a parameter} using a (0,0) point as the argument. + */ + NODE_CENTER_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter scaled parameter} + * that locates the port at the center of the left border of the node layout. + * This is the same as {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter creating a parameter} using a (-0.5,0) point as the argument. + */ + NODE_LEFT_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter scaled parameter} + * that locates the port at the center of the right border of the node layout. + * This is the same as {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter creating a parameter} using a (0.5,0) point as the argument. + */ + NODE_RIGHT_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter scaled parameter} + * that locates the port at the center of the top border of the node layout. + * This is the same as {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter creating a parameter} using a (0,-0.5) point as the argument. + */ + NODE_TOP_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter scaled parameter} + * that locates the port at the center of the bottom border of the node layout. + * This is the same as {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter creating a parameter} using a (0,0.5) point as the argument. + */ + NODE_BOTTOM_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter scaled parameter} + * that locates the port at the top left corner of the node layout. + * This is the same as {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter creating a parameter} using a (-0.5,-0.5) point as the argument. + */ + NODE_TOP_LEFT_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter scaled parameter} + * that locates the port at the top right corner of the node layout. + * This is the same as {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter creating a parameter} using a (0.5,-0.5) point as the argument. + */ + NODE_TOP_RIGHT_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter scaled parameter} + * that locates the port at the bottom right corner of the node layout. + * This is the same as {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter creating a parameter} using a (0.5,0.5) point as the argument. + */ + NODE_BOTTOM_RIGHT_ANCHORED:yfiles.graph.IPortLocationModelParameter; + /** + * A read only immutable singleton instance of a {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter scaled parameter} + * that locates the port at the bottom left corner of the node layout. + * This is the same as {@link yfiles.drawing.NodeScaledPortLocationModel#createScaledParameter creating a parameter} using a (-0.5,0.5) point as the argument. + */ + NODE_BOTTOM_LEFT_ANCHORED:yfiles.graph.IPortLocationModelParameter; + }; + /** + * An edge label model that knows nine different label positions. + * The possible positions are near the source port, at the center of the edge, + * or near the target port, each above, below, or centered on the edge. + * The distance to the edge and the absolute angular orientation of the label + * can be specified. + */ + export interface NinePositionsEdgeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{ + /** + * Gets or sets the angle for the rotation of the labels. + * A value of 0 makes the label appear horizontally aligned. + * Value: The angle in radians. + */ + angle:number; + /** + * Gets or sets the distance of the labels above or below the edge. + * Value: The distance to the edge. + */ + distance:number; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Create a model parameter for the specified position. + * @param {yfiles.drawing.NinePositionsEdgeLabelModel.Position} position The position for this parameter + * @return {yfiles.graph.ILabelModelParameter} a model parameter for the specified position + */ + createParameter(position:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface):yfiles.graph.ILabelModelParameter; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + } + export module NinePositionsEdgeLabelModel{ + export interface Position_Interface{} + } + var NinePositionsEdgeLabelModel:{ + $class:yfiles.lang.Class; + Position:{ + SOURCE_ABOVE:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + CENTER_ABOVE:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + TARGET_ABOVE:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + SOURCE_CENTERED:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + CENTER_CENTERED:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + TARGET_CENTERED:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + SOURCE_BELOW:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + CENTER_BELOW:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + TARGET_BELOW:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + ABOVE_CENTERED_BELOW_MASK:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + SOURCE_CENTER_TARGET_MASK:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + SOURCE:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + CENTER:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + TARGET:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + ABOVE:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + CENTERED:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + BELOW:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + }; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.NinePositionsEdgeLabelModel#angle} + * or {@link yfiles.drawing.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.system.InvalidOperationException}. + */ + SOURCE_ABOVE:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.NinePositionsEdgeLabelModel#angle} + * or {@link yfiles.drawing.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.system.InvalidOperationException}. + */ + CENTER_ABOVE:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.NinePositionsEdgeLabelModel#angle} + * or {@link yfiles.drawing.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.system.InvalidOperationException}. + */ + TARGET_ABOVE:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.NinePositionsEdgeLabelModel#angle} + * or {@link yfiles.drawing.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.system.InvalidOperationException}. + */ + SOURCE_CENTERED:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.NinePositionsEdgeLabelModel#angle} + * or {@link yfiles.drawing.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.system.InvalidOperationException}. + */ + CENTER_CENTERED:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.NinePositionsEdgeLabelModel#angle} + * or {@link yfiles.drawing.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.system.InvalidOperationException}. + */ + TARGET_CENTERED:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.NinePositionsEdgeLabelModel#angle} + * or {@link yfiles.drawing.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.system.InvalidOperationException}. + */ + SOURCE_BELOW:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.NinePositionsEdgeLabelModel#angle} + * or {@link yfiles.drawing.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.system.InvalidOperationException}. + */ + CENTER_BELOW:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.NinePositionsEdgeLabelModel#angle} + * or {@link yfiles.drawing.NinePositionsEdgeLabelModel#distance} properties will raise an {@link yfiles.system.InvalidOperationException}. + */ + TARGET_BELOW:yfiles.graph.ILabelModelParameter; + /** + * Initializes a new instance of the {@link yfiles.drawing.NinePositionsEdgeLabelModel} class + * with a {@link yfiles.drawing.NinePositionsEdgeLabelModel#distance} of 10 and an {@link yfiles.drawing.NinePositionsEdgeLabelModel#angle} of 0. + */ + new ():yfiles.drawing.NinePositionsEdgeLabelModel; + /** + * Initializes a new instance of the {@link yfiles.drawing.NinePositionsEdgeLabelModel} class. + * @param {number} distance The distance. + * @param {number} angle The angle. + */ + WithDistanceAndAngle:{ + new (distance:number,angle:number):yfiles.drawing.NinePositionsEdgeLabelModel; + }; + }; + /** + * An edge label model that allows placement of labels at a set of continuous positions + * along both sides of an edge. + * The set of positions can be influenced by specifying the density value that controls + * the spacing between adjacent label positions. + * Furthermore, it's possible to specify distance values that control the distance + * between label and edge and between label and nodes. + */ + export interface RotatedSideSliderEdgeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider,yfiles.graph.ILabelModelParameterFinder{ + /** + * The distance between the label's box and the edge's path. + * Specifies the distance between the label's box and the edge's path. + * The interpretation of positive/negative values depends on property + * {@link yfiles.drawing.RotatedSliderEdgeLabelModel#distanceRelativeToEdge}. + * @see {@link yfiles.drawing.RotatedSliderEdgeLabelModel#distanceRelativeToEdge} + */ + distance:number; + /** + * The angle of the label model. + * Specifies the angle of the label model. + */ + angle:number; + /** + * A value indicating whether the distance to the edge is interpreted + * relatively to the edge's path. + * Specifies a value indicating whether the distance to the edge is interpreted + * relatively to the edge's path. If this value is set, the label is placed + * to the left of the edge segment (relative to the segment direction) if + * {@link yfiles.drawing.RotatedSideSliderEdgeLabelModel#distance} is less than 0 and to the right of the + * edge segment if {@link yfiles.drawing.RotatedSideSliderEdgeLabelModel#distance} is greater than 0. + * If this value is not set, the label is placed below the edge segment (in + * geometric sense) if {@link yfiles.drawing.RotatedSideSliderEdgeLabelModel#distance} is less than 0 and + * above the edge segment if {@link yfiles.drawing.RotatedSideSliderEdgeLabelModel#distance} is greater than + * 0. + *

+ * The default value is true. + *

+ * @see {@link yfiles.drawing.RotatedSideSliderEdgeLabelModel#distance} + */ + distanceRelativeToEdge:boolean; + /** + * Specifies whether or not edge labels are automatically rotated according to + * the angle of the corresponding reference edge segment. + * Specifies whether or not edge labels have to be automatically rotated + * according to the angle of the corresponding reference edge segment. + *

+ * By default, this feature is enabled. + *

+ */ + autoRotationEnabled:boolean; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * A model parameter that encodes the default position of this model's + * allowed edge label positions. + * This implementation returns a model parameter that encodes the default position of this model's + * allowed edge label positions to the right of the edge path. + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * Creates a parameter that measures the provided segment index from the source side of the edge path. + * @param {number} segmentIndex The zero-based index of the segment beginning from the source side. + * @param {number} segmentRatio The ratio at which to place the label at the segment. + * @param {boolean} rightOfEdge Determines whether the label should be placed right or left of the edge. + * @return {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterFromSource(segmentIndex:number,segmentRatio:number,rightOfEdge:boolean):yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter that measures the provided segment index from the target side of the edge path. + * @param {number} segmentIndex The zero-based index of the segment beginning from the target side. + * @param {number} segmentRatio The ratio at which to place the label at the segment. + * @param {boolean} rightOfEdge Determines whether the label should be placed right or left of the edge. + * @return {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterFromTarget(segmentIndex:number,segmentRatio:number,rightOfEdge:boolean):yfiles.graph.ILabelModelParameter; + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,labelLayout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + } + var RotatedSideSliderEdgeLabelModel:{ + $class:yfiles.lang.Class; + /** + * Returns a new instance of {@link yfiles.drawing.RotatedSliderEdgeLabelModel}. + */ + new ():yfiles.drawing.RotatedSideSliderEdgeLabelModel; + /** + * Initializes a new instance of the {@link yfiles.drawing.RotatedSideSliderEdgeLabelModel} class. + */ + WithParams:{ + new (distance:number,angle:number,distanceRelativeToEdge:boolean,autoRotationEnabled:boolean):yfiles.drawing.RotatedSideSliderEdgeLabelModel; + }; + }; + /** + * A default implementation of the {@link yfiles.drawing.IArrow} + * interface that can render {@link yfiles.drawing.ArrowType}s. + */ + export interface Arrow extends Object,yfiles.drawing.IArrow,yfiles.system.ICloneable{ + /** + * Gets or sets the type of this arrow. + * Value: The type of this arrow. + */ + type:yfiles.drawing.ArrowType; + /** + * Gets or sets the scale factor of this arrow. + * Value: The scale factor of this arrow. + */ + scale:number; + /** + * Gets or sets the pen of the outline of this arrow. + * Value: The pen of this arrow. + */ + pen:yfiles.system.Pen; + /** + * Gets or sets the brush of the fill of this arrow. + * Value: The brush. + */ + brush:yfiles.system.Brush; + /** + * Gets the cropping length associated with this instance. + * Value: + * This value is used by {@link yfiles.drawing.IEdgeStyle} implementations to let the + * edge appear to end shortly before its actual target. + * @see Specified by {@link yfiles.drawing.IArrow#cropLength}. + */ + cropLength:number; + /** + * Gets an {@link yfiles.drawing.IVisualCreator} implementation that will paint this arrow + * at the given location using the given direction for the given edge. + * @param {yfiles.graph.IEdge} edge the edge this arrow belongs to + * @param {boolean} atSource whether this will be the source arrow + * @param {yfiles.geometry.PointD} anchor the anchor point for the tip of the arrow + * @param {yfiles.geometry.PointD} direction the direction the arrow is pointing in + * @return {yfiles.drawing.IVisualCreator} an implementation of the {@link yfiles.drawing.IVisualCreator} interface that can + * subsequently be used to perform the actual painting. Clients will always call + * this method before using the implementation and may not cache the instance returned. + * This allows for applying the flyweight design pattern to implementations. + * @see Specified by {@link yfiles.drawing.IArrow#getPaintable}. + */ + getPaintable(edge:yfiles.graph.IEdge,atSource:boolean,anchor:yfiles.geometry.PointD,direction:yfiles.geometry.PointD):yfiles.drawing.IVisualCreator; + /** + * Gets an {@link yfiles.drawing.IBoundsProvider} implementation that can yield + * this arrow's bounds if painted at the given location using the + * given direction for the given edge. + * @param {yfiles.graph.IEdge} edge the edge this arrow belongs to + * @param {boolean} atSource whether this will be the source arrow + * @param {yfiles.geometry.PointD} anchor the anchor point for the tip of the arrow + * @param {yfiles.geometry.PointD} direction the direction the arrow is pointing in + * @return {yfiles.drawing.IBoundsProvider} an implementation of the {@link yfiles.drawing.IBoundsProvider} interface that can + * subsequently be used to query the bounds. Clients will always call + * this method before using the implementation and may not cache the instance returned. + * This allows for applying the flyweight design pattern to implementations. + * @see Specified by {@link yfiles.drawing.IArrow#getBoundsProvider}. + */ + getBoundsProvider(edge:yfiles.graph.IEdge,atSource:boolean,anchor:yfiles.geometry.PointD,direction:yfiles.geometry.PointD):yfiles.drawing.IBoundsProvider; + /** + * Determines whether this arrow is equal to the other arrow. + * @param {yfiles.drawing.Arrow} other The other. + * @return {boolean} + */ + equalsWithOther(other:yfiles.drawing.Arrow):boolean; + equals(obj:Object):boolean; + hashCode():number; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + toString():string; + } + var Arrow:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.Arrow; + }; + /** + * An abstract base class for an {@link yfiles.drawing.IArrow} + * that provides a number of convenience factory methods + * and singleton instances for default arrow types. + */ + export interface DefaultArrow extends Object,yfiles.drawing.IArrow{ + /** + * The cropping length. + */ + cropLengthF:number; + /** + * The length of the arrow. + */ + lengthF:number; + /** + * The scale of the arrow. + */ + scaleF:number; + /** + * Gets the cropping length associated with this instance. + * This value is used by {@link yfiles.drawing.IEdgeStyle} implementations to let the + * edge appear to end shortly before its actual target. + * @see Specified by {@link yfiles.drawing.IArrow#cropLength}. + */ + cropLength:number; + /** + * Gets an {@link yfiles.drawing.IVisualCreator} implementation that will paint this arrow + * at the given location using the given direction for the given edge. + * @param {yfiles.graph.IEdge} edge the edge this arrow belongs to + * @param {boolean} atSource whether this will be the source arrow + * @param {yfiles.geometry.PointD} anchor the anchor point for the tip of the arrow + * @param {yfiles.geometry.PointD} direction the direction the arrow is pointing in + * @return {yfiles.drawing.IVisualCreator} an implementation of the {@link yfiles.drawing.IVisualCreator} interface that can + * subsequently be used to perform the actual painting. Clients will always call + * this method before using the implementation and may not cache the instance returned. + * This allows for applying the flyweight design pattern to implementations. + * @see Specified by {@link yfiles.drawing.IArrow#getPaintable}. + */ + getPaintable(edge:yfiles.graph.IEdge,atSource:boolean,anchor:yfiles.geometry.PointD,direction:yfiles.geometry.PointD):yfiles.drawing.IVisualCreator; + /** + * Gets an {@link yfiles.drawing.IBoundsProvider} implementation that can yield + * this arrow's bounds if painted at the given location using the + * given direction for the given edge. + * @param {yfiles.graph.IEdge} edge the edge this arrow belongs to + * @param {boolean} atSource whether this will be the source arrow + * @param {yfiles.geometry.PointD} anchor the anchor point for the tip of the arrow + * @param {yfiles.geometry.PointD} direction the direction the arrow is pointing in + * @return {yfiles.drawing.IBoundsProvider} an implementation of the {@link yfiles.drawing.IBoundsProvider} interface that can + * subsequently be used to query the bounds. Clients will always call + * this method before using the implementation and may not cache the instance returned. + * This allows for applying the flyweight design pattern to implementations. + * @see Specified by {@link yfiles.drawing.IArrow#getBoundsProvider}. + */ + getBoundsProvider(edge:yfiles.graph.IEdge,atSource:boolean,anchor:yfiles.geometry.PointD,direction:yfiles.geometry.PointD):yfiles.drawing.IBoundsProvider; + /** + * Returns the length of the arrow, i.e. the distance from the arrow's tip to + * the position where the visual representation of the edge's path should begin. + * @see Specified by {@link yfiles.drawing.IArrow#length}. + */ + length:number; + } + var DefaultArrow:{ + $class:yfiles.lang.Class; + /** + * A singleton {@link yfiles.drawing.IArrow} instance that paints no arrow at all. + */ + NONE:yfiles.drawing.IArrow; + /** + * A singleton {@link yfiles.drawing.IArrow} instance that paints a simple black arrow. + */ + SIMPLE:yfiles.drawing.IArrow; + /** + * A singleton {@link yfiles.drawing.IArrow} instance that paints a default shaped black arrow. + */ + DEFAULT:yfiles.drawing.IArrow; + /** + * A singleton {@link yfiles.drawing.IArrow} instance that paints a short black arrow. + */ + SHORT:yfiles.drawing.IArrow; + /** + * A singleton {@link yfiles.drawing.IArrow} instance that paints a simple diamond-shaped black arrow. + */ + DIAMOND:yfiles.drawing.IArrow; + /** + * A singleton {@link yfiles.drawing.IArrow} instance that paints a simple cross-shaped black arrow. + */ + CROSS:yfiles.drawing.IArrow; + /** + * A singleton {@link yfiles.drawing.IArrow} instance that paints a simple circle-shaped black arrow. + */ + CIRCLE:yfiles.drawing.IArrow; + /** + * A singleton {@link yfiles.drawing.IArrow} instance that paints a simple triangle-shaped black arrow. + */ + TRIANGLE:yfiles.drawing.IArrow; + /** + * Factory method that creates an arrow of the given type and color. + * @param {yfiles.drawing.ArrowType} arrowType The type of the arrow. + * @param {yfiles.system.Color} color The color to use for pen and brush. + * @return {yfiles.drawing.DefaultArrow} An arrow. + */ + create(arrowType:yfiles.drawing.ArrowType,color:yfiles.system.Color):yfiles.drawing.DefaultArrow; + /** + * Factory method that creates an arrow of the given type, color, and scale. + * @param {yfiles.drawing.ArrowType} arrowType The type of the arrow. + * @param {yfiles.system.Color} color The color to use for pen and brush. + * @param {number} scale The scale factor to apply. + * @return {yfiles.drawing.DefaultArrow} An arrow. + */ + createScaled(arrowType:yfiles.drawing.ArrowType,color:yfiles.system.Color,scale:number):yfiles.drawing.DefaultArrow; + /** + * Factory method that creates an arrow of the given type in black. + * @param {yfiles.drawing.ArrowType} arrowType The type of the arrow. + * @return {yfiles.drawing.DefaultArrow} An arrow. + */ + createDefault(arrowType:yfiles.drawing.ArrowType):yfiles.drawing.DefaultArrow; + /** + * Factory method that creates an arrow of the given type using the + * provided Pen and Brush for outline and fill respectively. + * @param {yfiles.drawing.ArrowType} arrowType The type of the arrow. + * @param {yfiles.system.Pen} pen The pen to draw the outline with or null. + * @param {yfiles.system.Brush} brush The brush to fill the interior with or null. + * @param {number} cropLength Length of the crop. + * @return {yfiles.drawing.DefaultArrow} An arrow. + */ + createWithCropLength(arrowType:yfiles.drawing.ArrowType,pen:yfiles.system.Pen,brush:yfiles.system.Brush,cropLength:number):yfiles.drawing.DefaultArrow; + /** + * Factory method that creates an arrow of the given type using the + * provided Pen and Brush for outline and fill respectively. + * @param {yfiles.drawing.ArrowType} arrowType The type of the arrow. + * @param {yfiles.system.Pen} pen The pen to draw the outline with or null. + * @param {yfiles.system.Brush} brush The brush to fill the interior with or null. + * @param {number} scale The scale factor to apply. + * @param {number} cropLength Length of the crop. + * @return {yfiles.drawing.DefaultArrow} An arrow. + */ + createWithCropLengthAndScale(arrowType:yfiles.drawing.ArrowType,pen:yfiles.system.Pen,brush:yfiles.system.Brush,cropLength:number,scale:number):yfiles.drawing.DefaultArrow; + /** + * Initializes a new instance of the {@link yfiles.drawing.DefaultArrow} class + * using the given length, cropping length, and scale values. + * @param {number} length The length. + * @param {number} cropLength The length by which an edge's path needs to be cropped. + * @param {number} scale The scale factor. + */ + new (length:number,cropLength:number,scale:number):yfiles.drawing.DefaultArrow; + }; + /** + * A simple implementation of the {@link yfiles.graph.IPortLocationModel} + * that uses simple {@link yfiles.geometry.PointD} and {@link yfiles.geometry.IPoint} implementations + * to anchor ports in the world coordinate system. + * This implementation can be used for ports at all kinds of {@link yfiles.graph.IPortOwner} + * implementations because it does not depend on the owner of the port at all. + */ + export interface AnchoredPortLocationModel extends Object,yfiles.graph.IPortLocationModel{ + /** + * This implementation has nothing in its lookup and will always yield null. + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Determines the location of the port for the given parameter. + * @param {yfiles.graph.IPort} port The port to determine the location for. + * @param {yfiles.graph.IPortLocationModelParameter} parameter The parameter to use. The parameter can be expected to be created by this instance + * having the {@link yfiles.graph.IPortLocationModelParameter#model} property set to this instance.. + * @return {yfiles.geometry.PointD} The calculated location of the port. + * @see Specified by {@link yfiles.graph.IPortLocationModel#getLocation}. + */ + getLocation(port:yfiles.graph.IPort,parameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.PointD; + /** + * Factory method that creates a parameter for the given port that tries to match the provided location + * in absolute world coordinates. + * This method will simply delegate to {@link yfiles.drawing.AnchoredPortLocationModel#createParameterForLocation} + * @param {yfiles.graph.IPortOwner} portOwner The port owner that will own the port for which the parameter shall be created. + * @param {yfiles.geometry.PointD} location The location in the world coordinate system that should be matched as best as possible. + * @return {yfiles.graph.IPortLocationModelParameter} + * A new instance that can be used to describe the location of an {@link yfiles.graph.IPort} at the given + * portOwner. + * @see Specified by {@link yfiles.graph.IPortLocationModel#createParameter}. + */ + createParameter(portOwner:yfiles.graph.IPortOwner,location:yfiles.geometry.PointD):yfiles.graph.IPortLocationModelParameter; + /** + * Creates a parameter that fixes the port location at the given coordinates. + * @param {yfiles.geometry.PointD} location The location of the port. + * @return {yfiles.graph.IPortLocationModelParameter} A parameter that exactly matches the provided coordinates. + */ + createParameterForLocation(location:yfiles.geometry.PointD):yfiles.graph.IPortLocationModelParameter; + /** + * Creates a dynamic parameter that fixes the port location at the given coordinates. + * @param {yfiles.geometry.IPoint} location The location of the port. + * @return {yfiles.graph.IPortLocationModelParameter} A parameter that exactly matches the provided coordinates. + */ + createDynamicParameter(location:yfiles.geometry.IPoint):yfiles.graph.IPortLocationModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of port + * and parameter. + * @param {yfiles.graph.IPort} port The port to use in the context. + * @param {yfiles.graph.IPortLocationModelParameter} parameter The parameter to use for the port in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the port/parameter combination. + * @see Specified by {@link yfiles.graph.IPortLocationModel#getContext}. + */ + getContext(port:yfiles.graph.IPort,parameter:yfiles.graph.IPortLocationModelParameter):yfiles.support.ILookup; + } + var AnchoredPortLocationModel:{ + $class:yfiles.lang.Class; + /** + * A static immutable global instance of this class. + */ + INSTANCE:yfiles.drawing.AnchoredPortLocationModel; + }; + /** + * Simple abstract base class for {@link yfiles.drawing.IEdgeStyle}s. + */ + export interface AbstractEdgeStyle extends Object,yfiles.drawing.IEdgeStyle,yfiles.drawing.IArrowOwner{ + /** + * Gets or sets the visual arrow at the target end of edges that use this style. + * Arrow instances may be shared between multiple style instances. + * @see Specified by {@link yfiles.drawing.IArrowOwner#targetArrow}. + */ + targetArrow:yfiles.drawing.IArrow; + /** + * Gets or sets the visual arrow at the source end of edges that use this style. + * Arrow instances may be shared between multiple style instances. + * @see Specified by {@link yfiles.drawing.IArrowOwner#sourceArrow}. + */ + sourceArrow:yfiles.drawing.IArrow; + /** + * Gets the renderer implementation that has been supplied to this instance in the constructor. + * @see Specified by {@link yfiles.drawing.IEdgeStyle#renderer}. + */ + renderer:yfiles.drawing.IEdgeStyleRenderer; + /** + * Performs a {@link Object#memberwiseClone}. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + /** + * Installs the edge in the canvas using the given context as a hint. + * @param {yfiles.model.IInstallerContext} context The context that yields the {@link yfiles.model.IInstallerContext#canvas} and {@link yfiles.model.IInstallerContext#canvasObjectGroup}. + * @param {yfiles.graph.IEdge} edge The edge to install this style for in the canvas. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,edge:yfiles.graph.IEdge):void; + } + var AbstractEdgeStyle:{ + $class:yfiles.lang.Class; + /** + * Creates an instance using the provided renderer instance. + * @param {yfiles.drawing.IEdgeStyleRenderer} styleRenderer + */ + new (styleRenderer:yfiles.drawing.IEdgeStyleRenderer):yfiles.drawing.AbstractEdgeStyle; + }; + /** + * An implementation of {@link yfiles.graph.ILabelModel} that can be used to create custom + * label models out of existing {@link yfiles.graph.ILabelModel} instances. + * This class holds a number of models and can provide all of their parameters in {@link yfiles.drawing.CompositeLabelModel#getParameters}. + * A custom model can easily be created that way: + *

+    * var glm = new CompositeLabelModel();
+    * glm.labelModels = { ExteriorLabelModel, InteriorStretchLabelModel};
+    * 
+ */ + export interface CompositeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider,yfiles.graph.ILabelModelParameterFinder{ + /** + * Gets a list of {@link yfiles.graph.ILabelModel} implementations that are wrapped by this instance. + */ + labelModels:yfiles.collections.IList; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter that can be used for this model. + * If {@link yfiles.drawing.CompositeLabelModel#labelModels} is not empty, the default parameter for the first model in that list is returned. Otherwise, + * the default parameter for {@link yfiles.drawing.FreeLabelModel#createDefaultParameter} is returned. + * @return {yfiles.graph.ILabelModelParameter} + * a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * This implementation returns all parameters from all models in {@link yfiles.drawing.CompositeLabelModel#labelModels} + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} + * A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * Tries to find a parameter that best matches the given layout for the + * provided label instance. + * This implementation tests all parameters from all models in {@link yfiles.drawing.CompositeLabelModel#labelModels}. + * @param {yfiles.graph.ILabel} label The label to find a parameter for. + * @param {yfiles.graph.ILabelModel} model The model instance to use. This should be the instance + * this instance has been obtained from. + * @param {yfiles.geometry.IOrientedRectangle} labelLayout The anticipated layout for the label. + * @return {yfiles.graph.ILabelModelParameter} + * A non-null parameter that can be used for the label to approximate the provided layout. + * @see Specified by {@link yfiles.graph.ILabelModelParameterFinder#findBestParameter}. + */ + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,labelLayout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + } + var CompositeLabelModel:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this label model with an empty {@link yfiles.drawing.CompositeLabelModel#labelModels} collection. + */ + new ():yfiles.drawing.CompositeLabelModel; + }; + /** + * An implementation of the {@link yfiles.graph.IPortLocationModel} + * that can create {@link yfiles.graph.IPortLocationModelParameter}s + * that describe the location of ports that are attached to the bends of {@link yfiles.graph.IEdge}s. + */ + export interface BendAnchoredPortLocationModel extends Object,yfiles.graph.IPortLocationModel{ + /** + * This implementation has nothing in its lookup and will always yield null. + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Determines the location of the port for the given parameter. + * @param {yfiles.graph.IPort} port The port to determine the location for. + * @param {yfiles.graph.IPortLocationModelParameter} parameter The parameter to use. The parameter can be expected to be created by this instance + * having the {@link yfiles.graph.IPortLocationModelParameter#model} property set to this instance.. + * @return {yfiles.geometry.PointD} The calculated location of the port. + * @see Specified by {@link yfiles.graph.IPortLocationModel#getLocation}. + */ + getLocation(port:yfiles.graph.IPort,parameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.PointD; + /** + * Creates a parameter that indicates the location of the bend with index bendIndex + * starting from the source side. + * @param {number} bendIndex The index of the bend counting from the source side. + * @return {yfiles.graph.IPortLocationModelParameter} A parameter that anchors the port at a bend. + */ + createFromSource(bendIndex:number):yfiles.graph.IPortLocationModelParameter; + /** + * Creates a parameter that indicates the location of the bend with index bendIndex + * starting from the target side. + * @param {number} bendIndex The index of the bend counting from the target side. + * @return {yfiles.graph.IPortLocationModelParameter} A parameter that anchors the port at a bend. + */ + createFromTarget(bendIndex:number):yfiles.graph.IPortLocationModelParameter; + /** + * Factory method that creates a parameter for the given port that tries to match the provided location + * in absolute world coordinates. + * @param {yfiles.graph.IPortOwner} portOwner The port owner that will own the port for which the parameter shall be created. + * @param {yfiles.geometry.PointD} location The location in the world coordinate system that should be matched as best as possible. + * @return {yfiles.graph.IPortLocationModelParameter} A new instance that can be used to describe the location of an {@link yfiles.graph.IPort} at the given + * portOwner. + * @see Specified by {@link yfiles.graph.IPortLocationModel#createParameter}. + */ + createParameter(portOwner:yfiles.graph.IPortOwner,location:yfiles.geometry.PointD):yfiles.graph.IPortLocationModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of port + * and parameter. + * @param {yfiles.graph.IPort} port The port to use in the context. + * @param {yfiles.graph.IPortLocationModelParameter} parameter The parameter to use for the port in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the port/parameter combination. + * @see Specified by {@link yfiles.graph.IPortLocationModel#getContext}. + */ + getContext(port:yfiles.graph.IPort,parameter:yfiles.graph.IPortLocationModelParameter):yfiles.support.ILookup; + } + var BendAnchoredPortLocationModel:{ + $class:yfiles.lang.Class; + /** + * A static immutable global instance of this class. + */ + INSTANCE:yfiles.drawing.BendAnchoredPortLocationModel; + /** + * A convenience instance of a parameter that is bound to the first {@link yfiles.graph.IBend} of the edge. + * @see {@link yfiles.drawing.BendAnchoredPortLocationModel#createFromSource} + */ + FIRST_BEND:yfiles.graph.IPortLocationModelParameter; + /** + * A convenience instance of a parameter that is bound to the last {@link yfiles.graph.IBend} of the edge. + * @see {@link yfiles.drawing.BendAnchoredPortLocationModel#createFromTarget} + */ + LAST_BEND:yfiles.graph.IPortLocationModelParameter; + }; + /** + * A label model that wraps an existing label model and decorates it with + * a {@link yfiles.graph.ILabelCandidateDescriptor descriptor}. + */ + export interface DescriptorWrapperLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelCandidateDescriptorProvider,yfiles.graph.ILabelModelParameterProvider{ + /** + * Gets or sets the descriptor. + */ + descriptor:yfiles.graph.ILabelCandidateDescriptor; + /** + * Gets or sets the inner label model. + */ + innerModel:yfiles.graph.ILabelModel; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} The default parameter from {@link yfiles.drawing.DescriptorWrapperLabelModel#innerModel} + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Gets the descriptor for a given combination of label and {@link yfiles.graph.ILabelModelParameter}. + * @param {yfiles.graph.ILabel} label The label to possibly assign the parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to provide a descriptor for if applied to the given label. + * @return {yfiles.graph.ILabelCandidateDescriptor} A descriptor or null. + * @see Specified by {@link yfiles.graph.ILabelCandidateDescriptorProvider#getDescriptor}. + */ + getDescriptor(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + } + var DescriptorWrapperLabelModel:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that uses {@link yfiles.drawing.FreeLabelModel#INSTANCE} as inner model. + */ + new ():yfiles.drawing.DescriptorWrapperLabelModel; + /** + * Initializes a new instance of the {@link yfiles.drawing.DescriptorWrapperLabelModel} class. + * @param {yfiles.graph.ILabelModel} innerModel The wrapped label model. + */ + ForLabelModel:{ + new (innerModel:yfiles.graph.ILabelModel):yfiles.drawing.DescriptorWrapperLabelModel; + }; + }; + /** + * An implementation of {@link yfiles.graph.ILabelModel} that can be used to create custom + * label models out of existing {@link yfiles.graph.ILabelModelParameter} instances. + * This class holds a number of parameters and serves as a container for these parameters. + * Custom models can easily be created that way: + *

+    * var glm = new GenericLabelModel(InteriorLabelModel.CENTER);
+    * glm.addParameter(ExteriorLabelModel.NORTH);
+    * glm.addParameter(ExteriorLabelModel.SOUTH);
+    * glm.addParameter(InteriorStretchLabelModel.EAST);
+    * glm.addParameter(InteriorStretchLabelModel.WEST);
+    * 
+ */ + export interface GenericLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider,yfiles.graph.ILabelCandidateDescriptorProvider{ + /** + * Adds another parameter to this models collection of parameters. + * Note that the parameter will be wrapped by this class and the resulting parameter + * which will use this model instance as its {@link yfiles.graph.ILabelModelParameter#model} will + * be returned. The parameter is stored by reference and subsequent modification of the parameter + * or its associated model will be reflected by this instance. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to add to this instance. + * @return {yfiles.graph.ILabelModelParameter} A new parameter that wraps the provided parameter and uses this instance as its model. + */ + addParameter(parameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelModelParameter; + /** + * Adds another parameter to this models collection of parameters. + * Note that the parameter will be wrapped by this class and the resulting parameter + * which will use this model instance as its {@link yfiles.graph.ILabelModelParameter#model} will + * be returned. The parameter is stored by reference and subsequent modification of the parameter + * or its associated model will be reflected by this instance. + * Also the methods allows for associating a {@link yfiles.graph.ILabelCandidateDescriptor} with each + * parameter that can later be retrieved via the {@link yfiles.drawing.GenericLabelModel#getDescriptor} method. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to add to this instance. + * @param {yfiles.graph.ILabelCandidateDescriptor} descriptor The descriptor to associate with the parameter. + * @return {yfiles.graph.ILabelModelParameter} A new parameter that wraps the provided parameter and uses this instance as its model. + */ + addParameterWithDescriptor(parameter:yfiles.graph.ILabelModelParameter,descriptor:yfiles.graph.ILabelCandidateDescriptor):yfiles.graph.ILabelModelParameter; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * Yields the {@link yfiles.graph.ILabelCandidateDescriptor} that has been associated with the instance + * during {@link yfiles.drawing.GenericLabelModel#addParameterWithDescriptor}. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to get the descriptor for. + * @return {yfiles.graph.ILabelCandidateDescriptor} The descriptor instance that had been added to this instance during + * {@link yfiles.drawing.GenericLabelModel#addParameterWithDescriptor}. + * @see Specified by {@link yfiles.graph.ILabelCandidateDescriptorProvider#getDescriptor}. + */ + getDescriptor(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; + } + var GenericLabelModel:{ + $class:yfiles.lang.Class; + /** + * Create a new generic label model using the provided parameter as the {@link yfiles.drawing.GenericLabelModel#createDefaultParameter default parameter.}. + * The parameter is stored by reference. + * @param {yfiles.graph.ILabelModelParameter} defaultParameter The parameter to use as the default. + * @throws {yfiles.system.ArgumentNullException} defaultParameter is null. + */ + WithDefault:{ + new (defaultParameter:yfiles.graph.ILabelModelParameter):yfiles.drawing.GenericLabelModel; + }; + /** + * Create a new generic label model using the provided parameter as the {@link yfiles.drawing.GenericLabelModel#createDefaultParameter default parameter.}. + * The parameter is stored by reference. + * @param {yfiles.graph.ILabelModelParameter} defaultParameter The parameter to use as the default. + * @param {yfiles.graph.ILabelCandidateDescriptor} descriptor The descriptor to associate with the parameter. + * @see {@link yfiles.drawing.GenericLabelModel#getDescriptor} + * @throws {yfiles.system.ArgumentNullException} defaultParameter is null. + */ + WithDefaultAndDescriptor:{ + new (defaultParameter:yfiles.graph.ILabelModelParameter,descriptor:yfiles.graph.ILabelCandidateDescriptor):yfiles.drawing.GenericLabelModel; + }; + }; + /** + * This node label model can be used to specify any position and orientation + * of a label. + * The position of the label is stored relative to the layout of the node + * the label belongs to. + */ + export interface FreeNodeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterFinder{ + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a parameter that is anchored at the node center and has no rotation. + * @return {yfiles.graph.ILabelModelParameter} A parameter that is anchored at the node center and has no rotation. + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Returns an empty context. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An empty context. + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Creates a parameter instance that is anchored to the node's {@link yfiles.graph.INode#layout}. + * @param {yfiles.geometry.PointD} offset The offset to the layout's top left corner. + * @param {number} angle The angle to rotate the label by, measured in radians. + * @return {yfiles.graph.ILabelModelParameter} A parameter that exactly fits the described location. + */ + createNodeLayoutAnchored(offset:yfiles.geometry.PointD,angle:number):yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter instance that is anchored to the node's {@link yfiles.graph.INode#layout}'s center. + * @param {yfiles.geometry.PointD} offset The offset to the layout's center. + * @param {number} angle The angle to rotate the label by, measured in radians. + * @return {yfiles.graph.ILabelModelParameter} A parameter that exactly fits the described location. + */ + createNodeCenterAnchored(offset:yfiles.geometry.PointD,angle:number):yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter instance that anchors the label to the node at a given position. + * The parameter will use the ratio and offset values to determine a point on both the + * label and the node. It will place the label in such a way that both points coincide. + * @param {yfiles.geometry.PointD} layoutRatio The ratio that describes the point on the node's layout relative to its size. + * @param {yfiles.geometry.PointD} layoutOffset The offset to apply to the point on the node after the ratio has been determined. + * @param {yfiles.geometry.PointD} labelRatio The ratio that describes the point on the label's layout relative to its size. + * @param {yfiles.geometry.PointD} labelOffset The offset to apply to the point on the label after the ratio has been determined. + * @param {number} angle The angle by which the label should be rotated around the point described using the ratio and offset, measured in radians. + * @return {yfiles.graph.ILabelModelParameter} + * A parameter that exactly fits the described location. + */ + createNodeRatioAnchored(layoutRatio:yfiles.geometry.PointD,layoutOffset:yfiles.geometry.PointD,labelRatio:yfiles.geometry.PointD,labelOffset:yfiles.geometry.PointD,angle:number):yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter instance that anchors the label to the node at the canonical position with respect to the + * given reference point. + * This method creates a {@link yfiles.drawing.FreeNodeLabelModel#createNodeRatioAnchored node ratio anchored parameter} with the canonical + * settings for the ratios and offsets in the following way. Each coordinate axis is considered independently. If + * the reference point coordinate is within the node layout interval, its relative location specifies the layout + * ratio for this coordinate. + * Otherwise, the absolute distance of the reference point and the interval specifies the layout offset and the + * layout ratio is either either 0.0 or 1.0. The parameters for the label ratio and label offset + * are calculated analogously. + * @param {yfiles.geometry.RectD} nodeLayout The node layout. + * @param {yfiles.geometry.IOrientedRectangle} labelLayout The label layout. + * @param {yfiles.geometry.PointD} referenceLocation The reference location. + * @return {yfiles.graph.ILabelModelParameter} The canonical parameter for the specified node and label layout. + */ + createSmartNodeRatioAnchoredWithLocation(nodeLayout:yfiles.geometry.RectD,labelLayout:yfiles.geometry.IOrientedRectangle,referenceLocation:yfiles.geometry.PointD):yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter instance that anchors the label to the node at the canonical position. + * This parameter can be used for example to anchor the label automatically relative the nearest node corner or the + * center. + *

+ * In more detail, the returned parameter is the same as the one of method + * {@link yfiles.drawing.FreeNodeLabelModel#createSmartNodeRatioAnchoredWithLocation} + * with the reference point determined in the following way: For each coordinate, if the node layout and label layout do + * not overlap, the reference is the label corner that is closest to the node. If they overlap and if in addition the + * start or end coordinate of the label matches the start, center or end coordinate of the node, that coordinate is the + * reference. Otherwise, the center of the label specifies the reference. + *

+ * @param {yfiles.geometry.RectD} nodeLayout The node layout. + * @param {yfiles.geometry.IOrientedRectangle} labelLayout The label layout. + * @return {yfiles.graph.ILabelModelParameter} The canonical parameter for the specified node and label layout. + */ + createSmartNodeRatioAnchored(nodeLayout:yfiles.geometry.RectD,labelLayout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + /** + * Tries to find a parameter that best matches the given layout for the + * provided label instance. + * This implementation will match the provided layout perfectly. + * @param {yfiles.graph.ILabel} label The label to find a parameter for. + * @param {yfiles.graph.ILabelModel} model The model instance to use. This should be this instance. + * @param {yfiles.geometry.IOrientedRectangle} labelLayout The anticipated layout for the label. + * @return {yfiles.graph.ILabelModelParameter} + * A non-null parameter that can be used for the label to approximate the provided layout. + * @see Specified by {@link yfiles.graph.ILabelModelParameterFinder#findBestParameter}. + */ + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,labelLayout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + /** + * Returns this instance if an instance of {@link yfiles.graph.ILabelModelParameterFinder} is + * requested and null otherwise. + * @param {yfiles.lang.Class} type The type for which an instance is requested. + * @return {Object} An instance that is assignable to the given type or null. + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + } + var FreeNodeLabelModel:{ + $class:yfiles.lang.Class; + /** + * A shared public instance that can be used to obtain parameters. + */ + INSTANCE:yfiles.drawing.FreeNodeLabelModel; + }; + /** + * Manages the visual appearance of an {@link yfiles.graph.IGraph} instance + * in a {@link yfiles.canvas.CanvasControl}. + * This class monitors the structural changes of an {@link yfiles.graph.IGraph} + * implementation and installs the necessary {@link yfiles.canvas.ICanvasObject} instances + * in the canvas for each item in the graph. + * The actual installation of the items is delegated to different + * {@link yfiles.drawing.StyleInstaller} instances depending on the type + * of the item. + * Typically one would use instances of this class as follows: + *

+    * GraphModelManager manager = new GraphModelManager(canvasControl);
+    * manager.graph = graph;
+    * 
+ * Note that {@link yfiles.canvas.GraphControl} has an instance of this type + * built-in already. + * This class will also {@link yfiles.drawing.GraphModelManager#useHierarchicNesting use the node hierarchy} + * to nest the nodes {@link yfiles.drawing.GraphModelManager#drawEdgesBehindGroupedNodes and edges} accordingly. + * @see {@link yfiles.drawing.GraphModelManager#nodeGroup} + * @see {@link yfiles.drawing.GraphModelManager#drawEdgesBehindGroupedNodes} + * @see {@link yfiles.drawing.GraphModelManager#useHierarchicNesting} + */ + export interface GraphModelManager extends Object{ + /** + * Creates an {@link yfiles.model.ICanvasGroupProvider} instance that + * returns for each node queried an {@link yfiles.canvas.ICanvasObjectGroup} + * that will be provided to the {@link yfiles.drawing.GraphModelManager#nodeStyleInstaller} + * for each node to be installed. + * @return {yfiles.model.ICanvasGroupProvider.} a constant provider that returns the {@link yfiles.drawing.GraphModelManager#nodeGroup} + */ + createNodeCanvasGroupProvider():yfiles.model.ICanvasGroupProvider; + /** + * Creates an {@link yfiles.model.ICanvasGroupProvider} instance that + * returns for each port queried an {@link yfiles.canvas.ICanvasObjectGroup} + * that will be provided to the {@link yfiles.drawing.GraphModelManager#portStyleInstaller} + * for each port to be installed. + * @return {yfiles.model.ICanvasGroupProvider.} a constant provider that returns the {@link yfiles.drawing.GraphModelManager#portGroup} + */ + createPortCanvasGroupProvider():yfiles.model.ICanvasGroupProvider; + /** + * Creates an {@link yfiles.model.ICanvasGroupProvider} instance that + * returns for each edge label queried an {@link yfiles.canvas.ICanvasObjectGroup} + * that will be provided to the {@link yfiles.drawing.GraphModelManager#edgeLabelInstaller} + * for each edge label to be installed. + * @return {yfiles.model.ICanvasGroupProvider.} a constant provider that returns the {@link yfiles.drawing.GraphModelManager#edgeLabelGroup} + */ + createEdgeLabelCanvasGroupProvider():yfiles.model.ICanvasGroupProvider; + /** + * Creates an {@link yfiles.model.ICanvasGroupProvider} instance that + * returns for each node label queried an {@link yfiles.canvas.ICanvasObjectGroup} + * that will be provided to the {@link yfiles.drawing.GraphModelManager#nodeLabelInstaller} + * for each node label to be installed. + * @return {yfiles.model.ICanvasGroupProvider.} a constant provider that returns the {@link yfiles.drawing.GraphModelManager#nodeLabelGroup} + */ + createNodeLabelCanvasGroupProvider():yfiles.model.ICanvasGroupProvider; + /** + * Creates an {@link yfiles.model.ICanvasGroupProvider} instance that + * returns for each edge queried an {@link yfiles.canvas.ICanvasObjectGroup} + * that will be provided to the {@link yfiles.drawing.GraphModelManager#edgeStyleInstaller} + * for each edge to be installed. + * @return {yfiles.model.ICanvasGroupProvider.} a constant provider that returns the {@link yfiles.drawing.GraphModelManager#edgeGroup} + */ + createEdgeCanvasGroupProvider():yfiles.model.ICanvasGroupProvider; + /** + * {@link yfiles.model.CollectionModelManager#update Updates} the visual representation + * of the given item. + * @param {yfiles.model.IModelItem} modelItem The item to update the visual representation + * @see {@link yfiles.model.CollectionModelManager#update} + */ + update(modelItem:yfiles.model.IModelItem):void; + /** + * Gets the {@link yfiles.canvas.ICanvasObjectGroup} instance that will be used + * for installing node styles. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.drawing.GraphModelManager#createNodeGroup} will be called. + * Note that in the case of {@link yfiles.drawing.GraphModelManager#useHierarchicNesting hierarchic nesting}, nodes + * will not be installed at the top-level of this group. Rather a more complicated nesting + * of dynamically created {@link yfiles.canvas.ICanvasObjectGroup}s will be used. + * @see {@link yfiles.drawing.GraphModelManager#createNodeCanvasGroupProvider} + * @see {@link yfiles.drawing.GraphModelManager#nodeStyleInstaller} + */ + nodeGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Factory method for the {@link yfiles.drawing.GraphModelManager#nodeGroup} property. This method will be called + * upon first access to the property. + * @return {yfiles.canvas.ICanvasObjectGroup} a new group that has been added to the {@link yfiles.drawing.GraphModelManager#contentGroup} + */ + createNodeGroup():yfiles.canvas.ICanvasObjectGroup; + /** + * Gets the {@link yfiles.canvas.ICanvasObjectGroup} instance that will be used + * for installing edge styles. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.drawing.GraphModelManager#createEdgeGroup} will be called. + * Note that in the case of {@link yfiles.drawing.GraphModelManager#useHierarchicNesting hierarchically nested graphs} + * edges will only be put directly in this {@link yfiles.canvas.ICanvasObjectGroup}, if the {@link yfiles.drawing.GraphModelManager#drawEdgesBehindGroupedNodes} + * property is set to false. Otherwise edges will actually be nested in the subtree + * of the {@link yfiles.drawing.GraphModelManager#nodeGroup} according to the node nesting. + * @see {@link yfiles.drawing.GraphModelManager#createEdgeCanvasGroupProvider} + * @see {@link yfiles.drawing.GraphModelManager#edgeStyleInstaller} + */ + edgeGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Factory method for the {@link yfiles.drawing.GraphModelManager#edgeGroup} property. This method will be called + * upon first access to the property. + * @return {yfiles.canvas.ICanvasObjectGroup} a new group that has been added to the {@link yfiles.drawing.GraphModelManager#contentGroup} + */ + createEdgeGroup():yfiles.canvas.ICanvasObjectGroup; + /** + * Gets the {@link yfiles.canvas.ICanvasObjectGroup} instance that will be used + * for installing edge label styles. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.drawing.GraphModelManager#createEdgeLabelGroup} will be called. + * @see {@link yfiles.drawing.GraphModelManager#createEdgeLabelCanvasGroupProvider} + * @see {@link yfiles.drawing.GraphModelManager#edgeLabelInstaller} + */ + edgeLabelGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Factory method for the {@link yfiles.drawing.GraphModelManager#edgeLabelGroup} property. This method will be called + * upon first access to the property. + * @return {yfiles.canvas.ICanvasObjectGroup} a new group that has been added to the {@link yfiles.drawing.GraphModelManager#contentGroup} + */ + createEdgeLabelGroup():yfiles.canvas.ICanvasObjectGroup; + /** + * Gets the {@link yfiles.canvas.ICanvasObjectGroup} instance that will be used + * for installing node label styles. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.drawing.GraphModelManager#createNodeLabelGroup} will be called. + * @see {@link yfiles.drawing.GraphModelManager#createNodeLabelCanvasGroupProvider} + * @see {@link yfiles.drawing.GraphModelManager#nodeLabelInstaller} + */ + nodeLabelGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Factory method for the {@link yfiles.drawing.GraphModelManager#nodeLabelGroup} property. This method will be called + * upon first access to the property. + * @return {yfiles.canvas.ICanvasObjectGroup} a new group that has been added to the {@link yfiles.drawing.GraphModelManager#contentGroup} + */ + createNodeLabelGroup():yfiles.canvas.ICanvasObjectGroup; + /** + * Gets the {@link yfiles.canvas.ICanvasObjectGroup} instance that will be used + * for installing port styles. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.drawing.GraphModelManager#createPortGroup} will be called. + * @see {@link yfiles.drawing.GraphModelManager#createPortCanvasGroupProvider} + * @see {@link yfiles.drawing.GraphModelManager#portStyleInstaller} + */ + portGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Factory method for the {@link yfiles.drawing.GraphModelManager#portGroup} property. This method will be called + * upon first access to the property. + * @return {yfiles.canvas.ICanvasObjectGroup} a new group that has been added to the {@link yfiles.drawing.GraphModelManager#contentGroup} + */ + createPortGroup():yfiles.canvas.ICanvasObjectGroup; + /** + * Gets the {@link yfiles.model.IModelItemInstaller} instance used for installing + * an {@link yfiles.graph.IEdge} into the canvas. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.drawing.GraphModelManager#createEdgeStyleInstaller} will be called. + * In the default implementation this property can safely be cast to a {@link yfiles.drawing.StyleInstaller} + * that is typed to the arguments that correspond to the item type. + */ + edgeStyleInstaller:yfiles.model.IModelItemInstaller; + /** + * Factory method for the {@link yfiles.drawing.GraphModelManager#edgeStyleInstaller} property. This method will be called + * upon first access to the property. + * @return {yfiles.model.IModelItemInstaller.} a new instance of {@link yfiles.drawing.StyleInstaller StyleInstaller}<IEdge,IEdgeStyle> + */ + createEdgeStyleInstaller():yfiles.model.IModelItemInstaller; + /** + * Gets the {@link yfiles.model.IModelItemInstaller} instance used for installing + * an {@link yfiles.graph.IPort} into the canvas. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.drawing.GraphModelManager#createPortStyleInstaller} will be called. + * In the default implementation this property can safely be cast to a {@link yfiles.drawing.StyleInstaller} + * that is typed to the arguments that correspond to the item type. + */ + portStyleInstaller:yfiles.model.IModelItemInstaller; + /** + * Factory method for the {@link yfiles.drawing.GraphModelManager#portStyleInstaller} property. This method will be called + * upon first access to the {@link yfiles.drawing.GraphModelManager#portStyleInstaller} property. + * @return {yfiles.model.IModelItemInstaller.} a new instance of {@link yfiles.drawing.StyleInstaller StyleInstaller}<IPort,IPortStyle> + */ + createPortStyleInstaller():yfiles.model.IModelItemInstaller; + /** + * Gets the {@link yfiles.model.IModelItemInstaller} instance used for installing + * an {@link yfiles.graph.ILabel} of an {@link yfiles.graph.IEdge} into the canvas. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.drawing.GraphModelManager#createEdgeLabelInstaller} will be called. + * In the default implementation this property can safely be cast to a {@link yfiles.drawing.StyleInstaller} + * that is typed to the arguments that correspond to the item type. + */ + edgeLabelInstaller:yfiles.model.IModelItemInstaller; + /** + * Factory method for the {@link yfiles.drawing.GraphModelManager#edgeLabelInstaller} property. This method will be called + * upon first access to the property. + * @return {yfiles.model.IModelItemInstaller.} a new instance of {@link yfiles.drawing.StyleInstaller StyleInstaller}<ILabel,ILabelStyle> + */ + createEdgeLabelInstaller():yfiles.model.IModelItemInstaller; + /** + * Gets the {@link yfiles.model.IModelItemInstaller} instance used for installing + * an {@link yfiles.graph.ILabel} of an {@link yfiles.graph.INode} into the canvas. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.drawing.GraphModelManager#createNodeLabelInstaller} will be called. + * In the default implementation this property can safely be cast to a {@link yfiles.drawing.StyleInstaller} + * that is typed to the arguments that correspond to the item type. + */ + nodeLabelInstaller:yfiles.model.IModelItemInstaller; + /** + * Factory method for the {@link yfiles.drawing.GraphModelManager#nodeLabelInstaller} property. This method will be called + * upon first access to the property. + * @return {yfiles.model.IModelItemInstaller.} a new instance of {@link yfiles.drawing.StyleInstaller StyleInstaller}<ILabel,ILabelStyle> + */ + createNodeLabelInstaller():yfiles.model.IModelItemInstaller; + /** + * Gets or sets a property that determines whether + * edges should be drawn behind nodes, if a {@link yfiles.drawing.GraphModelManager#getHierarchy grouped graph} + * is displayed. + * If the {@link yfiles.drawing.GraphModelManager#useHierarchicNesting hierarchic nesting} is enabled the edges will + * actually be interleaved with the nodes in the nested canvas object subtree. Thus the {@link yfiles.drawing.GraphModelManager#edgeGroup} + * will be empty in case this property is true, which is the default. + */ + drawEdgesBehindGroupedNodes:boolean; + /** + * Gets the {@link yfiles.model.IModelItemInstaller} instance used for installing + * an {@link yfiles.graph.INode} into the canvas. + * If the value has not yet been initialized upon first access, the + * factory method {@link yfiles.drawing.GraphModelManager#createNodeStyleInstaller} will be called. + * In the default implementation this property can safely be cast to a {@link yfiles.drawing.StyleInstaller} + * that is typed to the arguments that correspond to the item type. + */ + nodeStyleInstaller:yfiles.model.IModelItemInstaller; + /** + * Factory method for the {@link yfiles.drawing.GraphModelManager#nodeStyleInstaller} property. This method will be called + * upon first access to the property. + * @return {yfiles.model.IModelItemInstaller.} a new instance of {@link yfiles.drawing.StyleInstaller StyleInstaller}<INode, INodeStyle> + */ + createNodeStyleInstaller():yfiles.model.IModelItemInstaller; + /** + * Gets or sets the content group this manager instance uses to add + * visual representation of the graph to. + */ + contentGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Factory method that creates the {@link yfiles.drawing.GraphModelManager#contentGroup}. + * The default implementation will just add another group to the {@link yfiles.canvas.CanvasControl}. + * @return {yfiles.canvas.ICanvasObjectGroup} The group to use for adding the content. + */ + createContentGroup():yfiles.canvas.ICanvasObjectGroup; + /** + * Gets an {@link yfiles.collections.IComparer} instance that can be + * used to compare two model items with respect to their + * visual display order. + * An item is considered to be greater than another item if + * it is rendered on top of it. + */ + comparer:yfiles.collections.IComparer; + /** + * Gets a {@link yfiles.drawing.IHitTestEnumerator} that + * can be used to enumerate hits on the canvas + * at a given world coordinate position. + * This enumerator will enumerate hits in the order so that the + * visually topmost element will be reported first. + */ + hitTestEnumerator:yfiles.drawing.IHitTestEnumerator; + /** + * Creates a {@link yfiles.drawing.IHitTestEnumerator} that + * can be used to enumerate hits on the canvas + * at a given world coordinate position using the provided canvas context. + * This enumerator will enumerate hits in the order so that the + * visually topmost element will be reported first. + * @param {yfiles.canvas.ICanvasContext} hitTestContext The context to use during calls to {@link yfiles.drawing.IHitTestable#isHit}. + */ + createHitTestEnumerator(hitTestContext:yfiles.canvas.ICanvasContext):yfiles.drawing.IHitTestEnumerator; + /** + * Gets a {@link yfiles.graph.INodeHitTestEnumerator} that + * can be used to enumerate hits on the canvas + * at a given world coordinate position. + * This enumerator will enumerate hits in the order so that the + * visually topmost element will be reported first. + */ + createNodeHitTestEnumerator(hitTestContext:yfiles.canvas.ICanvasContext):yfiles.graph.INodeHitTestEnumerator; + /** + * Gets a {@link yfiles.graph.IEdgeHitTestEnumerator} that + * can be used to enumerate hits on the canvas + * at a given world coordinate position. + * This enumerator will enumerate hits in the order so that the + * visually topmost element will be reported first. + */ + createEdgeHitTestEnumerator(hitTestContext:yfiles.canvas.ICanvasContext):yfiles.graph.IEdgeHitTestEnumerator; + /** + * Gets a {@link yfiles.graph.ILabelHitTestEnumerator} that + * can be used to enumerate hits on the canvas + * at a given world coordinate position. + * This enumerator will enumerate hits in the order so that the + * visually topmost element will be reported first. + */ + createLabelHitTestEnumerator(hitTestContext:yfiles.canvas.ICanvasContext):yfiles.graph.ILabelHitTestEnumerator; + /** + * Gets a {@link yfiles.graph.IBendHitTestEnumerator} that + * can be used to enumerate hits on the canvas + * at a given world coordinate position. + * This enumerator will enumerate hits in the order so that the + * visually topmost element will be reported first. + */ + createBendHitTestEnumerator(hitTestContext:yfiles.canvas.ICanvasContext):yfiles.graph.IBendHitTestEnumerator; + /** + * Gets a {@link yfiles.graph.IPortHitTestEnumerator} that + * can be used to enumerate hits on the canvas + * at a given world coordinate position. + * This enumerator will enumerate hits in the order so that the + * visually topmost element will be reported first. + */ + createPortHitTestEnumerator(hitTestContext:yfiles.canvas.ICanvasContext):yfiles.graph.IPortHitTestEnumerator; + /** + * Gets a {@link yfiles.graph.ILabeledItemHitTestEnumerator} that + * can be used to enumerate hits on the canvas + * at a given world coordinate position. + * This enumerator will enumerate hits in the order so that the + * visually topmost element will be reported first. + */ + createLabeledItemHitTestEnumerator(hitTestContext:yfiles.canvas.ICanvasContext):yfiles.graph.ILabeledItemHitTestEnumerator; + /** + * Compares two items with respect to their visibility order. + * @param {yfiles.model.IModelItem} item1 the first item to compare + * @param {yfiles.model.IModelItem} item2 the second item to compare + * @return {number} an integer value indicating the relative painting order of + * the two items + * @see {@link yfiles.drawing.GraphModelManager#comparer} + */ + compare(item1:yfiles.model.IModelItem,item2:yfiles.model.IModelItem):number; + /** + * Retrieves the "main" {@link yfiles.canvas.ICanvasObject} for a given model item + * managed by this instance. + * @param {yfiles.model.IModelItem} item the item + * @return {yfiles.canvas.ICanvasObject} an instance that is deemed the main canvas object for the given item + * or null + * @see {@link yfiles.model.CollectionModelManager#getCanvasObject} + */ + getCanvasObject(item:yfiles.model.IModelItem):yfiles.canvas.ICanvasObject; + /** + * Invalidates the {@link yfiles.canvas.ICanvasObject}s for a given model item + * managed by this instance. + * @param {yfiles.model.IModelItem} item the item + * @see {@link yfiles.model.CollectionModelManager#invalidate} + */ + invalidate(item:yfiles.model.IModelItem):void; + /** + * Retrieves all {@link yfiles.canvas.ICanvasObject} registered for a given model item + * managed by this instance. + * @param {yfiles.model.IModelItem} item the item + * @return {yfiles.collections.IEnumerable.} all currently registered canvas objects. + * or null + * @see {@link yfiles.model.CollectionModelManager#getDescriptor} + */ + getCanvasObjects(item:yfiles.model.IModelItem):yfiles.collections.IEnumerable; + /** + * Enumerates hits on the canvas + * at a given world coordinate position. + * The instance returned will enumerate hits in the order so that the + * topmost visual element will be reported first. + * @param {yfiles.geometry.PointD} location the world coordinates to perform the hit test + * @return {yfiles.collections.IEnumerator.} an enumerator that will enumerate the hits at the given coordinates + */ + enumerateHits(location:yfiles.geometry.PointD):yfiles.collections.IEnumerator; + /** + * Enumerates hits on the canvas + * at a given world coordinate position for a given context. + * The instance returned will enumerate hits in the order so that the + * topmost visual element will be reported first. + * @param {yfiles.geometry.PointD} location the world coordinates to perform the hit test + * @param {yfiles.canvas.ICanvasObjectGroup} root The group to search the subtree of. + * @param {yfiles.canvas.ICanvasContext} context The context to provide to {@link yfiles.drawing.IHitTestable#isHit} + * @return {yfiles.collections.IEnumerator.} an enumerator that will enumerate the hits at the given coordinates + */ + enumerateHitsAtRoot(location:yfiles.geometry.PointD,root:yfiles.canvas.ICanvasObjectGroup,context:yfiles.canvas.ICanvasContext):yfiles.collections.IEnumerator; + /** + * Enumerates hits on the canvas + * at a given world coordinate position. + * The instance returned will enumerate hits in the order so that the + * topmost visual element will be reported first. + * @param {yfiles.geometry.PointD} location the world coordinates to perform the hit test + * @return {yfiles.collections.IEnumerator.} an enumerator that will enumerate the hits at the given coordinates + */ + enumerateTypedHits(itemType:yfiles.lang.Class,location:yfiles.geometry.PointD):yfiles.collections.IEnumerator; + /** + * Enumerates hits on the canvas + * at a given world coordinate position in a given context. + * The instance returned will enumerate hits in the order so that the + * topmost visual element will be reported first. + * @param {yfiles.geometry.PointD} location the world coordinates to perform the hit test + * @param {yfiles.canvas.ICanvasObjectGroup} rootGroup The group to search the subtree of. + * @param {yfiles.canvas.ICanvasContext} context The context to provide to {@link yfiles.drawing.IHitTestable#isHit} + * @return {yfiles.collections.IEnumerator.} an enumerator that will enumerate the hits at the given coordinates + */ + enumerateTypedHitsAtRoot(itemType:yfiles.lang.Class,location:yfiles.geometry.PointD,rootGroup:yfiles.canvas.ICanvasObjectGroup,context:yfiles.canvas.ICanvasContext):yfiles.collections.IEnumerator; + /** + * Retrieves the corresponding {@link yfiles.model.IModelItem} for + * the given canvas object. + * @param {yfiles.canvas.ICanvasObject} canvasObject the instance to use for the query + * @return {yfiles.model.IModelItem} The item that is associated with the object or null. + */ + getModelItem(canvasObject:yfiles.canvas.ICanvasObject):yfiles.model.IModelItem; + /** + * Gets or sets the graph this manager manages. + * The {@link yfiles.drawing.GraphModelManager#getHierarchy} method will be used in a separate call to find the associated + * {@link yfiles.graph.IHierarchy} for the nodes in the graph. + * @see {@link yfiles.drawing.GraphModelManager#onGraphChanged} + */ + graph:yfiles.graph.IGraph; + /** + * Called when the {@link yfiles.drawing.GraphModelManager#graph} property changes. + * This method registers the collections of the graph instance with the {@link yfiles.model.CollectionModelManager mechanism} that manages the + * mapping between the elements and the {@link yfiles.canvas.ICanvasObject}s. Subclasses should call the base method if they want to use the default mechanisms. + * @param {yfiles.graph.IGraph} oldGraph The old graph instance. + * @param {yfiles.graph.IGraph} newGraph The new graph instance. + */ + onGraphChanged(oldGraph:yfiles.graph.IGraph,newGraph:yfiles.graph.IGraph):void; + /** + * Helper method that will lookup the {@link yfiles.graph.IHierarchy} for the {@link yfiles.graph.INode}s + * for the given {@link yfiles.graph.IGraph}. + * This method simply uses the method of the graph + * to query the hierarchy implementation. + * @param {yfiles.graph.IGraph} graph The graph to query the hierarchy for. + * @return {yfiles.graph.IHierarchy.} The hierarchy to use for the nodes in the graph or null. + */ + getHierarchy(graph:yfiles.graph.IGraph):yfiles.graph.IHierarchy; + /** + * Determines whether this instance should use the {@link yfiles.drawing.GraphModelManager#getHierarchy hierarchy information for the graph} + * to nest the nodes {@link yfiles.drawing.GraphModelManager#drawEdgesBehindGroupedNodes and optionally edges} accordingly. + * Value: + * true (the default) iff the hierarchy should be queried. + */ + useHierarchicNesting:boolean; + /** + * Retrieves the Canvas Object group to use for the given node. + * This implementation is called by the default instance that is assigned to {@link yfiles.drawing.GraphModelManager#createNodeCanvasGroupProvider} + * @param {yfiles.canvas.CanvasControl} canvas The canvas to return a group for. + * @param {yfiles.graph.INode} node The node that will be installed in the canvas. + * @return {yfiles.canvas.ICanvasObjectGroup} The group to use. + */ + getCanvasObjectGroupForNode(canvas:yfiles.canvas.CanvasControl,node:yfiles.graph.INode):yfiles.canvas.ICanvasObjectGroup; + /** + * Retrieves the Canvas Object group to use for the given edge. + * This implementation is called by the default instance that is assigned to {@link yfiles.drawing.GraphModelManager#createEdgeCanvasGroupProvider} + * @param {yfiles.canvas.CanvasControl} canvas The canvas to return the a group for. + * @param {yfiles.graph.IEdge} edge The edge that will be installed in the canvas. + * @return {yfiles.canvas.ICanvasObjectGroup} The group to use. + */ + getCanvasObjectGroupForEdge(canvas:yfiles.canvas.CanvasControl,edge:yfiles.graph.IEdge):yfiles.canvas.ICanvasObjectGroup; + /** + * Retrieves the Canvas Object group to use for the given port. + * This implementation is called by the default instance that is assigned to {@link yfiles.drawing.GraphModelManager#createPortCanvasGroupProvider} + * @param {yfiles.canvas.CanvasControl} canvas The canvas to return the a group for. + * @param {yfiles.graph.IPort} port The port that will be installed in the canvas. + * @return {yfiles.canvas.ICanvasObjectGroup} The group to use. + */ + getCanvasObjectGroupForPort(canvas:yfiles.canvas.CanvasControl,port:yfiles.graph.IPort):yfiles.canvas.ICanvasObjectGroup; + /** + * Retrieves the Canvas Object group to use for the given label. + * This implementation is called by the default instance that is assigned to {@link yfiles.drawing.GraphModelManager#createNodeLabelCanvasGroupProvider} + * and {@link yfiles.drawing.GraphModelManager#createEdgeLabelCanvasGroupProvider} + * @param {yfiles.canvas.CanvasControl} canvas The canvas to return the a group for. + * @param {yfiles.graph.ILabel} label The label that will be installed in the canvas. + * @return {yfiles.canvas.ICanvasObjectGroup} The group to use. + */ + getCanvasObjectGroupForLabel(canvas:yfiles.canvas.CanvasControl,label:yfiles.graph.ILabel):yfiles.canvas.ICanvasObjectGroup; + } + var GraphModelManager:{ + $class:yfiles.lang.Class; + /** + * Creates a manager instance for the given control. The contents + * of the graph will be added to a newly created group that is + * added to the root of the scene graph. + * In order to get anything useful out of this instance the {@link yfiles.drawing.GraphModelManager#graph} + * property should be set to an instance after construction. + * @param {yfiles.canvas.CanvasControl} canvas the canvas to manage the visual appearance of a graph for. + */ + ForControl:{ + new (canvas:yfiles.canvas.CanvasControl):yfiles.drawing.GraphModelManager; + }; + /** + * Creates a manager instance for the given control. The contents + * of the graph will be added to given group that is + * must be part of the canvas. + * In order to get anything useful out of this instance the {@link yfiles.drawing.GraphModelManager#graph} + * property should be set to an instance after construction. + * @param {yfiles.canvas.CanvasControl} canvas the canvas to manage the visual appearance of a graph for. + * @param {yfiles.canvas.ICanvasObjectGroup} contentGroup the group to add the graph's visual content to. Can be null, in which case + * {@link yfiles.drawing.GraphModelManager#contentGroup} should be set afterwards or {@link yfiles.drawing.GraphModelManager#createContentGroup} + * will automatically create a group lazily. + */ + new (canvas:yfiles.canvas.CanvasControl,contentGroup:yfiles.canvas.ICanvasObjectGroup):yfiles.drawing.GraphModelManager; + }; + /** + * An implementation of {@link yfiles.graph.IPortLocationModel} that can be used to create custom + * port location models out of existing {@link yfiles.graph.IPortLocationModelParameter} instances. + * This class holds a number of parameters and serves as a container for these parameters. + * Custom models can easily be created that way: + *

+    *     var genericModel = new GenericPortLocationModel();
+    *     genericModel.addParameter(NodeScaledPortLocationModel.NODE_CENTER_ANCHORED);
+    *     genericModel.addParameter(NodeScaledPortLocationModel.NODE_BOTTOM_ANCHORED); 
+    *     genericModel.addParameter(NodeScaledPortLocationModel.NODE_TOP_ANCHORED); 
+    *     genericModel.addParameter(NodeScaledPortLocationModel.NODE_RIGHT_ANCHORED);
+    *     genericModel.addParameter(NodeScaledPortLocationModel.NODE_LEFT_ANCHORED); 
+    *     GraphControl.graph.nodeDefaults.ports.locationModelParameter = genericModel.parameters[0];
+    * 
+ * Note that in order to work, this model needs to have at least one {@link yfiles.drawing.GenericPortLocationModel#addParameter parameter added}. + * @see {@link yfiles.drawing.GenericPortLocationModel#addParameter} + */ + export interface GenericPortLocationModel extends Object,yfiles.graph.IPortLocationModel,yfiles.collections.IEnumerable,yfiles.input.IPortLocationModelParameterProvider{ + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Determines the location of the port for the given parameter. + * @param {yfiles.graph.IPort} port The port to determine the location for. + * @param {yfiles.graph.IPortLocationModelParameter} parameter The parameter to use. The parameter can be expected to be created by this instance + * having the {@link yfiles.graph.IPortLocationModelParameter#model} property set to this instance.. + * @return {yfiles.geometry.PointD} The calculated location of the port. + * @see Specified by {@link yfiles.graph.IPortLocationModel#getLocation}. + */ + getLocation(port:yfiles.graph.IPort,parameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.PointD; + /** + * Adds the given parameter to the {@link yfiles.drawing.GenericPortLocationModel#parameters} of this instance. + * Note that this will create a new parameter instance that is then actually bound to this instance and returned. + * The instance is stored by reference so if this is a mutable instance this instance will be modified, implicitly, too. + * @param {yfiles.graph.IPortLocationModelParameter} parameter The parameter to add to this instance. + * @return {yfiles.graph.IPortLocationModelParameter} The parameter to use with this model that wraps the given parameter. + * @see {@link yfiles.drawing.GenericPortLocationModel#add} + */ + addParameter(parameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.IPortLocationModelParameter; + /** + * Gets all parameters that are associated with this instance. + * This enumerates the instances that wraps the parameters that have been added to this instance via + * {@link yfiles.drawing.GenericPortLocationModel#addParameter} + * Value: The parameters that are managed by this instance. + */ + parameters:yfiles.collections.IEnumerable; + /** + * Factory method that creates a parameter for the given port that tries to match the provided location + * in absolute world coordinates. + * This implementation iterates over all {@link yfiles.drawing.GenericPortLocationModel#parameters} to return the one that matches the given location the best. + * @param {yfiles.graph.IPortOwner} portOwner The port owner that will own the port for which the parameter shall be created. + * @param {yfiles.geometry.PointD} location The location in the world coordinate system that should be matched as best as possible. + * @return {yfiles.graph.IPortLocationModelParameter} + * A new instance that can be used to describe the location of an {@link yfiles.graph.IPort} at the given + * portOwner. + * @see Specified by {@link yfiles.graph.IPortLocationModel#createParameter}. + */ + createParameter(portOwner:yfiles.graph.IPortOwner,location:yfiles.geometry.PointD):yfiles.graph.IPortLocationModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of port + * and parameter. + * @param {yfiles.graph.IPort} port The port to use in the context. + * @param {yfiles.graph.IPortLocationModelParameter} parameter The parameter to use for the port in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the port/parameter combination. + * @see Specified by {@link yfiles.graph.IPortLocationModel#getContext}. + */ + getContext(port:yfiles.graph.IPort,parameter:yfiles.graph.IPortLocationModelParameter):yfiles.support.ILookup; + /** + * This method simply delegates to {@link yfiles.drawing.GenericPortLocationModel#addParameter}. It is there to allow for convenient + * initialization in code. + * This method is used by the compiler if the collection initializer syntax is used. + * @param {yfiles.graph.IPortLocationModelParameter} portLocationModelParameter The parameter to add to this instance. + * @see {@link yfiles.drawing.GenericPortLocationModel#addParameter} + */ + add(portLocationModelParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + getParameters(port:yfiles.graph.IPort,model:yfiles.graph.IPortLocationModel):yfiles.collections.IEnumerable; + } + var GenericPortLocationModel:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.GenericPortLocationModel} class. + */ + new ():yfiles.drawing.GenericPortLocationModel; + }; + /** + * A label model for node labels that lie outside of the node's {@link yfiles.graph.INode#layout} + * bounds. + * This label model supports eight positions outside of the layout's bounds. + */ + export interface ExteriorLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{ + /** + * Gets or sets the insets to use by this model. + * The insets are in fact "outsets", i.e. they are treated as margins. Positive values will increase the distance + * of the labels to the node. + */ + insets:yfiles.geometry.InsetsD; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Creates a new parameter that is associated with this instance for the provided position. + * @param {yfiles.drawing.ExteriorLabelModel.Position} position The position constant that describes the position of the label. + * @return {yfiles.graph.ILabelModelParameter} A new parameter instance. + */ + createParameter(position:yfiles.drawing.ExteriorLabelModel.Position_Interface):yfiles.graph.ILabelModelParameter; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,labelModel:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + } + export module ExteriorLabelModel{ + export interface Position_Interface{} + } + var ExteriorLabelModel:{ + $class:yfiles.lang.Class; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.ExteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + NORTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.ExteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.ExteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + SOUTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.ExteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + SOUTH_EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.ExteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + SOUTH_WEST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.ExteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + WEST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.ExteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + NORTH_EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.ExteriorLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + NORTH_WEST:yfiles.graph.ILabelModelParameter; + Position:{ + NORTH:yfiles.drawing.ExteriorLabelModel.Position_Interface; + EAST:yfiles.drawing.ExteriorLabelModel.Position_Interface; + SOUTH:yfiles.drawing.ExteriorLabelModel.Position_Interface; + WEST:yfiles.drawing.ExteriorLabelModel.Position_Interface; + NORTH_EAST:yfiles.drawing.ExteriorLabelModel.Position_Interface; + SOUTH_EAST:yfiles.drawing.ExteriorLabelModel.Position_Interface; + NORTH_WEST:yfiles.drawing.ExteriorLabelModel.Position_Interface; + SOUTH_WEST:yfiles.drawing.ExteriorLabelModel.Position_Interface; + }; + /** + * Creates a new instance of this model. + */ + new ():yfiles.drawing.ExteriorLabelModel; + }; + /** + * A label model that can be used to describe any position and orientation + * of a label. + * The position of the label is stored absolutely and is not influenced + * by the layout or position of the owner of the label. In fact the owner is not even + * queried during a call to {@link yfiles.drawing.FreeLabelModel#getGeometry}. + */ + export interface FreeLabelModel extends Object,yfiles.graph.ILabelModelParameterFinder,yfiles.graph.ILabelModel{ + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Creates a new label at the given absolute position using the provided angle. + * @param {yfiles.geometry.PointD} anchorLocation The location for the parameter. + * @param {number} angle The angle of rotation. + * @return {yfiles.graph.ILabelModelParameter} A new parameter that is associated with this instance. + */ + createAbsolute(anchorLocation:yfiles.geometry.PointD,angle:number):yfiles.graph.ILabelModelParameter; + /** + * Creates a new label whose layout is dynamically read from the provided instance. + * @param {yfiles.geometry.IOrientedRectangle} orientedRectangle The oriented rectangle to dynamically retrieve the values from. + * @return {yfiles.graph.ILabelModelParameter} + * A new parameter that is associated with this instance. + */ + createDynamic(orientedRectangle:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + /** + * Creates a new label at the given dynamic location using the provided angle. + * @param {yfiles.geometry.IPoint} location The location to place the parameter at. That instance is stored by reference. + * @param {number} angle The angle of rotation. + * @return {yfiles.graph.ILabelModelParameter} A new parameter that is associated with this instance. + */ + createAnchored(location:yfiles.geometry.IPoint,angle:number):yfiles.graph.ILabelModelParameter; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Tries to find a parameter that best matches the given layout for the + * provided label instance. + * This method may not necessarily find a parameter that matches the provided + * layout exactly. Implementations may choose to simply return the model's + * {@link yfiles.graph.ILabelModel#createDefaultParameter default parameter} + * but may never return null. + * @param {yfiles.graph.ILabel} label The label to find a parameter for. + * @param {yfiles.graph.ILabelModel} model The model instance to use. This should be the instance + * this instance has been obtained from. + * @param {yfiles.geometry.IOrientedRectangle} labelLayout The anticipated layout for the label. + * @return {yfiles.graph.ILabelModelParameter} A non-null parameter that can be used for the label to approximate the provided layout. + * @see Specified by {@link yfiles.graph.ILabelModelParameterFinder#findBestParameter}. + */ + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,labelLayout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + } + var FreeLabelModel:{ + $class:yfiles.lang.Class; + /** + * A shared public instance that can be used to obtain parameters. + */ + INSTANCE:yfiles.drawing.FreeLabelModel; + }; + /** + * An edge label model that can be used to describe any position and orientation + * of a label. + * The position of the label is stored relative to the positions of the ports + * of the edge the label belongs to. + */ + export interface FreeEdgeLabelModel extends Object,yfiles.graph.ILabelModelParameterFinder,yfiles.graph.ILabelModel{ + /** + * Gets or sets a property that indicates whether the angle used by the {@link yfiles.drawing.FreeEdgeLabelModel#createEdgeAnchored + * parameter} should be interpreted relative to the edge's orientation or as an absolute angle + * in the coordinate system. + * By default the angle is interpreted to be relative to the world coordinates axes. + */ + edgeRelativeAngle:boolean; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Creates a parameter for the given location. + * @param {number} ratio The ratio at which the label will be anchored between the location + * of the source port and the location of the target port. + * @param {number} distance The distance orthogonally to the connection between the source and target point. + * @param {number} angle The angle by which the label should be rotated. + * @return {yfiles.graph.ILabelModelParameter} A parameter that describes the position. + * @see {@link yfiles.drawing.FreeEdgeLabelModel#edgeRelativeAngle} + */ + createEdgeAnchored(ratio:number,distance:number,angle:number):yfiles.graph.ILabelModelParameter; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Tries to find a parameter that best matches the given layout for the + * provided label instance. + * This implementation will match the provided layout perfectly. + * @param {yfiles.graph.ILabel} label The label to find a parameter for. + * @param {yfiles.graph.ILabelModel} model The model instance to use. This should be this instance. + * @param {yfiles.geometry.IOrientedRectangle} labelLayout The anticipated layout for the label. + * @return {yfiles.graph.ILabelModelParameter} + * A non-null parameter that can be used for the label to approximate the provided layout. + * @see Specified by {@link yfiles.graph.ILabelModelParameterFinder#findBestParameter}. + */ + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,labelLayout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + } + var FreeEdgeLabelModel:{ + $class:yfiles.lang.Class; + /** + * A shared unmodifiable public instance that can be used to obtain parameters. + */ + INSTANCE:yfiles.drawing.FreeEdgeLabelModel; + }; + /** + * Interface used by the framework mainly for calculating the visible path of an edge. + * This interface is queried through the {@link yfiles.support.ILookup#lookup} of {@link yfiles.graph.IPort} + * instances to calculate the visible portion of an edge path. + */ + export interface IEdgeIntersectionCalculator extends Object{ + /** + * Crops the provided edgePath at one end of an edge. + * @param {yfiles.graph.IEdge} edge The edge whose path is to be cropped. + * @param {boolean} atSource Whether to crop the source or target side of the path. + * @param {yfiles.drawing.IArrow} arrow The arrow that is used at the end of the edge. + * @param {yfiles.drawing.GeneralPath} edgePath The path to crop. + * @see Specified by {@link yfiles.drawing.IEdgeIntersectionCalculator#cropEdgePath}. + */ + cropEdgePath(edge:yfiles.graph.IEdge,atSource:boolean,arrow:yfiles.drawing.IArrow,edgePath:{value:yfiles.drawing.GeneralPath;}):void; + } + var IEdgeIntersectionCalculator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.drawing.INodeStyle} implementations + * that can be used to query the actual {@link yfiles.drawing.IVisualCreator}, + * {@link yfiles.drawing.IBoundsProvider}, {@link yfiles.drawing.IHitTestable}, and + * {@link yfiles.drawing.IMarqueeTestable} implementations for a node + * and an associated style. + * @see {@link yfiles.drawing.IStyleRenderer} + * @see {@link yfiles.drawing.INodeStyle} + * @see {@link yfiles.graph.INode} + */ + export interface INodeStyleRenderer extends Object,yfiles.drawing.IStyleRenderer{ + /** + * Gets an implementation of the {@link yfiles.drawing.IShapeGeometry} interface that can + * handle the provided node and its associated style. + * This method may return a flyweight implementation. + * @param {yfiles.graph.INode} node The node to provide an instance for + * @param {yfiles.drawing.INodeStyle} style The style to use for the painting + * @return {yfiles.drawing.IShapeGeometry} An implementation that may be used to subsequently query geometry information from. + * Clients should not cache this instance and must always call + * this method immediately before using the value returned. This enables the + * use of the flyweight design pattern for implementations + * @see Specified by {@link yfiles.drawing.INodeStyleRenderer#getShapeGeometry}. + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):yfiles.drawing.IShapeGeometry; + } + var INodeStyleRenderer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * {@link yfiles.drawing.IVisualStyle} implementation for {@link yfiles.graph.IPort} + * instances in an {@link yfiles.graph.IGraph}. + * Implementations are responsible for rendering {@link yfiles.graph.IPort} + * instances in a {@link yfiles.canvas.CanvasControl}. + * It is up to the implementation to interpret the visual appearance of a + * port. + * The framework uses the associated, possibly shared {@link yfiles.drawing.IPortStyle#renderer} + * to perform the actual rendering of this style for a given port. + * This interface extends the {@link yfiles.system.ICloneable} interface. This allows clients + * to obtain a persistent copy of the current state of this style. + * Immutable style implementations may return themselves. + *
+ * Related Information in the Developers Guide: + *

+ * Working with styles (and their style renderers) is explained in detail in the section + * Visual Representation of Graph Elements. + *

+ */ + export interface IPortStyle extends Object,yfiles.drawing.IVisualStyle{ + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given port and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(port, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.IPortStyle#renderer}. + */ + renderer:yfiles.drawing.IPortStyleRenderer; + } + var IPortStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that is used mainly by {@link yfiles.drawing.IEdgeStyleRenderer} implementations + * to reveal geometric details about the visualization of an edge's path. + */ + export interface IPathGeometry extends Object{ + /** + * Calculates the tangent on the edge's path at the given ratio point. + * The result is provided through the various out parameters. If the method returns false, no valid result could be calculated and + * the values of the out parameters should be ignored. + * @param {number} ratio a value in [0,1] where 0 is the source's end and 1 is at the target's end of the visible edge path + * @param {yfiles.geometry.PointD} p The coordinates in world-coordinate space that denotes the tangent point. + * @param {yfiles.geometry.PointD} tangent The vector which is tangent to the edge's path at the point denoted by p. The tangent vector + * needs not necessarily be normalized. + * @return {boolean} true if the values in the out parameters are valid, otherwise false + * @see Specified by {@link yfiles.drawing.IPathGeometry#getTangent}. + */ + getTangent(ratio:number,p:{value:yfiles.geometry.PointD;},tangent:{value:yfiles.geometry.PointD;}):boolean; + /** + * Calculates the tangent on the edge's path at the given ratio point for the given segment. + * The result is provided through the various out parameters. If the method returns false, no valid result could be calculated and + * the values of the out parameters should be ignored. + * @param {number} segmentIndex the segment to use for the calculation + * @param {number} ratio a value in [0,1] where 0 is the source's end and 1 is at the target's end of the segment + * @param {yfiles.geometry.PointD} p The coordinates in world-coordinate space that denote the tangent point. + * @param {yfiles.geometry.PointD} tangent The vector which is tangent to the edge's path at the point denoted by p. The tangent vector + * needs not necessarily be normalized. + * @return {boolean} true if the values in the out parameters are valid, otherwise false + * @see {@link yfiles.drawing.IPathGeometry#getTangent} + * @see {@link yfiles.drawing.IPathGeometry#getSegmentCount} + * @see Specified by {@link yfiles.drawing.IPathGeometry#getTangentForIndex}. + */ + getTangentForIndex(segmentIndex:number,ratio:number,p:{value:yfiles.geometry.PointD;},tangent:{value:yfiles.geometry.PointD;}):boolean; + /** + * Returns the number of "segments" this edge's path consists of. + * @return {number} the number of segments or -1 if there is no such thing as a segment for this edge. + * @see Specified by {@link yfiles.drawing.IPathGeometry#getSegmentCount}. + */ + getSegmentCount():number; + /** + * Returns a representation of the visible path of the edge in form of a {@link yfiles.drawing.GeneralPath}. + * @return {yfiles.drawing.GeneralPath} An instance that describes the visible path or null if this is not applicable for the current geometry. + * @see Specified by {@link yfiles.drawing.IPathGeometry#getPath}. + */ + getPath():yfiles.drawing.GeneralPath; + } + var IPathGeometry:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.drawing.ILabelStyle} implementations to + * query the actual {@link yfiles.drawing.IVisualCreator}, {@link yfiles.drawing.IVisibilityTest}, + * {@link yfiles.drawing.IBoundsProvider}, {@link yfiles.drawing.IHitTestable}, and + * {@link yfiles.drawing.IMarqueeTestable} implementations for a label + * and an associated style. + * @see {@link yfiles.drawing.IStyleRenderer} + * @see {@link yfiles.drawing.ILabelStyle} + * @see {@link yfiles.graph.ILabel} + */ + export interface ILabelStyleRenderer extends Object,yfiles.drawing.IStyleRenderer{ + /** + * Calculates the {@link yfiles.graph.ILabel#preferredSize preferred size} + * of a given label using the associated style. + * @param {yfiles.graph.ILabel} label The label to determine the preferred size for + * @param {yfiles.drawing.ILabelStyle} style The style instance that uses this instance as its + * {@link yfiles.drawing.ILabelStyle#renderer} + * @return {yfiles.geometry.SizeD} A size that can be used as the {@link yfiles.graph.ILabel#preferredSize} + * if this renderer paints the label using the associated style. + * @see Specified by {@link yfiles.drawing.ILabelStyleRenderer#getPreferredSize}. + */ + getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle):yfiles.geometry.SizeD; + } + var ILabelStyleRenderer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * {@link yfiles.drawing.IVisualStyle} implementation for {@link yfiles.graph.ILabel} + * instances in an {@link yfiles.graph.IGraph}. + * Implementations are responsible for rendering {@link yfiles.graph.ILabel} + * instances in a {@link yfiles.canvas.CanvasControl}. + * It is up to the implementation to interpret the visual appearance of a + * label. + * The framework uses the associated, possibly shared {@link yfiles.drawing.ILabelStyle#renderer} + * to perform the actual rendering of this style for a given label. + * This interface extends the {@link yfiles.system.ICloneable} interface. This allows clients + * to obtain a persistent copy of the current state of this style. + * Immutable style implementations may return themselves. + *
+ * Related Information in the Developers Guide: + *

+ * Working with styles (and their style renderers) is explained in detail in the section + * Visual Representation of Graph Elements. + *

+ */ + export interface ILabelStyle extends Object,yfiles.drawing.IVisualStyle{ + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given label and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(label, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.ILabelStyle#renderer}. + */ + renderer:yfiles.drawing.ILabelStyleRenderer; + } + var ILabelStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * {@link yfiles.drawing.IVisualStyle} implementation for {@link yfiles.graph.INode} + * instances in an {@link yfiles.graph.IGraph}. + * Implementations are responsible for rendering {@link yfiles.graph.INode} + * instances in a {@link yfiles.canvas.CanvasControl}. + * It is up to the implementation to interpret the visual appearance of a + * node. + * The framework uses the associated, possibly shared {@link yfiles.drawing.INodeStyle#renderer} + * to perform the actual rendering of this style for a given node. + * This interface extends the {@link yfiles.system.ICloneable} interface. This allows clients + * to obtain a persistent copy of the current state of this style. + * Immutable style implementations may return themselves. + *
+ * Related Information in the Developers Guide: + *

+ * Working with styles (and their style renderers) is explained in detail in the section + * Visual Representation of Graph Elements. + *

+ */ + export interface INodeStyle extends Object,yfiles.drawing.IVisualStyle{ + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given node and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(node, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.INodeStyle#renderer}. + */ + renderer:yfiles.drawing.INodeStyleRenderer; + } + var INodeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for implementations that yield insets for a given item. + * {@link yfiles.graph.INode}-implementations of this interface will be + * queried from an {@link yfiles.graph.INode}'s {@link yfiles.support.ILookup#lookup} + * method. {@link yfiles.graph.GroupedGraph} uses this instance by default to determine the insets of a group node. + */ + export interface IInsetsProvider extends Object{ + /** + * Returns the insets for the given item. + * @param {T} item The item to yield insets for. + * @return {yfiles.geometry.InsetsD} A rectangle that describes the insets. {@link yfiles.geometry.IPoint#x} is the left inset, + * {@link yfiles.geometry.IPoint#y} is the top inset, {@link yfiles.geometry.ISize#width} is the right inset, and + * {@link yfiles.geometry.ISize#height} is the bottom inset. + * @see Specified by {@link yfiles.drawing.IInsetsProvider#getInsets}. + */ + getInsets(item:T):yfiles.geometry.InsetsD; + } + var IInsetsProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.drawing.IPortStyle} implementations + * that can be used to query the actual {@link yfiles.drawing.IVisualCreator}, + * {@link yfiles.drawing.IBoundsProvider}, {@link yfiles.drawing.IHitTestable}, {@link yfiles.drawing.IVisibilityTest}, and + * {@link yfiles.drawing.IMarqueeTestable} implementations for a port + * and an associated style. + * @see {@link yfiles.drawing.IStyleRenderer} + * @see {@link yfiles.drawing.IPortStyle} + * @see {@link yfiles.graph.IPort} + */ + export interface IPortStyleRenderer extends Object,yfiles.drawing.IStyleRenderer{ + } + var IPortStyleRenderer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An {@link yfiles.canvas.ICanvasObjectDescriptor} implementation + * that casts the {@link yfiles.canvas.ICanvasObject#userObject} + * to {@link yfiles.graph.INode} and uses its {@link yfiles.graph.INode#style} + * to get implementations for the various interfaces. + */ + export interface NodeStyleDescriptor extends Object,yfiles.canvas.ICanvasObjectDescriptor{ + /** + * Casts the forUserObject to {@link yfiles.graph.INode} + * and retrieves its {@link yfiles.graph.INode#style} to obtain the {@link yfiles.drawing.IVisualCreator} + * from it via the {@link yfiles.drawing.IStyleRenderer#getVisualCreator} + * method. + * @param {Object} forUserObject The user object that should be of type {@link yfiles.graph.INode} + * @return {yfiles.drawing.IVisualCreator} The {@link yfiles.drawing.IVisualCreator} as returned from + * {@link yfiles.drawing.IStyleRenderer#getVisualCreator} or null + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getVisualCreator}. + */ + getVisualCreator(forUserObject:Object):yfiles.drawing.IVisualCreator; + /** + * Always returns true. + * This will cause the system to always {@link yfiles.drawing.IVisualCreator#updateVisual update the visual}. + * Optimization should be performed in the update method itself, which could easily just return the + * old visual. + * @param {yfiles.canvas.ICanvasObject} canvasObject The object to check + * @param {yfiles.canvas.ICanvasContext} context The context. + * @return {boolean} + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#isDirty}. + */ + isDirty(canvasObject:yfiles.canvas.ICanvasObject,context:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns an implementation of {@link yfiles.drawing.IBoundsProvider} that can determine the visible bounds + * of the rendering of the user object. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to query the bounds for + * @return {yfiles.drawing.IBoundsProvider} an implementation or null if the bounds are not known, in which + * case the bounds are treated as infinite + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getBoundsProvider}. + */ + getBoundsProvider(forUserObject:Object):yfiles.drawing.IBoundsProvider; + /** + * Returns an implementation of {@link yfiles.drawing.IVisibilityTest} that can determine if the + * rendering of the user object would be visible in a given context. + * This method may always return the same instance. By contract clients will + * not cache instances returned but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to query the bounds for + * @return {yfiles.drawing.IVisibilityTest} an implementation or null if the bounds are not known, in which + * case the bounds are treated as infinite + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getVisibilityTest}. + */ + getVisibilityTest(forUserObject:Object):yfiles.drawing.IVisibilityTest; + /** + * Returns an implementation of {@link yfiles.drawing.IHitTestable} that can determine whether + * the rendering of the user object has been hit at a given coordinate. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to do the hit testing for + * @return {yfiles.drawing.IHitTestable} an implementation or null if the rendering cannot be hit tested + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getHitTestable}. + */ + getHitTestable(forUserObject:Object):yfiles.drawing.IHitTestable; + } + var NodeStyleDescriptor:{ + $class:yfiles.lang.Class; + /** + * An instance that can be shared. + */ + INSTANCE:yfiles.canvas.ICanvasObjectDescriptor; + }; + /** + * An {@link yfiles.canvas.ICanvasObjectDescriptor} implementation + * that casts the {@link yfiles.canvas.ICanvasObject#userObject} + * to {@link yfiles.graph.ILabel} and uses it's {@link yfiles.graph.ILabel#style} + * to get implementations for the various interfaces. + */ + export interface LabelStyleDescriptor extends Object,yfiles.canvas.ICanvasObjectDescriptor{ + /** + * Casts the forUserObject to {@link yfiles.graph.ILabel} + * and retrieves its {@link yfiles.graph.ILabel#style} to obtain the {@link yfiles.drawing.IVisualCreator} + * from it via the {@link yfiles.drawing.IStyleRenderer#getVisualCreator} + * method. + * @param {Object} forUserObject The user object that should be of type {@link yfiles.graph.ILabel} + * @return {yfiles.drawing.IVisualCreator} The {@link yfiles.drawing.IVisualCreator} as returned from + * {@link yfiles.drawing.IStyleRenderer#getVisualCreator} or null + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getVisualCreator}. + */ + getVisualCreator(forUserObject:Object):yfiles.drawing.IVisualCreator; + /** + * Always returns true. + * This will cause the system to always {@link yfiles.drawing.IVisualCreator#updateVisual update the visual}. + * Optimization should be performed in the update method itself, which could easily just return the + * old visual. + * @param {yfiles.canvas.ICanvasObject} canvasObject The object to check + * @param {yfiles.canvas.ICanvasContext} context The context. + * @return {boolean} + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#isDirty}. + */ + isDirty(canvasObject:yfiles.canvas.ICanvasObject,context:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns an implementation of {@link yfiles.drawing.IBoundsProvider} that can determine the visible bounds + * of the rendering of the user object. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to query the bounds for + * @return {yfiles.drawing.IBoundsProvider} an implementation or null if the bounds are not known, in which + * case the bounds are treated as infinite + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getBoundsProvider}. + */ + getBoundsProvider(forUserObject:Object):yfiles.drawing.IBoundsProvider; + /** + * Returns an implementation of {@link yfiles.drawing.IVisibilityTest} that can determine if the + * rendering of the user object would be visible in a given context. + * This method may always return the same instance. By contract clients will + * not cache instances returned but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to query the bounds for + * @return {yfiles.drawing.IVisibilityTest} an implementation or null if the bounds are not known, in which + * case the bounds are treated as infinite + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getVisibilityTest}. + */ + getVisibilityTest(forUserObject:Object):yfiles.drawing.IVisibilityTest; + /** + * Returns an implementation of {@link yfiles.drawing.IHitTestable} that can determine whether + * the rendering of the user object has been hit at a given coordinate. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to do the hit testing for + * @return {yfiles.drawing.IHitTestable} an implementation or null if the rendering cannot be hit tested + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getHitTestable}. + */ + getHitTestable(forUserObject:Object):yfiles.drawing.IHitTestable; + } + var LabelStyleDescriptor:{ + $class:yfiles.lang.Class; + /** + * An instance that can be shared. + */ + INSTANCE:yfiles.canvas.ICanvasObjectDescriptor; + }; + /** + * An {@link yfiles.canvas.ICanvasObjectDescriptor} implementation + * that casts the {@link yfiles.canvas.ICanvasObject#userObject} + * to {@link yfiles.graph.IPort} and uses it's {@link yfiles.graph.IPort#style} + * to get implementations for the various interfaces. + */ + export interface PortStyleDescriptor extends Object,yfiles.canvas.ICanvasObjectDescriptor{ + /** + * Casts the forUserObject to {@link yfiles.graph.IPort} + * and retrieves its {@link yfiles.graph.IPort#style} to obtain the {@link yfiles.drawing.IVisualCreator} + * from it via the {@link yfiles.drawing.IStyleRenderer#getVisualCreator} + * method. + * @param {Object} forUserObject The user object that should be of type {@link yfiles.graph.IPort} + * @return {yfiles.drawing.IVisualCreator} The {@link yfiles.drawing.IVisualCreator} as returned from + * {@link yfiles.drawing.IStyleRenderer#getVisualCreator} or null + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getVisualCreator}. + */ + getVisualCreator(forUserObject:Object):yfiles.drawing.IVisualCreator; + /** + * Always returns true. + * This will cause the system to always {@link yfiles.drawing.IVisualCreator#updateVisual update the visual}. + * Optimization should be performed in the update method itself, which could easily just return the + * old visual. + * @param {yfiles.canvas.ICanvasObject} canvasObject The object to check + * @param {yfiles.canvas.ICanvasContext} context The context. + * @return {boolean} + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#isDirty}. + */ + isDirty(canvasObject:yfiles.canvas.ICanvasObject,context:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns an implementation of {@link yfiles.drawing.IBoundsProvider} that can determine the visible bounds + * of the rendering of the user object. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to query the bounds for + * @return {yfiles.drawing.IBoundsProvider} an implementation or null if the bounds are not known, in which + * case the bounds are treated as infinite + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getBoundsProvider}. + */ + getBoundsProvider(forUserObject:Object):yfiles.drawing.IBoundsProvider; + /** + * Returns an implementation of {@link yfiles.drawing.IVisibilityTest} that can determine if the + * rendering of the user object would be visible in a given context. + * This method may always return the same instance. By contract clients will + * not cache instances returned but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to query the bounds for + * @return {yfiles.drawing.IVisibilityTest} an implementation or null if the bounds are not known, in which + * case the bounds are treated as infinite + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getVisibilityTest}. + */ + getVisibilityTest(forUserObject:Object):yfiles.drawing.IVisibilityTest; + /** + * Returns an implementation of {@link yfiles.drawing.IHitTestable} that can determine whether + * the rendering of the user object has been hit at a given coordinate. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to do the hit testing for + * @return {yfiles.drawing.IHitTestable} an implementation or null if the rendering cannot be hit tested + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getHitTestable}. + */ + getHitTestable(forUserObject:Object):yfiles.drawing.IHitTestable; + } + var PortStyleDescriptor:{ + $class:yfiles.lang.Class; + /** + * An instance that can be shared. + */ + INSTANCE:yfiles.canvas.ICanvasObjectDescriptor; + }; + /** + * An {@link yfiles.drawing.IVisualCreator} for use in a {@link yfiles.canvas.CanvasControl} + * that renders a {@link yfiles.graph.IGraph} instance in a sloppy overview style. + */ + export interface OverviewGraphVisualCreator extends Object,yfiles.drawing.IVisualCreator{ + /** + * Factory method that creates the {@link yfiles.drawing.OverviewGraphVisualCreator#overviewEdgeStyle}. + */ + createEdgeStyle():yfiles.drawing.IEdgeStyle; + /** + * Factory method that creates the {@link yfiles.drawing.OverviewGraphVisualCreator#overviewNodeStyle}. + */ + createNodeStyle():yfiles.drawing.INodeStyle; + /** + * Factory method that creates the {@link yfiles.drawing.OverviewGraphVisualCreator#overviewGroupNodeStyle}. + */ + createGroupNodeStyle():yfiles.drawing.INodeStyle; + /** + * Gets or sets the overview node style. + * Value: The overview node style. + */ + overviewNodeStyle:yfiles.drawing.INodeStyle; + /** + * Gets or sets the overview group node style. + * Value: The overview node style. + */ + overviewGroupNodeStyle:yfiles.drawing.INodeStyle; + /** + * Gets or sets the overview edge style. + * Value: The overview edge style. + */ + overviewEdgeStyle:yfiles.drawing.IEdgeStyle; + /** + * Callback that returns and/or configures a node style for the given node to render. + * @param {yfiles.graph.INode} node The node to render. + * @return {yfiles.drawing.INodeStyle} The style or null + */ + getOverviewNodeStyle(node:yfiles.graph.INode):yfiles.drawing.INodeStyle; + /** + * Callback that returns and/or configures a group node style for the given node to render. + * @param {yfiles.graph.INode} node The group node to render. + * @return {yfiles.drawing.INodeStyle} The style or null + */ + getOverviewGroupNodeStyle(node:yfiles.graph.INode):yfiles.drawing.INodeStyle; + /** + * Callback that returns and/or configures a edge style for the given edge to render. + * @param {yfiles.graph.IEdge} edge The edge to render. + * @return {yfiles.drawing.IEdgeStyle} The style or null + */ + getOverviewEdgeStyle(edge:yfiles.graph.IEdge):yfiles.drawing.IEdgeStyle; + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * Obtains the {@link yfiles.drawing.IVisualCreator} for the given node. + * @param {yfiles.drawing.IRenderContext} ctx The context. + * @param {yfiles.graph.INode} node The node. + * @return {yfiles.drawing.IVisualCreator} The visual creator that is obtained from the {@link yfiles.drawing.OverviewGraphVisualCreator#getOverviewNodeStyle}'s + * {@link yfiles.drawing.AbstractStyleRenderer#getVisualCreator} method. + */ + getNodeVisualCreator(ctx:yfiles.drawing.IRenderContext,node:yfiles.graph.INode):yfiles.drawing.IVisualCreator; + /** + * Obtains the {@link yfiles.drawing.IVisualCreator} for the given group node. + * @param {yfiles.drawing.IRenderContext} ctx The context. + * @param {yfiles.graph.INode} node The group node. + * @return {yfiles.drawing.IVisualCreator} The visual creator that is obtained from the {@link yfiles.drawing.OverviewGraphVisualCreator#getOverviewGroupNodeStyle}'s + * {@link yfiles.drawing.AbstractStyleRenderer#getVisualCreator} method. + */ + getGroupNodeVisualCreator(ctx:yfiles.drawing.IRenderContext,node:yfiles.graph.INode):yfiles.drawing.IVisualCreator; + /** + * Obtains the {@link yfiles.drawing.IVisualCreator} for the given edge. + * @param {yfiles.drawing.IRenderContext} ctx The context. + * @param {yfiles.graph.IEdge} edge The edge. + * @return {yfiles.drawing.IVisualCreator} The visual creator that is obtained from the {@link yfiles.drawing.OverviewGraphVisualCreator#getOverviewEdgeStyle}'s + * {@link yfiles.drawing.AbstractStyleRenderer#getVisualCreator} method. + */ + getEdgeVisualCreator(ctx:yfiles.drawing.IRenderContext,edge:yfiles.graph.IEdge):yfiles.drawing.IVisualCreator; + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + } + var OverviewGraphVisualCreator:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance for the given graph. + * @param {yfiles.graph.IGraph} graph + */ + new (graph:yfiles.graph.IGraph):yfiles.drawing.OverviewGraphVisualCreator; + }; + /** + * The interface used by {@link yfiles.drawing.SimpleLabelStyleRenderer} + * to describe a basic label style. + * @see {@link yfiles.drawing.SimpleLabelStyle} + */ + export interface ISimpleLabelStyle extends Object,yfiles.drawing.ILabelStyle{ + /** + * Gets the typeface to use for the label. + * Value: The typeface. + * @see {@link Object} + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#typeface}. + */ + typeface:yfiles.system.Typeface; + /** + * Gets the brush to use for the label's text. + * Value: The font brush or null. + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#textBrush}. + */ + textBrush:yfiles.system.Brush; + /** + * Gets a value indicating whether the label should be flipped 180 degrees + * automatically, if it would be oriented downwards, otherwise. + * Value: + * true if the label should be flipped automatically otherwise, false. + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#autoFlip}. + */ + autoFlip:boolean; + /** + * Gets the pen to use for the background box of the label. + * Value: The background pen or null. + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#backgroundPen}. + */ + backgroundPen:yfiles.system.Pen; + /** + * Gets the brush to use for the background box of the label. + * Value: The background brush or null. + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#backgroundBrush}. + */ + backgroundBrush:yfiles.system.Brush; + /** + * Gets the vertical text alignment to use if the label is assigned more space than needed. + * Value: The vertical text alignment. + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#verticalTextAlignment}. + */ + verticalTextAlignment:yfiles.system.VerticalAlignment; + /** + * Gets the text alignment to use if the label is assigned more space than needed. + * Value: The text alignment. + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#textAlignment}. + */ + textAlignment:yfiles.system.TextAlignment; + /** + * Gets a value that determines whether text should be clipped. + * @see {@link Object} + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#clipText}. + */ + clipText:boolean; + /** + * Gets the value that determines how to trim the text. + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#trimming}. + */ + trimming:yfiles.system.StringTrimming; + } + var ISimpleLabelStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that describes the geometry of a shape which has an interior and an exterior. + */ + export interface IShapeGeometry extends Object{ + /** + * Returns the intersection for the given line with this shape's geometry. + * @param {yfiles.geometry.PointD} inner The first point of the line that is inside the shape. + * @param {yfiles.geometry.PointD} outer The second point of the line that is outside the shape. + * @return {yfiles.geometry.PointD} The coordinates of the intersection point, if an intersection was found. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getIntersection}. + */ + getIntersection(inner:yfiles.geometry.PointD,outer:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Checks whether the given coordinate is deemed to lie within the shape's geometric bounds. + * @param {yfiles.geometry.PointD} point The point to test. + * @return {boolean} True if the point lies within the shape. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#isInside}. + */ + isInside(point:yfiles.geometry.PointD):boolean; + /** + * Returns the outline of the shape or null. + * @return {yfiles.drawing.GeneralPath} The outline or null if no outline can be provided. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getOutline}. + */ + getOutline():yfiles.drawing.GeneralPath; + } + var IShapeGeometry:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Generic interface used by {@link yfiles.drawing.IVisualStyle} implementations + * that can be used to query the actual {@link yfiles.drawing.IVisualCreator}, {@link yfiles.drawing.IVisibilityTest}, + * {@link yfiles.drawing.IBoundsProvider}, {@link yfiles.drawing.IHitTestable}, and + * {@link yfiles.drawing.IMarqueeTestable} implementations for an {@link yfiles.model.IModelItem} + * instance and its associated style instance. + * Implementations of this interface should be designed to be sharable between multiple + * style instances and should therefore not contain style specific state. + * @see {@link yfiles.drawing.IVisualStyle} + */ + export interface IStyleRenderer> extends Object{ + /** + * Gets an implementation of the {@link yfiles.drawing.IVisualCreator} interface that can + * handle the provided item and its associated style. + * This method may return a flyweight implementation, but never null. + * @param {TModelItem} item The item to provide an instance for + * @param {TStyle} style The style to use for the creation of the visual + * @return {yfiles.drawing.IVisualCreator} An implementation that may be used to subsequently create or update the visual for + * the item. Clients should not cache this instance and must always call + * this method immediately before using the value returned. This enables the + * use of the flyweight design pattern for implementations. This method may not return null + * but should yield a {@link yfiles.drawing.VoidVisualCreator#INSTANCE void} implementation instead. + * @see {@link yfiles.drawing.VoidVisualCreator#INSTANCE} + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getVisualCreator}. + */ + getVisualCreator(item:TModelItem,style:TStyle):yfiles.drawing.IVisualCreator; + /** + * Gets an implementation of the {@link yfiles.drawing.IBoundsProvider} interface that can + * handle the provided item and its associated style. + * This method may return a flyweight implementation. + * @param {TModelItem} item The item to provide an instance for + * @param {TStyle} style The style to use for the calculating the painting bounds + * @return {yfiles.drawing.IBoundsProvider} An implementation that may be used to subsequently query + * the item's painting bounds. Clients should not cache this instance and must always call + * this method immediately before using the value returned. This enables the + * use of the flyweight design pattern for implementations + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getBoundsProvider}. + */ + getBoundsProvider(item:TModelItem,style:TStyle):yfiles.drawing.IBoundsProvider; + /** + * Gets an implementation of the {@link yfiles.drawing.IVisibilityTest} interface that can + * handle the provided item and its associated style. + * This method may return a flyweight implementation. + * @param {TModelItem} item The item to provide an instance for + * @param {TStyle} style The style to use for the testing the visibility + * @return {yfiles.drawing.IVisibilityTest} An implementation that may be used to subsequently query + * the item's visibility. Clients should not cache this instance and must always call + * this method immediately before using the value returned. This enables the + * use of the flyweight design pattern for implementations + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getVisibilityTest}. + */ + getVisibilityTest(item:TModelItem,style:TStyle):yfiles.drawing.IVisibilityTest; + /** + * Gets an implementation of the {@link yfiles.drawing.IHitTestable} interface that can + * handle the provided item and its associated style. + * This method may return a flyweight implementation. + * @param {TModelItem} item The item to provide an instance for + * @param {TStyle} style The style to use for the querying hit tests + * @return {yfiles.drawing.IHitTestable} An implementation that may be used to subsequently perform + * hit tests. Clients should not cache this instance and must always call + * this method immediately before using the value returned. This enables the + * use of the flyweight design pattern for implementations. This method may return null + * to indicate that the item cannot be hit tested. + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getHitTestable}. + */ + getHitTestable(item:TModelItem,style:TStyle):yfiles.drawing.IHitTestable; + /** + * Gets an implementation of the {@link yfiles.drawing.IMarqueeTestable} interface that can + * handle the provided item and its associated style. + * This method may return a flyweight implementation. + * @param {TModelItem} item The item to provide an instance for + * @param {TStyle} style The style to use for the querying marquee intersection test. + * @return {yfiles.drawing.IMarqueeTestable} An implementation that may be used to subsequently query + * the marquee intersections. Clients should not cache this instance and must always call + * this method immediately before using the value returned. This enables the + * use of the flyweight design pattern for implementations + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getMarqueeTestable}. + */ + getMarqueeTestable(item:TModelItem,style:TStyle):yfiles.drawing.IMarqueeTestable; + /** + * Gets a temporary context instance that can be used to query additional information + * for the item's style. + * Implementations may return {@link yfiles.support.Lookups#EMPTY} if they don't support this, but may not return null. + * @param {TModelItem} item The item to provide a context instance for. + * @param {TStyle} style The style to use for the context. + * @return {yfiles.support.ILookup} An non-null lookup implementation. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see {@link yfiles.support.ILookup} + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getContext}. + */ + getContext(item:TModelItem,style:TStyle):yfiles.support.ILookup; + } + var IStyleRenderer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A simple interface for use with the {@link yfiles.drawing.SimplePortStyleRenderer}. + * @see {@link yfiles.drawing.SimplePortStyle} + */ + export interface ISimplePortStyle extends Object,yfiles.drawing.IPortStyle{ + /** + * Gets the brush to paint the port representation. + * @see Specified by {@link yfiles.drawing.ISimplePortStyle#brush}. + */ + brush:yfiles.system.Brush; + } + var ISimplePortStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An edge label model that allows the placement at any position. + * Similar to {@link yfiles.drawing.RotatedSliderEdgeLabelModel}, a position is specified by an edge segment and a ratio on that + * segment, amongst others. During changes of the edge path, the label keeps its relative location with respect to the + * bends of the reference segment in a similar way. + *

+ * In contrast to {@link yfiles.drawing.RotatedSliderEdgeLabelModel}, the distance from the edge path is not a property of the + * model but of the particular parameter. In addition, this class does not implement + * {@link yfiles.graph.ILabelModelParameterProvider} and therefore, labels with this model can be moved freely and are not + * restricted to a fixed set of candidates at a given distance from the edge. + *

+ *

+ * If {@link yfiles.drawing.SmartEdgeLabelModel#autoRotation} is enabled, labels are automatically rotated according to the angle of + * the corresponding reference edge segment. + *

+ *

+ * During movements, labels with this model snap to noteable positions if the + * provides a {@link yfiles.input.LabelSnapContext} that is enabled and has a suitable configuration. + *

+ */ + export interface SmartEdgeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterFinder{ + /** + * Specifies whether edge labels are automatically rotated according to the angle of + * the corresponding reference edge segment. + * Value: + * true if edge labels are automatically rotated; otherwise, false. + * By default, this feature is enabled. + */ + autoRotation:boolean; + /** + * Specifies the rotation angle of all labels with this model. + * Value: + * The rotation angle of all labels with this model. + */ + angle:number; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a parameter that measures the provided segment index from the source side of the + * edge path. + * @param {number} segmentIndex The zero-based index of the segment beginning from the source side. + * @param {number} distance The distance between the label's box and the edge's path. + * @param {number} segmentRatio + * The ratio at which to place the label at the segment. A ratio of 0.0 + * will place the label at the source side of the segment, a ratio of 1.0 at the target side. Ratios + * lesser than 0.0 or greater than 1.0 will be interpreted as absolute values in world coordinates. + * @return {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterFromSource(segmentIndex:number,distance:number,segmentRatio:number):yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter that measures the provided segment index from the target side of the + * edge path. + * @param {number} segmentIndex The zero-based index of the segment beginning from the target side. + * @param {number} distance The distance between the label's box and the edge's path. + * @param {number} segmentRatio + * The ratio at which to place the label at the segment. A ratio of 0.0 + * will place the label at the target side of the segment, a ratio of 1.0 at the source side. Ratios + * lesser than 0.0 or greater than 1.0 will be interpreted as absolute values in world coordinates. + * @return {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterFromTarget(segmentIndex:number,distance:number,segmentRatio:number):yfiles.graph.ILabelModelParameter; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Tries to find a parameter that best matches the given layout for the + * provided label instance. + * This method may not necessarily find a parameter that matches the provided + * layout exactly. Implementations may choose to simply return the model's + * {@link yfiles.graph.ILabelModel#createDefaultParameter default parameter} + * but may never return null. + * @param {yfiles.graph.ILabel} label The label to find a parameter for. + * @param {yfiles.graph.ILabelModel} model The model instance to use. This should be the instance + * this instance has been obtained from. + * @param {yfiles.geometry.IOrientedRectangle} labelLayout The anticipated layout for the label. + * @return {yfiles.graph.ILabelModelParameter} A non-null parameter that can be used for the label to approximate the provided layout. + * @see Specified by {@link yfiles.graph.ILabelModelParameterFinder#findBestParameter}. + */ + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,labelLayout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + } + var SmartEdgeLabelModel:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of this class. + */ + new ():yfiles.drawing.SmartEdgeLabelModel; + }; + /** + * An edge label model that can be used for labels along the path of an edge. + * This model allows for specifying the index of the segment of + * the edge and the distance from the edge, as well as the angle + * of the label. + */ + export interface SliderEdgeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{ + /** + * Gets or sets the angle the labels are rotated about. + * The angle is measured relative to the x-axis. + * The default value is 0.0. + * Value: The angle in radians. + */ + angle:number; + /** + * Gets or sets a value indicating whether distance to the edge is interpreted + * relatively to the edge's path. + * If this is set to false positive {@link yfiles.drawing.SliderEdgeLabelModel#distance} values + * will make the label appear above the edge, otherwise they will appear left of the edge. + */ + edgeRelativeDistance:boolean; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Gets or sets the distance between the label and the edge's path. + * A positive value will make the label appear above or right of the edge, + * whereas negative values will make it appear on the opposite side of the edge's path. + * A value of 0 will make the label's appear centered on the edge's path. + * @see {@link yfiles.drawing.SliderEdgeLabelModel#edgeRelativeDistance} + */ + distance:number; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Creates a parameter that measures the provided segment index from the source side of the edge path. + * @param {number} segmentIndex The zero-based index of the segment beginning from the source side. + * @param {number} segmentRatio The ratio at which to place the label at the segment. + * @return {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterFromSource(segmentIndex:number,segmentRatio:number):yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter that measures the provided segment index from the target side of the edge path. + * @param {number} segmentIndex The zero-based index of the segment beginning from the target side. + * @param {number} segmentRatio The ratio at which to place the label at the segment. + * @return {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterFromTarget(segmentIndex:number,segmentRatio:number):yfiles.graph.ILabelModelParameter; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + } + var SliderEdgeLabelModel:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with distance and angle set to 0. + */ + new ():yfiles.drawing.SliderEdgeLabelModel; + /** + * Creates a new instance using the provided values. + */ + WithParams:{ + new (distance:number,angle:number,edgeRelativeDistance:boolean):yfiles.drawing.SliderEdgeLabelModel; + }; + }; + export enum ArrowType{ + /** + * Default arrow. + */ + DEFAULT, + /** + * Simple arrow. + */ + SIMPLE, + /** + * Short arrow. + */ + SHORT, + /** + * Diamond shaped arrow. + */ + DIAMOND, + /** + * No arrow. + */ + NONE, + /** + * Circular shaped arrow. + */ + CIRCLE, + /** + * Cross shaped arrow. + */ + CROSS, + /** + * Triangular shaped arrow. + */ + TRIANGLE + } + /** + * A port location model that places the port on a certain edge segment at a specified ratio. + */ + export interface SegmentRatioPortLocationModel extends Object,yfiles.graph.IPortLocationModel{ + /** + * Determines the location of the port for the given parameter. + * @param {yfiles.graph.IPort} port The port to determine the location for. + * @param {yfiles.graph.IPortLocationModelParameter} parameter The parameter to use. The parameter can be expected to be created by this instance + * having the {@link yfiles.graph.IPortLocationModelParameter#model} property set to this instance.. + * @return {yfiles.geometry.PointD} The calculated location of the port. + * @see Specified by {@link yfiles.graph.IPortLocationModel#getLocation}. + */ + getLocation(port:yfiles.graph.IPort,parameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.PointD; + /** + * Factory method that creates a parameter for the given port that tries to match the provided location + * in absolute world coordinates. + * @param {yfiles.graph.IPortOwner} portOwner The port owner that will own the port for which the parameter shall be created. + * @param {yfiles.geometry.PointD} location The location in the world coordinate system that should be matched as best as possible. + * @return {yfiles.graph.IPortLocationModelParameter} A new instance that can be used to describe the location of an {@link yfiles.graph.IPort} at the given + * portOwner. + * @see Specified by {@link yfiles.graph.IPortLocationModel#createParameter}. + */ + createParameter(portOwner:yfiles.graph.IPortOwner,location:yfiles.geometry.PointD):yfiles.graph.IPortLocationModelParameter; + /** + * Creates the a new parameter for the specified segment index and ratio. + * @param {number} ratio The ratio for the segment, with 0 being at the start of the segment and 1 at the end. + * @param {number} segmentIndex The index of the segment. + * @return {yfiles.graph.IPortLocationModelParameter} A parameter for the given ratio and segment. + */ + createFromSource(ratio:number,segmentIndex:number):yfiles.graph.IPortLocationModelParameter; + /** + * Creates the a new parameter for the specified segment index counted from the target end of the edge and the provided ratio. + * @param {number} ratio The ratio for the segment, with 0 being at the start of the segment and 1 at the end. + * @param {number} segmentIndex The index of the segment counted from the target end. + * @return {yfiles.graph.IPortLocationModelParameter} A parameter for the given ratio and segment. + */ + createFromTarget(ratio:number,segmentIndex:number):yfiles.graph.IPortLocationModelParameter; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of port + * and parameter. + * @param {yfiles.graph.IPort} port The port to use in the context. + * @param {yfiles.graph.IPortLocationModelParameter} parameter The parameter to use for the port in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the port/parameter combination. + * @see Specified by {@link yfiles.graph.IPortLocationModel#getContext}. + */ + getContext(port:yfiles.graph.IPort,parameter:yfiles.graph.IPortLocationModelParameter):yfiles.support.ILookup; + } + var SegmentRatioPortLocationModel:{ + $class:yfiles.lang.Class; + /** + * A static immutable global instance of this class. + */ + INSTANCE:yfiles.drawing.SegmentRatioPortLocationModel; + }; + export enum SliderParameterLocation{ + /** + * Left of the edge. + */ + LEFT, + /** + * Right of the edge. + */ + RIGHT, + /** + * Measured from the source end. + */ + FROM_SOURCE, + /** + * Measured from the target end. + */ + FROM_TARGET + } + /** + * An edge {@link yfiles.graph.ILabelModel} implementation that provides labels + * to both sides of the edge's path. + * This implementation allows for specifying the angle that the label is rotated, + * the distance between the label and the edge's path, and how the distance should be interpreted. + */ + export interface SideSliderEdgeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{ + /** + * Gets or sets the distance between the label and the edge's path. + * The larger the value, the farther the label will be away from the edge's path. + * @see {@link yfiles.drawing.SideSliderEdgeLabelModel#edgeRelativePosition} + */ + distance:number; + /** + * Gets or sets a property that determines if label's are placed left or right + * or above or below the edge's path. + * If the property is true, the label's position is interpreted + * as relative to the edge's path, otherwise it is interpreted as absolute (above or below). + */ + edgeRelativePosition:boolean; + /** + * Gets or sets the angle the labels are rotated about. + * The angle is measured relative to the x-axis. + * The default value is 0.0. + * Value: The angle in radians. + */ + angle:number; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Creates a parameter that describes + * a position at the left of the edge at the segment index from the source side of the edge path. + * @param {number} segmentIndex The zero-based index of the segment beginning from the source side. + * @param {number} segmentRatio The ratio at which to place the label at the segment. + * @return {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterLeftFromSource(segmentIndex:number,segmentRatio:number):yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter that describes + * a position at the right of the edge at the segment index from the source side of the edge path. + * @param {number} segmentIndex The zero-based index of the segment beginning from the source side. + * @param {number} segmentRatio The ratio at which to place the label at the segment. + * @return {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterRightFromSource(segmentIndex:number,segmentRatio:number):yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter that describes + * a position at the left of the edge at the segment index from the target side of the edge path. + * @param {number} segmentIndex The zero-based index of the segment beginning from the target side. + * @param {number} segmentRatio The ratio at which to place the label at the segment. + * @return {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterLeftFromTarget(segmentIndex:number,segmentRatio:number):yfiles.graph.ILabelModelParameter; + /** + * Creates a parameter that describes + * a position at the right of the edge at the segment index from the target side of the edge path. + * @param {number} segmentIndex The zero-based index of the segment beginning from the target side. + * @param {number} segmentRatio The ratio at which to place the label at the segment. + * @return {yfiles.graph.ILabelModelParameter} A label parameter that describes the provided parameters for this model instance. + */ + createParameterRightFromTarget(segmentIndex:number,segmentRatio:number):yfiles.graph.ILabelModelParameter; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + } + var SideSliderEdgeLabelModel:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.SideSliderEdgeLabelModel; + }; + /** + * An {@link yfiles.drawing.IVisualCreator} for use in a {@link yfiles.canvas.CanvasControl} + * that renders a {@link yfiles.graph.IGraph} instance in a sloppy overview style. + */ + export interface CanvasOverviewGraphVisualCreator extends Object,yfiles.drawing.IVisualCreator{ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Callback method that paints a node. + */ + paintNode(ctx:Object,renderContext:yfiles.drawing.IRenderContext,node:yfiles.graph.INode):void; + /** + * Callback method that paints a group node. + */ + paintGroupNode(ctx:Object,renderContext:yfiles.drawing.IRenderContext,node:yfiles.graph.INode):void; + /** + * Callback that paints the edge. + */ + paintEdge(ctx:Object,renderContext:yfiles.drawing.IRenderContext,edge:yfiles.graph.IEdge):void; + } + var CanvasOverviewGraphVisualCreator:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance for the given graph. + * @param {yfiles.graph.IGraph} graph + */ + new (graph:yfiles.graph.IGraph):yfiles.drawing.CanvasOverviewGraphVisualCreator; + }; + /** + * An {@link yfiles.canvas.ICanvasObjectDescriptor} implementation + * that casts the {@link yfiles.canvas.ICanvasObject#userObject} + * to {@link yfiles.graph.IEdge} and uses it's {@link yfiles.graph.IEdge#style} + * to get implementations for the various interfaces. + */ + export interface EdgeStyleDescriptor extends Object,yfiles.canvas.ICanvasObjectDescriptor{ + /** + * Uses {@link yfiles.graph.IEdge}to retrieve its {@link yfiles.graph.IEdge#style} to obtain the {@link yfiles.drawing.IVisualCreator} + * from it via the {@link yfiles.drawing.IStyleRenderer#getVisualCreator} + * method. + * @param {Object} forUserObject The user object that should be of type {@link yfiles.graph.IEdge} + * @return {yfiles.drawing.IVisualCreator} The {@link yfiles.drawing.IVisualCreator} as returned from + * {@link yfiles.drawing.IStyleRenderer#getVisualCreator} or null + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getVisualCreator}. + */ + getVisualCreator(forUserObject:Object):yfiles.drawing.IVisualCreator; + /** + * Always returns true. + * This will cause the system to always {@link yfiles.drawing.IVisualCreator#updateVisual update the visual}. + * Optimization should be performed in the update method itself, which could easily just return the + * old visual. + * @param {yfiles.canvas.ICanvasObject} canvasObject The object to check + * @param {yfiles.canvas.ICanvasContext} context The context. + * @return {boolean} + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#isDirty}. + */ + isDirty(canvasObject:yfiles.canvas.ICanvasObject,context:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns an implementation of {@link yfiles.drawing.IBoundsProvider} that can determine the visible bounds + * of the rendering of the user object. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to query the bounds for + * @return {yfiles.drawing.IBoundsProvider} an implementation or null if the bounds are not known, in which + * case the bounds are treated as infinite + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getBoundsProvider}. + */ + getBoundsProvider(forUserObject:Object):yfiles.drawing.IBoundsProvider; + /** + * Returns an implementation of {@link yfiles.drawing.IVisibilityTest} that can determine if the + * rendering of the user object would be visible in a given context. + * This method may always return the same instance. By contract clients will + * not cache instances returned but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to query the bounds for + * @return {yfiles.drawing.IVisibilityTest} an implementation or null if the bounds are not known, in which + * case the bounds are treated as infinite + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getVisibilityTest}. + */ + getVisibilityTest(forUserObject:Object):yfiles.drawing.IVisibilityTest; + /** + * Returns an implementation of {@link yfiles.drawing.IHitTestable} that can determine whether + * the rendering of the user object has been hit at a given coordinate. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to do the hit testing for + * @return {yfiles.drawing.IHitTestable} an implementation or null if the rendering cannot be hit tested + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getHitTestable}. + */ + getHitTestable(forUserObject:Object):yfiles.drawing.IHitTestable; + } + var EdgeStyleDescriptor:{ + $class:yfiles.lang.Class; + /** + * An instance that can be shared. + */ + INSTANCE:yfiles.canvas.ICanvasObjectDescriptor; + }; + /** + * An implementation of the {@link yfiles.model.IModelItemInstaller} + * interface that can install the selection outline of an {@link yfiles.graph.IEdge}. + * This will {@link yfiles.model.IInstallerContext#addInstalled install} + * {@link yfiles.canvas.ICanvasObject} during {@link yfiles.drawing.EdgeSelectionRenderer#install installation}, + * that will render the path and the bends of an edge using a {@link yfiles.drawing.EdgeSelectionRenderer#getPen pen} + * for the path and a {@link yfiles.drawing.EdgeSelectionRenderer#getBendDrawing drawing} for the bends. + */ + export interface EdgeSelectionRenderer extends Object,yfiles.model.ISelectionInstaller,yfiles.input.IHighlightInstaller,yfiles.input.IFocusIndicatorInstaller{ + /** + * Installs a rendering for the item if it is an {@link yfiles.graph.IEdge} + * that will use the {@link yfiles.drawing.EdgeSelectionRenderer#getBendDrawing} and {@link yfiles.drawing.EdgeSelectionRenderer#getPen} to render + * the path and bends. + * @param {yfiles.model.IInstallerContext} context The context to use for the installation. + * @param {Object} item The item to install. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:Object):void; + /** + * Callback method that retrieves the pen for the context. + * This implementation will use the {@link yfiles.drawing.EdgeSelectionRenderer#PEN_KEY} resource to find a {@link yfiles.system.Pen} instance. + * If null is yielded, a default pen will be used. + * @param {yfiles.graph.IEdge} edge The edge for which the rendering will be used. + * @param {yfiles.model.IInstallerContext} context The context for which the pen shall be returned. + * @return {yfiles.system.Pen} The pen instance to use for the rendering of the edge in the given context. + */ + getPen(context:yfiles.model.IInstallerContext,edge:yfiles.graph.IEdge):yfiles.system.Pen; + /** + * Callback method that retrieves the drawing of the bend for the context. + * This implementation will use the {@link yfiles.drawing.EdgeSelectionRenderer#BEND_TEMPLATE_KEY} resource to find a + * {@link yfiles.drawing.DataTemplate} instance. + * If null is yielded, a default drawing will be used. + * @param {yfiles.model.IInstallerContext} context The context for which the drawing shall be returned. + * @param {yfiles.graph.IEdge} edge The edge for which the rendering will be used. + * @return {yfiles.drawing.DataTemplate} The drawing instance to use for the rendering of the bends in the given context. + */ + getBendDrawing(context:yfiles.model.IInstallerContext,edge:yfiles.graph.IEdge):yfiles.drawing.DataTemplate; + } + var EdgeSelectionRenderer:{ + $class:yfiles.lang.Class; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.system.Pen} + * that will be used to draw the path of the edge. + */ + PEN_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.drawing.DataTemplate} + * that will be used to draw the bends of the edge. + */ + BEND_TEMPLATE_KEY:yfiles.system.ResourceKey; + }; + /** + * Interface for implementations that can calculate the bounds of a group + * node in a {@link yfiles.graph.IGroupedGraph}. + * Implementations of this interface will be queried from {@link yfiles.graph.INode}'s + * {@link yfiles.support.ILookup#lookup} method. + */ + export interface IGroupBoundsCalculator extends Object{ + /** + * Calculates the bounds of the {@link yfiles.graph.INode#layout} + * for the given groupNode that is a group node + * in the hierarchy. + * @param {yfiles.graph.IHierarchy.} hierarchy The hierarchy to use for the calculation. This is the hierarchy of the nodes that describe the nesting of the group nodes. + * @param {yfiles.graph.INode} groupNode The node to calculate the bounds for. + * @return {yfiles.geometry.RectD} The minimum bounds to use for the given group node. + * @see Specified by {@link yfiles.drawing.IGroupBoundsCalculator#calculateBounds}. + */ + calculateBounds(hierarchy:yfiles.graph.IHierarchy,groupNode:yfiles.graph.INode):yfiles.geometry.RectD; + } + var IGroupBoundsCalculator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for node styles that can display node shapes with a boundary + * that is defined by a {@link yfiles.drawing.GeneralPath} instance. + * @see {@link yfiles.drawing.GeneralPathNodeStyle} + */ + export interface IGeneralPathNodeStyle extends Object,yfiles.drawing.INodeStyle{ + /** + * Get the path that defines the boundary of the shape. + * The path must be defined in such a way that <0,0> will + * be at the top left of a node's {@link yfiles.graph.INode#layout} + * and <1,1> will be at the lower right. + * The path will be scaled accordingly during the painting. + * @see Specified by {@link yfiles.drawing.IGeneralPathNodeStyle#path}. + */ + path:yfiles.drawing.GeneralPath; + /** + * Gets the {@link yfiles.drawing.IGeneralPathNodeStyle#brush} that is used to draw the shape. + * @see Specified by {@link yfiles.drawing.IGeneralPathNodeStyle#brush}. + */ + brush:yfiles.system.Brush; + /** + * Gets the {@link yfiles.drawing.IGeneralPathNodeStyle#pen} that is used to draw the shape. + * @see Specified by {@link yfiles.drawing.IGeneralPathNodeStyle#pen}. + */ + pen:yfiles.system.Pen; + } + var IGeneralPathNodeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Generic default implementation of an {@link yfiles.input.IPositionHandler}. + * This implementation delegates to a pair of {@link yfiles.geometry.IPoint} and {@link yfiles.geometry.IPointSetter} + * implementations or an {@link yfiles.geometry.IPoint}+{@link yfiles.geometry.IReshapeable} implementation pair. + */ + export interface DefaultPositionHandler extends Object,yfiles.input.IPositionHandler{ + /** + * Applies the new position to the delegates. + */ + applyPosition(location:yfiles.geometry.PointD):boolean; + /** + * Returns the x coordinate of the current position of the element. + * The point describes the current world coordinate position of the element. + * It is up to the implementation how this position is interpreted. + */ + x:number; + /** + * Returns the y coordinate of the current position of the element. + * The point describes the current world coordinate position of the element. + * It is up to the implementation how this position is interpreted. + */ + y:number; + /** + * Returns a view of the location of the item. + * The point describes the current world coordinate of the element that can + * be modified by this handler. + * @see Specified by {@link yfiles.input.IDragHandler#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Called by clients to set the position to the given coordinates. + * It is up to the implementation to decide how the position of the element in + * question should be interpreted. This may be the upper left corner of the element, + * its center or anything else. The implementation may decide to not use the values + * provided or use different values internally. + * @param {yfiles.geometry.PointD} location The new location. + * @see {@link yfiles.input.IDragHandler#location} + * @see Specified by {@link yfiles.input.IPositionHandler#setPosition}. + */ + setPosition(location:yfiles.geometry.PointD):void; + /** + * Called by clients to indicate that the element is going to be dragged. + * This call will be followed by one or more calls to {@link yfiles.input.IDragHandler#handleMove}, + * and a final {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. + */ + initializeDrag(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Called by clients to indicate that the element has been dragged and its position + * should be updated. + * This method may be called more than once after an initial {@link yfiles.input.IDragHandler#initializeDrag} + * and will the final call will be followed by either one + * {@link yfiles.input.IDragHandler#dragFinished} or one {@link yfiles.input.IDragHandler#cancelDrag} call. + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @return {boolean} Whether the move had any visual effect. This is a hint to the engine to optimize invalidation. + * @see Specified by {@link yfiles.input.IDragHandler#handleMove}. + */ + handleMove(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):boolean; + /** + * Called by clients to indicate that the dragging has been canceled by the user. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Implementations should reset the position of the items they modify to their initial state. + * Alternatively to this method the {@link yfiles.input.IDragHandler#dragFinished} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} originalLocation The value of the coordinate of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#cancelDrag}. + */ + cancelDrag(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * Called by clients to indicate that the repositioning has just been finished. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Alternatively to this method the {@link yfiles.input.IDragHandler#cancelDrag} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * This is the same value as delivered in the last invocation of {@link yfiles.input.IDragHandler#handleMove} + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#dragFinished}. + */ + dragFinished(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + } + var DefaultPositionHandler:{ + $class:yfiles.lang.Class; + /** + * Creates a position handler that delegates to a mutable point. + * @param {yfiles.geometry.IMutablePoint} point The point to read and write the position to. + */ + WithPoint:{ + new (point:yfiles.geometry.IMutablePoint):yfiles.drawing.DefaultPositionHandler; + }; + /** + * Creates a position handler that delegates to a mutable rectangle. + * @param {yfiles.geometry.IMutableRectangle} rectangle The rectangle to read and write its location to. + */ + WithRectangle:{ + new (rectangle:yfiles.geometry.IMutableRectangle):yfiles.drawing.DefaultPositionHandler; + }; + /** + * Creates a position handler that delegates to two point implementations. + * @param {yfiles.geometry.IPoint} pointGetter The point read the position from. + * @param {yfiles.geometry.IPointSetter} pointSetter The point write the new position to. + */ + new (pointGetter:yfiles.geometry.IPoint,pointSetter:yfiles.geometry.IPointSetter):yfiles.drawing.DefaultPositionHandler; + /** + * Creates a position handler that delegates to two rectangle implementations. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle to read the location from. + * @param {yfiles.geometry.IReshapeable} reshapeable The reshapeable to write the new location to. + */ + WithReshapeable:{ + new (rectangle:yfiles.geometry.IRectangle,reshapeable:yfiles.geometry.IReshapeable):yfiles.drawing.DefaultPositionHandler; + }; + }; + /** + * An specialized subclass of the {@link yfiles.drawing.EdgeSelectionRenderer} + * that can install the highlight rendering of an {@link yfiles.graph.IEdge}. + * This will {@link yfiles.model.IInstallerContext#addInstalled install} + * {@link yfiles.canvas.ICanvasObject} during {@link yfiles.drawing.EdgeSelectionRenderer#install installation}, + * that will render the path and the bends of an edge using a {@link yfiles.drawing.EdgeHighlightRenderer#getPen pen} + * for the path and a {@link yfiles.drawing.EdgeHighlightRenderer#getBendDrawing drawing} for the bends. + */ + export interface EdgeHighlightRenderer extends yfiles.drawing.EdgeSelectionRenderer{ + /** + * Callback method that retrieves the pen for the context. + * This implementation will use the {@link yfiles.drawing.EdgeHighlightRenderer#PEN_KEY} resource to find a {@link yfiles.system.Pen} instance. + * If null is yielded, a default pen will be used. + * @param {yfiles.graph.IEdge} edge The edge for which the rendering will be used. + * @param {yfiles.model.IInstallerContext} context The context for which the pen shall be returned. + * @return {yfiles.system.Pen} The pen instance to use for the rendering of the edge in the given context. + * @see Overrides {@link yfiles.drawing.EdgeSelectionRenderer#getPen} + */ + getPen(context:yfiles.model.IInstallerContext,edge:yfiles.graph.IEdge):yfiles.system.Pen; + /** + * Callback method that retrieves the drawing of the bend for the context. + * This implementation will use the {@link yfiles.drawing.EdgeHighlightRenderer#BEND_TEMPLATE_KEY} resource to find a + * {@link yfiles.drawing.DataTemplate} instance. + * If null is yielded, a default drawing will be used. + * @param {yfiles.model.IInstallerContext} context The context for which the drawing shall be returned. + * @param {yfiles.graph.IEdge} edge The edge for which the rendering will be used. + * @return {yfiles.drawing.DataTemplate} The drawing instance to use for the rendering of the bends in the given context. + * @see Overrides {@link yfiles.drawing.EdgeSelectionRenderer#getBendDrawing} + */ + getBendDrawing(context:yfiles.model.IInstallerContext,edge:yfiles.graph.IEdge):yfiles.drawing.DataTemplate; + } + var EdgeHighlightRenderer:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.EdgeHighlightRenderer; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.system.Pen} + * that will be used to draw the path of the edge. + */ + PEN_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.drawing.DataTemplate} + * that will be used to draw the bends of the edge. + */ + BEND_TEMPLATE_KEY:yfiles.system.ResourceKey; + }; + /** + * An specialized subclass of the {@link yfiles.drawing.EdgeSelectionRenderer} + * that can install the focus indicator of an {@link yfiles.graph.IEdge}. + * This will {@link yfiles.model.IInstallerContext#addInstalled install} + * {@link yfiles.canvas.ICanvasObject} during {@link yfiles.drawing.EdgeSelectionRenderer#install installation}, + * that will render the path and the bends of an edge using a {@link yfiles.drawing.EdgeFocusIndicatorRenderer#getPen pen} + * for the path and a {@link yfiles.drawing.EdgeFocusIndicatorRenderer#getBendDrawing drawing} for the bends. + */ + export interface EdgeFocusIndicatorRenderer extends yfiles.drawing.EdgeSelectionRenderer{ + /** + * Callback method that retrieves the pen for the context. + * This implementation will use the {@link yfiles.drawing.EdgeFocusIndicatorRenderer#PEN_KEY} resource to find a {@link yfiles.system.Pen} instance. + * If null is yielded, a default pen will be used. + * @param {yfiles.graph.IEdge} edge The edge for which the rendering will be used. + * @param {yfiles.model.IInstallerContext} context The context for which the pen shall be returned. + * @return {yfiles.system.Pen} The pen instance to use for the rendering of the edge in the given context. + * @see Overrides {@link yfiles.drawing.EdgeSelectionRenderer#getPen} + */ + getPen(context:yfiles.model.IInstallerContext,edge:yfiles.graph.IEdge):yfiles.system.Pen; + /** + * Callback method that retrieves the drawing of the bend for the context. + * This implementation will use the {@link yfiles.drawing.EdgeFocusIndicatorRenderer#BEND_TEMPLATE_KEY} resource to find a + * {@link yfiles.drawing.DataTemplate} instance. + * If null is yielded, a default drawing will be used. + * @param {yfiles.model.IInstallerContext} context The context for which the drawing shall be returned. + * @param {yfiles.graph.IEdge} edge The edge for which the rendering will be used. + * @return {yfiles.drawing.DataTemplate} The drawing instance to use for the rendering of the bends in the given context. + * @see Overrides {@link yfiles.drawing.EdgeSelectionRenderer#getBendDrawing} + */ + getBendDrawing(context:yfiles.model.IInstallerContext,edge:yfiles.graph.IEdge):yfiles.drawing.DataTemplate; + } + var EdgeFocusIndicatorRenderer:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.EdgeFocusIndicatorRenderer; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.system.Pen} + * that will be used to draw the path of the edge. + */ + PEN_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.drawing.DataTemplate} + * that will be used to draw the bends of the edge. + */ + BEND_TEMPLATE_KEY:yfiles.system.ResourceKey; + }; + /** + * Base interface for many of the {@link yfiles.drawing.IVisualStyle} implementations. + * This interface adds the ability to specify a {@link yfiles.drawing.ITaggedStyleBase#userTagProvider} and a custom {@link yfiles.drawing.ITaggedStyleBase#contextLookup}, + * as well as a {@link yfiles.drawing.ITaggedStyleBase#styleTag}. + */ + export interface ITaggedStyleBase extends Object,yfiles.drawing.IVisualStyle{ + /** + * Gets the tag that is associated with this style instance. + * Value: The tag associated with this style instance. + * @see Specified by {@link yfiles.drawing.ITaggedStyleBase#styleTag}. + */ + styleTag:Object; + /** + * Provides an implementation of a {@link yfiles.drawing.IUserTagProvider} that can yield + * a user specified tag object for each item that will be assigned this style. + * @see {@link yfiles.drawing.common.VoidUserTagProvider} + * @see {@link yfiles.drawing.TagOwnerUserTagProvider} + * @see {@link yfiles.drawing.MapperBasedUserTagProvider} + * @see Specified by {@link yfiles.drawing.ITaggedStyleBase#userTagProvider}. + */ + userTagProvider:yfiles.drawing.IUserTagProvider; + /** + * Provides an implementation of {@link yfiles.support.IContextLookup} that can be used to satisfy queries + * that are made to the implementation which is returned by calls to + * {@link yfiles.drawing.IStyleRenderer#getContext} that are made on the {@link yfiles.drawing.IStyleRenderer} + * that is associated with this style instance. + * This can be used to conveniently customize the lookup behavior of the style renderers that + * are associated with this instance. E.g. it is possible to provide customized implementations of {@link yfiles.model.ISelectionInstaller}, + * {@link yfiles.input.IHighlightInstaller}, {@link yfiles.input.IHandleProvider}, {@link yfiles.input.ISizeConstraintProvider}, and {@link yfiles.drawing.IInsetsProvider}. + * Simple style implementations can use {@link yfiles.support.Lookups#EMPTY_CONTEXT_LOOKUP} but may not use null for this property. + * @see Specified by {@link yfiles.drawing.ITaggedStyleBase#contextLookup}. + */ + contextLookup:yfiles.support.IContextLookup; + } + var ITaggedStyleBase:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface that describes the current context for painting routines. + * @see {@link yfiles.drawing.IVisualCreator} + */ + export interface IRenderContext extends Object,yfiles.canvas.ICanvasContext{ + /** + * The CanvasControl that the painting is performed to, or null. + * @see Specified by {@link yfiles.drawing.IRenderContext#canvas}. + */ + canvas:yfiles.canvas.CanvasControl; + /** + * The clipping rectangle in world coordinates. Painting outside of this clip + * may be skipped altogether. + * @see Specified by {@link yfiles.drawing.IRenderContext#clip}. + */ + clip:yfiles.geometry.RectD; + /** + * A transform that can be applied to the graphics context in order to paint + * in the view coordinate system. + * Using this value as a transform for a visual element + * will make it appear in the view coordinate system. + * @see Specified by {@link yfiles.drawing.IRenderContext#viewTransform}. + */ + viewTransform:yfiles.geometry.Matrix2D; + /** + * The transform that can be applied to the graphics context in order to paint + * into the world coordinate system. + * Using this value as a transform for a visual element + * will make it appear in the the world coordinate system + * (if it had been in the view coordinate system). + * @see Specified by {@link yfiles.drawing.IRenderContext#worldTransform}. + */ + worldTransform:yfiles.geometry.Matrix2D; + /** + * The transform that is used to convert between the {@link yfiles.drawing.IRenderContext#viewTransform} + * and the resulting {@link yfiles.drawing.IRenderContext#worldTransform}. + * Coordinates transformed using this matrix can be drawn into a graphics + * context that has the {@link yfiles.drawing.IRenderContext#viewTransform} applied but appear to + * be drawn into the {@link yfiles.drawing.IRenderContext#worldTransform world coordinate system.} + * ViewTransform * Transform = WorldTransform + * @see {@link yfiles.drawing.IRenderContext#toViewCoordinates} + * @see Specified by {@link yfiles.drawing.IRenderContext#transform}. + */ + transform:yfiles.geometry.Matrix2D; + /** + * Converts the given set of world coordinates to a coordinate pair that can + * be used to paint within the {@link yfiles.drawing.IRenderContext#viewTransform}. + * @see {@link yfiles.drawing.IRenderContext#worldTransform} + * @see {@link yfiles.drawing.IRenderContext#viewTransform} + * @param {yfiles.geometry.PointD} worldPoint The coordinates in the world coordinate system. + * @return {yfiles.geometry.PointD} The coordinates in the view coordinate system. + * @see Specified by {@link yfiles.drawing.IRenderContext#toViewCoordinates}. + */ + toViewCoordinates(worldPoint:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Provides access to the defs element in the SVG DOM that is managed by this instance. + * @see {@link yfiles.drawing.IRenderContext#defsManager} + * @see Specified by {@link yfiles.drawing.IRenderContext#defsElement}. + */ + defsElement:Element; + /** + * Provides access to the {@link yfiles.canvas.DefsManager} that manages this instance. + * @see Specified by {@link yfiles.drawing.IRenderContext#defsManager}. + */ + defsManager:yfiles.canvas.DefsManager; + } + var IRenderContext:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A void/null implementation of the {@link yfiles.drawing.IVisualCreator} interface + * that does nothing. + * Use the {@link yfiles.drawing.VoidVisualCreator#INSTANCE} instance of null for methods that + * require non-null implementations but if you want to have the default void behavior. + */ + export interface VoidVisualCreator extends Object,yfiles.drawing.IVisualCreator{ + /** + * Returns null. + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * Returns null. + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + } + var VoidVisualCreator:{ + $class:yfiles.lang.Class; + /** + * An immutable and shareable convenience instance of the {@link yfiles.drawing.VoidVisualCreator} class. + */ + INSTANCE:yfiles.drawing.IVisualCreator; + }; + /** + * Factory interface which is used by implementations that know + * how to create {@link yfiles.drawing.Visual}s for rendering into a given + * {@link yfiles.drawing.IRenderContext}. + * @see {@link yfiles.canvas.CanvasControl} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.ICanvasObject} + */ + export interface IVisualCreator extends Object{ + /** + * This method is called by the framework to create a {@link yfiles.drawing.Visual} + * that will be included into the {@link yfiles.drawing.IRenderContext}. + * {@link yfiles.canvas.CanvasControl} uses this interface through the {@link yfiles.canvas.ICanvasObjectDescriptor} + * to populate the visual canvas object tree. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used. + * @return {yfiles.drawing.Visual} The visual to include in the canvas object visual tree. This may be null. + * @see {@link yfiles.drawing.IVisualCreator#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * This method updates or replaces a previously created {@link yfiles.drawing.Visual} for inclusion + * in the {@link yfiles.drawing.IRenderContext}. + * The {@link yfiles.canvas.CanvasControl} uses this method to give implementations a chance to + * update an existing Visual that has previously been created by the same instance during a call + * to {@link yfiles.drawing.IVisualCreator#createVisual}. Implementation may update the oldVisual + * and return that same reference, or create a new visual and return the new instance or null. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used in. + * @param {yfiles.drawing.Visual} oldVisual The visual instance that had been returned the last time the {@link yfiles.drawing.IVisualCreator#createVisual} + * method was called on this instance. + * @return {yfiles.drawing.Visual} oldVisual, if this instance modified the visual, or a new visual that should replace the + * existing one in the canvas object visual tree. + * @see {@link yfiles.drawing.IVisualCreator#createVisual} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasControl} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + } + var IVisualCreator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface MoveTo extends Object{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + point:yfiles.geometry.PointD; + } + var MoveTo:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.drawing.MoveTo; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromXAndY:{ + new (x:number,y:number):yfiles.drawing.MoveTo; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + MoveTo:{ + new (p:yfiles.geometry.PointD):yfiles.drawing.MoveTo; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface GeneralPathMarkupExtension extends yfiles.system.MarkupExtension{ + /** + * Returns an object that is set as the value of the target property for this markup extension. + * @param {yfiles.support.ILookup} serviceProvider Object that can provide services for the markup extension. + * @return {Object} The object value to set on the property where the extension is applied. + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + /** + * Adds a child object. + * @param {Object} value The child object to add. + */ + addChild(value:Object):void; + /** + * Contains the items that make up the {@link yfiles.drawing.GeneralPath}. + * @see {@link yfiles.drawing.MoveTo} + * @see {@link yfiles.drawing.LineTo} + * @see {@link yfiles.drawing.Close} + * @see {@link yfiles.drawing.QuadTo} + * @see {@link yfiles.drawing.CubicTo} + */ + items:yfiles.objectcollections.IList; + /** + * Adds the text content of a node to the object. + * This implementation does nothing + * @param {string} text The text to add to the object. + */ + addText(text:string):void; + } + var GeneralPathMarkupExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.drawing.GeneralPathMarkupExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPath:{ + new (path:yfiles.drawing.GeneralPath):yfiles.drawing.GeneralPathMarkupExtension; + }; + }; + /** + * Interface that is implemented for elements that can determine + * whether they might be visible in a given clipping rectangle. + * @see {@link yfiles.drawing.IVisualCreator} + * @see {@link yfiles.canvas.CanvasControl} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.ICanvasObject} + * @see {@link yfiles.drawing.VisibilityTest} + */ + export interface IVisibilityTest extends Object{ + /** + * Determines whether an element might intersect the visible region for a given context. + * Conservative implementations can always return true. + * @param {yfiles.geometry.RectD} clip The visible region clip. + * @param {yfiles.canvas.ICanvasContext} ctx The context to determine the visibility for. + * @return {boolean} false if and only if it is safe not to paint the element because + * it would not affect the given clipping region. + * @see Specified by {@link yfiles.drawing.IVisibilityTest#isVisible}. + */ + isVisible(clip:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + } + var IVisibilityTest:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that is implemented for elements that can provide painting + * bounds in the world coordinate system. This information can be used + * by the rendering engine to increase rendering performance significantly. + * @see {@link yfiles.drawing.IVisualCreator} + * @see {@link yfiles.canvas.CanvasControl} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.ICanvasObject} + * @see {@link yfiles.drawing.BoundsProvider} + */ + export interface IBoundsProvider extends Object{ + /** + * Returns a tight rectangular area where the whole rendering + * would fit into. + * If calculating the bounds is too expensive or the painting is not + * bound to a certain area, this method may return {@link yfiles.geometry.RectD#INFINITE}. + * If nothing is painted, this method should return an empty rectangle, where + * either or both the width and height is non-positive or + * {@link yfiles.geometry.RectD#EMPTY}. + * @param {yfiles.canvas.ICanvasContext} ctx the context to calculate the bounds for + * @return {yfiles.geometry.RectD} the bounds or {@link yfiles.geometry.RectD#EMPTY} to indicate an unbound area + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + } + var IBoundsProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that is implemented for elements that can be hit or picked in + * a coordinate system. + * @see {@link yfiles.canvas.CanvasControl} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.ICanvasObject} + */ + export interface IHitTestable extends Object{ + /** + * Determines if something has been hit at the given coordinates + * in the world coordinate system. + * Implementations should inspect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * and take the value into account when performing hit tests. + * This allows the user to hit elements even if the zoom level is very + * small and allows for accurate hit tests at greater zoom levels. + * @param {yfiles.geometry.PointD} p the coordinates in world coordinate system + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + } + var IHitTestable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A convenience implementation of the {@link yfiles.drawing.IMarqueeTestable} + * interface that provide two default instances. + * @see {@link yfiles.drawing.MarqueeTestable#ALWAYS} + * @see {@link yfiles.drawing.MarqueeTestable#NEVER} + */ + export interface MarqueeTestable extends Object,yfiles.drawing.IMarqueeTestable{ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + } + var MarqueeTestable:{ + $class:yfiles.lang.Class; + /** + * An implementation that always yields true. + */ + ALWAYS:yfiles.drawing.IMarqueeTestable; + /** + * An implementation that always yields false. + */ + NEVER:yfiles.drawing.IMarqueeTestable; + }; + /** + * Interface that is used to test whether a rendered item is deemed + * to be inside a rectangular marquee selection. + */ + export interface IMarqueeTestable extends Object{ + /** + * This callback returns true if the corresponding + * item is considered to intersect the given rectangular box. + * This method may return false if the item cannot be + * selected using a selection marquee or optionally if the + * item is only partially contained within the box. + * Implementations should respect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * if marquee selections should behave differently on different zoom levels. + * @param {yfiles.geometry.RectD} box the box describing the marquee's bounds + * @param {yfiles.canvas.ICanvasContext} ctx the current canvas context + * @return {boolean} true if the item is considered to be captured by the marquee + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + } + var IMarqueeTestable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Utility class that offers convenience methods for working with {@link yfiles.system.Color} + * instances and applies effects to {@link HTMLCanvasElement}s. + */ + export interface ImageSupport extends Object{ + } + var ImageSupport:{ + $class:yfiles.lang.Class; + /** + * Create a color from HSB values. + */ + fromHSB(hue:number,saturation:number,brightness:number,alpha:number):yfiles.system.Color; + /** + * Converts an RGB color value to HSB values. + * @param {yfiles.system.Color} color The color. + * @param {number} hue The hue. + * @param {number} saturation The saturation. + * @param {number} brightness The brightness. + * @param {number} alpha The alpha. + */ + toHSB(color:yfiles.system.Color,hue:{value:number;},saturation:{value:number;},brightness:{value:number;},alpha:{value:number;}):void; + gaussianBlurWithThetaAndSize(bitmap:HTMLCanvasElement,theta:number,size:number):void; + gaussianBlur(bitmap:HTMLCanvasElement,intkernel:number[]):void; + /** + * Creates a 1 dimensional gaussian kernel normalized to integer values between 0 and 255. + */ + gaussian1DScaled(theta:number,size:number):number[]; + /** + * Mixes two colors using the provided ratio. + */ + mix(color0:yfiles.system.Color,color1:yfiles.system.Color,ratio:number):yfiles.system.Color; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface LineTo extends Object{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + point:yfiles.geometry.PointD; + } + var LineTo:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.drawing.LineTo; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromXAndY:{ + new (x:number,y:number):yfiles.drawing.LineTo; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + LineTo:{ + new (p:yfiles.geometry.PointD):yfiles.drawing.LineTo; + }; + }; + /** + * A simple {@link yfiles.input.IHighlightInstaller} implementation + * that draws a rectangle of the bounds of the selected item. + */ + export interface RectangularHighlightInstaller extends yfiles.drawing.RectangularSelectionInstaller{ + /** + * Gets the {@link yfiles.system.ResourceKey} to use for the {@link yfiles.drawing.DataTemplate}. + * @return {yfiles.system.ResourceKey} The {@link yfiles.drawing.RectangularHighlightInstaller#TEMPLATE_KEY} + * @see Overrides {@link yfiles.drawing.RectangularSelectionInstaller#getTemplateKey} + */ + getTemplateKey():yfiles.system.ResourceKey; + } + var RectangularHighlightInstaller:{ + $class:yfiles.lang.Class; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.drawing.DataTemplate} + * that will be used to fill the rectangular focus. + */ + TEMPLATE_KEY:yfiles.system.ResourceKey; + /** + * Initializes a new instance of the {@link yfiles.drawing.RectangularFocusInstaller} class. + * @param {yfiles.geometry.IRectangle} bounds The bounds. + */ + new (bounds:yfiles.geometry.IRectangle):yfiles.drawing.RectangularHighlightInstaller; + }; + /** + * A simple {@link yfiles.input.IFocusIndicatorInstaller} implementation + * that draws a rectangle of the bounds of the selected item. + */ + export interface RectangularFocusInstaller extends yfiles.drawing.RectangularSelectionInstaller{ + /** + * Gets the {@link yfiles.system.ResourceKey} to use for the {@link yfiles.drawing.DataTemplate}. + * @return {yfiles.system.ResourceKey} The {@link yfiles.drawing.RectangularFocusInstaller#TEMPLATE_KEY} + * @see Overrides {@link yfiles.drawing.RectangularSelectionInstaller#getTemplateKey} + */ + getTemplateKey():yfiles.system.ResourceKey; + } + var RectangularFocusInstaller:{ + $class:yfiles.lang.Class; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.drawing.DataTemplate} + * that will be used to fill the rectangular focus. + */ + TEMPLATE_KEY:yfiles.system.ResourceKey; + /** + * Initializes a new instance of the {@link yfiles.drawing.RectangularFocusInstaller} class. + * @param {yfiles.geometry.IRectangle} bounds The bounds. + */ + new (bounds:yfiles.geometry.IRectangle):yfiles.drawing.RectangularFocusInstaller; + }; + /** + * A simple {@link yfiles.drawing.IMarqueeTestable} implementation + * that checks for intersection with an {@link yfiles.geometry.IRectangle}. + */ + export interface RectangleMarqueeTestable extends Object,yfiles.drawing.IMarqueeTestable{ + /** + * Implements the interface. + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + } + var RectangleMarqueeTestable:{ + $class:yfiles.lang.Class; + /** + * Creates an instance using the given rectangle to check for intersection + * with the marquee box. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle to query intersections for. + */ + new (rectangle:yfiles.geometry.IRectangle):yfiles.drawing.RectangleMarqueeTestable; + }; + /** + * A simple {@link yfiles.model.ISelectionInstaller} implementation + * that draws a rectangle of the bounds of the selected item. + */ + export interface RectangularSelectionInstaller extends Object,yfiles.model.ISelectionInstaller,yfiles.input.IHighlightInstaller,yfiles.input.IFocusIndicatorInstaller{ + /** + * Gets or sets a value indicating whether the brush + * property should be set to null. + * The default is false. + * Value: true if the brush property should be reset; otherwise, false. + */ + clearFillProperty:boolean; + /** + * Gets or sets the template to use for drawing the rectangle in the view coordinate system. + */ + rectangleTemplate:yfiles.drawing.DataTemplate; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:Object):void; + /** + * Gets the {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.drawing.DataTemplate} + * to use for drawing the rectangle. + * @return {yfiles.system.ResourceKey} A {@link yfiles.system.ResourceKey} that can be used to find an instance of {@link yfiles.drawing.DataTemplate} or null. + */ + getTemplateKey():yfiles.system.ResourceKey; + /** + * Factory method that retrieves the bounds for a given user object. + * This implementation simply returns the value provided to the constructor. + */ + getRectangle(userObject:Object):yfiles.geometry.IRectangle; + } + var RectangularSelectionInstaller:{ + $class:yfiles.lang.Class; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.drawing.DataTemplate} + * that will be used to represent the rectangular selection. + */ + TEMPLATE_KEY:yfiles.system.ResourceKey; + /** + * Initializes a new instance of the {@link yfiles.drawing.RectangularSelectionInstaller} class. + */ + new ():yfiles.drawing.RectangularSelectionInstaller; + /** + * Initializes a new instance of the {@link yfiles.drawing.RectangularSelectionInstaller} class. + * @param {yfiles.geometry.IRectangle} bounds The bounds. + */ + FromRectangle:{ + new (bounds:yfiles.geometry.IRectangle):yfiles.drawing.RectangularSelectionInstaller; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface Close extends Object{ + } + var Close:{ + $class:yfiles.lang.Class; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface QuadTo extends Object{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + point:yfiles.geometry.PointD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + controlPoint:yfiles.geometry.PointD; + } + var QuadTo:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.drawing.QuadTo; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromControlPointsCoords:{ + new (cp1x:number,cp1y:number,x:number,y:number):yfiles.drawing.QuadTo; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromControlPoints:{ + new (cp:yfiles.geometry.PointD,p:yfiles.geometry.PointD):yfiles.drawing.QuadTo; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface CubicTo extends Object{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + point:yfiles.geometry.PointD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + controlPoint2:yfiles.geometry.PointD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + controlPoint1:yfiles.geometry.PointD; + } + var CubicTo:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.drawing.CubicTo; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromControlPointsCoords:{ + new (cp1x:number,cp1y:number,cp2x:number,cp2y:number,x:number,y:number):yfiles.drawing.CubicTo; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromControlPoints:{ + new (cp1:yfiles.geometry.PointD,cp2:yfiles.geometry.PointD,p:yfiles.geometry.PointD):yfiles.drawing.CubicTo; + }; + }; + /** + * A simple {@link yfiles.model.ISelectionInstaller}, {@link yfiles.input.IFocusIndicatorInstaller} and {@link yfiles.input.IHighlightInstaller} + * implementation + * that draws an oriented rectangle as a highlight box. + */ + export interface OrientedRectangleHighlightInstaller extends yfiles.drawing.OrientedRectangleSelectionInstaller{ + /** + * Gets the {@link yfiles.system.ResourceKey} to use for the brush. + * @return {yfiles.system.ResourceKey} The {@link yfiles.drawing.OrientedRectangleHighlightInstaller#TEMPLATE_KEY} + * @see Overrides {@link yfiles.drawing.OrientedRectangleSelectionInstaller#getTemplateKey} + */ + getTemplateKey():yfiles.system.ResourceKey; + } + var OrientedRectangleHighlightInstaller:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.OrientedRectangleHighlightInstaller} class. + * @param {yfiles.geometry.IOrientedRectangle} bounds The bounds to query for the painting. + */ + new (bounds:yfiles.geometry.IOrientedRectangle):yfiles.drawing.OrientedRectangleHighlightInstaller; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.system.Brush} + * that will be used to fill the rectangular focus. + */ + TEMPLATE_KEY:yfiles.system.ResourceKey; + }; + /** + * A simple {@link yfiles.model.ISelectionInstaller} implementation + * that draws an ellipse centered at a given point in world coordinate space. + */ + export interface PointSelectionInstaller extends Object,yfiles.model.ISelectionInstaller{ + /** + * Gets or sets the pen to use for drawing the point in the view coordinate system. + */ + pen:yfiles.system.Pen; + /** + * Gets or sets the brush to use for filling the point's ellipse in the view coordinate system. + */ + brush:yfiles.system.Brush; + /** + * Factory method that retrieves the center for a given user object. + * This implementation simply returns the value provided to the constructor. + */ + getCenterPoint(userObject:Object):yfiles.geometry.IPoint; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:Object):void; + } + var PointSelectionInstaller:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that indicates a point. + * @param {yfiles.geometry.IPoint} point The point to use for the center. + */ + new (point:yfiles.geometry.IPoint):yfiles.drawing.PointSelectionInstaller; + }; + /** + * A specialized subclass of {@link yfiles.drawing.OrientedRectangleSelectionInstaller} + * that redefines the {@link yfiles.drawing.OrientedRectangleFocusInstaller#getTemplateKey}. + */ + export interface OrientedRectangleFocusInstaller extends yfiles.drawing.OrientedRectangleSelectionInstaller{ + /** + * Gets the {@link yfiles.system.ResourceKey} to use for the brush. + * @return {yfiles.system.ResourceKey} The {@link yfiles.drawing.OrientedRectangleFocusInstaller#TEMPLATE_KEY} + * @see Overrides {@link yfiles.drawing.OrientedRectangleSelectionInstaller#getTemplateKey} + */ + getTemplateKey():yfiles.system.ResourceKey; + } + var OrientedRectangleFocusInstaller:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.OrientedRectangleFocusInstaller} class. + * that uses the provided bounds for painting. + * @param {yfiles.geometry.IOrientedRectangle} bounds The bounds to query for the painting. + */ + new (bounds:yfiles.geometry.IOrientedRectangle):yfiles.drawing.OrientedRectangleFocusInstaller; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.system.Brush} + * that will be used to fill the rectangular focus. + */ + TEMPLATE_KEY:yfiles.system.ResourceKey; + }; + /** + * A simple {@link yfiles.model.ISelectionInstaller}, {@link yfiles.input.IFocusIndicatorInstaller} and {@link yfiles.input.IHighlightInstaller} + * implementation + * that draws an oriented rectangle as a selection box. + */ + export interface OrientedRectangleSelectionInstaller extends Object,yfiles.model.ISelectionInstaller,yfiles.input.IHighlightInstaller,yfiles.input.IFocusIndicatorInstaller{ + /** + * Gets or sets the template to use for drawing the rectangle in the view coordinate system. + */ + rectangleTemplate:yfiles.drawing.DataTemplate; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:Object):void; + /** + * Creates the {@link yfiles.canvas.ICanvasObjectDescriptor} for this class and the provided template. + * @param {yfiles.drawing.DataTemplate} template The template to use. + * @return {yfiles.canvas.ICanvasObjectDescriptor} A descriptor that can be used to render an oriented rectangle. + */ + createDescriptor(template:yfiles.drawing.DataTemplate):yfiles.canvas.ICanvasObjectDescriptor; + /** + * Gets the {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.drawing.DataTemplate} + * to use for drawing the rectangle. + * @return {yfiles.system.ResourceKey} A {@link yfiles.system.ResourceKey} that can be used to find an instance of {@link yfiles.drawing.DataTemplate} or null. + */ + getTemplateKey():yfiles.system.ResourceKey; + /** + * Factory method that retrieves the bounds for a given user object. + * This implementation simply returns the value provided to the constructor. + */ + getRectangle(userObject:Object):yfiles.geometry.IOrientedRectangle; + } + var OrientedRectangleSelectionInstaller:{ + $class:yfiles.lang.Class; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.drawing.DataTemplate} + * that will be used to represent the rectangular selection. + */ + TEMPLATE_KEY:yfiles.system.ResourceKey; + /** + * Initializes a new instance of the {@link yfiles.drawing.OrientedRectangleSelectionInstaller} class. + */ + new ():yfiles.drawing.OrientedRectangleSelectionInstaller; + /** + * Creates a new instance that paints the bounds. + * @param {yfiles.geometry.IOrientedRectangle} bounds The bounds to query. + */ + WithRectangle:{ + new (bounds:yfiles.geometry.IOrientedRectangle):yfiles.drawing.OrientedRectangleSelectionInstaller; + }; + }; + /** + * Static helper class which contains methods for working with references in SVG elements. + */ + export interface SvgDefsUtil extends Object{ + } + var SvgDefsUtil:{ + $class:yfiles.lang.Class; + /** + * Determine whether the given element has an attribute that references the id in the defs element. + * @param {Element} element The element to inspect + * @param {string} attributeName The attribute to check + * @param {string} defsId The id in the defs section + * @return {boolean} Whether the attribute is equal to "url(#{defsId})" + */ + isAttributeReference(element:Element,attributeName:string,defsId:string):boolean; + /** + * Determines whether the specified element is an SVG use element that references the given id. + * @param {Node} element The element to inspect. + * @param {string} defsId The id of the element in the defs section. + * @return {boolean} + * true if the specified element references the element; otherwise, false. + */ + isUseReference(element:Node,defsId:string):boolean; + /** + * Determines whether the specified element is an SVG element of the given name. + * Use instanceof instead! + * @param {Element} element The element to check. + * @param {string} tagName the Name of the tag. + * @return {boolean} + * true if the specified element is an svg element; otherwise, false. + */ + isElementReference(element:Element,tagName:string):boolean; + }; + /** + * Renders a grid using various different {@link yfiles.drawing.GridVisualCreator#gridStyle styles}. + * @see {@link yfiles.canvas.GridInfo} + * @see {@link yfiles.drawing.GridVisualCreator#gridStyle} + */ + export interface GridVisualCreator extends Object,yfiles.drawing.IVisualCreator{ + /** + * Gets or sets the error that is tolerable in grid visualization. + *

+ * If the visualization abberation exceeds the tolerance, the grid is hidden. + *

+ *

+ * In order to make sure, the grid is displayed, restrict the zoom level to 0.25, + * 0.5, 1, 2, 4 etc... + *

+ *

+ * The error occurs because the grid is visualized using an SVG pattern. + * The pattern can only be drawn in integer coordinates. Even using a transform + * the coordinates are rounded. This leads to a small error that is added for each + * pattern repeat and leads to a significant abberation for the right/bottom + * grid cells. + *

+ */ + abberationTolerance:number; + /** + * Gets or sets the grid style that this implementation uses. + * Value: The grid style. + */ + gridStyle:yfiles.drawing.GridStyle; + /** + * Gets or sets the grid info that describes the geometry of the grid. + * Value: The grid info. + */ + gridInfo:yfiles.canvas.GridInfo; + /** + * Gets or sets a value indicating whether this {@link yfiles.drawing.GridVisualCreator} is visible. + * Value: true if visible; otherwise, false. + */ + visible:boolean; + /** + * Gets or sets the pen to use for painting the grid points. + * Value: The pen. + */ + pen:yfiles.system.Pen; + /** + * Gets or sets the visibility threshold. + * This indicates the minimum distance in the view coordinate system between two grid points. + * If the distance becomes smaller, the grid will not be rendered. + * The default value is 20.0d. + * Value: The visibility threshold. + */ + visibilityThreshold:number; + /** + * This method is called by the framework to create a {@link yfiles.drawing.Visual} + * that will be included into the {@link yfiles.drawing.IRenderContext}. + * {@link yfiles.canvas.CanvasControl} uses this interface through the {@link yfiles.canvas.ICanvasObjectDescriptor} + * to populate the visual canvas object tree. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used. + * @return {yfiles.drawing.Visual} The visual to include in the canvas object visual tree. This may be null. + * @see {@link yfiles.drawing.IVisualCreator#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * This method updates or replaces a previously created {@link yfiles.drawing.Visual} for inclusion + * in the {@link yfiles.drawing.IRenderContext}. + * The {@link yfiles.canvas.CanvasControl} uses this method to give implementations a chance to + * update an existing Visual that has previously been created by the same instance during a call + * to {@link yfiles.drawing.IVisualCreator#createVisual}. Implementation may update the oldVisual + * and return that same reference, or create a new visual and return the new instance or null. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used in. + * @param {yfiles.drawing.Visual} oldVisual The visual instance that had been returned the last time the {@link yfiles.drawing.IVisualCreator#createVisual} + * method was called on this instance. + * @return {yfiles.drawing.Visual} oldVisual, if this instance modified the visual, or a new visual that should replace the + * existing one in the canvas object visual tree. + * @see {@link yfiles.drawing.IVisualCreator#createVisual} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasControl} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + } + var GridVisualCreator:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.GridVisualCreator} class. + * The spacing is initialized to 25 units. + */ + new ():yfiles.drawing.GridVisualCreator; + /** + * Initializes a new instance of the {@link yfiles.drawing.GridVisualCreator} class. + * This initializes the {@link yfiles.drawing.GridVisualCreator#gridInfo} field using the given values. + * @param {number} xSpacing The x spacing. + * @param {number} ySpacing The y spacing. + */ + FromSpacings:{ + new (xSpacing:number,ySpacing:number):yfiles.drawing.GridVisualCreator; + }; + /** + * Initializes a new instance of the {@link yfiles.drawing.GridVisualCreator} class. + * @param {yfiles.canvas.GridInfo} gridInfo The grid info. + */ + WithGrid:{ + new (gridInfo:yfiles.canvas.GridInfo):yfiles.drawing.GridVisualCreator; + }; + }; + export enum FillMode{ + /** + * Never fill figures. + */ + NEVER, + /** + * Always fill figures. + */ + ALWAYS, + /** + * Fill all closed figures. + */ + FILL_CLOSED_FIGURES + } + /** + * Models a path that consists of lines and B�zier curves. + * This class uses double precision coordinates to model a virtual pen that + * can be moved across the world coordinate system and which can be used + * to draw lines and B�zier curves. + * This class provides many geometric utility methods, such as calculating + * the bounds, hit tests, containment tests, curve flattening, path transformation, + * path modification, and path iteration. + */ + export interface GeneralPath extends Object,yfiles.system.ICloneable,yfiles.system.IEquatable{ + equalsTyped(path:yfiles.drawing.GeneralPath):boolean; + /** + * Gets the last x coordinate of the last path element. + */ + lastX:number; + /** + * Gets the last coordinates of the last path element. + * Value: The last coordinate. + */ + lastCoordinate:yfiles.geometry.PointD; + /** + * Gets the last y coordinate of the last path element. + */ + lastY:number; + /** + * Finds the first intersection of a ray with this general path. + * The ray is treated like an infinite line starting at the given anchor point and + * continuing in the direction of rayX, rayY. The ray vector does not need to be normalized. + * The value returned will be the smallest positive value such that the point depicted by + * (anchorX + result * rayX, anchorY + result * rayY) is an intersection point + * between the ray and the path. + * @param {yfiles.geometry.PointD} anchor The coordinate of the anchor point of the ray. + * @param {yfiles.geometry.PointD} direction The coordinates of the direction vector of the ray. + * @return {number} The factor to calculate the intersection point or double.PositiveInfinity. + */ + findRayIntersection(anchor:yfiles.geometry.PointD,direction:yfiles.geometry.PointD):number; + /** + * Finds the first intersection of a ray with this general path using a given epsilon + * for flattening B�zier curves contained in the path. + * The ray is treated like an infinite line starting at the given anchor point and + * continuing in the direction of rayX, rayY. The ray vector does not need to be normalized. + * The value returned will be the smallest positive value such that the point depicted by + * (anchorX + result * rayX, anchorY + result * rayY) is an intersection point + * between the ray and the path. + * @param {yfiles.geometry.PointD} anchor The coordinates of the anchor point of the ray. + * @param {yfiles.geometry.PointD} direction The coordinates of the direction vector of the ray. + * @return {number} The factor to calculate the intersection point or double.PositiveInfinity. + * @param {number} eps The epsilon value that is used for the accuracy with which the implementation + * should test B�zier curves within the path for intersections. + */ + findEpsRayIntersection(anchor:yfiles.geometry.PointD,direction:yfiles.geometry.PointD,eps:number):number; + /** + * Creates a {@link SVGPathElement svg path} using the provided parameters. + * @param {yfiles.system.Brush} brush The brush to use for filling the path. + * @param {yfiles.system.Pen} pen The pen to use for stroking. + * @param {yfiles.geometry.Matrix2D} matrix The matrix to apply to the path data. + * @param {yfiles.drawing.FillMode} fillMode The fill mode to use. + * @param {yfiles.canvas.ICanvasContext} context The canvas context needed for defs registration. + * @return {yfiles.drawing.Visual} A {@link SVGPathElement path} that displays this instance using the provided attributes. + * @see {@link yfiles.drawing.GeneralPath#updatePath} + */ + createVisual(brush:yfiles.system.Brush,pen:yfiles.system.Pen,matrix:yfiles.geometry.Matrix2D,fillMode:yfiles.drawing.FillMode,context:yfiles.canvas.ICanvasContext):yfiles.drawing.Visual; + /** + * Updates a path instance that has been created using {@link yfiles.drawing.GeneralPath#createVisual}. + * @param {yfiles.drawing.PathVisual} visual The path instance to update. + * @param {yfiles.system.Brush} brush The brush to use for filling the path. + * @param {yfiles.system.Pen} pen The pen to use for stroking. + * @param {yfiles.geometry.Matrix2D} matrix The matrix to apply to the path data. + * @param {yfiles.drawing.FillMode} fillMode The fill mode to use. + * @param {yfiles.canvas.ICanvasContext} context The canvas context + * @see {@link yfiles.drawing.GeneralPath#createVisual} + */ + updatePath(visual:yfiles.drawing.PathVisual,brush:yfiles.system.Brush,pen:yfiles.system.Pen,matrix:yfiles.geometry.Matrix2D,fillMode:yfiles.drawing.FillMode,context:yfiles.canvas.ICanvasContext):void; + /** + * Creates a string representing an SVG path from this instance using the provided {@link yfiles.drawing.FillMode}. + * @param {yfiles.drawing.FillMode} fillMode The fill mode to apply. + * @return {string} A geometry that represents the current state of this instance. + */ + createGeometry(fillMode:yfiles.drawing.FillMode):string; + /** + * Creates the path data for this instance after applying the given matrix. + * @param {yfiles.geometry.Matrix2D} matrix The matrix to apply for the creation of the instance. + * @param {yfiles.drawing.FillMode} fillMode The fill mode to use. + * @return {string} The data that describes the current state of this instance after the matrix has been applied. + */ + createGeometryWithMatrix(matrix:yfiles.geometry.Matrix2D,fillMode:yfiles.drawing.FillMode):string; + /** + * Finds an intersection point between a line and this general path. + * The value returned will be the smallest positive value smaller than 1 such that the point depicted by + * lp1 + result * (lp2 - lp1) is an intersection point + * between the line and the path. + * @param {yfiles.geometry.PointD} lp1 The coordinates of the first point of the line. + * @param {yfiles.geometry.PointD} lp2 The coordinates of the second point of the line. + * @return {number} The factor to calculate the intersection point or double.PositiveInfinity. + */ + findLineIntersection(lp1:yfiles.geometry.PointD,lp2:yfiles.geometry.PointD):number; + /** + * Finds an intersection point between a line and this general path. + * The value returned will be the smallest positive value smaller than 1 such that the point depicted by + * lp1 + result * (lp2 - lp1) is an intersection point + * between the line and the path. + * @param {yfiles.geometry.PointD} lp1 The coordinates of the first point of the line. + * @param {yfiles.geometry.PointD} lp2 The coordinates of the second point of the line. + * @param {number} eps The value to use for interpolating B�zier curves. + * @return {number} The factor to calculate the intersection point or double.PositiveInfinity. + */ + findEpsLineIntersection(lp1:yfiles.geometry.PointD,lp2:yfiles.geometry.PointD,eps:number):number; + /** + * Returns whether this path contains elements other than an initial MOVE_TO. + * @return {boolean} Whether the path contains visible parts. + */ + isEmpty():boolean; + /** + * Returns whether the path contains visible parts. + * @return {boolean} + */ + isVisible():boolean; + /** + * Appends a {@link yfiles.drawing.PathType#MOVE_TO} operation to the path elements. + * This moves the pen to a new position without drawing a line. + * @param {number} x The next x coordinate. + * @param {number} y The next y coordinate. + */ + moveToValues(x:number,y:number):void; + /** + * Appends a {@link yfiles.drawing.PathType#MOVE_TO} operation to the path elements. + * This moves the pen to a new position without drawing a line. + * @param {yfiles.geometry.IPoint} point The next coordinate. + */ + moveToPoint(point:yfiles.geometry.IPoint):void; + /** + * Appends a {@link yfiles.drawing.PathType#MOVE_TO} operation to the path elements. + * This moves the pen to a new position without drawing a line. + * @param {yfiles.geometry.PointD} point The next coordinate. + */ + moveTo(point:yfiles.geometry.PointD):void; + /** + * Appends a rectangle to this path instance. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle to get the coordinates from. + * @param {boolean} connect Whether to use a {@link yfiles.drawing.GeneralPath#lineToPoint} to the upper left corner. + */ + appendRectangle(rectangle:yfiles.geometry.IRectangle,connect:boolean):void; + /** + * Appends an oriented rectangle to this path instance. + * @param {yfiles.geometry.IOrientedRectangle} rectangle The oriented rectangle to get the coordinates from. + * @param {boolean} connect Whether to use a {@link yfiles.drawing.GeneralPath#lineToPoint} to the anchor corner. + */ + appendOrientedRectangle(rectangle:yfiles.geometry.IOrientedRectangle,connect:boolean):void; + /** + * Appends the contents of the given path to this path. + * If connect is true, an initial + * {@link yfiles.drawing.PathType#MOVE_TO} in other + * will be transformed into a {@link yfiles.drawing.PathType#LINE_TO}. + * @param {yfiles.drawing.GeneralPath} other The path to append to this path. + * @param {boolean} connect Whether to connect the path to the end of this path. + */ + append(other:yfiles.drawing.GeneralPath,connect:boolean):void; + /** + * Adds the contents of the given path to the beginning of this path. + * If connect is true, the initial + * {@link yfiles.drawing.PathType#MOVE_TO} in this + * will be transformed into a {@link yfiles.drawing.PathType#LINE_TO}. + * @param {yfiles.drawing.GeneralPath} other The path to append to this path. + * @param {boolean} connect Whether to connect the path to the end of this path. + */ + prepend(other:yfiles.drawing.GeneralPath,connect:boolean):void; + /** + * Appends parts of the contents of the given path to this path. + * If connect is true, an initial + * {@link yfiles.drawing.PathType#MOVE_TO} in other + * will be transformed into a {@link yfiles.drawing.PathType#LINE_TO}. + * @param {yfiles.drawing.GeneralPath} other The path to append to this path. + * @param {boolean} connect Whether to connect the path to the end of this path. + * @param {number} beginIndex The first element to be copied from other, inclusively. + * @param {number} endIndex The last element to be copied from other, exclusively. + */ + appendAt(other:yfiles.drawing.GeneralPath,beginIndex:number,endIndex:number,connect:boolean):void; + /** + * Gets the number of {@link yfiles.drawing.PathType} operations stored in this instance. + */ + length:number; + /** + * Appends a {@link yfiles.drawing.PathType#LINE_TO} operation to the path elements. + * This draws a line from the current end point to the given position. + * @param {number} x The x coordinate of the line's end point. + * @param {number} y The y coordinate of the line's end point. + */ + lineToValues(x:number,y:number):void; + /** + * Appends a {@link yfiles.drawing.PathType#LINE_TO} operation to the path elements. + * This draws a line from the current end point to the given position. + * @param {yfiles.geometry.IPoint} p The coordinates of the line's end point. + */ + lineToPoint(p:yfiles.geometry.IPoint):void; + /** + * Appends a {@link yfiles.drawing.PathType#LINE_TO} operation to the path elements. + * This draws a line from the current end point to the given position. + * @param {yfiles.geometry.PointD} p The coordinates of the line's end point. + */ + lineTo(p:yfiles.geometry.PointD):void; + /** + * Appends a {@link yfiles.drawing.PathType#QUAD_TO quadratic B�zier curve} to the path elements. + * This draws a quadratic B�zier curve from the current end point to the given position using + * the given control point. + * @param {number} cx The x coordinate of the B�zier control point. + * @param {number} cy The y coordinate of the B�zier control point. + * @param {number} x The x coordinate of the curve's end point. + * @param {number} y The y coordinate of the curve's end point. + */ + quadToValues(cx:number,cy:number,x:number,y:number):void; + /** + * Appends a {@link yfiles.drawing.PathType#QUAD_TO quadratic B�zier curve} to the path elements. + * This draws a quadratic B�zier curve from the current end point to the given position using + * the given control point. + * @param {yfiles.geometry.IPoint} center The coordinates of the B�zier control point. + * @param {yfiles.geometry.IPoint} p The coordinates of the curve's end point. + */ + quadToPoints(center:yfiles.geometry.IPoint,p:yfiles.geometry.IPoint):void; + /** + * Appends a {@link yfiles.drawing.PathType#QUAD_TO quadratic B�zier curve} to the path elements. + * This draws a quadratic B�zier curve from the current end point to the given position using + * the given control point. + * @param {yfiles.geometry.PointD} center The coordinates of the B�zier control point. + * @param {yfiles.geometry.PointD} p The coordinates of the curve's end point. + */ + quadTo(center:yfiles.geometry.PointD,p:yfiles.geometry.PointD):void; + /** + * Creates a new path from this instance flattening all B�zier curves using the given + * epsilon. + * This will create a path that consists of {@link yfiles.drawing.PathType#MOVE_TO}, {@link yfiles.drawing.PathType#LINE_TO}, + * and {@link yfiles.drawing.PathType#CLOSE} operations only. + * @param {number} eps The maximum value the flattened path may diverge from the original path for the + * B�zier curve line interpolations. + * @return {yfiles.drawing.GeneralPath} A new path that does not contain B�zier curves. + */ + flatten(eps:number):yfiles.drawing.GeneralPath; + /** + * Appends a {@link yfiles.drawing.PathType#CUBIC_TO cubic B�zier curve} to the path elements. + * This draws a cubic B�zier curve from the current end point to the given position using + * the two given control points. + * @param {number} c1x The x coordinate of the first B�zier control point. + * @param {number} c1y The y coordinate of the first B�zier control point. + * @param {number} c2x The x coordinate of the second B�zier control point. + * @param {number} c2y The y coordinate of the second B�zier control point. + * @param {number} x The x coordinate of the curve's end point. + * @param {number} y The y coordinate of the curve's end point. + */ + cubicToValues(c1x:number,c1y:number,c2x:number,c2y:number,x:number,y:number):void; + /** + * Appends a {@link yfiles.drawing.PathType#CUBIC_TO cubic B�zier curve} to the path elements. + * This draws a cubic B�zier curve from the current end point to the given position using + * the two given control points. + * @param {yfiles.geometry.PointD} c1 The coordinates of the first B�zier control point. + * @param {yfiles.geometry.PointD} c2 The coordinates of the second B�zier control point. + * @param {yfiles.geometry.PointD} p The coordinates of the curve's end point. + */ + cubicTo(c1:yfiles.geometry.PointD,c2:yfiles.geometry.PointD,p:yfiles.geometry.PointD):void; + /** + * Appends a {@link yfiles.drawing.PathType#CUBIC_TO cubic B�zier curve} to the path elements. + * This draws a cubic B�zier curve from the current end point to the given position using + * the two given control points. + * @param {yfiles.geometry.IPoint} c1 The coordinates of the first B�zier control point. + * @param {yfiles.geometry.IPoint} c2 The coordinates of the second B�zier control point. + * @param {yfiles.geometry.IPoint} p The coordinates of the curve's end point. + */ + cubicToPoints(c1:yfiles.geometry.IPoint,c2:yfiles.geometry.IPoint,p:yfiles.geometry.IPoint):void; + /** + * Appends a {@link yfiles.drawing.PathType#CLOSE} operation to the path elements, creating a line + * to the last {@link yfiles.drawing.PathType#MOVE_TO} position. + * This draws a line from the current end point to the last {@link yfiles.drawing.GeneralPath#moveToValues} position, + * closing the current sub path. + */ + close():void; + /** + * Creates a cursor for iterating over the elements of this path. + * The cursor is fail-fast, i.e. if the path's structure is modified after the construction + * of the cursor any cursor operation will fail. + * @return {yfiles.drawing.GeneralPath.PathCursor} A cursor to iterate over this path. + */ + createCursor():yfiles.drawing.GeneralPath.PathCursor; + /** + * Ensures that this path can contain coords more coordinates and an additional + * type. + * This enlarges the internal data structures appropriately if needed. + * @param {number} coords The number of coordinates to hold for the next type to be added. + */ + ensureCapacity(coords:number):void; + /** + * Resets this path to be an empty path. + */ + clear():void; + /** + * Creates a {@link SVGPathElement svg path} from the current path using the given transform. + * @param {yfiles.geometry.Matrix2D} transform The transform that is applied to the path points. + * @return {yfiles.drawing.PathVisual} A {@link SVGPathElement} instance that can be used to render this path to a + * {@link SVGSVGElement svg element}. + */ + createPathVisual(transform:yfiles.geometry.Matrix2D):yfiles.drawing.PathVisual; + /** + * Gets a point on this path instance at the given ratio. + * Note that this implementation still treats B�zier curves as linear segments. + * @param {number} ratio A value between 0 and 1 inclusively that indicates a ratio from + * the beginning to the end of this path. + * @return {yfiles.geometry.PointD} The coordinates of the point. + */ + getPoint(ratio:number):yfiles.geometry.PointD; + /** + * Gets a point and the tangent on this path instance at the given ratio. + * Note that this implementation still treats B�zier curves as linear segments. + * @param {number} ratio A value between 0 and 1 inclusively that indicates a ratio from + * the beginning to the end of this path. + * @param {yfiles.geometry.PointD} p The value to place the coordinates of the point in. + * @param {yfiles.geometry.PointD} tangent The value to place the coordinates of the tangent vector at the point in. + */ + getTangent(ratio:number,p:{value:yfiles.geometry.PointD;},tangent:{value:yfiles.geometry.PointD;}):boolean; + /** + * Gets a point and the tangent on this path instance at the segment and segment ratio. + * Note that this implementation still treats B�zier curves as linear segments. + * Also note that the tangent vector may not be normalized. + * @param {number} ratio A value between 0 and 1 inclusively that indicates a ratio from + * the beginning to the end of the segment at segmentIndex for this path. + * @param {number} segmentIndex The segment index to determine a point at. + * @param {yfiles.geometry.PointD} p The value to place the coordinates of the point in. + * @param {yfiles.geometry.PointD} tangent The value to place the coordinates of the tangent vector at the point in. + */ + getSegmentTangent(segmentIndex:number,ratio:number,p:{value:yfiles.geometry.PointD;},tangent:{value:yfiles.geometry.PointD;}):boolean; + /** + * Gets the number of segments in this path, i.e. the number of {@link yfiles.drawing.PathType#LINE_TO} and + * {@link yfiles.drawing.PathType#CLOSE} operations. + * @return {number} The number of segments. + */ + getSegmentCount():number; + /** + * Returns the geometric length of this path. + * Note that B�zier curves are still treated as line segments. + * @return {number} The length of this path. + */ + getLength():number; + /** + * Gets the bounds of a flattened version the path. + * @param {number} eps The epsilon to use for the flattening operation. + * @return {yfiles.geometry.RectD} The bounds of the flattened path. + */ + getEpsBounds(eps:number):yfiles.geometry.RectD; + /** + * Calculates the bounds of this path and returns it. + * This will not yield tight bounds if the path contains B�zier curves. + * The bounds are calculated using the union of all points and control points contained in this path. + * @return {yfiles.geometry.RectD} A rectangle that describes the geometric bounds of this path. + * @see {@link yfiles.drawing.GeneralPath#getEpsBounds} + */ + getBounds():yfiles.geometry.RectD; + /** + * Checks whether the point lies inside the area that is described by this path instance. + * Note that this will only work as expected for closed paths. + * @param {yfiles.geometry.PointD} p The coordinates of the point to test. + * @return {boolean} Whether the point lies within the area described by this path. + */ + areaContains(p:yfiles.geometry.PointD):boolean; + /** + * Checks whether the point lies inside the area that is described by this path instance. + * Note that this will only work as expected for closed paths. + * @param {yfiles.geometry.IPoint} p The coordinates of the point to test. + * @return {boolean} Whether the point lies within the area described by this path. + */ + areaContainsPoint(p:yfiles.geometry.IPoint):boolean; + /** + * Checks whether the point lies inside the area that is described by this path instance. + * Note that this will only work as expected for closed paths. + * The epsilon is used for internally flattening B�zier curves. + * @param {yfiles.geometry.PointD} p The coordinates of the point to test. + * @param {number} eps The value to use for flattening B�zier curves during the test. + * @return {boolean} Whether the point lies within the area described by this path. + */ + areaEpsContains(p:yfiles.geometry.PointD,eps:number):boolean; + /** + * Tests whether the line of the path is hit at the given point using an epsilon + * for fuzzy hit testing. + * @param {yfiles.geometry.PointD} p The p coordinates of the point to test. + * @param {number} eps The allowed distance from the point to the path that is considered a hit. + * @return {boolean} Whether the point hits the path. + */ + pathContains(p:yfiles.geometry.PointD,eps:number):boolean; + /** + * Crops the path after the position indicated by the cursor. + * This will remove all path operations that follow the position indicated by the cursor. + * @param {yfiles.drawing.GeneralPath.PathCursor} cursor The cursor that depicts a position in this path. + */ + cropAfter(cursor:yfiles.drawing.GeneralPath.PathCursor):void; + /** + * Compresses the internal data structures so that the amount of memory + * used by this instance is minimal with respect to the information stored in it. + */ + compress():void; + /** + * Crops the path before the position indicated by the cursor. + * This will remove all path operations that precede the position indicated by the cursor. + * @param {yfiles.drawing.GeneralPath.PathCursor} cursor The cursor that depicts a position in this path. + */ + cropBefore(cursor:yfiles.drawing.GeneralPath.PathCursor):void; + /** + * Checks whether this path intersects the given rectangle. + * This will yield false if the rectangle is fully contained within the area + * of the path. + * @param {yfiles.geometry.RectD} rect The rectangle to test. + * @param {number} eps The epsilon to use for fuzzy testing. + * @return {boolean} Whether the path described by this instance intersects the rectangle. + */ + intersects(rect:yfiles.geometry.RectD,eps:number):boolean; + /** + * Performs a quick test to decide whether this path might intersect the + * clipping rectangle, provided the path would be painted using stroke of the given width. + * This method will return false if the clip is entirely inside the area of this path. + * @param {yfiles.geometry.RectD} clip The clip to check for intersection. + * @param {number} width The width of the stroke. + * @return {boolean} false if it is guaranteed that this instance would not intersect the given clip. + */ + mayIntersectClip(clip:yfiles.geometry.RectD,width:number):boolean; + /** + * Creates a new GeneralPath that is a copy of this path with all geometry transformed + * using the supplied matrix. + * @param {yfiles.geometry.Matrix2D} transform The matrix to multiply the geometry with. + * @return {yfiles.drawing.GeneralPath} A new path. + */ + createGeneralPath(transform:yfiles.geometry.Matrix2D):yfiles.drawing.GeneralPath; + /** + * Transforms this general path in place using the given transform. + * @param {yfiles.geometry.Matrix2D} transform The matrix to multiply the geometry with. + */ + transform(transform:yfiles.geometry.Matrix2D):void; + /** + * Appends an ellipse using the given bounding box to this instance. + * @param {yfiles.geometry.IRectangle} bounds The bounds of the ellipse. + * @param {boolean} connect Whether to initially {@link yfiles.drawing.GeneralPath#lineToPoint} the ellipses lowest point. + */ + appendEllipse(bounds:yfiles.geometry.IRectangle,connect:boolean):void; + /** + * Creates a clone of this instance, copying the path information to the new instance. + * @return {Object} An exact clone of this instance. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + export module GeneralPath{ + /** + * A class that is used by {@link yfiles.drawing.GeneralPath} to iterate over the elements + * the path is made up of. + * @see {@link yfiles.drawing.GeneralPath#createCursor} + */ + export interface PathCursor extends Object{ + /** + * Advances the cursor to the next position if possible. + * @return {boolean} Whether the cursor has been moved successfully. false if the cursor + * has been moved beyond the end of the path. + */ + moveNext():boolean; + /** + * Reset the cursor to point to the beginning of the path. + */ + reset():void; + /** + * Resets the cursor to point to the last element in the path. + * @return {boolean} Whether the cursor has been moved successfully. + */ + toLast():boolean; + /** + * Returns the current position of the cursor. + */ + index:number; + /** + * Moves the cursor to the previous position in the path. + * @return {boolean} Whether the move was successful. + */ + movePrevious():boolean; + /** + * Returns the type of the path at the position of the cursor. + * @return {yfiles.drawing.PathType} The type. + */ + getPathType():yfiles.drawing.PathType; + /** + * Places the coordinates for the current type into the given array. + * The array needs to have a length of at least 6, since {@link yfiles.drawing.PathType#CUBIC_TO} + * needs six coordinates. If the path has been flattened a length of two suffices. + * @return {yfiles.drawing.PathType} The current type of the path element. + * @see {@link yfiles.drawing.GeneralPath.PathCursor#getCurrentEndPointValueArray} + */ + getCurrent(coordinates:number[]):yfiles.drawing.PathType; + /** + * Returns the current x coordinate of the last path element. + * @return {number} The x coordinate or 0 if the element is of type {@link yfiles.drawing.PathType#CLOSE}. + */ + getCurrentEndPointX():number; + /** + * Gets the current end point of the last path element. + * Value: The current end point. + */ + currentEndPoint:yfiles.geometry.PointD; + /** + * Returns the current y coordinate of the last path element. + * @return {number} The y coordinate or 0 if the element is of type {@link yfiles.drawing.PathType#CLOSE}. + */ + getCurrentEndPointY():number; + /** + * Places the current end coordinates of the last path element into the array. + * @param {number[]} coordinates An array with length at least 2. + * @return {yfiles.drawing.PathType} The type of the current element. + */ + getCurrentEndPointValueArray(coordinates:number[]):yfiles.drawing.PathType; + /** + * Places the current end coordinates into the out parameters. + * @param {number} x The x coordinate of the current end point. + * @param {number} y The y coordinate of the current end point. + * @return {yfiles.drawing.PathType} The type of the current element. + */ + getCurrentEndPointValues(x:{value:number;},y:{value:number;}):yfiles.drawing.PathType; + /** + * Places the current end coordinates into the out parameters. + * @param {number} x The x coordinate of the current end point. + * @param {number} y The y coordinate of the current end point. + * @return {yfiles.drawing.PathType} The type of the current element. + */ + getCurrentEndPointSValues(x:{value:number;},y:{value:number;}):yfiles.drawing.PathType; + /** + * Places the current end coordinates of the last path element into the array. + * @param {number[]} coordinates An array with length at least 2. + * @return {yfiles.drawing.PathType} The type of the current element. + */ + getCurrentEndPointWithCoordinatesSValueArray(coordinates:number[]):yfiles.drawing.PathType; + /** + * Places the coordinates for the current type into the given array. + * The array have a length of at least 6, since {@link yfiles.drawing.PathType#CUBIC_TO} + * needs six coordinates. If the path has been flattened. A length of two suffices. + * @return {yfiles.drawing.PathType} The current type of the path element. + * @see {@link yfiles.drawing.GeneralPath.PathCursor#getCurrentEndPointWithCoordinatesSValueArray} + */ + getCurrentSingles(coordinates:number[]):yfiles.drawing.PathType; + } + } + var GeneralPath:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with an initial capacity of 16 elements. + */ + new ():yfiles.drawing.GeneralPath; + /** + * Creates a new instance with given initial capacity. + * @param {number} capacity The number of elements for which storage will be allocated initially. + */ + WithCapacity:{ + new (capacity:number):yfiles.drawing.GeneralPath; + }; + }; + export enum GridStyle{ + /** + * For each grid point, there is a small dot rendered. + */ + DOTS, + /** + * For each grid point, there is a small cross rendered. + */ + CROSSES, + /** + * Draws horizontal and vertical lines through the grid points. + */ + LINES + } + /** + * Simple default implementation of {@link yfiles.drawing.IBoundsProvider} + * that returns a constant rectangle instance. + */ + export interface BoundsProvider extends Object,yfiles.drawing.IBoundsProvider{ + /** + * Returns the internal instance. + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + } + var BoundsProvider:{ + $class:yfiles.lang.Class; + /** + * An implementation that returns an IBoundsProvider that yields + * an "Empty" bounds. + */ + EMPTY:yfiles.drawing.IBoundsProvider; + /** + * An implementation that returns an IBoundsProvider that yields + * an "infinite"/unbound bounds. + */ + UNBOUND:yfiles.drawing.IBoundsProvider; + /** + * Creates an instance that return the given model as the bounds. + * @param {yfiles.geometry.IRectangle} rect the rectangle + */ + FromRectangle:{ + new (rect:yfiles.geometry.IRectangle):yfiles.drawing.BoundsProvider; + }; + /** + * Creates an instance that return the a bounding rectangle that uses + * the given . + * @param {yfiles.geometry.RectD} bounds The bounds to return. + */ + FromRectD:{ + new (bounds:yfiles.geometry.RectD):yfiles.drawing.BoundsProvider; + }; + }; + /** + * An implementation of {@link yfiles.drawing.DrawingTemplate} + * that renders a rectangle. + */ + export interface RectangleTemplate extends yfiles.drawing.DrawingTemplate{ + /** + * Creates the visual representation of this object. + * @param {yfiles.canvas.ICanvasContext} ctx The canvas context. + * @return {yfiles.drawing.ArrangeVisual} A {@link yfiles.drawing.ArrangeVisual} representing this object. + */ + loadContent(ctx:yfiles.canvas.ICanvasContext):yfiles.drawing.ArrangeVisual; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var RectangleTemplate:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.RectangleTemplate} class with a transparent fill and a black border. + */ + new ():yfiles.drawing.RectangleTemplate; + }; + /** + * Utility class that provides simple implementations of {@link yfiles.drawing.IVisibilityTest}. + */ + export interface VisibilityTest extends Object,yfiles.drawing.IVisibilityTest{ + /** + * Determines whether an element might intersect the visible region for a given context. + * Conservative implementations can always return true. + * @param {yfiles.geometry.RectD} clip The visible region clip. + * @param {yfiles.canvas.ICanvasContext} ctx The context to determine the visibility for. + * @return {boolean} false if and only if it is safe not to paint the element because + * it would not affect the given clipping region. + * @see Specified by {@link yfiles.drawing.IVisibilityTest#isVisible}. + */ + isVisible(clip:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + } + var VisibilityTest:{ + $class:yfiles.lang.Class; + /** + * An implementation of a {@link yfiles.drawing.IVisibilityTest} + * that always yields true. + */ + ALWAYS:yfiles.drawing.VisibilityTest; + /** + * An implementation of a {@link yfiles.drawing.IVisibilityTest} + * that always yields false. + */ + NEVER:yfiles.drawing.VisibilityTest; + /** + * Creates an implementation of a {@link yfiles.drawing.IVisibilityTest} + * that delegates to {@link yfiles.geometry.RectD#intersectsRectD}. + * Note that the rectangle is used by reference. + * @param {yfiles.geometry.IRectangle} rect The rectangle instance to use for the intersection test with the clip. + */ + createRectangleBasedTest(rect:yfiles.geometry.IRectangle):yfiles.drawing.IVisibilityTest; + }; + export enum PathType{ + /** + * The type that is used to move the pen to the next position. + * This type uses one coordinate pair. + */ + MOVE_TO, + /** + * The type that is used to add a line from the current position to the next position. + * This type uses one coordinate pair. + */ + LINE_TO, + /** + * The type that is used to add a quadratic B�zier curve from the current position + * to the next position using one control point. + * This type uses two coordinate pairs. + */ + QUAD_TO, + /** + * The type that is used to add a cubic B�zier curve from the current position + * to the next position using two intermediate control points. + * This type uses three coordinate pairs. + */ + CUBIC_TO, + /** + * The type that is used to add a line from the current position to the last + * {@link yfiles.drawing.PathType#MOVE_TO} position. + * This type uses no coordinate pair. + */ + CLOSE + } + /** + * A utility class that provides simple {@link yfiles.drawing.IHitTestable} implementations. + */ + export interface HitTestable extends Object{ + } + var HitTestable:{ + $class:yfiles.lang.Class; + /** + * Wrap a handler into an interface. + */ + create(handler:(location:yfiles.geometry.PointD,context:yfiles.canvas.ICanvasContext)=>boolean):yfiles.drawing.IHitTestable; + /** + * An IHitTestable that always returns false. + */ + NEVER:yfiles.drawing.IHitTestable; + /** + * An IHitTestable that always returns true. + */ + ALWAYS:yfiles.drawing.IHitTestable; + }; + /** + * Support class that allows to iterate over hits on table elements or subregions of table elements. + */ + export interface StripeHitTestEnumerator extends Object{ + /** + * Return the hit test order that is currently used by this instance. + */ + tableRenderingOrder:yfiles.drawing.TableRenderingOrder; + /** + * Return a collection of hits at location. + * This implementation returns the hits in the following order: + *
    + *
  • First all {@link yfiles.graph.IRow}s or {@link yfiles.graph.IColumn}s at the given location, in the order specified by the {@link yfiles.drawing.StripeHitTestEnumerator#tableRenderingOrder} property. + *
  • + *
  • + * For each stripe type, the stripes are returned in bottom up order, i.e. children are returned before their parents. + *
  • + *
  • For each stripe, the subregions are returned in the order {@link yfiles.graph.StripeSubregion#NEAR_BORDER}, {@link yfiles.graph.StripeSubregion#FAR_BORDER}, {@link yfiles.graph.StripeSubregion#LEADING_HEADER}, {@link yfiles.graph.StripeSubregion#TRAILING_HEADER},{@link yfiles.graph.StripeSubregion#STRIPE}, + * e.g. a header hit is always returned before a hit on the whole stripe.
  • + *
+ * @param {yfiles.canvas.ICanvasContext} context The canvas context to use. + * @param {yfiles.geometry.PointD} location The location in absolute coordinates. + * @param {yfiles.graph.INode} node The node where the table instance is currently bound to. + * @return {yfiles.collections.IEnumerable.} A collection of {@link yfiles.graph.StripeSubregionDescriptor}s at location + */ + enumerateHits(context:yfiles.canvas.ICanvasContext,location:yfiles.geometry.PointD,node:yfiles.graph.INode):yfiles.collections.IEnumerable; + } + var StripeHitTestEnumerator:{ + $class:yfiles.lang.Class; + /** + * Create a new instance for a specific table instance that use the order specified by tableRenderingOrder to determine the order of the hit test results. + * @param {yfiles.graph.ITable} table The table to use + * @param {yfiles.drawing.TableRenderingOrder} tableRenderingOrder The hit test order. This determines the order in which stripes are returned by {@link yfiles.drawing.StripeHitTestEnumerator#enumerateHits} + */ + new (table:yfiles.graph.ITable,tableRenderingOrder:yfiles.drawing.TableRenderingOrder):yfiles.drawing.StripeHitTestEnumerator; + }; + /** + * A simple {@link yfiles.drawing.ILabelStyleRenderer} implementation that can handle {@link yfiles.drawing.ISimpleLabelStyle} + * instances. + * This implementation will just draw the label's {@link yfiles.graph.ILabel#text} using the properties provided by + * {@link yfiles.drawing.ISimpleLabelStyle} into the label's {@link yfiles.graph.ILabel#layout} area. + */ + export interface SimpleLabelStyleRenderer extends yfiles.drawing.AbstractLabelStyleRenderer{ + /** + * Determines how the text should be aligned vertically within the assigned label bounds. + * @return {yfiles.system.VerticalAlignment} This value as obtained from the style. + */ + getVerticalAlignment():yfiles.system.VerticalAlignment; + /** + * Determines how the text should be aligned within the assigned label bounds. + * @return {yfiles.system.TextAlignment} This value as obtained from the style. + */ + getTextAlignment():yfiles.system.TextAlignment; + /** + * Determines whether text should be forced to be clipped inside the rectangle. + * @return {boolean} This value as obtained from the style. + */ + isClippingText():boolean; + /** + * Determines how the text should be trimmed to fit the assigned label bounds. + * @return {yfiles.system.StringTrimming} This value as obtained from the style. + */ + getTrimming():yfiles.system.StringTrimming; + /** + * Delegates to {@link yfiles.drawing.ISimpleLabelStyle#autoFlip}. + * @return {boolean} Whether to flip the drawing if it is upside down. + * @see Overrides {@link yfiles.drawing.AbstractLabelStyleRenderer#isAutoFlip} + */ + isAutoFlip():boolean; + /** + * The render support instance that is used for + * {@link yfiles.drawing.TextRenderSupport#getTextSize text size measurement} + * and {@link yfiles.drawing.TextRenderSupport#placeText text placement}. + */ + textRenderSupport:yfiles.drawing.TextRenderSupport; + /** + * Calculates the preferred size given the current state of the renderer. + * @return {yfiles.geometry.SizeD} The size as suggested by this renderer. + * @see Overrides {@link yfiles.drawing.AbstractLabelStyleRenderer#getPreferredSizeImpl} + */ + getPreferredSizeImpl():yfiles.geometry.SizeD; + /** + * This method is called by the framework to create a {@link yfiles.drawing.Visual} + * that will be included into the {@link yfiles.drawing.IRenderContext}. + * {@link yfiles.canvas.CanvasControl} uses this interface through the {@link yfiles.canvas.ICanvasObjectDescriptor} + * to populate the visual canvas object tree. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used. + * @return {yfiles.drawing.Visual} The visual to include in the canvas object visual tree. This may be null. + * @see {@link yfiles.drawing.IVisualCreator#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * This method updates or replaces a previously created {@link yfiles.drawing.Visual} for inclusion + * in the {@link yfiles.drawing.IRenderContext}. + * The {@link yfiles.canvas.CanvasControl} uses this method to give implementations a chance to + * update an existing Visual that has previously been created by the same instance during a call + * to {@link yfiles.drawing.IVisualCreator#createVisual}. Implementation may update the oldVisual + * and return that same reference, or create a new visual and return the new instance or null. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used in. + * @param {yfiles.drawing.Visual} oldVisual The visual instance that had been returned the last time the {@link yfiles.drawing.IVisualCreator#createVisual} + * method was called on this instance. + * @return {yfiles.drawing.Visual} oldVisual, if this instance modified the visual, or a new visual that should replace the + * existing one in the canvas object visual tree. + * @see {@link yfiles.drawing.IVisualCreator#createVisual} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasControl} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + } + var SimpleLabelStyleRenderer:{ + $class:yfiles.lang.Class; + /** + * Creates a new default instance. + */ + new ():yfiles.drawing.SimpleLabelStyleRenderer; + }; + /** + * An {@link yfiles.drawing.IStyleRenderer} that can handle {@link yfiles.drawing.IIconLabelStyle} + * instances. + * This implementation paints the label's inner style and an icon. + */ + export interface IconLabelStyleRenderer extends yfiles.drawing.AbstractStyleRenderer,yfiles.drawing.ILabelStyleRenderer{ + /** + * This method is called by the framework to create a {@link yfiles.drawing.Visual} + * that will be included into the {@link yfiles.drawing.IRenderContext}. + * {@link yfiles.canvas.CanvasControl} uses this interface through the {@link yfiles.canvas.ICanvasObjectDescriptor} + * to populate the visual canvas object tree. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used. + * @return {yfiles.drawing.Visual} The visual to include in the canvas object visual tree. This may be null. + * @see {@link yfiles.drawing.IVisualCreator#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * Gets the size of the icon from the {@link yfiles.drawing.IIconLabelStyle#iconSize} property. + * @return {yfiles.geometry.SizeD} The size to use for the icon. + */ + getIconSize():yfiles.geometry.SizeD; + /** + * This method updates or replaces a previously created {@link yfiles.drawing.Visual} for inclusion + * in the {@link yfiles.drawing.IRenderContext}. + * The {@link yfiles.canvas.CanvasControl} uses this method to give implementations a chance to + * update an existing Visual that has previously been created by the same instance during a call + * to {@link yfiles.drawing.IVisualCreator#createVisual}. Implementation may update the oldVisual + * and return that same reference, or create a new visual and return the new instance or null. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used in. + * @param {yfiles.drawing.Visual} oldVisual The visual instance that had been returned the last time the {@link yfiles.drawing.IVisualCreator#createVisual} + * method was called on this instance. + * @return {yfiles.drawing.Visual} oldVisual, if this instance modified the visual, or a new visual that should replace the + * existing one in the canvas object visual tree. + * @see {@link yfiles.drawing.IVisualCreator#createVisual} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasControl} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Determines if something has been hit at the given coordinates + * in the world coordinate system. + * Implementations should inspect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * and take the value into account when performing hit tests. + * This allows the user to hit elements even if the zoom level is very + * small and allows for accurate hit tests at greater zoom levels. + * @param {yfiles.geometry.PointD} p the coordinates in world coordinate system + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * This callback returns true if the corresponding + * item is considered to intersect the given rectangular box. + * This method may return false if the item cannot be + * selected using a selection marquee or optionally if the + * item is only partially contained within the box. + * Implementations should respect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * if marquee selections should behave differently on different zoom levels. + * @param {yfiles.geometry.RectD} box the box describing the marquee's bounds + * @param {yfiles.canvas.ICanvasContext} ctx the current canvas context + * @return {boolean} true if the item is considered to be captured by the marquee + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns a tight rectangular area where the whole rendering + * would fit into. + * If calculating the bounds is too expensive or the painting is not + * bound to a certain area, this method may return {@link yfiles.geometry.RectD#INFINITE}. + * If nothing is painted, this method should return an empty rectangle, where + * either or both the width and height is non-positive or + * {@link yfiles.geometry.RectD#EMPTY}. + * @param {yfiles.canvas.ICanvasContext} ctx the context to calculate the bounds for + * @return {yfiles.geometry.RectD} the bounds or {@link yfiles.geometry.RectD#EMPTY} to indicate an unbound area + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Factory method for the StyleDescriptor property. This method will be called + * upon first access to the {@link yfiles.drawing.AbstractStyleRenderer#styleDescriptor} property. + * @return {yfiles.canvas.ICanvasObjectDescriptor} an ICanvasObjectDescriptor instance that will delegate to this instance's methods + */ + createStyleDescriptor():yfiles.canvas.ICanvasObjectDescriptor; + /** + * Prepares this instance for subsequent calls after the + * style and item have been initialized. + * Upon invocation the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} fields have + * been populated by the {@link yfiles.drawing.AbstractStyleRenderer#getVisualCreator}, + * {@link yfiles.drawing.AbstractStyleRenderer#getBoundsProvider}, {@link yfiles.drawing.AbstractStyleRenderer#getHitTestable}, or + * {@link yfiles.drawing.AbstractStyleRenderer#getMarqueeTestable} methods. + */ + configure():void; + /** + * Retrieves the {@link yfiles.drawing.IIconLabelStyle#innerStyle} from the + * {@link yfiles.drawing.AbstractStyleRenderer#style}. + * @return {yfiles.drawing.ILabelStyle} The style. + */ + getInnerStyle():yfiles.drawing.ILabelStyle; + /** + * Retrieves the {@link yfiles.drawing.IIconLabelStyle#icon} from the + * {@link yfiles.drawing.AbstractStyleRenderer#style}. + * @return {yfiles.drawing.ImageSource} The icon. + */ + getIcon():yfiles.drawing.ImageSource; + /** + * Retrieves the {@link yfiles.drawing.IIconLabelStyle#innerStyleInsets} from the + * {@link yfiles.drawing.AbstractStyleRenderer#style}. + * @return {yfiles.geometry.InsetsD} The insets. + */ + getInnerStyleInsets():yfiles.geometry.InsetsD; + /** + * Retrieves the {@link yfiles.drawing.IIconLabelStyle#autoFlip} property from the + * {@link yfiles.drawing.AbstractStyleRenderer#style}. + * @return {boolean} The autoflip property value. + */ + isAutoFlip():boolean; + /** + * Retrieves the {@link yfiles.drawing.IIconLabelStyle#iconPlacement} from the + * {@link yfiles.drawing.AbstractStyleRenderer#style}. + * @return {yfiles.graph.ILabelModelParameter} The placement parameter. + */ + getIconPlacement():yfiles.graph.ILabelModelParameter; + /** + * Returns whether the icon bounds should be considered for hit testing. + * @return {boolean} true + */ + shouldHitTestIcon():boolean; + /** + * Calculates the preferred size given the current state of the renderer. + * @return {yfiles.geometry.SizeD} The size as suggested by this renderer. + */ + getPreferredSizeImpl():yfiles.geometry.SizeD; + /** + * Calculates the {@link yfiles.graph.ILabel#preferredSize preferred size} + * of a given label using the associated style. + * @param {yfiles.graph.ILabel} label The label to determine the preferred size for + * @param {yfiles.drawing.ILabelStyle} style The style instance that uses this instance as its + * {@link yfiles.drawing.ILabelStyle#renderer} + * @return {yfiles.geometry.SizeD} A size that can be used as the {@link yfiles.graph.ILabel#preferredSize} + * if this renderer paints the label using the associated style. + * @see Specified by {@link yfiles.drawing.ILabelStyleRenderer#getPreferredSize}. + */ + getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle):yfiles.geometry.SizeD; + } + var IconLabelStyleRenderer:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this renderer. + */ + new ():yfiles.drawing.IconLabelStyleRenderer; + }; + /** + * A canonic implementation of {@link yfiles.drawing.ISimplePortStyle}. + */ + export interface SimplePortStyle extends Object,yfiles.drawing.ISimplePortStyle{ + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given port and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(port, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.IPortStyle#renderer}. + */ + renderer:yfiles.drawing.IPortStyleRenderer; + /** + * Gets the brush to paint the port representation. + * @see Specified by {@link yfiles.drawing.ISimplePortStyle#brush}. + */ + brush:yfiles.system.Brush; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.IPort):void; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var SimplePortStyle:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using a dark gray brush. + */ + new ():yfiles.drawing.SimplePortStyle; + /** + * Creates a new instance using the given brush. + */ + WithBrush:{ + new (brush:yfiles.system.Brush):yfiles.drawing.SimplePortStyle; + }; + /** + * Creates a new instance using the given brush and renderer. + */ + WithBrushAndRenderer:{ + new (brush:yfiles.system.Brush,renderer:yfiles.drawing.IPortStyleRenderer):yfiles.drawing.SimplePortStyle; + }; + }; + /** + * The default mutable implementation of the {@link yfiles.drawing.IIconLabelStyle} + * interface. + */ + export interface IconLabelStyle extends Object,yfiles.drawing.IIconLabelStyle{ + /** + * Gets the icon to paint for the label. + * Value: The icon. + * @see Specified by {@link yfiles.drawing.IIconLabelStyle#icon}. + */ + icon:yfiles.drawing.ImageSource; + /** + * Gets the size of the icon to paint for the label. + * Value: The icon. + * @see Specified by {@link yfiles.drawing.IIconLabelStyle#iconSize}. + */ + iconSize:yfiles.geometry.SizeD; + /** + * Gets the icon placement model parameter. + * All valid node label model parameters can be used. + * The label's {@link yfiles.graph.ILabel#layout} will be interpreted as the + * a node's layout and the icon will be placed relative to that layout as if it was + * a node's label. + * Value: The icon placement parameter. + * @see Specified by {@link yfiles.drawing.IIconLabelStyle#iconPlacement}. + */ + iconPlacement:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets the inner style to decorate. + * Value: The inner style to decorate. + * This style will be rendered before the icon and is responsible for rendering the + * {@link yfiles.graph.ILabel#text}, since {@link yfiles.drawing.IconLabelStyleRenderer} + * will only render the {@link yfiles.drawing.IconLabelStyle#icon}. + * @throws {yfiles.system.ArgumentNullException} value is null. + * @see Specified by {@link yfiles.drawing.IIconLabelStyle#innerStyle}. + */ + innerStyle:yfiles.drawing.ILabelStyle; + /** + * Gets or sets the insets that should be applied for the {@link yfiles.graph.ILabel#layout} of the {@link yfiles.drawing.IconLabelStyle#innerStyle inner style} + * rendering. + * Value: The insets for the inner style rendering. + * The {@link yfiles.drawing.IconLabelStyleRenderer#getPreferredSize} will take the preferred size of the {@link yfiles.drawing.IconLabelStyle#innerStyle}'s + * {@link yfiles.drawing.ILabelStyleRenderer} and add these insets to it. During the {@link yfiles.drawing.IVisualCreator rendering} + * these insets will be used to offset the rendering of the inner style. + * @see Specified by {@link yfiles.drawing.IIconLabelStyle#innerStyleInsets}. + */ + innerStyleInsets:yfiles.geometry.InsetsD; + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given label and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(label, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.ILabelStyle#renderer}. + */ + renderer:yfiles.drawing.ILabelStyleRenderer; + /** + * Gets a value indicating whether to automatically flip the rendering should the {@link yfiles.graph.ILabel#layout}'s + * {@link yfiles.geometry.IOrientedRectangle#upY up vector} point downwards. + * Value: true if this style should automatically flip the rendering so that it is never rendered upside down; otherwise, false. + * @see Specified by {@link yfiles.drawing.IIconLabelStyle#autoFlip}. + */ + autoFlip:boolean; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.ILabel):void; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var IconLabelStyle:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.IconLabelStyle} class + * using {@link yfiles.drawing.ExteriorLabelModel#WEST} for the label model parameter. + */ + new ():yfiles.drawing.IconLabelStyle; + /** + * Creates a new instance using the provided icon and placement. + * @param {yfiles.drawing.ImageSource} icon The icon to draw. + * @param {yfiles.geometry.SizeD} iconSize The size of the icon. + * @param {yfiles.graph.ILabelModelParameter} iconPlacement The placement of the icon. + */ + WithImageSizeAndParameter:{ + new (icon:yfiles.drawing.ImageSource,iconSize:yfiles.geometry.SizeD,iconPlacement:yfiles.graph.ILabelModelParameter):yfiles.drawing.IconLabelStyle; + }; + /** + * Creates a new instance using the provided icon placement and typeface. + * @param {yfiles.drawing.ImageSource} icon The icon to draw. + * @param {yfiles.geometry.SizeD} iconSize The size of the icon. + * @param {yfiles.graph.ILabelModelParameter} iconPlacement The placement of the icon. + * @param {yfiles.system.Typeface} font The typeface to use. + */ + WithImageSizeParameterAndTypeface:{ + new (icon:yfiles.drawing.ImageSource,iconSize:yfiles.geometry.SizeD,iconPlacement:yfiles.graph.ILabelModelParameter,font:yfiles.system.Typeface):yfiles.drawing.IconLabelStyle; + }; + /** + * Creates a new instance using the provided parameters. + */ + FromIconSizePlacementFontAndBrush:{ + new (icon:yfiles.drawing.ImageSource,iconSize:yfiles.geometry.SizeD,iconPlacement:yfiles.graph.ILabelModelParameter,font:yfiles.system.Typeface,brush:yfiles.system.Brush):yfiles.drawing.IconLabelStyle; + }; + /** + * Creates a new instance using the provided parameters. + * @throws {yfiles.system.ArgumentNullException} renderer, iconPlacement or innerStyle is null. + */ + FromRendererIconSizePlacementAndInnerStyle:{ + new (renderer:yfiles.drawing.ILabelStyleRenderer,icon:yfiles.drawing.ImageSource,iconSize:yfiles.geometry.SizeD,iconPlacement:yfiles.graph.ILabelModelParameter,innerStyle:yfiles.drawing.ILabelStyle):yfiles.drawing.IconLabelStyle; + }; + }; + /** + * Default implementation of the {@link yfiles.drawing.IShapeNodeStyle} interface. + */ + export interface ShapeNodeStyle extends Object,yfiles.drawing.IShapeNodeStyle{ + /** + * Gets the for this style. + * @see Specified by {@link yfiles.drawing.IShapeNodeStyle#pen}. + */ + pen:yfiles.system.Pen; + /** + * Gets the for this style. + * @see Specified by {@link yfiles.drawing.IShapeNodeStyle#brush}. + */ + brush:yfiles.system.Brush; + /** + * Gets the shape for this style. + * @see Specified by {@link yfiles.drawing.IShapeNodeStyle#shape}. + */ + shape:yfiles.drawing.ShapeNodeShape; + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given node and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(node, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.INodeStyle#renderer}. + */ + renderer:yfiles.drawing.INodeStyleRenderer; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.INode):void; + } + var ShapeNodeStyle:{ + $class:yfiles.lang.Class; + /** + * Create a new style instance with a default renderer implementation and + * default values for all parameters. + * This creates a style with {@link yfiles.drawing.ShapeNodeShape#RECTANGLE} shape, + * {@link yfiles.system.Pens#BLACK} drawing pen and {@link yfiles.system.Brushes#WHITE} brush. + */ + new ():yfiles.drawing.ShapeNodeStyle; + /** + * Create a new style instance with a default renderer implementation and + * the given values for all other parameters. + * @param {yfiles.system.Brush} brush The initial brush for this style + * @param {yfiles.system.Pen} pen The initial pen for this style + * @param {yfiles.drawing.ShapeNodeShape} shape The initial shape for this style + */ + WithShapePenAndBrush:{ + new (shape:yfiles.drawing.ShapeNodeShape,pen:yfiles.system.Pen,brush:yfiles.system.Brush):yfiles.drawing.ShapeNodeStyle; + }; + /** + * Create a new style instance with a custom renderer implementation and + * default values for all parameters. + * This creates a style with {@link yfiles.drawing.ShapeNodeShape#RECTANGLE} shape, + * {@link yfiles.system.Pens#BLACK} drawing pen and {@link yfiles.system.Brushes#WHITE} brush. + * @param {yfiles.drawing.ShapeNodeStyleRenderer} styleRenderer Custom renderer instance for this style. + */ + WithRenderer:{ + new (styleRenderer:yfiles.drawing.ShapeNodeStyleRenderer):yfiles.drawing.ShapeNodeStyle; + }; + /** + * Create a new style instance with a custom renderer implementation and + * the given values for all other parameters. + * @param {yfiles.system.Brush} brush The initial brush for this style + * @param {yfiles.system.Pen} pen The initial pen for this style + * @param {yfiles.drawing.ShapeNodeShape} shape The initial shape for this style + * @param {yfiles.drawing.ShapeNodeStyleRenderer} styleRenderer Custom renderer instance for this style. + */ + WithRendererShapePenAndBrush:{ + new (styleRenderer:yfiles.drawing.ShapeNodeStyleRenderer,shape:yfiles.drawing.ShapeNodeShape,pen:yfiles.system.Pen,brush:yfiles.system.Brush):yfiles.drawing.ShapeNodeStyle; + }; + }; + /** + * A label style that also holds an icon. + */ + export interface IIconLabelStyle extends Object,yfiles.drawing.ILabelStyle{ + /** + * Gets the icon to paint for the label. + * Value: The icon. + * @see Specified by {@link yfiles.drawing.IIconLabelStyle#icon}. + */ + icon:yfiles.drawing.ImageSource; + /** + * Gets the size of the icon to paint for the label. + * Value: The icon. + * @see Specified by {@link yfiles.drawing.IIconLabelStyle#iconSize}. + */ + iconSize:yfiles.geometry.SizeD; + /** + * Gets the icon placement model parameter. + * All valid node label model parameters can be used. + * The label's {@link yfiles.graph.ILabel#layout} will be interpreted as the + * a node's layout and the icon will be placed relative to that layout as if it was + * a node's label. + * Value: The icon placement parameter. + * @see Specified by {@link yfiles.drawing.IIconLabelStyle#iconPlacement}. + */ + iconPlacement:yfiles.graph.ILabelModelParameter; + /** + * Gets the inner style to decorate. + * This style will be rendered before the icon and is responsible for rendering the + * {@link yfiles.graph.ILabel#text}, since {@link yfiles.drawing.IconLabelStyleRenderer} + * will only render the {@link yfiles.drawing.IIconLabelStyle#icon}. + * Value: The inner style to decorate. + * @see Specified by {@link yfiles.drawing.IIconLabelStyle#innerStyle}. + */ + innerStyle:yfiles.drawing.ILabelStyle; + /** + * Gets the insets that should be applied for the {@link yfiles.graph.ILabel#layout} of the {@link yfiles.drawing.IIconLabelStyle#innerStyle inner style} + * rendering. + * The {@link yfiles.drawing.IconLabelStyleRenderer#getPreferredSize} will take the preferred size of the {@link yfiles.drawing.IIconLabelStyle#innerStyle}'s + * {@link yfiles.drawing.ILabelStyleRenderer} and add these insets to it. During the {@link yfiles.drawing.IVisualCreator rendering} + * these insets will be used to offset the rendering of the inner style. + * Value: The insets for the inner style rendering. + * @see Specified by {@link yfiles.drawing.IIconLabelStyle#innerStyleInsets}. + */ + innerStyleInsets:yfiles.geometry.InsetsD; + /** + * Gets a value indicating whether to automatically flip the rendering should the {@link yfiles.graph.ILabel#layout}'s + * {@link yfiles.geometry.IOrientedRectangle#upY up vector} point downwards. + * Value: true if this style should automatically flip the rendering so that it is never rendered upside down; otherwise, false. + * @see Specified by {@link yfiles.drawing.IIconLabelStyle#autoFlip}. + */ + autoFlip:boolean; + } + var IIconLabelStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The default mutable implementation of the {@link yfiles.drawing.ISimpleLabelStyle} + * interface. + */ + export interface SimpleLabelStyle extends Object,yfiles.drawing.ISimpleLabelStyle{ + /** + * Gets the brush to use for the background box of the label. + * Value: The background brush or null. + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#backgroundBrush}. + */ + backgroundBrush:yfiles.system.Brush; + /** + * Gets or sets the vertical text alignment to use if the label is assigned more space than needed. + * The default value is {@link yfiles.system.VerticalAlignment#TOP}. + * Value: The vertical text alignment. + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#verticalTextAlignment}. + */ + verticalTextAlignment:yfiles.system.VerticalAlignment; + /** + * Gets or sets the text alignment to use if the label is assigned more space than needed. + * The default value is {@link yfiles.system.TextAlignment#LEFT}. + * Value: The text alignment. + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#textAlignment}. + */ + textAlignment:yfiles.system.TextAlignment; + /** + * Gets a value that determines whether text should be clipped. + * @see {@link Object} + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#clipText}. + */ + clipText:boolean; + /** + * Gets the value that determines how to trim the text. + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#trimming}. + */ + trimming:yfiles.system.StringTrimming; + /** + * Gets the pen to use for the background box of the label. + * Value: The background pen or null. + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#backgroundPen}. + */ + backgroundPen:yfiles.system.Pen; + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given label and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(label, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.ILabelStyle#renderer}. + */ + renderer:yfiles.drawing.ILabelStyleRenderer; + /** + * Gets the typeface to use for the label. + * Value: The typeface. + * @see {@link Object} + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#typeface}. + */ + typeface:yfiles.system.Typeface; + /** + * Gets a value indicating whether the label should be flipped 180 degrees + * automatically, if it would be oriented downwards, otherwise. + * Value: + * true if the label should be flipped automatically otherwise, false. + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#autoFlip}. + */ + autoFlip:boolean; + /** + * Gets the brush to use for the label's text. + * Value: The font brush or null. + * @see Specified by {@link yfiles.drawing.ISimpleLabelStyle#textBrush}. + */ + textBrush:yfiles.system.Brush; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.ILabel):void; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var SimpleLabelStyle:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the default system typeface and a black brush. + */ + new ():yfiles.drawing.SimpleLabelStyle; + /** + * Creates a new instance using a black brush. + */ + WithFont:{ + new (font:yfiles.system.Typeface):yfiles.drawing.SimpleLabelStyle; + }; + /** + * Creates a new instance using a black brush and the given typeface and size. + */ + WithFontAndSize:{ + new (font:yfiles.system.Typeface,size:number):yfiles.drawing.SimpleLabelStyle; + }; + /** + * Creates a new instance using the provided typeface and brush. + */ + WithFontAndBrush:{ + new (font:yfiles.system.Typeface,brush:yfiles.system.Brush):yfiles.drawing.SimpleLabelStyle; + }; + /** + * Creates a new instance using the given brush, typeface, and size. + */ + WithFontSizeAndBrush:{ + new (font:yfiles.system.Typeface,size:number,brush:yfiles.system.Brush):yfiles.drawing.SimpleLabelStyle; + }; + /** + * Creates a new instance using the provided typeface and brush. + */ + WithRendererFontAndBrush:{ + new (renderer:yfiles.drawing.ILabelStyleRenderer,font:yfiles.system.Typeface,fontBrush:yfiles.system.Brush):yfiles.drawing.SimpleLabelStyle; + }; + /** + * Creates a new instance using the given renderer, brush, typeface, and size. + */ + WithRendererFontSizeAndBrush:{ + new (renderer:yfiles.drawing.ILabelStyleRenderer,font:yfiles.system.Typeface,size:number,fontBrush:yfiles.system.Brush):yfiles.drawing.SimpleLabelStyle; + }; + }; + /** + * Simple mutable implementation of the {@link yfiles.drawing.IArcEdgeStyle} interface. + */ + export interface ArcEdgeStyle extends yfiles.drawing.AbstractEdgeStyle,yfiles.drawing.IArcEdgeStyle{ + /** + * Gets the that is used to draw the arc. + * @see Specified by {@link yfiles.drawing.IArcEdgeStyle#pen}. + */ + pen:yfiles.system.Pen; + /** + * Gets the "height" of the arc. + * Depending on the setting of {@link yfiles.drawing.IArcEdgeStyle#ratio}, this value is interpreted differently: + * If Ratio is enabled, the height of the arc will depend on it's width. + * The width will be multiplied by this value to obtain the height. + * If the Ratio feature is disabled, this value will be interpreted as the + * absolute height. + * Value: The height of the arc, either relative or absolute. + * @see Specified by {@link yfiles.drawing.IArcEdgeStyle#height}. + */ + height:number; + /** + * Gets a value indicating whether this {@link yfiles.drawing.IArcEdgeStyle} interprets + * the {@link yfiles.drawing.IArcEdgeStyle#height} value as an absolute or relative value. + * Value: + * true if the height value should be interpreted as a relative value, otherwise, false. + * @see {@link yfiles.drawing.IArcEdgeStyle#height} + * @see Specified by {@link yfiles.drawing.IArcEdgeStyle#ratio}. + */ + ratio:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.drawing.ArcEdgeStyleRenderer} should provide an {@link yfiles.input.IHandle} + * if queried for the {@link yfiles.input.IHandleProvider} implementation that allows for adjusting the {@link yfiles.drawing.ArcEdgeStyle#height} + * of this instance. + * Value: true(which is the default) if a handle should be provided; otherwise, false. + */ + provideHeightHandle:boolean; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.IEdge):void; + } + var ArcEdgeStyle:{ + $class:yfiles.lang.Class; + /** + * Create a new style instance with default settings. + * Default value for {@link yfiles.drawing.ArcEdgeStyle#pen} is {@link yfiles.system.Pens#BLACK}, for + * {@link yfiles.drawing.ArcEdgeStyle#height} is 0 + */ + new ():yfiles.drawing.ArcEdgeStyle; + /** + * Create a new style instance with a custom renderer implementation and default pen and height parameters. + * Default value for {@link yfiles.drawing.ArcEdgeStyle#pen} is {@link yfiles.system.Pens#BLACK}, for + * {@link yfiles.drawing.ArcEdgeStyle#height} is 0 + * @param {yfiles.drawing.ArcEdgeStyleRenderer} styleRenderer The custom renderer for this style instance + */ + WithRenderer:{ + new (styleRenderer:yfiles.drawing.ArcEdgeStyleRenderer):yfiles.drawing.ArcEdgeStyle; + }; + /** + * Create a new style instance with a default renderer implementation and given pen and height parameters. + * @param {yfiles.system.Pen} pen The pen that is used to draw the arc + * @param {number} height The initial height of the arc + */ + WithPenAndHeight:{ + new (pen:yfiles.system.Pen,height:number):yfiles.drawing.ArcEdgeStyle; + }; + /** + * Create a new style instance with a custom renderer implementation and given pen and height parameters. + * @param {yfiles.drawing.ArcEdgeStyleRenderer} styleRenderer The custom renderer for this style instance + * @param {yfiles.system.Pen} pen The pen that is used to draw the arc + * @param {number} height The initial height of the arc + */ + WithRendererPenAndHeight:{ + new (styleRenderer:yfiles.drawing.ArcEdgeStyleRenderer,pen:yfiles.system.Pen,height:number):yfiles.drawing.ArcEdgeStyle; + }; + }; + export enum DecorationZoomMode{ + /** + * The visual is rendered in the view coordinate space and doesn't scale + * with the zoom level. This is similar to the default node resize handles, + * for example. + */ + VIEW_COORDINATES, + /** + * The visual is rendered in the world coordinate space and scales with the + * zoom level like a regular graph item visualization, for example a node + * style. + */ + WORLD_COORDINATES, + /** + * Uses WorldCoordinates rendering for zoom level >= 1 and ViewCoordinates + * rendering for zoom level < 1. + */ + MIXED + } + /** + * Allows the use of an {@link yfiles.drawing.IEdgeStyle} to render the selection, + * highlight or focus indicator of edges. + * The {@link yfiles.drawing.EdgeStyleDecorationInstaller#zoomMode} property defines how the zoom level affects the + * rendering of the indicator. It can either scale according to the zoom + * level similar to regular graph items or have always to same thickness + * regardless of the zoom, similar to the default yFiles indicators. + *

+ * To use the {@link yfiles.drawing.DecorationZoomMode#VIEW_COORDINATES} zoom mode, the + * {@link yfiles.drawing.Visual} created by the edge style must be at least a . + *

+ * @see {@link yfiles.drawing.NodeStyleDecorationInstaller} + * @see {@link yfiles.drawing.LabelStyleDecorationInstaller} + */ + export interface EdgeStyleDecorationInstaller extends Object,yfiles.model.ISelectionInstaller,yfiles.input.IHighlightInstaller,yfiles.input.IFocusIndicatorInstaller{ + /** + * Specifies how the style is affected by the current zoom level. + * Changes of the value of this property are propagated to all styles + * created by this instance and become immediately visible. + */ + zoomMode:yfiles.drawing.DecorationZoomMode; + /** + * The style to use for the rendering. + * Changes of the value of this property are not propagated to + * already created styles. + */ + edgeStyle:yfiles.drawing.IEdgeStyle; + /** + * Installs a rendering for the item if it is an {@link yfiles.graph.IEdge}. + * @param {yfiles.model.IInstallerContext} context The context to use for the installation. + * @param {Object} item The item to install. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:Object):void; + } + var EdgeStyleDecorationInstaller:{ + $class:yfiles.lang.Class; + /** + * Create a new instance of this class. + */ + new ():yfiles.drawing.EdgeStyleDecorationInstaller; + }; + /** + * Default renderer implementation for {@link yfiles.drawing.IArcEdgeStyle}. + */ + export interface ArcEdgeStyleRenderer extends yfiles.drawing.PathBasedEdgeStyleRenderer{ + /** + * Prepares this instance for subsequent calls after the + * style and item have been initialized. + * Upon invocation the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} fields have + * been populated by the {@link yfiles.drawing.AbstractStyleRenderer#getVisualCreator}, + * {@link yfiles.drawing.AbstractStyleRenderer#getBoundsProvider}, {@link yfiles.drawing.AbstractStyleRenderer#getHitTestable}, or + * {@link yfiles.drawing.AbstractStyleRenderer#getMarqueeTestable} methods. + */ + configure():void; + /** + * Retrieves the {@link yfiles.drawing.IArcEdgeStyle#height} of the style. + * @return {number} the height. + */ + getHeight():number; + /** + * Overridden for performance reasons. + * @param {yfiles.geometry.RectD} clip + * @param {yfiles.canvas.ICanvasContext} ctx + * @return {boolean} + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#isVisible} + * @see Specified by {@link yfiles.drawing.IVisibilityTest#isVisible}. + */ + isVisible(clip:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Gets a value indicating whether this {@link yfiles.drawing.ArcEdgeStyleRenderer#getHeight} should be interpreted + * as an absolute or relative value. + * @return {boolean} + * true if the height value should be interpreted as a relative value, otherwise, false. + * @see {@link yfiles.drawing.ArcEdgeStyleRenderer#getHeight} + */ + isRatio():boolean; + /** + * Gets the pen to use for painting the path. + * @return {yfiles.system.Pen} The pen or null. + */ + getPen():yfiles.system.Pen; + /** + * Calculates the tangent on the edge's path at the given ratio point. + * The result is provided through the various out parameters. If the method returns false, no valid result could be calculated and + * the values of the out parameters should be ignored. + * @param {number} ratio a value in [0,1] where 0 is the source's end and 1 is at the target's end of the visible edge path + * @param {yfiles.geometry.PointD} p The coordinates in world-coordinate space that denotes the tangent point. + * @param {yfiles.geometry.PointD} tangent The vector which is tangent to the edge's path at the point denoted by p. The tangent vector + * needs not necessarily be normalized. + * @return {boolean} true if the values in the out parameters are valid, otherwise false + * @see Specified by {@link yfiles.drawing.IPathGeometry#getTangent}. + */ + getTangent(ratio:number,p:{value:yfiles.geometry.PointD;},tangent:{value:yfiles.geometry.PointD;}):boolean; + /** + * Calculates the tangent on the edge's path at the given ratio point for the given segment. + * The result is provided through the various out parameters. If the method returns false, no valid result could be calculated and + * the values of the out parameters should be ignored. + * @param {number} segmentIndex the segment to use for the calculation + * @param {number} ratio a value in [0,1] where 0 is the source's end and 1 is at the target's end of the segment + * @param {yfiles.geometry.PointD} p The coordinates in world-coordinate space that denote the tangent point. + * @param {yfiles.geometry.PointD} tangent The vector which is tangent to the edge's path at the point denoted by p. The tangent vector + * needs not necessarily be normalized. + * @return {boolean} true if the values in the out parameters are valid, otherwise false + * @see {@link yfiles.drawing.IPathGeometry#getTangent} + * @see {@link yfiles.drawing.IPathGeometry#getSegmentCount} + * @see Specified by {@link yfiles.drawing.IPathGeometry#getTangentForIndex}. + */ + getTangentForIndex(segmentIndex:number,ratio:number,p:{value:yfiles.geometry.PointD;},tangent:{value:yfiles.geometry.PointD;}):boolean; + /** + * Crops the edge's path at the nodes. + * This implementation uses the {@link yfiles.drawing.IEdgeIntersectionCalculator} instances + * found in the {@link yfiles.support.ILookup#lookup} of the source and target port + * of the edge to perform the actual cropping. + * @param {yfiles.drawing.GeneralPath} pathToCrop The path that should be cropped. + */ + cropPath(pathToCrop:{value:yfiles.drawing.GeneralPath;}):void; + /** + * Returns the number of "segments" this edge's path consists of. + * @return {number} the number of segments or -1 if there is no such thing as a segment for this edge. + * @see Specified by {@link yfiles.drawing.IPathGeometry#getSegmentCount}. + */ + getSegmentCount():number; + /** + * Overridden to return false since the flattening interferes + * with its own obstacles. + * @see Overrides {@link yfiles.drawing.PathBasedEdgeStyleRenderer#addBridges} + */ + addBridges:boolean; + /** + * This method should create the basic uncropped path given the control points. + * @return {yfiles.drawing.GeneralPath} A path that has to be cropped, yet. + */ + createPath():yfiles.drawing.GeneralPath; + /** + * Gets the target arrow from the style via {@link yfiles.drawing.IArrowOwner#targetArrow}. + * @return {yfiles.drawing.IArrow} The arrow to use. + * @see Overrides {@link yfiles.drawing.PathBasedEdgeStyleRenderer#getTargetArrow} + */ + getTargetArrow():yfiles.drawing.IArrow; + /** + * Gets the source arrow from the style via {@link yfiles.drawing.IArrowOwner#sourceArrow}. + * @return {yfiles.drawing.IArrow} The arrow to use. + * @see Overrides {@link yfiles.drawing.PathBasedEdgeStyleRenderer#getSourceArrow} + */ + getSourceArrow():yfiles.drawing.IArrow; + } + var ArcEdgeStyleRenderer:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.ArcEdgeStyleRenderer; + }; + /** + * A trivial implementation of a {@link yfiles.drawing.IPortStyleRenderer} + * that draws {@link yfiles.drawing.ISimplePortStyle} instances using a small colored circle. + */ + export interface SimplePortStyleRenderer extends yfiles.drawing.AbstractStyleRenderer,yfiles.drawing.IPortStyleRenderer{ + /** + * Determines if something has been hit at the given coordinates + * in the world coordinate system. + * Implementations should inspect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * and take the value into account when performing hit tests. + * This allows the user to hit elements even if the zoom level is very + * small and allows for accurate hit tests at greater zoom levels. + * @param {yfiles.geometry.PointD} p the coordinates in world coordinate system + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * This callback returns true if the corresponding + * item is considered to intersect the given rectangular box. + * This method may return false if the item cannot be + * selected using a selection marquee or optionally if the + * item is only partially contained within the box. + * Implementations should respect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * if marquee selections should behave differently on different zoom levels. + * @param {yfiles.geometry.RectD} box the box describing the marquee's bounds + * @param {yfiles.canvas.ICanvasContext} ctx the current canvas context + * @return {boolean} true if the item is considered to be captured by the marquee + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns a tight rectangular area where the whole rendering + * would fit into. + * If calculating the bounds is too expensive or the painting is not + * bound to a certain area, this method may return {@link yfiles.geometry.RectD#INFINITE}. + * If nothing is painted, this method should return an empty rectangle, where + * either or both the width and height is non-positive or + * {@link yfiles.geometry.RectD#EMPTY}. + * @param {yfiles.canvas.ICanvasContext} ctx the context to calculate the bounds for + * @return {yfiles.geometry.RectD} the bounds or {@link yfiles.geometry.RectD#EMPTY} to indicate an unbound area + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Factory method for the StyleDescriptor property. This method will be called + * upon first access to the {@link yfiles.drawing.AbstractStyleRenderer#styleDescriptor} property. + * @return {yfiles.canvas.ICanvasObjectDescriptor} an instance of {@link yfiles.drawing.PortStyleDescriptor}. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#createStyleDescriptor} + */ + createStyleDescriptor():yfiles.canvas.ICanvasObjectDescriptor; + /** + * Prepares this instance for subsequent calls after the + * style and item have been initialized. + * Upon invocation the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} fields have + * been populated by the {@link yfiles.drawing.AbstractStyleRenderer#getVisualCreator}, + * {@link yfiles.drawing.AbstractStyleRenderer#getBoundsProvider}, {@link yfiles.drawing.AbstractStyleRenderer#getHitTestable}, or + * {@link yfiles.drawing.AbstractStyleRenderer#getMarqueeTestable} methods. + */ + configure():void; + /** + * This method is called by the framework to create a {@link yfiles.drawing.Visual} + * that will be included into the {@link yfiles.drawing.IRenderContext}. + * {@link yfiles.canvas.CanvasControl} uses this interface through the {@link yfiles.canvas.ICanvasObjectDescriptor} + * to populate the visual canvas object tree. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used. + * @return {yfiles.drawing.Visual} The visual to include in the canvas object visual tree. This may be null. + * @see {@link yfiles.drawing.IVisualCreator#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * This method updates or replaces a previously created {@link yfiles.drawing.Visual} for inclusion + * in the {@link yfiles.drawing.IRenderContext}. + * The {@link yfiles.canvas.CanvasControl} uses this method to give implementations a chance to + * update an existing Visual that has previously been created by the same instance during a call + * to {@link yfiles.drawing.IVisualCreator#createVisual}. Implementation may update the oldVisual + * and return that same reference, or create a new visual and return the new instance or null. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used in. + * @param {yfiles.drawing.Visual} oldVisual The visual instance that had been returned the last time the {@link yfiles.drawing.IVisualCreator#createVisual} + * method was called on this instance. + * @return {yfiles.drawing.Visual} oldVisual, if this instance modified the visual, or a new visual that should replace the + * existing one in the canvas object visual tree. + * @see {@link yfiles.drawing.IVisualCreator#createVisual} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasControl} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + } + var SimplePortStyleRenderer:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.SimplePortStyleRenderer; + }; + /** + * A utility class that provides {@link yfiles.drawing.TextRenderSupport#getTextSize text size measurement} + * and {@link yfiles.drawing.TextRenderSupport#placeText text placement} functionality, + * e.g. for {@link yfiles.drawing.SimpleLabelStyleRenderer#textRenderSupport label rendering}. + * This class supports both {@link yfiles.drawing.TextRenderSupport.TextMeasureMode#SVG SVG-based} and {@link yfiles.drawing.TextRenderSupport.TextMeasureMode#CANVAS Canvas-based} + * text measurement. Method {@link yfiles.drawing.TextRenderSupport#determineMeasureMode} tries to determine the optimal measure mode by comparing + * the measure results and performance of both variants. + */ + export interface TextRenderSupport extends Object{ + /** + * This property can be used to force a measure mode for all typefaces, instead of using + * {@link yfiles.drawing.TextRenderSupport#determineMeasureMode} to determine the measure mode for a specific typeface. + * Default value is {@link yfiles.drawing.TextRenderSupport.TextMeasureMode#AUTOMATIC}. + * @see {@link yfiles.drawing.TextRenderSupport#determineMeasureMode} + */ + measureModeOverride:yfiles.drawing.TextRenderSupport.TextMeasureMode_Interface; + /** + * Determines whether to use {@link yfiles.drawing.TextRenderSupport.TextMeasureMode#CANVAS} or + * {@link yfiles.drawing.TextRenderSupport.TextMeasureMode#SVG} for {@link yfiles.drawing.TextRenderSupport#getTextSize text size measurement}. + * If {@link yfiles.drawing.TextRenderSupport#measureModeOverride} is set to a value other than, {@link yfiles.drawing.TextRenderSupport.TextMeasureMode#AUTOMATIC} + * the override value will be used instead of calling this method to determine a typeface-specific measure mode. + * This implementation compares the performance of + * getBBox() and + * CanvasContext2D.measureText() + * to determine the optimal measure mode for the provided typeface. + * Please see the documentation of {@link yfiles.drawing.TextRenderSupport#getTextSize} for details about the measurement implementations. + * @param {yfiles.system.Typeface} typeface The typeface for which to determine the measure mode. + * @return {yfiles.drawing.TextRenderSupport.TextMeasureMode} {@link yfiles.drawing.TextRenderSupport.TextMeasureMode#CANVAS} or {@link yfiles.drawing.TextRenderSupport.TextMeasureMode#SVG} + * @see {@link yfiles.drawing.TextRenderSupport#measureModeOverride} + * @see {@link yfiles.drawing.TextRenderSupport#getTextSize} + */ + determineMeasureMode(typeface:yfiles.system.Typeface):yfiles.drawing.TextRenderSupport.TextMeasureMode_Interface; + /** + * Calculate the width and height required to render the provided text using the provided typeface. + * {@link yfiles.drawing.TextRenderSupport#determineMeasureMode} and {@link yfiles.drawing.TextRenderSupport#measureModeOverride} can be used to + * specify the {@link yfiles.drawing.TextRenderSupport.TextMeasureMode measuring implementation} that should be used for + * text size calculation. + * Because canvas-based text measurement can only be used to calculate the text width, the + * {@link yfiles.drawing.TextRenderSupport.TextMeasureMode#CANVAS canvas-based} measurement implementation calculates the + * text height based on the following information: + *
    + *
  • A cached line height value that is calculated using SVG text measurement (getBBox()) + * in order to determine the ascent and descent for a given {@link yfiles.system.Typeface}
  • + *
  • The {@link yfiles.system.Typeface#fontSize} and {@link yfiles.system.Typeface#lineSpacing} + * in order to calculate the height of multiline text. + *
  • + *
+ * Also, if the canvas and SVG based measurements yield different results for the text width, the canvas-based + * measurement uses a correction factor to better match the SVG result. + * @param {string} text A string that should be rendered + * @param {yfiles.system.Typeface} typeface The typeface that should be used to render the string + * @return {yfiles.geometry.SizeD} The calculated size + * @see {@link yfiles.drawing.TextRenderSupport#determineMeasureMode} + * @see {@link yfiles.drawing.TextRenderSupport#measureModeOverride} + * @see {@link yfiles.drawing.TextRenderSupport#getTextSizeFromExistingElement} + */ + getTextSize(text:string,typeface:yfiles.system.Typeface):yfiles.geometry.SizeD; + /** + * Calculate the width and height of the provided element's text content. + * {@link yfiles.drawing.TextRenderSupport#determineMeasureMode} and {@link yfiles.drawing.TextRenderSupport#measureModeOverride} can be used to + * specify the {@link yfiles.drawing.TextRenderSupport.TextMeasureMode} measuring implementation that should be used for + * text size calculation. + * While the {@link yfiles.drawing.TextRenderSupport.TextMeasureMode#SVG SVG-based} measuring implementation + * will use the actual bounds of the provided text element, the {@link yfiles.drawing.TextRenderSupport.TextMeasureMode#CANVAS canvas-based} + * measuring implementation will just use the text and typeface to determine the size, ignoring the provided element. + * @param {string} text The text that should be measured. This method will not add the string to the provided element. + * It is expected that the text has already been added, either as textContent, or through child elements. + * @param {yfiles.system.Typeface} typeface The typeface that was applied to the existingElement. + * @return {yfiles.geometry.SizeD} The calculated size + * @see {@link yfiles.drawing.TextRenderSupport#determineMeasureMode} + * @see {@link yfiles.drawing.TextRenderSupport#measureModeOverride} + * @see {@link yfiles.drawing.TextRenderSupport#getTextSize} + */ + getTextSizeFromExistingElement(text:string,typeface:yfiles.system.Typeface,existingElement:SVGTextElement):yfiles.geometry.SizeD; + /** + * Adds the text content to the provided text element. + * @param {SVGTextElement} targetElement An SVG text element to add the provided text to (either as textContent, or by + * appending tspan elements). + * @param {string} text The text content to add to the provided text element (may contain newline characters). + * @param {yfiles.system.Typeface} typeface The typeface that defines the font properties to apply to the added text. + * @param {yfiles.geometry.SizeD} maxSize The bounds that shouldn't be exceeded when placing the text. + * @param {yfiles.system.StringTrimming} stringTrimming The trimming mode to apply when the text exceeds the provided maxSize. + * @return {string} The text that was actually placed in the targetElement. + * @see {@link yfiles.drawing.TextRenderSupport#addText} + */ + placeText(targetElement:SVGTextElement,text:string,typeface:yfiles.system.Typeface,maxSize:yfiles.geometry.SizeD,stringTrimming:yfiles.system.StringTrimming):string; + /** + * Returns whether the text placement implementation should stop adding text content, given the + * already added text and the maximum allowed height. + * This implementation returns true, if adding nine tenths of the line height + * (including {@link yfiles.system.Typeface#lineSpacing}) would exceed the maxHeight. + * @param {SVGTextElement} textElement A text element containing the text content that has been added by the text placement method so far. + * @param {yfiles.system.Typeface} typeface The typeface that is applied to the text. + * @param {number} calculatedTextHeight The current text height. + * @param {number} maxHeight The height that shouldn't be exceeded by the text content. + * @return {boolean} true if no more text content should be added + */ + isLastLine(textElement:SVGTextElement,typeface:yfiles.system.Typeface,calculatedTextHeight:number,maxHeight:number):boolean; + } + export module TextRenderSupport{ + export interface TextMeasureMode_Interface{} + } + var TextRenderSupport:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.TextRenderSupport; + TextMeasureMode:{ + AUTOMATIC:yfiles.drawing.TextRenderSupport.TextMeasureMode_Interface; + SVG:yfiles.drawing.TextRenderSupport.TextMeasureMode_Interface; + CANVAS:yfiles.drawing.TextRenderSupport.TextMeasureMode_Interface; + }; + /** + * Calculate the width and height required to render the provided text using the provided typeface. + * Delegates to {@link yfiles.drawing.TextRenderSupport#getTextSize}. + * @param {string} text The text that should be measured. + * @param {yfiles.system.Typeface} typeface The typeface to apply to the text before measuring. + * @return {yfiles.geometry.SizeD} The measured text size + */ + measureText(text:string,typeface:yfiles.system.Typeface):yfiles.geometry.SizeD; + /** + * Add the text content to the provided text element. + * Delegates to {@link yfiles.drawing.TextRenderSupport#placeText}. + * @param {SVGTextElement} targetElement An SVG text element to add the provided text to (either as textContent, or by + * appending tspan elements). + * @param {string} text The text content to add to the provided text element (may contain newline characters). + * @param {yfiles.system.Typeface} typeface The typeface that defines the font properties to apply to the added text. + * @param {yfiles.geometry.SizeD} maxSize The bounds that shouldn't be exceeded when placing the text. + * @param {yfiles.system.StringTrimming} stringTrimming The trimming mode to apply when the text exceeds the provided maxSizebounds + * @see {@link yfiles.drawing.TextRenderSupport#placeText} + */ + addText(targetElement:SVGTextElement,text:string,typeface:yfiles.system.Typeface,maxSize:yfiles.geometry.SizeD,stringTrimming:yfiles.system.StringTrimming):void; + }; + /** + * Default renderer implementation that can be used for {@link yfiles.drawing.ShapeNodeStyle} + * instances. + */ + export interface ShapeNodeStyleRenderer extends yfiles.drawing.AbstractNodeStyleRenderer{ + /** + * Gets or sets the radius that is used to draw rounded edges. + */ + roundRectArcRadius:number; + /** + * This method is called by the framework to create a {@link yfiles.drawing.Visual} + * that will be included into the {@link yfiles.drawing.IRenderContext}. + * {@link yfiles.canvas.CanvasControl} uses this interface through the {@link yfiles.canvas.ICanvasObjectDescriptor} + * to populate the visual canvas object tree. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used. + * @return {yfiles.drawing.Visual} The visual to include in the canvas object visual tree. This may be null. + * @see {@link yfiles.drawing.IVisualCreator#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * This method updates or replaces a previously created {@link yfiles.drawing.Visual} for inclusion + * in the {@link yfiles.drawing.IRenderContext}. + * The {@link yfiles.canvas.CanvasControl} uses this method to give implementations a chance to + * update an existing Visual that has previously been created by the same instance during a call + * to {@link yfiles.drawing.IVisualCreator#createVisual}. Implementation may update the oldVisual + * and return that same reference, or create a new visual and return the new instance or null. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used in. + * @param {yfiles.drawing.Visual} oldVisual The visual instance that had been returned the last time the {@link yfiles.drawing.IVisualCreator#createVisual} + * method was called on this instance. + * @return {yfiles.drawing.Visual} oldVisual, if this instance modified the visual, or a new visual that should replace the + * existing one in the canvas object visual tree. + * @see {@link yfiles.drawing.IVisualCreator#createVisual} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasControl} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Determines if something has been hit at the given coordinates + * in the world coordinate system. + * Implementations should inspect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * and take the value into account when performing hit tests. + * This allows the user to hit elements even if the zoom level is very + * small and allows for accurate hit tests at greater zoom levels. + * @param {yfiles.geometry.PointD} p the coordinates in world coordinate system + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns the intersection for the given line with this shape's geometry. + * @param {yfiles.geometry.PointD} inner The first point of the line that is inside the shape. + * @param {yfiles.geometry.PointD} outer The second point of the line that is outside the shape. + * @return {yfiles.geometry.PointD} The coordinates of the intersection point, if an intersection was found. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getIntersection}. + */ + getIntersection(inner:yfiles.geometry.PointD,outer:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Checks whether the given coordinate is deemed to lie within the shape's geometric bounds. + * @param {yfiles.geometry.PointD} point The point to test. + * @return {boolean} True if the point lies within the shape. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#isInside}. + */ + isInside(point:yfiles.geometry.PointD):boolean; + /** + * Get the shape that is currently used by this renderer. + * This implementation retrieves the shape from the + * owning style + * @return {yfiles.drawing.ShapeNodeShape} The shape that is currently used by this renderer. + */ + getShape():yfiles.drawing.ShapeNodeShape; + /** + * Get the brush that is currently used by this renderer. + * This implementation retrieves the brush from the + * owning style + * @return {yfiles.system.Brush} The brush that is currently used by this renderer. + */ + getBrush():yfiles.system.Brush; + /** + * Get the pen that is currently used by this renderer. + * This implementation retrieves the pen from the + * owning style + * @return {yfiles.system.Pen} The pen that is currently used by this renderer. + */ + getPen():yfiles.system.Pen; + /** + * Determines whether an element might intersect the visible region for a given context. + * Conservative implementations can always return true. + * @param {yfiles.geometry.RectD} clip The visible region clip. + * @param {yfiles.canvas.ICanvasContext} ctx The context to determine the visibility for. + * @return {boolean} false if and only if it is safe not to paint the element because + * it would not affect the given clipping region. + * @see Specified by {@link yfiles.drawing.IVisibilityTest#isVisible}. + */ + isVisible(clip:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Prepares this instance for subsequent calls after the + * style and item have been initialized. + * Upon invocation the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} fields have + * been populated by the {@link yfiles.drawing.AbstractStyleRenderer#getVisualCreator}, + * {@link yfiles.drawing.AbstractStyleRenderer#getBoundsProvider}, {@link yfiles.drawing.AbstractStyleRenderer#getHitTestable}, or + * {@link yfiles.drawing.AbstractStyleRenderer#getMarqueeTestable} methods. + */ + configure():void; + /** + * Returns the outline of the shape or null. + * @return {yfiles.drawing.GeneralPath} The outline or null if no outline can be provided. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getOutline}. + */ + getOutline():yfiles.drawing.GeneralPath; + } + var ShapeNodeStyleRenderer:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.ShapeNodeStyleRenderer; + /** + * A shared immutable instance of this class. + * Trying to modify the properties of this instance will trigger exceptions. + */ + INSTANCE:yfiles.drawing.ShapeNodeStyleRenderer; + }; + /** + * A port style decorator that uses a node style instance to render the port. + */ + export interface NodeStylePortStyleAdapter extends Object,yfiles.drawing.IPortStyle{ + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given port and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(port, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.IPortStyle#renderer}. + */ + renderer:yfiles.drawing.IPortStyleRenderer; + /** + * Gets the {@link yfiles.drawing.INodeStyle} that is used for rendering the port. + */ + nodeStyle:yfiles.drawing.INodeStyle; + /** + * Gets or sets the {@link yfiles.geometry.Size} of the port that will be displayed using {@link yfiles.drawing.NodeStylePortStyleAdapter#nodeStyle}. + * The default value is (5,5). + */ + renderSize:yfiles.geometry.SizeD; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.IPort):void; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var NodeStylePortStyleAdapter:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.NodeStylePortStyleAdapter} class. + * This constructor uses an ellipse {@link yfiles.drawing.ShapeNodeStyle} with a black brush + * for the {@link yfiles.drawing.NodeStylePortStyleAdapter#nodeStyle} property. + */ + new ():yfiles.drawing.NodeStylePortStyleAdapter; + /** + * Creates a port style that uses the provided node style to render the port. + * Note that the styles will be stored by reference, thus modifying the style will + * directly affect the rendering of this instance. + * @param {yfiles.drawing.INodeStyle} nodeStyle The style to use for rendering the port. + */ + WithNodeStyle:{ + new (nodeStyle:yfiles.drawing.INodeStyle):yfiles.drawing.NodeStylePortStyleAdapter; + }; + }; + /** + * A label style decorator that uses a node style instance to render the background + * and a label style instance to render the foreground of a label. + */ + export interface NodeStyleLabelStyleAdapter extends Object,yfiles.drawing.ILabelStyle{ + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given label and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(label, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.ILabelStyle#renderer}. + */ + renderer:yfiles.drawing.ILabelStyleRenderer; + /** + * Gets the {@link yfiles.drawing.INodeStyle} that is used for rendering the background of the label. + */ + nodeStyle:yfiles.drawing.INodeStyle; + /** + * Gets the {@link yfiles.drawing.ILabelStyle} that is used for rendering the foreground of the label. + */ + labelStyle:yfiles.drawing.ILabelStyle; + /** + * Gets a value indicating whether the label should be flipped 180 degrees + * automatically, if it would be oriented downwards, otherwise. + * Value: + * true if the label should be flipped automatically otherwise, false. + * The default is true. + */ + autoFlip:boolean; + /** + * Gets or sets the insets to apply for the {@link yfiles.drawing.NodeStyleLabelStyleAdapter#labelStyle} as margins. + * Value: The label style insets. The default is (0,0,0,0). + */ + labelStyleInsets:yfiles.geometry.InsetsD; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.ILabel):void; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var NodeStyleLabelStyleAdapter:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.NodeStyleLabelStyleAdapter} class. + * This constructor uses a {@link yfiles.drawing.ShapeNodeStyle} and a {@link yfiles.drawing.SimpleLabelStyle} + * for the {@link yfiles.drawing.NodeStyleLabelStyleAdapter#nodeStyle} and {@link yfiles.drawing.NodeStyleLabelStyleAdapter#labelStyle} properties. + */ + new ():yfiles.drawing.NodeStyleLabelStyleAdapter; + /** + * Creates a label style that uses the provided node style to render the background + * and the label style to render the foreground of this style. + * Note that the styles will be stored by reference, thus modifying the style will + * directly affect the rendering of this instance. + * @param {yfiles.drawing.INodeStyle} nodeStyle The style to use for rendering the background of the label. + * @param {yfiles.drawing.ILabelStyle} labelStyle The style to use for rendering the foreground of the label. + */ + FromNodeStyleAndLabelStyle:{ + new (nodeStyle:yfiles.drawing.INodeStyle,labelStyle:yfiles.drawing.ILabelStyle):yfiles.drawing.NodeStyleLabelStyleAdapter; + }; + }; + /** + * Interface that is mainly used by {@link yfiles.drawing.ITaggedStyleBase} + * to provide read and optional write access to a user defined tag that + * is associated with a given model item. + * @see {@link yfiles.drawing.TagOwnerUserTagProvider} + * @see {@link yfiles.drawing.common.VoidUserTagProvider} + */ + export interface IUserTagProvider extends Object{ + /** + * Gets the user tag that is associated with the given item. + * @param {yfiles.model.IModelItem} forItem The item to get the user associated data from. + * @param {yfiles.support.ILookup} context The context that can optional be queried for additional service implementations. + * @return {Object} The tag that is associated with the item or null. + * @see Specified by {@link yfiles.drawing.IUserTagProvider#getUserTag}. + */ + getUserTag(forItem:yfiles.model.IModelItem,context:yfiles.support.ILookup):Object; + /** + * Sets the new user tag for the specified item. + * Implementations should store the newTag for the forItem + * and return whether they successfully stored the tag. + * @param {yfiles.model.IModelItem} forItem The item to store the new tag with. + * @param {Object} newTag The new tag. + * @param {yfiles.support.ILookup} context The context that can optional be queried for additional service implementations. + * @return {boolean} Whether the tag was successfully stored with the item. + * @see Specified by {@link yfiles.drawing.IUserTagProvider#setUserTag}. + */ + setUserTag(forItem:yfiles.model.IModelItem,newTag:Object,context:yfiles.support.ILookup):boolean; + } + var IUserTagProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An implementation of {@link yfiles.drawing.IUserTagProvider} that delegates to the + * {@link yfiles.support.ITagOwner}'s {@link yfiles.support.ITagOwner#tag} property that is retrieved + * from the {@link yfiles.support.ILookup#lookup} of the {@link yfiles.model.IModelItem} + * that is passed in for the queries. + */ + export interface TagOwnerUserTagProvider extends Object,yfiles.drawing.IUserTagProvider{ + /** + * Gets the {@link yfiles.support.ITagOwner#tag} from the {@link yfiles.support.ITagOwner} + * that is found in the {@link yfiles.support.ILookup#lookup} of the model item. + * @param {yfiles.model.IModelItem} item The item from which {@link yfiles.support.ITagOwner} will be queried. + * @param {yfiles.support.ILookup} context The context, which is ignored by this implementation. + * @return {Object} The value of the {@link yfiles.support.ITagOwner#tag} property or null + * if no {@link yfiles.support.ITagOwner} was returned by the lookup mechanism implemented by the model item. + * @see Specified by {@link yfiles.drawing.IUserTagProvider#getUserTag}. + */ + getUserTag(item:yfiles.model.IModelItem,context:yfiles.support.ILookup):Object; + /** + * Gets the {@link yfiles.support.ITagOwner#tag} from the {@link yfiles.support.ITagOwner} + * that is found in the {@link yfiles.support.ILookup#lookup} of the model item. + * @param {yfiles.model.IModelItem} forItem The item from which {@link yfiles.support.ITagOwner} will be queried. + * @param {Object} newTag The tag object to set the {@link yfiles.support.ITagOwner#tag} property to. + * @param {yfiles.support.ILookup} context The context, which is ignored by this implementation. + * @return {boolean} Whether the value of the {@link yfiles.support.ITagOwner#tag} property could be set to the new value. + * false, if no {@link yfiles.support.ITagOwner} was returned by the lookup mechanism implemented by the model item. + * @see Specified by {@link yfiles.drawing.IUserTagProvider#setUserTag}. + */ + setUserTag(forItem:yfiles.model.IModelItem,newTag:Object,context:yfiles.support.ILookup):boolean; + } + var TagOwnerUserTagProvider:{ + $class:yfiles.lang.Class; + /** + * A static singleton instance of this class. + */ + INSTANCE:yfiles.drawing.TagOwnerUserTagProvider; + }; + /** + * Abstract base class for {@link yfiles.drawing.ILabelStyleRenderer} implementations that use an {@link yfiles.drawing.ShapedLabelStyleRendererBase#getOutlineShape outline shape}. + */ + export interface ShapedLabelStyleRendererBase extends yfiles.drawing.AbstractStyleRenderer,yfiles.drawing.ILabelStyleRenderer{ + /** + * Retrieves the current {@link yfiles.graph.ILabel#layout}. + */ + layout:yfiles.geometry.IOrientedRectangle; + /** + * Delegates to the {@link yfiles.drawing.ITaggedStyleBase#contextLookup} of the {@link yfiles.drawing.ILabelStyle}. + * @param {yfiles.lang.Class} type The type to query an instance for. + * @return {Object} The implementation or null. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#lookup} + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Callback method for looking up types based on the current label context. + * @param {TLabelStyle} style The style to look up the context for. + * @param {yfiles.graph.ILabel} label The current label. + * @param {yfiles.lang.Class} type The type to look up. + * @return {Object} The result from the context or null. + */ + lookupContext(style:TLabelStyle,label:yfiles.graph.ILabel,type:yfiles.lang.Class):Object; + /** + * Callback that gets the outline shape for the given style. + * @param {TLabelStyle} labelStyle The label style. + * @return {yfiles.drawing.GeneralPath} + */ + getOutlineShape(labelStyle:TLabelStyle):yfiles.drawing.GeneralPath; + /** + * Determines if something has been hit at the given coordinates + * in the world coordinate system. + * Implementations should inspect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * and take the value into account when performing hit tests. + * This allows the user to hit elements even if the zoom level is very + * small and allows for accurate hit tests at greater zoom levels. + * @param {yfiles.geometry.PointD} p the coordinates in world coordinate system + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * This callback returns true if the corresponding + * item is considered to intersect the given rectangular box. + * This method may return false if the item cannot be + * selected using a selection marquee or optionally if the + * item is only partially contained within the box. + * Implementations should respect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * if marquee selections should behave differently on different zoom levels. + * @param {yfiles.geometry.RectD} box the box describing the marquee's bounds + * @param {yfiles.canvas.ICanvasContext} ctx the current canvas context + * @return {boolean} true if the item is considered to be captured by the marquee + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns a tight rectangular area where the whole rendering + * would fit into. + * If calculating the bounds is too expensive or the painting is not + * bound to a certain area, this method may return {@link yfiles.geometry.RectD#INFINITE}. + * If nothing is painted, this method should return an empty rectangle, where + * either or both the width and height is non-positive or + * {@link yfiles.geometry.RectD#EMPTY}. + * @param {yfiles.canvas.ICanvasContext} ctx the context to calculate the bounds for + * @return {yfiles.geometry.RectD} the bounds or {@link yfiles.geometry.RectD#EMPTY} to indicate an unbound area + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Uses the {@link yfiles.graph.ILabel#layout} to determine whether the clip intersects. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#isVisible} + * @see Specified by {@link yfiles.drawing.IVisibilityTest#isVisible}. + */ + isVisible(clip:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Factory method for the StyleDescriptor property. This method will be called + * upon first access to the {@link yfiles.drawing.AbstractStyleRenderer#styleDescriptor} property. + * @return {yfiles.canvas.ICanvasObjectDescriptor} an instance of {@link yfiles.drawing.LabelStyleDescriptor}. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#createStyleDescriptor} + */ + createStyleDescriptor():yfiles.canvas.ICanvasObjectDescriptor; + /** + * Calculates the preferred size for the given label and style. + * @param {yfiles.graph.ILabel} label The label instance. + * @param {yfiles.drawing.ILabelStyle} style The style instance to apply. + * @return {yfiles.geometry.SizeD} The preferred size for the given label and style. + * @see {@link yfiles.drawing.ShapedLabelStyleRendererBase#getPreferredSizeWithContext} + * @see Specified by {@link yfiles.drawing.ILabelStyleRenderer#getPreferredSize}. + */ + getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle):yfiles.geometry.SizeD; + /** + * Calculates the preferred size for the given label and style. + * @param {yfiles.graph.ILabel} label The label instance. + * @param {yfiles.drawing.ILabelStyle} style The style instance to apply. + * @param {yfiles.drawing.IRenderContext} renderContext The render context which can be null. + * @return {yfiles.geometry.SizeD} The preferred size for the given label and style.. + * @see {@link yfiles.drawing.ShapedLabelStyleRendererBase#getPreferredSizeWithContext} + */ + getPreferredSizeWithLabelStyleAndRenderContext(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle,renderContext:yfiles.drawing.IRenderContext):yfiles.geometry.SizeD; + /** + * Arranges the provided element according to the current {@link yfiles.drawing.ShapedLabelStyleRendererBase#layout}, taking into account + * the value of {@link yfiles.drawing.ShapedLabelStyleRendererBase#isAutoFlip}. + * @param {yfiles.drawing.ArrangeVisual} element The element to arrange to fit into the {@link yfiles.drawing.ShapedLabelStyleRendererBase#layout}. + */ + arrange(element:yfiles.drawing.ArrangeVisual):void; + /** + * Callback that needs to be implemented to obtain the preferred size for the current configuration. + * @param {yfiles.drawing.IRenderContext} renderContext The render context which can be null. + * @return {yfiles.geometry.SizeD} + * The preferred size of the label for the current configuration. + */ + getPreferredSizeWithContext(renderContext:yfiles.drawing.IRenderContext):yfiles.geometry.SizeD; + /** + * Determines whether the label's style should automatically flip the painting contents if the + * {@link yfiles.drawing.ShapedLabelStyleRendererBase#layout} is upside down. + */ + isAutoFlip(labelStyle:TLabelStyle):boolean; + /** + * Stores the {@link yfiles.graph.ILabel#layout}. + * Subclasses should override this method, call the super implementation and configure their + * painting entities. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#configure} + */ + configure():void; + } + var ShapedLabelStyleRendererBase:{ + $class:yfiles.lang.Class; + new (labelStyleType:yfiles.lang.Class):yfiles.drawing.ShapedLabelStyleRendererBase; + }; + /** + * Abstract base type for {@link yfiles.drawing.INodeStyle}s that use an {@link yfiles.drawing.ShapedNodeStyleRendererBase#getOutlineShape outline shape}. + */ + export interface ShapedNodeStyleRendererBase extends yfiles.drawing.AbstractNodeStyleRenderer{ + /** + * Delegates to the {@link yfiles.drawing.ShapedNodeStyleRendererBase#getContextLookup} method. + * @param {yfiles.lang.Class} type The type to query an instance for. + * @return {Object} The implementation or null. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#lookup} + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Callback that obtains the outline shape for the given style. + */ + getOutlineShape(style:TNodeStyle):yfiles.drawing.GeneralPath; + /** + * Callback that obtains the insets for use in the {@link yfiles.drawing.IInsetsProvider} + * for the given style. + */ + getInsets(style:TNodeStyle):yfiles.geometry.InsetsD; + /** + * Callback that obtains the {@link yfiles.support.IContextLookup} + * for the given style. + */ + getContextLookup(style:TNodeStyle):yfiles.support.IContextLookup; + /** + * Provides the geometry for the visual representation. + * If {@link yfiles.drawing.ITaggedStyleBase#contextLookup} provides an implementation + * of the {@link yfiles.drawing.IShapeGeometry} interface than this instance will be returned, otherwise + * the {@link yfiles.drawing.ShapedNodeStyleRendererBase#getOutlineShape outline shape} will be used to determine the outline + * of the visual representation of a node. + * @param {yfiles.graph.INode} node The node to query the geometry for. + * @param {yfiles.drawing.INodeStyle} style The style for which the geometry is queried. + * @return {yfiles.drawing.IShapeGeometry} An implementation that describes the outline geometry of the shape. + * @see {@link yfiles.drawing.ShapedNodeStyleRendererBase#isInside} + * @see {@link yfiles.drawing.ShapedNodeStyleRendererBase#getOutline} + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#getShapeGeometry} + * @see Specified by {@link yfiles.drawing.INodeStyleRenderer#getShapeGeometry}. + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):yfiles.drawing.IShapeGeometry; + /** + * Provides a {@link yfiles.drawing.IMarqueeTestable marquee testing} implementation for + * the given style and node. + * If {@link yfiles.drawing.ITaggedStyleBase#contextLookup} provides an implementation + * of the {@link yfiles.drawing.IMarqueeTestable} interface than this instance will be returned, otherwise + * the {@link yfiles.drawing.ShapedNodeStyleRendererBase#getOutlineShape outline shape} will be used to determine the marquee + * intersection test with the visual representation of the node. + * @param {yfiles.graph.INode} node The node to query the tester for. + * @param {yfiles.drawing.INodeStyle} style The style whose tester is queried. + * @return {yfiles.drawing.IMarqueeTestable} An implementation that can test for marquee intersections. + * @see {@link yfiles.drawing.ShapedNodeStyleRendererBase#isInBox} + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#getMarqueeTestable} + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getMarqueeTestable}. + */ + getMarqueeTestable(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):yfiles.drawing.IMarqueeTestable; + /** + * Provides a {@link yfiles.drawing.IVisibilityTest visibility testing} implementation for + * the given style and node. + * If {@link yfiles.drawing.ITaggedStyleBase#contextLookup} provides an implementation + * of the {@link yfiles.drawing.IMarqueeTestable} interface than this instance will be returned, otherwise + * this reverts to the default (rectangular) behavior. + * @return {yfiles.drawing.IVisibilityTest} + * An instance that can be used to determine rendering visibility. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#getVisibilityTest} + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getVisibilityTest}. + */ + getVisibilityTest(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):yfiles.drawing.IVisibilityTest; + /** + * Provides a {@link yfiles.drawing.IBoundsProvider bounds calculation} implementation for + * the given style and node. + * If {@link yfiles.drawing.ITaggedStyleBase#contextLookup} provides an implementation + * of the {@link yfiles.drawing.IBoundsProvider} interface than this instance will be returned, otherwise + * the default (rectangular) behavior will be used. + * @param {yfiles.graph.INode} node The node to query the provider for. + * @param {yfiles.drawing.INodeStyle} style The style whose provider is queried. + * @return {yfiles.drawing.IBoundsProvider} An implementation that can calculate visual bounds. + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#getBoundsProvider} + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getBoundsProvider}. + */ + getBoundsProvider(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):yfiles.drawing.IBoundsProvider; + /** + * Determines whether the rendering is visible for the specified clip. + * @param {yfiles.geometry.RectD} clip The clip. + * @param {yfiles.canvas.ICanvasContext} ctx The context. + * @return {boolean} + * true if the rendering is visible for the specified clip; otherwise, false. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#isVisible} + * @see Specified by {@link yfiles.drawing.IVisibilityTest#isVisible}. + */ + isVisible(clip:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Provides a {@link yfiles.drawing.IHitTestable hit testing} implementation for + * the given style and node. + * If {@link yfiles.drawing.ITaggedStyleBase#contextLookup} provides an implementation + * of the {@link yfiles.drawing.IHitTestable} interface than this instance will be returned, otherwise + * the {@link yfiles.drawing.ShapedNodeStyleRendererBase#getOutlineShape outline shape} will be used to perform the hit testing. + * @param {yfiles.graph.INode} node The node to query the tester for. + * @param {yfiles.drawing.INodeStyle} style The style whose tester is queried. + * @return {yfiles.drawing.IHitTestable} An implementation that can perform the hit testing. + * @see {@link yfiles.drawing.ShapedNodeStyleRendererBase#isHit} + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#getHitTestable} + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getHitTestable}. + */ + getHitTestable(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):yfiles.drawing.IHitTestable; + /** + * Tries to use the {@link yfiles.drawing.ShapedNodeStyleRendererBase#getOutlineShape outline shape} to perform + * the hit test analysis, otherwise reverts to default (rectangular) behavior. + * @param {yfiles.geometry.PointD} p the hit point in world coordinates + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#isHit} + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Tries to use the {@link yfiles.drawing.ShapedNodeStyleRendererBase#getOutlineShape outline shape} to perform + * the marquee intersection analysis, otherwise reverts to default (rectangular) behavior. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#isInBox} + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Tries to use the {@link yfiles.drawing.ShapedNodeStyleRendererBase#getOutlineShape outline shape} to perform + * the intersection calculation, otherwise reverts to default (rectangular) behavior. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#getIntersection} + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getIntersection}. + */ + getIntersection(inner:yfiles.geometry.PointD,outer:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Tries to use the {@link yfiles.drawing.ShapedNodeStyleRendererBase#getOutlineShape outline shape} to perform + * the contains test, otherwise reverts to default (rectangular) behavior. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#isInside} + * @see Specified by {@link yfiles.drawing.IShapeGeometry#isInside}. + */ + isInside(point:yfiles.geometry.PointD):boolean; + /** + * Tries to use the {@link yfiles.drawing.ShapedNodeStyleRendererBase#getOutlineShape outline shape} to create + * the outline shape path, otherwise reverts to default (rectangular) behavior. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#getOutline} + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getOutline}. + */ + getOutline():yfiles.drawing.GeneralPath; + /** + * Calculates the preferred size given the current state of the renderer. + * @return {yfiles.geometry.SizeD} The size as suggested by this renderer. + */ + getPreferredSizeImpl():yfiles.geometry.SizeD; + /** + * Calculates the preferred size given the current state of the renderer for the given context. + * @param {yfiles.drawing.IRenderContext} renderContext The render context for which the preferred size should be calculated. + * @return {yfiles.geometry.SizeD} The size as suggested by this renderer. + */ + getPreferredSizeWithContext(renderContext:yfiles.drawing.IRenderContext):yfiles.geometry.SizeD; + /** + * Calculates the preferred size for the given node and style. + * @param {yfiles.graph.INode} node The node instance. + * @param {yfiles.drawing.INodeStyle} style The style instance to apply. + * @return {yfiles.geometry.SizeD} Always return a fixed size. + * @see {@link yfiles.drawing.ShapedNodeStyleRendererBase#getPreferredSizeImpl} + */ + getPreferredSize(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):yfiles.geometry.SizeD; + /** + * Calculates the preferred size for the given node and style in the provided context. + * @param {yfiles.graph.INode} node The node instance. + * @param {yfiles.drawing.INodeStyle} style The style instance to apply. + * @param {yfiles.drawing.IRenderContext} context The context for which the preferred size should be calculated. + * @return {yfiles.geometry.SizeD} Always return a fixed size. + * @see {@link yfiles.drawing.ShapedNodeStyleRendererBase#getPreferredSizeWithContext} + */ + getPreferredSizeWithNodeStyleAndContext(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle,context:yfiles.drawing.IRenderContext):yfiles.geometry.SizeD; + } + var ShapedNodeStyleRendererBase:{ + $class:yfiles.lang.Class; + new (nodeStyleType1:yfiles.lang.Class):yfiles.drawing.ShapedNodeStyleRendererBase; + }; + export enum ShapeNodeShape{ + /** + * A rectangular shape. + */ + RECTANGLE, + /** + * A rectangular shape with rounded edges. + */ + ROUND_RECTANGLE, + /** + * An elliptical shape. + */ + ELLIPSE, + /** + * A triangular shape that points to the top. + */ + TRIANGLE, + /** + * A triangular shape that points to the bottom. + */ + TRIANGLE2, + /** + * A rectangle that is sheared in the horizontal direction to the right. + */ + SHEARED_RECTANGLE, + /** + * A rectangle that is sheared in the horizontal direction to the left. + */ + SHEARED_RECTANGLE2, + /** + * A trapezoid shape that is smaller at the bottom. + */ + TRAPEZ, + /** + * A trapezoid shape that is smaller at the top. + */ + TRAPEZ2, + /** + * A 5-star shape. + */ + STAR5, + /** + * A 6-star shape. + */ + STAR6, + /** + * An 8-star shape. + */ + STAR8, + /** + * An arrow like shape that points to the right. + */ + FAT_ARROW, + /** + * An arrow like shape that points to the left. + */ + FAT_ARROW2, + /** + * A symmetric parallelogram shape that has sloped edges. + */ + DIAMOND, + /** + * A regular eight-sided shape,. + */ + OCTAGON, + /** + * A regular six-sided shape,. + */ + HEXAGON + } + /** + * A decorator implementation of {@link yfiles.drawing.INodeStyle} that can + * wrap most style implementations and draw a smooth drop shadow + * underneath the rendering of the wrapped style. + * This implementation uses an SVG filter effect. This may cause performance issues + * for larger nodes or high zoom factors. In this case it might be more appropriate + * to implement a drop shadow implementation using canvas drawing and displaying the + * canvas content using an image element with canvas.toDataURL. + */ + export interface ShadowNodeStyleDecorator extends Object,yfiles.drawing.INodeStyle{ + /** + * Provides access to the wrapped node style instance by reference. + */ + wrapped:yfiles.drawing.INodeStyle; + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given node and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(node, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.INodeStyle#renderer}. + */ + renderer:yfiles.drawing.INodeStyleRenderer; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.INode):void; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var ShadowNodeStyleDecorator:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance wrapping a simple {@link yfiles.drawing.ShapeNodeStyle}. + * The provided instance is used by reference, so subsequent changes to the style + * will affect the appearance of this style. + * @see {@link yfiles.drawing.ShadowNodeStyleDecorator#wrapped} + */ + new ():yfiles.drawing.ShadowNodeStyleDecorator; + /** + * Creates a new instance wrapping the provided style. + * The provided instance is used by reference, so subsequent changes to the style + * will affect the appearance of this style. + * @param {yfiles.drawing.INodeStyle} wrapped The style to wrap. + */ + WithNodeStyle:{ + new (wrapped:yfiles.drawing.INodeStyle):yfiles.drawing.ShadowNodeStyleDecorator; + }; + }; + /** + * An abstract base class for {@link yfiles.drawing.IEdgeStyleRenderer} implementations that are based on + * the calculation of a {@link yfiles.drawing.GeneralPath}. + */ + export interface PathBasedEdgeStyleRenderer extends yfiles.drawing.AbstractEdgeStyleRenderer,yfiles.model.IObstacleProvider{ + /** + * The path instance that this instance is working with. + */ + pathF:yfiles.drawing.GeneralPath; + /** + * Gets the target arrow from the style. + * @return {yfiles.drawing.IArrow} The arrow to use. + */ + getTargetArrow():yfiles.drawing.IArrow; + /** + * Gets the source arrow from the style. + * @return {yfiles.drawing.IArrow} The arrow to use. + */ + getSourceArrow():yfiles.drawing.IArrow; + /** + * Calculate and update the anchor and the source arrow's direction vector. + * @param {yfiles.drawing.IArrow} arrow The arrow to calculate the anchor for. + * @param {yfiles.geometry.PointD} anchorPoint The tip of the arrow. + * @param {yfiles.geometry.PointD} arrowDirection The direction vector of the arrow. + * @return {boolean} Whether an anchor has been successfully determined. + */ + getSourceArrowAnchor(arrow:yfiles.drawing.IArrow,anchorPoint:{value:yfiles.geometry.PointD;},arrowDirection:{value:yfiles.geometry.PointD;}):boolean; + /** + * Calculate and update the anchor and the target arrow's direction vector. + * @param {yfiles.drawing.IArrow} arrow The arrow to calculate the anchor for. + * @param {yfiles.geometry.PointD} anchorPoint The tip of the arrow. + * @param {yfiles.geometry.PointD} arrowDirection The direction vector of the arrow. + * @return {boolean} Whether an anchor has been successfully determined. + */ + getTargetArrowAnchor(arrow:yfiles.drawing.IArrow,anchorPoint:{value:yfiles.geometry.PointD;},arrowDirection:{value:yfiles.geometry.PointD;}):boolean; + /** + * Crops the edge's path at the nodes. + * This implementation uses the {@link yfiles.drawing.IEdgeIntersectionCalculator} instances + * found in the {@link yfiles.support.ILookup#lookup} of the source and target port + * of the edge to perform the actual cropping. + * @param {yfiles.drawing.GeneralPath} pathToCrop The path that should be cropped. + */ + cropPath(pathToCrop:{value:yfiles.drawing.GeneralPath;}):void; + /** + * This method should create the basic uncropped path given the control points. + * @return {yfiles.drawing.GeneralPath} A path that has to be cropped, yet. + */ + createPath():yfiles.drawing.GeneralPath; + /** + * Prepares this instance for subsequent calls after the + * style and item have been initialized. + * Upon invocation the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} fields have + * been populated by the {@link yfiles.drawing.AbstractStyleRenderer#getVisualCreator}, + * {@link yfiles.drawing.AbstractStyleRenderer#getBoundsProvider}, {@link yfiles.drawing.AbstractStyleRenderer#getHitTestable}, or + * {@link yfiles.drawing.AbstractStyleRenderer#getMarqueeTestable} methods. + */ + configure():void; + /** + * Yields the {@link yfiles.model.IAddBridgesCallback} to use for + * {@link yfiles.drawing.PathBasedEdgeStyleRenderer#addBridges adding bridges} to the + * {@link yfiles.drawing.PathBasedEdgeStyleRenderer#createPath created path}. + * The return value of this method (which may be null) + * will be passed to the {@link yfiles.model.BridgeManager}'s + * {@link yfiles.model.BridgeManager#addBridges} method. + * @return {yfiles.model.IAddBridgesCallback} This implementation returns null. + */ + getAddBridgesCallback():yfiles.model.IAddBridgesCallback; + /** + * Determines whether the rendered path should use + * the {@link yfiles.model.BridgeManager} to {@link yfiles.model.BridgeManager#addBridges add bridges to it.}. + * @see {@link yfiles.drawing.PathBasedEdgeStyleRenderer#getAddBridgesCallback} + */ + addBridges:boolean; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns {@link yfiles.drawing.PathBasedEdgeStyleRenderer#createPath} unless + * {@link yfiles.drawing.AbstractStyleRenderer#isVisible} + * yields false for the provided context and {@link yfiles.drawing.IRenderContext#clip}. + * @param {yfiles.drawing.IRenderContext} ctx The context to yield the obstacles for. + * @return {yfiles.drawing.GeneralPath} Either null or the result of {@link yfiles.drawing.PathBasedEdgeStyleRenderer#createPath}. + * @see {@link yfiles.model.IObstacleProvider} + * @see Specified by {@link yfiles.model.IObstacleProvider#getObstacles}. + */ + getObstacles(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.GeneralPath; + /** + * This method is called by the framework to create a {@link yfiles.drawing.Visual} + * that will be included into the {@link yfiles.drawing.IRenderContext}. + * {@link yfiles.canvas.CanvasControl} uses this interface through the {@link yfiles.canvas.ICanvasObjectDescriptor} + * to populate the visual canvas object tree. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used. + * @return {yfiles.drawing.Visual} The visual to include in the canvas object visual tree. This may be null. + * @see {@link yfiles.drawing.IVisualCreator#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * This method updates or replaces a previously created {@link yfiles.drawing.Visual} for inclusion + * in the {@link yfiles.drawing.IRenderContext}. + * The {@link yfiles.canvas.CanvasControl} uses this method to give implementations a chance to + * update an existing Visual that has previously been created by the same instance during a call + * to {@link yfiles.drawing.IVisualCreator#createVisual}. Implementation may update the oldVisual + * and return that same reference, or create a new visual and return the new instance or null. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used in. + * @param {yfiles.drawing.Visual} oldVisual The visual instance that had been returned the last time the {@link yfiles.drawing.IVisualCreator#createVisual} + * method was called on this instance. + * @return {yfiles.drawing.Visual} oldVisual, if this instance modified the visual, or a new visual that should replace the + * existing one in the canvas object visual tree. + * @see {@link yfiles.drawing.IVisualCreator#createVisual} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasControl} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Gets the value that determines the radius of the smoothing arcs that can be + * added to the path at the bends. + * This implementation returns 0.0d, which effectively turns off path smoothing. + * @return {number} The radius of the arcs to use at the bends of the path. + */ + getSmoothing():number; + /** + * Gets the pen to use for painting the path. + * @return {yfiles.system.Pen} The pen or null. + */ + getPen():yfiles.system.Pen; + /** + * This method is overridden for performance reasons. + * This implementation uses {@link yfiles.drawing.AbstractStyleRenderer#isVisible} + * as an early exit indicator. If IsVisible returns false for a certain + * rectangle, the instance will not be configured but a non-hit will be assumed. + * Otherwise this instance will be configured and the standard path based hit test routine + * Subclasses should not depend on the fact that {@link yfiles.drawing.PathBasedEdgeStyleRenderer#configure} + * has already been called. This may not be the case. If your subclass depends + * on Configure being called, override {@link yfiles.drawing.PathBasedEdgeStyleRenderer#getHitTestable} + * and call {@link yfiles.drawing.PathBasedEdgeStyleRenderer#configure} after the base class call. + * @see {@link yfiles.drawing.AbstractStyleRenderer#isHit} + * @see {@link yfiles.drawing.PathBasedEdgeStyleRenderer#getHitTestable} + * @see {@link yfiles.drawing.PathBasedEdgeStyleRenderer#configure} + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#isHit} + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * This callback returns true if the corresponding + * item is considered to intersect the given rectangular box. + * This method may return false if the item cannot be + * selected using a selection marquee or optionally if the + * item is only partially contained within the box. + * Implementations should respect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * if marquee selections should behave differently on different zoom levels. + * @param {yfiles.geometry.RectD} box the box describing the marquee's bounds + * @param {yfiles.canvas.ICanvasContext} ctx the current canvas context + * @return {boolean} true if the item is considered to be captured by the marquee + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * This method is overridden for performance reasons. + * This implementation does not call {@link yfiles.drawing.PathBasedEdgeStyleRenderer#configure}. + * If subclasses depend on a configured instance in an override of {@link yfiles.drawing.PathBasedEdgeStyleRenderer#isHit}, they need + * to override this method, too and call {@link yfiles.drawing.PathBasedEdgeStyleRenderer#configure} if the base call returns a non-null + * value. + * @see {@link yfiles.drawing.PathBasedEdgeStyleRenderer#isHit} + * @see {@link yfiles.drawing.PathBasedEdgeStyleRenderer#configure} + * @see {@link yfiles.drawing.AbstractStyleRenderer#getHitTestable} + * @see Overrides {@link yfiles.drawing.AbstractStyleRenderer#getHitTestable} + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getHitTestable}. + */ + getHitTestable(item:yfiles.graph.IEdge,style:yfiles.drawing.IEdgeStyle):yfiles.drawing.IHitTestable; + /** + * Returns a tight rectangular area where the whole rendering + * would fit into. + * If calculating the bounds is too expensive or the painting is not + * bound to a certain area, this method may return {@link yfiles.geometry.RectD#INFINITE}. + * If nothing is painted, this method should return an empty rectangle, where + * either or both the width and height is non-positive or + * {@link yfiles.geometry.RectD#EMPTY}. + * @param {yfiles.canvas.ICanvasContext} ctx the context to calculate the bounds for + * @return {yfiles.geometry.RectD} the bounds or {@link yfiles.geometry.RectD#EMPTY} to indicate an unbound area + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Special implementation that will create a self loop path. + * @return {yfiles.drawing.GeneralPath} + */ + createSelfLoopPath(roundSelfLoop:boolean):yfiles.drawing.GeneralPath; + /** + * Gets or sets the distance between the node's layout and its self loop control points. + */ + selfLoopDistance:number; + /** + * Returns a representation of the visible path of the edge in form of a {@link yfiles.drawing.GeneralPath}. + * @return {yfiles.drawing.GeneralPath} An instance that describes the visible path or null if this is not applicable for the current geometry. + * @see Specified by {@link yfiles.drawing.IPathGeometry#getPath}. + */ + getPath():yfiles.drawing.GeneralPath; + } + var PathBasedEdgeStyleRenderer:{ + $class:yfiles.lang.Class; + new (edgeStyleType1:yfiles.lang.Class):yfiles.drawing.PathBasedEdgeStyleRenderer; + /** + * Static utility method that creates a rectangular self loop path. + * @param {number} sx The x coordinate of the source port. + * @param {number} sy The y coordinate of the source port. + * @param {number} oppositeX The x coordinate of the single control point. + * @param {number} oppositeY The y coordinate of the single control point. + * @param {number} tx The x coordinate of the target port. + * @param {number} ty The y coordinate of the target port. + * @return {yfiles.drawing.GeneralPath} A path that describes a rectangular self loop. + * @see {@link yfiles.drawing.PathBasedEdgeStyleRenderer#createSelfLoopPath} + */ + createRectangleSelfLoop(sx:number,sy:number,oppositeX:number,oppositeY:number,tx:number,ty:number):yfiles.drawing.GeneralPath; + /** + * Static utility method that creates a round self loop path. + * @param {number} sx The x coordinate of the source port. + * @param {number} sy The y coordinate of the source port. + * @param {number} oppositeX The x coordinate of the single control point. + * @param {number} oppositeY The y coordinate of the single control point. + * @param {number} tx The x coordinate of the target port. + * @param {number} ty The y coordinate of the target port. + * @return {yfiles.drawing.GeneralPath} A path that describes a round self loop. + * @see {@link yfiles.drawing.PathBasedEdgeStyleRenderer#createSelfLoopPath} + */ + createRoundSelfLoop(sx:number,sy:number,oppositeX:number,oppositeY:number,tx:number,ty:number):yfiles.drawing.GeneralPath; + }; + /** + * An {@link yfiles.drawing.IStyleRenderer} that will + * render {@link yfiles.drawing.IPolylineEdgeStyle} instances. + */ + export interface PolylineEdgeStyleRenderer extends yfiles.drawing.PathBasedEdgeStyleRenderer{ + /** + * This method should create the basic uncropped path given the control points. + * @return {yfiles.drawing.GeneralPath} A path that has to be cropped, yet. + */ + createPath():yfiles.drawing.GeneralPath; + /** + * Gets the value that determines the radius of the smoothing arcs that can be + * added to the path at the bends. + * This implementation returns {@link yfiles.drawing.IPolylineEdgeStyle#smoothing}. + * @return {number} + * The radius of the arcs to use at the bends of the path. + * @see Overrides {@link yfiles.drawing.PathBasedEdgeStyleRenderer#getSmoothing} + */ + getSmoothing():number; + /** + * Gets the pen to use for painting the path. + * @return {yfiles.system.Pen} The pen or null. + */ + getPen():yfiles.system.Pen; + /** + * Calculates the tangent on the edge's path at the given ratio point. + * The result is provided through the various out parameters. If the method returns false, no valid result could be calculated and + * the values of the out parameters should be ignored. + * @param {number} ratio a value in [0,1] where 0 is the source's end and 1 is at the target's end of the visible edge path + * @param {yfiles.geometry.PointD} p The coordinates in world-coordinate space that denotes the tangent point. + * @param {yfiles.geometry.PointD} tangent The vector which is tangent to the edge's path at the point denoted by p. The tangent vector + * needs not necessarily be normalized. + * @return {boolean} true if the values in the out parameters are valid, otherwise false + * @see Specified by {@link yfiles.drawing.IPathGeometry#getTangent}. + */ + getTangent(ratio:number,p:{value:yfiles.geometry.PointD;},tangent:{value:yfiles.geometry.PointD;}):boolean; + /** + * Calculates the tangent on the edge's path at the given ratio point for the given segment. + * The result is provided through the various out parameters. If the method returns false, no valid result could be calculated and + * the values of the out parameters should be ignored. + * @param {number} segmentIndex the segment to use for the calculation + * @param {number} ratio a value in [0,1] where 0 is the source's end and 1 is at the target's end of the segment + * @param {yfiles.geometry.PointD} p The coordinates in world-coordinate space that denote the tangent point. + * @param {yfiles.geometry.PointD} tangent The vector which is tangent to the edge's path at the point denoted by p. The tangent vector + * needs not necessarily be normalized. + * @return {boolean} true if the values in the out parameters are valid, otherwise false + * @see {@link yfiles.drawing.IPathGeometry#getTangent} + * @see {@link yfiles.drawing.IPathGeometry#getSegmentCount} + * @see Specified by {@link yfiles.drawing.IPathGeometry#getTangentForIndex}. + */ + getTangentForIndex(segmentIndex:number,ratio:number,p:{value:yfiles.geometry.PointD;},tangent:{value:yfiles.geometry.PointD;}):boolean; + /** + * Determines whether an element might intersect the visible region for a given context. + * Conservative implementations can always return true. + * @param {yfiles.geometry.RectD} clip The visible region clip. + * @param {yfiles.canvas.ICanvasContext} ctx The context to determine the visibility for. + * @return {boolean} false if and only if it is safe not to paint the element because + * it would not affect the given clipping region. + * @see Specified by {@link yfiles.drawing.IVisibilityTest#isVisible}. + */ + isVisible(clip:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns the number of "segments" this edge's path consists of. + * @return {number} the number of segments or -1 if there is no such thing as a segment for this edge. + * @see Specified by {@link yfiles.drawing.IPathGeometry#getSegmentCount}. + */ + getSegmentCount():number; + /** + * Gets the target arrow from the style via {@link yfiles.drawing.IArrowOwner#targetArrow}. + * @return {yfiles.drawing.IArrow} The arrow to use. + * @see Overrides {@link yfiles.drawing.PathBasedEdgeStyleRenderer#getTargetArrow} + */ + getTargetArrow():yfiles.drawing.IArrow; + /** + * Gets the source arrow from the style via {@link yfiles.drawing.IArrowOwner#sourceArrow}. + * @return {yfiles.drawing.IArrow} The arrow to use. + * @see Overrides {@link yfiles.drawing.PathBasedEdgeStyleRenderer#getSourceArrow} + */ + getSourceArrow():yfiles.drawing.IArrow; + } + var PolylineEdgeStyleRenderer:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.PolylineEdgeStyleRenderer; + }; + /** + * Simple mutable implementation of the {@link yfiles.drawing.IPolylineEdgeStyle}. + */ + export interface PolylineEdgeStyle extends yfiles.drawing.AbstractEdgeStyle,yfiles.drawing.IPolylineEdgeStyle{ + /** + * Gets the for the line. + * @see Specified by {@link yfiles.drawing.IPolylineEdgeStyle#pen}. + */ + pen:yfiles.system.Pen; + /** + * Gets the smoothing length used for creating smooth bends. + * A value of 0.0d will disable smoothing. + * @see Specified by {@link yfiles.drawing.IPolylineEdgeStyle#smoothing}. + */ + smoothing:number; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.IEdge):void; + } + var PolylineEdgeStyle:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with a black pen. + */ + new ():yfiles.drawing.PolylineEdgeStyle; + /** + * Creates a new instance using the provided pen. + */ + WithPen:{ + new (pen:yfiles.system.Pen):yfiles.drawing.PolylineEdgeStyle; + }; + /** + * Creates a new instance using the provided renderer and black pen. + */ + WithRenderer:{ + new (styleRenderer:yfiles.drawing.PolylineEdgeStyleRenderer):yfiles.drawing.PolylineEdgeStyle; + }; + /** + * Creates a new instance using the provided renderer and pen. + */ + WithRendererAndPen:{ + new (styleRenderer:yfiles.drawing.PolylineEdgeStyleRenderer,pen:yfiles.system.Pen):yfiles.drawing.PolylineEdgeStyle; + }; + }; + /** + * Base interface for styles that can visualize a {@link yfiles.graph.ITable} instance. + */ + export interface ITableNodeStyle extends Object,yfiles.drawing.INodeStyle,yfiles.system.INotifyPropertyChanged{ + /** + * The style that is used to draw the background of the table. + * @see Specified by {@link yfiles.drawing.ITableNodeStyle#backgroundStyle}. + */ + backgroundStyle:yfiles.drawing.INodeStyle; + /** + * Gets the implementation of the {@link yfiles.drawing.ITableProvider} + * interface that can yield + * a table object for each item that will be assigned this style. + * Value: The implementation to use for yielding and storing the tag associated with items. + * @see Specified by {@link yfiles.drawing.ITableNodeStyle#tableProvider}. + */ + tableProvider:yfiles.drawing.ITableProvider; + } + var ITableNodeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that is mainly used by {@link yfiles.drawing.ITableNodeStyle} implementations + * to decouple the association from a table instance to its owner from the actual style implementation. + * @see {@link yfiles.drawing.TagOwnerTableProvider} + * @see {@link yfiles.drawing.TableNodeStyle} + */ + export interface ITableProvider extends Object{ + /** + * Gets the table that is associated with the given item. + * @param {yfiles.graph.INode} node The node to get the table from. + * @param {yfiles.support.ILookup} context The context that can optional be queried for additional service implementations. + * @return {yfiles.graph.ITable} The table that is associated with the item or null. + * @see Specified by {@link yfiles.drawing.ITableProvider#getTable}. + */ + getTable(node:yfiles.graph.INode,context:yfiles.support.ILookup):yfiles.graph.ITable; + /** + * Sets a new table instance for the specified item. + * Implementations should store the table for the node + * and return whether they successfully stored the tag. + * @param {yfiles.graph.INode} node The node to store the new table with. + * @param {yfiles.graph.ITable} table The new table. + * @param {yfiles.support.ILookup} context The context that can optional be queried for additional service implementations. + * @return {boolean} Whether the table was successfully stored with the item. + * @see Specified by {@link yfiles.drawing.ITableProvider#setTable}. + */ + setTable(node:yfiles.graph.INode,table:yfiles.graph.ITable,context:yfiles.support.ILookup):boolean; + } + var ITableProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Abstract base implementation for {@link yfiles.drawing.ITableNodeStyle}. + * Implementers are required to implement the abstract {@link yfiles.drawing.AbstractTableNodeStyle#tableProvider} property that is responsible to + * provide a mapping between a table instance and the style. + */ + export interface AbstractTableNodeStyle extends yfiles.drawing.SimpleAbstractNodeStyle,yfiles.drawing.ITableNodeStyle{ + /** + * Specifies the order in which rows and columns are rendered. + */ + tableRenderingOrder:yfiles.drawing.TableRenderingOrder; + /** + * The style that is used to draw the background of the table. + * @see Specified by {@link yfiles.drawing.ITableNodeStyle#backgroundStyle}. + */ + backgroundStyle:yfiles.drawing.INodeStyle; + /** + * Gets the implementation of the {@link yfiles.drawing.ITableProvider} + * interface that can yield + * a table object for each item that will be assigned this style. + * Value: The implementation to use for yielding and storing the tag associated with items. + * @see Specified by {@link yfiles.drawing.ITableNodeStyle#tableProvider}. + */ + tableProvider:yfiles.drawing.ITableProvider; + /** + * Callback that creates the visual. + * This method is called in response to a {@link yfiles.drawing.IVisualCreator#createVisual} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractNodeStyle#renderer}. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @param {yfiles.drawing.IRenderContext} renderContext The render context. + * @return {TVisual} The visual as required by the {@link yfiles.drawing.IVisualCreator#createVisual} interface. + * @see {@link yfiles.drawing.SimpleAbstractNodeStyle#updateVisual} + */ + createVisual(node:yfiles.graph.INode,renderContext:yfiles.drawing.IRenderContext):yfiles.canvas.CanvasContainer; + /** + * Callback that updates the visual previously created by {@link yfiles.drawing.SimpleAbstractNodeStyle#createVisual}. + * This method is called in response to a {@link yfiles.drawing.IVisualCreator#updateVisual} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractNodeStyle#renderer}. + * This implementation simply delegates to {@link yfiles.drawing.SimpleAbstractNodeStyle#createVisual} so subclasses + * should override to improve rendering performance. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @param {yfiles.drawing.IRenderContext} renderContext The render context. + * @param {TVisual} oldVisual The visual that has been created in the call to {@link yfiles.drawing.SimpleAbstractNodeStyle#createVisual}. + * @return {TVisual} The visual as required by the {@link yfiles.drawing.IVisualCreator#createVisual} interface. + * @see {@link yfiles.drawing.SimpleAbstractNodeStyle#createVisual} + */ + updateVisual(node:yfiles.graph.INode,renderContext:yfiles.drawing.IRenderContext,oldVisual:yfiles.canvas.CanvasContainer):yfiles.canvas.CanvasContainer; + /** + * Performs the {@link yfiles.support.ILookup#lookup} operation for + * the {@link yfiles.drawing.IStyleRenderer#getContext} + * that has been queried from the {@link yfiles.drawing.SimpleAbstractNodeStyle#renderer}. + * This implementation yields null for everything but: + *
    + *
  • + * {@link yfiles.drawing.IHitTestable} + *
  • + *
  • + * {@link yfiles.drawing.IVisualCreator} + *
  • + *
  • + * {@link yfiles.drawing.IBoundsProvider} + *
  • + *
  • + * {@link yfiles.drawing.IVisibilityTest} + *
  • + *
  • + * {@link yfiles.drawing.IMarqueeTestable} + *
  • + *
  • + * {@link yfiles.support.ILookup} + *
  • + *
  • + * {@link yfiles.drawing.IShapeGeometry} + *
  • + *
  • + * {@link yfiles.model.IModelItemInstaller IModelItemInstaller<INode>} + *
  • + *
+ * For these interfaces an implementation will be returned that delegates to the methods in this instance. + * @param {yfiles.graph.INode} node The node to use for the context lookup. + * @param {yfiles.lang.Class} type The type to query. + * @return {Object} An implementation of the type or null. + */ + lookup(node:yfiles.graph.INode,type:yfiles.lang.Class):Object; + /** + * Occurs when a property value changes. + */ + addPropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Occurs when a property value changes. + */ + removePropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Raises the {@link yfiles.drawing.AbstractTableNodeStyle#addPropertyChangedListener PropertyChanged} event. + * @param {yfiles.system.PropertyChangedEventArgs} ea The {@link yfiles.system.PropertyChangedEventArgs} instance containing the event data. + */ + onPropertyChanged(ea:yfiles.system.PropertyChangedEventArgs):void; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var AbstractTableNodeStyle:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.AbstractTableNodeStyle; + }; + /** + * An abstract base class that makes it possible to easily implement a custom + * {@link yfiles.drawing.IPortStyle}. + * Only {@link yfiles.drawing.SimpleAbstractPortStyle#createVisual} and {@link yfiles.drawing.SimpleAbstractPortStyle#getBounds} need to be implemented + * by subclasses, however it is highly recommended to implement at least {@link yfiles.drawing.SimpleAbstractPortStyle#updateVisual}, too. + * This implementation differs from the straightforward {@link yfiles.drawing.IPortStyle} implementation + * in that there is no visible separation between the {@link yfiles.drawing.IVisualStyle} + * and its {@link yfiles.drawing.IStyleRenderer}. Instead the renderer used by the + * base class is fixed and delegates all calls back to the style instance. + */ + export interface SimpleAbstractPortStyle extends Object,yfiles.drawing.IPortStyle{ + /** + * Gets the renderer implementation for this instance. + * The private implementation will delegate all API calls back to this instance. + * @see Specified by {@link yfiles.drawing.IPortStyle#renderer}. + */ + renderer:yfiles.drawing.IPortStyleRenderer; + /** + * Callback that creates the visual. + * This method is called in response to a {@link yfiles.drawing.IVisualCreator#createVisual} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractPortStyle#renderer}. + * @param {yfiles.graph.IPort} port The port to which this style instance is assigned. + * @param {yfiles.drawing.IRenderContext} renderContext The render context. + * @return {TVisual} The visual as required by the {@link yfiles.drawing.IVisualCreator#createVisual} interface. + * @see {@link yfiles.drawing.SimpleAbstractPortStyle#updateVisual} + */ + createVisual(port:yfiles.graph.IPort,renderContext:yfiles.drawing.IRenderContext):TVisual; + /** + * Callback that updates the visual previously created by {@link yfiles.drawing.SimpleAbstractPortStyle#createVisual}. + * This method is called in response to a {@link yfiles.drawing.IVisualCreator#updateVisual} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractPortStyle#renderer}. + * This implementation simply delegates to {@link yfiles.drawing.SimpleAbstractPortStyle#createVisual} so subclasses + * should override to improve rendering performance. + * @param {yfiles.graph.IPort} port The port to which this style instance is assigned. + * @param {yfiles.drawing.IRenderContext} renderContext The render context. + * @param {TVisual} oldVisual The visual that has been created in the call to {@link yfiles.drawing.SimpleAbstractPortStyle#createVisual}. + * @return {TVisual} The visual as required by the {@link yfiles.drawing.IVisualCreator#createVisual} interface. + * @see {@link yfiles.drawing.SimpleAbstractPortStyle#createVisual} + */ + updateVisual(port:yfiles.graph.IPort,renderContext:yfiles.drawing.IRenderContext,oldVisual:TVisual):TVisual; + /** + * Callback that returns the bounds of the visual for the port in the given context. + * @param {yfiles.graph.IPort} port The port to which this style instance is assigned. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {yfiles.geometry.RectD} The visual bounds of the visual representation. + */ + getBounds(port:yfiles.graph.IPort,canvasContext:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Determines whether the visualization for the specified port is visible in the context. + * This method is called in response to a {@link yfiles.drawing.IVisibilityTest#isVisible} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractPortStyle#renderer}. + * This implementation simply tests whether the {@link yfiles.drawing.SimpleAbstractPortStyle#getBounds bounds} + * intersect the clip. + * @param {yfiles.graph.IPort} port The port to which this style instance is assigned. + * @param {yfiles.geometry.RectD} clip The clipping rectangle. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {boolean} + * true if the specified port is visible in the clipping rectangle; otherwise, false. + */ + isVisible(port:yfiles.graph.IPort,clip:yfiles.geometry.RectD,canvasContext:yfiles.canvas.ICanvasContext):boolean; + /** + * Determines whether the visual representation of the port has been hit at the given location. + *

+ * This method is called in response to a {@link yfiles.drawing.IHitTestable#isHit} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractPortStyle#renderer}. + *

+ *

+ * This implementation uses the {@link yfiles.drawing.SimpleAbstractPortStyle#getBounds bounds} to determine + * whether the port has been hit. + *

+ * @param {yfiles.graph.IPort} port The port to which this style instance is assigned. + * @param {yfiles.geometry.PointD} p The point to test. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {boolean} + * true if the specified port representation is hit; otherwise, false. + */ + isHit(port:yfiles.graph.IPort,p:yfiles.geometry.PointD,canvasContext:yfiles.canvas.ICanvasContext):boolean; + /** + * Determines whether the visualization for the specified port is included in the marquee selection. + *

+ * This method is called in response to a {@link yfiles.drawing.IMarqueeTestable#isInBox} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractPortStyle#renderer}. + *

+ *

+ * This implementation simply tests whether the {@link yfiles.drawing.SimpleAbstractPortStyle#getBounds bounds} + * intersect the marquee box. + *

+ * @param {yfiles.graph.IPort} port The port to which this style instance is assigned. + * @param {yfiles.geometry.RectD} box The marquee selection box. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {boolean} + * true if the specified port is visible is selected by the marquee rectangle; otherwise, false. + */ + isInBox(port:yfiles.graph.IPort,box:yfiles.geometry.RectD,canvasContext:yfiles.canvas.ICanvasContext):boolean; + /** + * Performs the {@link yfiles.support.ILookup#lookup} operation for + * the {@link yfiles.drawing.IStyleRenderer#getContext} + * that has been queried from the {@link yfiles.drawing.SimpleAbstractPortStyle#renderer}. + * This implementation yields null for everything but: + *
    + *
  • + * {@link yfiles.drawing.IHitTestable} + *
  • + *
  • + * {@link yfiles.drawing.IVisualCreator} + *
  • + *
  • + * {@link yfiles.drawing.IBoundsProvider} + *
  • + *
  • + * {@link yfiles.drawing.IVisibilityTest} + *
  • + *
  • + * {@link yfiles.drawing.IMarqueeTestable} + *
  • + *
  • + * {@link yfiles.support.ILookup} + *
  • + *
  • + * {@link yfiles.model.IModelItemInstaller IModelItemInstaller<IPort>} + *
  • + *
+ * For these interfaces an implementation will be returned that delegates to the methods in this instance. + * @param {yfiles.graph.IPort} port The port to use for the context lookup. + * @param {yfiles.lang.Class} type The type to query. + * @return {Object} An implementation of the type or null. + */ + lookup(port:yfiles.graph.IPort,type:yfiles.lang.Class):Object; + /** + * Installs the port using this style into the context. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.IPort):void; + /** + * Creates a new object that is a copy of the current instance. + * Immutable subclasses should consider returning this. + * @return {Object} + * A new object that is a copy of this instance using {@link Object#memberwiseClone}. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var SimpleAbstractPortStyle:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.SimpleAbstractPortStyle} class. + */ + new (visualType:yfiles.lang.Class):yfiles.drawing.SimpleAbstractPortStyle; + }; + /** + * An abstract base class that makes it possible to easily implement a custom + * {@link yfiles.drawing.IEdgeStyle}. + * The only method that needs to be implemented by subclasses is {@link yfiles.drawing.SimpleAbstractEdgeStyle#createVisual}, + * however it is highly recommended to implement at least {@link yfiles.drawing.SimpleAbstractEdgeStyle#updateVisual}, too. + * This implementation differs from the straightforward {@link yfiles.drawing.IEdgeStyle} implementation + * in that there is no visible separation between the {@link yfiles.drawing.IVisualStyle} + * and its {@link yfiles.drawing.IStyleRenderer}. Instead the renderer used by the + * base class is fixed and delegates all calls back to the style instance. + */ + export interface SimpleAbstractEdgeStyle extends Object,yfiles.drawing.IEdgeStyle{ + /** + * Gets the renderer implementation for this instance. + * The private implementation will delegate all API calls back to this instance. + * @see Specified by {@link yfiles.drawing.IEdgeStyle#renderer}. + */ + renderer:yfiles.drawing.IEdgeStyleRenderer; + /** + * Callback that creates the visual. + * This method is called in response to a {@link yfiles.drawing.IVisualCreator#createVisual} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractEdgeStyle#renderer}. + * @param {yfiles.graph.IEdge} edge The edge to which this style instance is assigned. + * @param {yfiles.drawing.IRenderContext} renderContext The render context. + * @return {TVisual} The visual as required by the {@link yfiles.drawing.IVisualCreator#createVisual} interface. + * @see {@link yfiles.drawing.SimpleAbstractEdgeStyle#updateVisual} + */ + createVisual(edge:yfiles.graph.IEdge,renderContext:yfiles.drawing.IRenderContext):TVisual; + /** + * Callback that updates the visual previously created by {@link yfiles.drawing.SimpleAbstractEdgeStyle#createVisual}. + * This method is called in response to a {@link yfiles.drawing.IVisualCreator#updateVisual} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractEdgeStyle#renderer}. + * This implementation simply delegates to {@link yfiles.drawing.SimpleAbstractEdgeStyle#createVisual} so subclasses + * should override to improve rendering performance. + * @param {yfiles.graph.IEdge} edge The edge to which this style instance is assigned. + * @param {yfiles.drawing.IRenderContext} renderContext The render context. + * @param {TVisual} oldVisual The visual that has been created in the call to {@link yfiles.drawing.SimpleAbstractEdgeStyle#createVisual}. + * @return {TVisual} The visual as required by the {@link yfiles.drawing.IVisualCreator#createVisual} interface. + * @see {@link yfiles.drawing.SimpleAbstractEdgeStyle#createVisual} + */ + updateVisual(edge:yfiles.graph.IEdge,renderContext:yfiles.drawing.IRenderContext,oldVisual:TVisual):TVisual; + /** + * Gets the bounds of the visual for the edge in the given context. + * This method is called in response to a {@link yfiles.drawing.IBoundsProvider#getBounds} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractEdgeStyle#renderer}. + * This implementation simply yields a {@link yfiles.geometry.RectD rectangle} containing. + * the locations of the {@link yfiles.graph.IEdge#sourcePort source port} and the + * {@link yfiles.graph.IEdge#targetPort target port} of the edge and the locations of + * all its {@link yfiles.graph.IEdge#bends bends}. + * @param {yfiles.graph.IEdge} edge The edge to which this style instance is assigned. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {yfiles.geometry.RectD} The visual bounds of the visual representation. + */ + getBounds(edge:yfiles.graph.IEdge,canvasContext:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Determines whether the visualization for the specified edge is visible in the context. + * This method is called in response to a {@link yfiles.drawing.IVisibilityTest#isVisible} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractEdgeStyle#renderer}. + * This implementation simply tests whether the {@link yfiles.drawing.SimpleAbstractEdgeStyle#getBounds bounds} + * intersect the clip. + * @param {yfiles.graph.IEdge} edge The edge to which this style instance is assigned. + * @param {yfiles.geometry.RectD} clip The clipping rectangle. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {boolean} + * true if the specified edge is visible in the clipping rectangle; otherwise, false. + */ + isVisible(edge:yfiles.graph.IEdge,clip:yfiles.geometry.RectD,canvasContext:yfiles.canvas.ICanvasContext):boolean; + /** + * Determines whether the visual representation of the edge has been hit at the given location. + *

+ * This method is called in response to a {@link yfiles.drawing.IHitTestable#isHit} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractEdgeStyle#renderer}. + *

+ *

+ * This implementation returns the result of the {@link yfiles.geometry.PointD#hitsPolyline} method of + * class {@link yfiles.geometry.PointD} with the polygonal line defined by the source port, the target port and + * the bends of the edge and the {@link yfiles.canvas.ICanvasContext#hitTestRadius} of the + * {@link yfiles.canvas.ICanvasContext canvas context}. + *

+ * @param {yfiles.graph.IEdge} edge The edge to which this style instance is assigned. + * @param {yfiles.geometry.PointD} p The point to test. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {boolean} + * true if the specified edge representation is hit; otherwise, false. + * @see {@link yfiles.geometry.PointD#hitsPolyline} + */ + isHit(edge:yfiles.graph.IEdge,p:yfiles.geometry.PointD,canvasContext:yfiles.canvas.ICanvasContext):boolean; + /** + * Determines whether the visualization for the specified edge is included in the marquee selection. + *

+ * This method is called in response to a {@link yfiles.drawing.IMarqueeTestable#isInBox} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractEdgeStyle#renderer}. + *

+ *

+ * This implementation returns the result of the {@link yfiles.geometry.RectD#intersectsPolyline} method of class + * {@link yfiles.geometry.RectD} with the polygonal line defined by the source port, the target port and + * the bends of the edge. + *

+ * @param {yfiles.graph.IEdge} edge The edge to which this style instance is assigned. + * @param {yfiles.geometry.RectD} box The marquee selection box. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {boolean} + * true if the specified edge is visible is selected by the marquee rectangle; otherwise, false. + */ + isInBox(edge:yfiles.graph.IEdge,box:yfiles.geometry.RectD,canvasContext:yfiles.canvas.ICanvasContext):boolean; + /** + * Performs the {@link yfiles.support.ILookup#lookup} operation for + * the {@link yfiles.drawing.IStyleRenderer#getContext} + * that has been queried from the {@link yfiles.drawing.SimpleAbstractEdgeStyle#renderer}. + * This implementation yields null for everything but: + *
    + *
  • + * {@link yfiles.drawing.IHitTestable} + *
  • + *
  • + * {@link yfiles.drawing.IVisualCreator} + *
  • + *
  • + * {@link yfiles.drawing.IBoundsProvider} + *
  • + *
  • + * {@link yfiles.drawing.IVisibilityTest} + *
  • + *
  • + * {@link yfiles.drawing.IMarqueeTestable} + *
  • + *
  • + * {@link yfiles.support.ILookup} + *
  • + *
  • + * {@link yfiles.drawing.IPathGeometry} + *
  • + *
  • + * {@link yfiles.model.IModelItemInstaller IModelItemInstaller<IEdge>} + *
  • + *
+ * For these interfaces an implementation will be returned that delegates to the methods in this instance. + * @param {yfiles.graph.IEdge} edge The edge to use for the context lookup. + * @param {yfiles.lang.Class} type The type to query. + * @return {Object} An implementation of the type or null. + */ + lookup(edge:yfiles.graph.IEdge,type:yfiles.lang.Class):Object; + /** + * Installs the edge using this style into the context. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.IEdge):void; + /** + * Creates a new object that is a copy of the current instance. + * Immutable subclasses should consider returning this. + * @return {Object} + * A new object that is a copy of this instance using {@link Object#memberwiseClone}. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + /** + * Gets the tangent to the edge at the specified ratio and the corresponding touch point. + * @param {yfiles.graph.IEdge} edge The edge. + * @param {number} ratio A value between 0 and 1 inclusively that indicates a ratio from + * the beginning to the end of the path of the edge. + * @param {yfiles.geometry.PointD} p The out parameter for the touch point of the tangent. + * @param {yfiles.geometry.PointD} tangent The out parameter for the tangent vector. + * @return {boolean} True, if a tangent was obtained with the specified parameters. + */ + getTangent(edge:yfiles.graph.IEdge,ratio:number,p:{value:yfiles.geometry.PointD;},tangent:{value:yfiles.geometry.PointD;}):boolean; + /** + * Gets the tangent to the edge at the specified ratio of a segment of the edge and + * the corresponding touch point. + * @param {yfiles.graph.IEdge} edge The edge. + * @param {number} segmentIndex Index of the segment of the edge. + * @param {number} ratio A value between 0 and 1 inclusively that indicates a ratio from + * the beginning to the end of the segment of the edge. + * @param {yfiles.geometry.PointD} p The out parameter for the touch point of the tangent. + * @param {yfiles.geometry.PointD} tangent The out parameter for the tangent vector. + * @return {boolean} True, if a tangent was obtained with the specified parameters. + */ + getTangentForSegment(edge:yfiles.graph.IEdge,segmentIndex:number,ratio:number,p:{value:yfiles.geometry.PointD;},tangent:{value:yfiles.geometry.PointD;}):boolean; + /** + * Gets the path of the edge. + * @param {yfiles.graph.IEdge} edge The edge. + * @return {yfiles.drawing.GeneralPath} The path. + */ + getPath(edge:yfiles.graph.IEdge):yfiles.drawing.GeneralPath; + /** + * Gets the number of segments of the edge. + * @param {yfiles.graph.IEdge} edge The edge. + * @return {number} The segment count. + */ + getSegmentCount(edge:yfiles.graph.IEdge):number; + /** + * Convenience method that calculates the target arrow anchor and direction for a a given arrow and path. + * @param {yfiles.drawing.GeneralPath} path The path of the edge. + * @param {yfiles.drawing.IArrow} arrow The arrow. + * @param {yfiles.geometry.PointD} anchorPoint The anchor point result. + * @param {yfiles.geometry.PointD} arrowDirection The arrow direction result. + * @return {boolean} Whether the values are valid. + */ + getTargetArrowAnchor(path:yfiles.drawing.GeneralPath,arrow:yfiles.drawing.IArrow,anchorPoint:{value:yfiles.geometry.PointD;},arrowDirection:{value:yfiles.geometry.PointD;}):boolean; + /** + * Convenience method that calculates the source arrow anchor and direction for a a given arrow and path. + * @param {yfiles.drawing.GeneralPath} path The path of the edge. + * @param {yfiles.drawing.IArrow} arrow The arrow. + * @param {yfiles.geometry.PointD} anchorPoint The anchor point result. + * @param {yfiles.geometry.PointD} arrowDirection The arrow direction result. + * @return {boolean} Whether the values are valid. + */ + getSourceArrowAnchor(path:yfiles.drawing.GeneralPath,arrow:yfiles.drawing.IArrow,anchorPoint:{value:yfiles.geometry.PointD;},arrowDirection:{value:yfiles.geometry.PointD;}):boolean; + /** + * Convenience method that crops the edge's path at the nodes. + * This implementation uses the {@link yfiles.drawing.IEdgeIntersectionCalculator} instances + * found in the {@link yfiles.support.ILookup#lookup} of the source and target port + * of the edge to perform the actual cropping. + * @param {yfiles.graph.IEdge} edge The edge that is being rendered. + * @param {yfiles.drawing.GeneralPath} pathToCrop The path that should be cropped. + * @param {yfiles.drawing.IArrow} sourceArrow The source arrow instance. + * @param {yfiles.drawing.IArrow} targetArrow The target arrow instance. + */ + cropPath(edge:yfiles.graph.IEdge,sourceArrow:yfiles.drawing.IArrow,targetArrow:yfiles.drawing.IArrow,pathToCrop:{value:yfiles.drawing.GeneralPath;}):void; + /** + * Convenience method that adds the arrows to a given container. + * @param {yfiles.drawing.IRenderContext} context The context for the rendering. + * @param {yfiles.canvas.CanvasContainer} container The container to which the arrows should be added. + * @param {yfiles.graph.IEdge} edge The edge that is being rendered. + * @param {yfiles.drawing.GeneralPath} edgePath The edge path. + * @param {yfiles.drawing.IArrow} sourceArrow The source arrow. + * @param {yfiles.drawing.IArrow} targetArrow The target arrow. + */ + addArrows(context:yfiles.drawing.IRenderContext,container:yfiles.canvas.CanvasContainer,edge:yfiles.graph.IEdge,edgePath:yfiles.drawing.GeneralPath,sourceArrow:yfiles.drawing.IArrow,targetArrow:yfiles.drawing.IArrow):void; + /** + * Convenience method that updates the arrows in a given container. + * @param {yfiles.drawing.IRenderContext} context The context for the rendering. + * @param {yfiles.canvas.CanvasContainer} container The container to which the arrows should be added. + * @param {yfiles.graph.IEdge} edge The edge that is being rendered. + * @param {yfiles.drawing.GeneralPath} edgePath The edge path. + * @param {yfiles.drawing.IArrow} sourceArrow The source arrow. + * @param {yfiles.drawing.IArrow} targetArrow The target arrow. + */ + updateArrows(context:yfiles.drawing.IRenderContext,container:yfiles.canvas.CanvasContainer,edge:yfiles.graph.IEdge,edgePath:yfiles.drawing.GeneralPath,sourceArrow:yfiles.drawing.IArrow,targetArrow:yfiles.drawing.IArrow):void; + } + var SimpleAbstractEdgeStyle:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.SimpleAbstractEdgeStyle} class. + */ + new (visualType:yfiles.lang.Class):yfiles.drawing.SimpleAbstractEdgeStyle; + }; + /** + * An abstract base class that makes it possible to easily implement a custom + * {@link yfiles.drawing.ILabelStyle}. + * Only {@link yfiles.drawing.SimpleAbstractLabelStyle#createVisual} and {@link yfiles.drawing.SimpleAbstractLabelStyle#getPreferredSize} need to be implemented + * by subclasses, however it is highly recommended to implement at least {@link yfiles.drawing.SimpleAbstractLabelStyle#updateVisual}, too. + * This implementation differs from the straightforward {@link yfiles.drawing.ILabelStyle} implementation + * in that there is no visible separation between the {@link yfiles.drawing.IVisualStyle} + * and its {@link yfiles.drawing.IStyleRenderer}. Instead the renderer used by the + * base class is fixed and delegates all calls back to the style instance. + */ + export interface SimpleAbstractLabelStyle extends Object,yfiles.drawing.ILabelStyle{ + /** + * Gets the renderer implementation for this instance. + * The private implementation will delegate all API calls back to this instance. + * @see Specified by {@link yfiles.drawing.ILabelStyle#renderer}. + */ + renderer:yfiles.drawing.ILabelStyleRenderer; + /** + * Arranges the given visual for use in a {@link yfiles.canvas.CanvasContainer} using the provided layout + * and auto flipping rule. + * @param {yfiles.drawing.Visual} visual The visual to arrange. + * @param {yfiles.geometry.IOrientedRectangle} layout The layout to use for arranging. + * @param {boolean} autoFlip if set to true auto flipping logic will be applied. + */ + arrangeByLayout(visual:yfiles.drawing.Visual,layout:yfiles.geometry.IOrientedRectangle,autoFlip:boolean):void; + /** + * Callback that creates the visual. + * This method is called in response to a {@link yfiles.drawing.IVisualCreator#createVisual} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractLabelStyle#renderer}. + * @param {yfiles.graph.ILabel} label The label to which this style instance is assigned. + * @param {yfiles.drawing.IRenderContext} renderContext The render context. + * @return {TVisual} The visual as required by the {@link yfiles.drawing.IVisualCreator#createVisual} interface. + * @see {@link yfiles.drawing.SimpleAbstractLabelStyle#updateVisual} + */ + createVisual(label:yfiles.graph.ILabel,renderContext:yfiles.drawing.IRenderContext):TVisual; + /** + * Callback that updates the visual previously created by {@link yfiles.drawing.SimpleAbstractLabelStyle#createVisual}. + * This method is called in response to a {@link yfiles.drawing.IVisualCreator#updateVisual} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractLabelStyle#renderer}. + * This implementation simply delegates to {@link yfiles.drawing.SimpleAbstractLabelStyle#createVisual} so subclasses + * should override to improve rendering performance. + * @param {yfiles.graph.ILabel} label The label to which this style instance is assigned. + * @param {yfiles.drawing.IRenderContext} renderContext The render context. + * @param {TVisual} oldVisual The visual that has been created in the call to {@link yfiles.drawing.SimpleAbstractLabelStyle#createVisual}. + * @return {TVisual} The visual as required by the {@link yfiles.drawing.IVisualCreator#createVisual} interface. + * @see {@link yfiles.drawing.SimpleAbstractLabelStyle#createVisual} + */ + updateVisual(label:yfiles.graph.ILabel,renderContext:yfiles.drawing.IRenderContext,oldVisual:TVisual):TVisual; + /** + * Gets the bounds of the visual for the label in the given context. + *

+ * This method is called in response to a {@link yfiles.drawing.IBoundsProvider#getBounds} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractLabelStyle#renderer}. + *

+ *

+ * This implementation simply yields the {@link yfiles.support.OrientedRectangleExtensions#getBounds bounds} + * of the {@link yfiles.graph.ILabel#layout layout} of the given label. + *

+ * @param {yfiles.graph.ILabel} label The label to which this style instance is assigned. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {yfiles.geometry.RectD} The visual bounds of the visual representation. + */ + getBounds(label:yfiles.graph.ILabel,canvasContext:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Determines whether the visualization for the specified label is visible in the context. + *

+ * This method is called in response to a {@link yfiles.drawing.IVisibilityTest#isVisible} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractLabelStyle#renderer}. + *

+ *

+ * This implementation simply tests whether the {@link yfiles.drawing.SimpleAbstractLabelStyle#getBounds bounds} + * intersect the clip. + *

+ * @param {yfiles.graph.ILabel} label The label to which this style instance is assigned. + * @param {yfiles.geometry.RectD} clip The clipping rectangle. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {boolean} + * true if the specified label is visible in the clipping rectangle; otherwise, false. + */ + isVisible(label:yfiles.graph.ILabel,clip:yfiles.geometry.RectD,canvasContext:yfiles.canvas.ICanvasContext):boolean; + /** + * Determines whether the visual representation of the label has been hit at the given location. + *

+ * This method is called in response to a {@link yfiles.drawing.IHitTestable#isHit} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractLabelStyle#renderer}. + *

+ *

+ * This implementation returns the result of the {@link yfiles.support.OrientedRectangleExtensions#hits} + * method invoked for the {@link yfiles.graph.ILabel#layout layout} of the label, the + * given {@link yfiles.geometry.PointD point} and the + * {@link yfiles.canvas.ICanvasContext#hitTestRadius hit test radius} of the + * {@link yfiles.canvas.ICanvasContext canvas context}. + *

+ * @param {yfiles.graph.ILabel} label The label to which this style instance is assigned. + * @param {yfiles.geometry.PointD} p The point to test. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {boolean} + * true if the specified label representation is hit; otherwise, false. + */ + isHit(label:yfiles.graph.ILabel,p:yfiles.geometry.PointD,canvasContext:yfiles.canvas.ICanvasContext):boolean; + /** + * Determines whether the visualization for the specified label is included in the marquee selection. + *

+ * This method is called in response to a {@link yfiles.drawing.IMarqueeTestable#isInBox} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractLabelStyle#renderer}. + *

+ *

+ * This implementation returns the result of the {@link yfiles.geometry.RectD#intersectsOrientedRectangleEps} + * method invoked on box + * for the {@link yfiles.graph.ILabel#layout layout} of the label and the + * canvasContext. + *

+ * @param {yfiles.graph.ILabel} label The label to which this style instance is assigned. + * @param {yfiles.geometry.RectD} box The marquee selection box. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {boolean} + * true if the specified label is visible is selected by the marquee rectangle; otherwise, false. + */ + isInBox(label:yfiles.graph.ILabel,box:yfiles.geometry.RectD,canvasContext:yfiles.canvas.ICanvasContext):boolean; + /** + * Performs the {@link yfiles.support.ILookup#lookup} operation for + * the {@link yfiles.drawing.IStyleRenderer#getContext} + * that has been queried from the {@link yfiles.drawing.SimpleAbstractLabelStyle#renderer}. + * This implementation yields null for everything but: + *
    + *
  • + * {@link yfiles.drawing.IHitTestable} + *
  • + *
  • + * {@link yfiles.drawing.IVisualCreator} + *
  • + *
  • + * {@link yfiles.drawing.IBoundsProvider} + *
  • + *
  • + * {@link yfiles.drawing.IVisibilityTest} + *
  • + *
  • + * {@link yfiles.drawing.IMarqueeTestable} + *
  • + *
  • + * {@link yfiles.support.ILookup} + *
  • + *
  • + * {@link yfiles.model.IModelItemInstaller IModelItemInstaller<ILabel>} + *
  • + *
+ * For these interfaces an implementation will be returned that delegates to the methods in this instance. + * @param {yfiles.graph.ILabel} label The label to use for the context lookup. + * @param {yfiles.lang.Class} type The type to query. + * @return {Object} An implementation of the type or null. + */ + lookup(label:yfiles.graph.ILabel,type:yfiles.lang.Class):Object; + /** + * Installs the label using this style into the context. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.ILabel):void; + /** + * Creates a new object that is a copy of the current instance. + * Immutable subclasses should consider returning this. + * @return {Object} + * A new object that is a copy of this instance using {@link Object#memberwiseClone}. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + /** + * Callback that returns the preferred {@link yfiles.geometry.SizeD size} of the label. + * @param {yfiles.graph.ILabel} label The label to which this style instance is assigned. + * @return {yfiles.geometry.SizeD} The preferred size. + */ + getPreferredSize(label:yfiles.graph.ILabel):yfiles.geometry.SizeD; + } + var SimpleAbstractLabelStyle:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.SimpleAbstractLabelStyle} class. + */ + new (visualType:yfiles.lang.Class):yfiles.drawing.SimpleAbstractLabelStyle; + }; + /** + * An abstract base class that makes it possible to easily implement a custom + * {@link yfiles.drawing.INodeStyle}. + * The only method that needs to be implemented by subclasses is {@link yfiles.drawing.SimpleAbstractNodeStyle#createVisual}, + * however it is highly recommended to implement at least {@link yfiles.drawing.SimpleAbstractNodeStyle#updateVisual}, too. + * This implementation differs from the straightforward {@link yfiles.drawing.INodeStyle} implementation + * in that there is no visible separation between the {@link yfiles.drawing.IVisualStyle} + * and its {@link yfiles.drawing.IStyleRenderer}. Instead the renderer used by the + * base class is fixed and delegates all calls back to the style instance. + */ + export interface SimpleAbstractNodeStyle extends Object,yfiles.drawing.INodeStyle{ + /** + * Gets the renderer implementation for this instance. + * The private implementation will delegate all API calls back to this instance. + * @see Specified by {@link yfiles.drawing.INodeStyle#renderer}. + */ + renderer:yfiles.drawing.INodeStyleRenderer; + /** + * Callback that creates the visual. + * This method is called in response to a {@link yfiles.drawing.IVisualCreator#createVisual} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractNodeStyle#renderer}. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @param {yfiles.drawing.IRenderContext} renderContext The render context. + * @return {TVisual} The visual as required by the {@link yfiles.drawing.IVisualCreator#createVisual} interface. + * @see {@link yfiles.drawing.SimpleAbstractNodeStyle#updateVisual} + */ + createVisual(node:yfiles.graph.INode,renderContext:yfiles.drawing.IRenderContext):TVisual; + /** + * Callback that updates the visual previously created by {@link yfiles.drawing.SimpleAbstractNodeStyle#createVisual}. + * This method is called in response to a {@link yfiles.drawing.IVisualCreator#updateVisual} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractNodeStyle#renderer}. + * This implementation simply delegates to {@link yfiles.drawing.SimpleAbstractNodeStyle#createVisual} so subclasses + * should override to improve rendering performance. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @param {yfiles.drawing.IRenderContext} renderContext The render context. + * @param {TVisual} oldVisual The visual that has been created in the call to {@link yfiles.drawing.SimpleAbstractNodeStyle#createVisual}. + * @return {TVisual} The visual as required by the {@link yfiles.drawing.IVisualCreator#createVisual} interface. + * @see {@link yfiles.drawing.SimpleAbstractNodeStyle#createVisual} + */ + updateVisual(node:yfiles.graph.INode,renderContext:yfiles.drawing.IRenderContext,oldVisual:TVisual):TVisual; + /** + * Gets the bounds of the visual for the node in the given context. + * This method is called in response to a {@link yfiles.drawing.IBoundsProvider#getBounds} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractNodeStyle#renderer}. + * This implementation simply yields the {@link yfiles.graph.INode#layout}. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {yfiles.geometry.RectD} The visual bounds of the visual representation. + */ + getBounds(node:yfiles.graph.INode,canvasContext:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Determines whether the visualization for the specified node is visible in the context. + * This method is called in response to a {@link yfiles.drawing.IVisibilityTest#isVisible} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractNodeStyle#renderer}. + * This implementation simply tests whether the {@link yfiles.drawing.SimpleAbstractNodeStyle#getBounds bounds} + * intersect the clip. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @param {yfiles.geometry.RectD} clip The clipping rectangle. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {boolean} + * true if the specified node is visible in the clipping rectangle; otherwise, false. + */ + isVisible(node:yfiles.graph.INode,clip:yfiles.geometry.RectD,canvasContext:yfiles.canvas.ICanvasContext):boolean; + /** + * Determines whether the visual representation of the node has been hit at the given location. + * This method is called in response to a {@link yfiles.drawing.IHitTestable#isHit} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractNodeStyle#renderer}. + * This implementation uses the {@link yfiles.drawing.SimpleAbstractNodeStyle#getOutline outline} to determine + * whether the node has been hit. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @param {yfiles.geometry.PointD} p The point to test. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {boolean} + * true if the specified node representation is hit; otherwise, false. + */ + isHit(node:yfiles.graph.INode,p:yfiles.geometry.PointD,canvasContext:yfiles.canvas.ICanvasContext):boolean; + /** + * Determines whether the visualization for the specified node is included in the marquee selection. + * This method is called in response to a {@link yfiles.drawing.IMarqueeTestable#isInBox} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractNodeStyle#renderer}. + * This implementation simply tests whether the {@link yfiles.drawing.SimpleAbstractNodeStyle#getBounds bounds} + * intersect the marquee box. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @param {yfiles.geometry.RectD} box The marquee selection box. + * @param {yfiles.canvas.ICanvasContext} canvasContext The canvas context. + * @return {boolean} + * true if the specified node is visible is selected by the marquee rectangle; otherwise, false. + */ + isInBox(node:yfiles.graph.INode,box:yfiles.geometry.RectD,canvasContext:yfiles.canvas.ICanvasContext):boolean; + /** + * Performs the {@link yfiles.support.ILookup#lookup} operation for + * the {@link yfiles.drawing.IStyleRenderer#getContext} + * that has been queried from the {@link yfiles.drawing.SimpleAbstractNodeStyle#renderer}. + * This implementation yields null for everything but: + *
    + *
  • + * {@link yfiles.drawing.IHitTestable} + *
  • + *
  • + * {@link yfiles.drawing.IVisualCreator} + *
  • + *
  • + * {@link yfiles.drawing.IBoundsProvider} + *
  • + *
  • + * {@link yfiles.drawing.IVisibilityTest} + *
  • + *
  • + * {@link yfiles.drawing.IMarqueeTestable} + *
  • + *
  • + * {@link yfiles.support.ILookup} + *
  • + *
  • + * {@link yfiles.drawing.IShapeGeometry} + *
  • + *
  • + * {@link yfiles.model.IModelItemInstaller IModelItemInstaller<INode>} + *
  • + *
+ * For these interfaces an implementation will be returned that delegates to the methods in this instance. + * @param {yfiles.graph.INode} node The node to use for the context lookup. + * @param {yfiles.lang.Class} type The type to query. + * @return {Object} An implementation of the type or null. + */ + lookup(node:yfiles.graph.INode,type:yfiles.lang.Class):Object; + /** + * Gets the intersection of a line with the visual representation of the node. + * This method is called in response to a {@link yfiles.drawing.IShapeGeometry#getIntersection} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractNodeStyle#renderer}. + * This implementation simply uses the {@link yfiles.drawing.SimpleAbstractNodeStyle#getOutline outline} + * to determine the intersection or the {@link yfiles.graph.INode#layout} + * if the outline is null. + * If it is feasible to determine + * the intersection point for the current shape, this method should be implemented + * in addition to {@link yfiles.drawing.SimpleAbstractNodeStyle#getOutline} to improve performance. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @param {yfiles.geometry.PointD} inner The coordinates of a point lying {@link yfiles.drawing.SimpleAbstractNodeStyle#isInside inside} the shape. + * @param {yfiles.geometry.PointD} outer The coordinates of a point lying outside the shape. + * @return {yfiles.geometry.PointD} The intersection point if one has been found or null, otherwise. + * @see {@link yfiles.drawing.SimpleAbstractNodeStyle#isInside} + */ + getIntersection(node:yfiles.graph.INode,inner:yfiles.geometry.PointD,outer:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Determines whether the provided point is geometrically inside the visual bounds of the node. + * This method is called in response to a {@link yfiles.drawing.IShapeGeometry#isInside} + * call to the instance that has been queried from the {@link yfiles.drawing.SimpleAbstractNodeStyle#renderer}. + * This implementation simply uses the {@link yfiles.drawing.SimpleAbstractNodeStyle#getOutline outline} + * to determine whether the point is contained or the {@link yfiles.graph.INode#layout} + * if the outline is null. If it is feasible to determine + * whether a given point lies inside the shape, this method should be implemented + * in addition to {@link yfiles.drawing.SimpleAbstractNodeStyle#getOutline} to improve performance. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @param {yfiles.geometry.PointD} point The point to test. + * @return {boolean} Whether the point is considered to lie inside the shape. + */ + isInside(node:yfiles.graph.INode,point:yfiles.geometry.PointD):boolean; + /** + * Gets the outline of the visual style. + * This implementation yields null to indicate that + * the {@link yfiles.graph.INode#layout} depicts the outline. + * Implementing this method influences the behavior of {@link yfiles.drawing.SimpleAbstractNodeStyle#isInside} + * and {@link yfiles.drawing.SimpleAbstractNodeStyle#getIntersection} since the default implementations delegate to it. + * @param {yfiles.graph.INode} node The node to which this style instance is assigned. + * @return {yfiles.drawing.GeneralPath} The outline of the visual representation or null. + */ + getOutline(node:yfiles.graph.INode):yfiles.drawing.GeneralPath; + /** + * Installs the node using this style into the context. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.INode):void; + /** + * Creates a new object that is a copy of the current instance. + * Immutable subclasses should consider returning this. + * @return {Object} + * A new object that is a copy of this instance using {@link Object#memberwiseClone}. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var SimpleAbstractNodeStyle:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.SimpleAbstractNodeStyle} class. + */ + new (visualType:yfiles.lang.Class):yfiles.drawing.SimpleAbstractNodeStyle; + }; + /** + * A label model for labels that is especially tailored to be used as a model for the four default positions where the label of a stripe may lie. + * This label model supports four positions inside of the stripe bounds. The east and west positions are rotated automatically. The {@link yfiles.graph.ILabel#owner} is expected to be an {@link yfiles.graph.IStripe} instance, i.e. + * the parameter supports only {@link yfiles.graph.IStripe} instances. + */ + export interface StretchStripeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{ + /** + * Gets or sets the insets to use within the stripe's {@link yfiles.graph.IStripe#layout}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Whether to use the {@link yfiles.graph.StripeExtensions#getActualInsets actual insets} or the normal {@link yfiles.graph.IStripe#insets} of a stripe for centering the label inside the stripe + * header area. + * If true the header insets are used. Default is false + */ + useActualInsets:boolean; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * The geometry is calculated in table coordinates, i.e. relative to {@link yfiles.graph.ITable#relativeLocation}. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Creates the parameter for the given position. + * @param {yfiles.drawing.StretchStripeLabelModel.Position} position The position. + * @return {yfiles.graph.ILabelModelParameter} + */ + createParameter(position:yfiles.drawing.StretchStripeLabelModel.Position_Interface):yfiles.graph.ILabelModelParameter; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,labelModel:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + } + export module StretchStripeLabelModel{ + export interface Position_Interface{} + } + var StretchStripeLabelModel:{ + $class:yfiles.lang.Class; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.StretchStripeLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + NORTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.StretchStripeLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + SOUTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.StretchStripeLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.StretchStripeLabelModel#insets} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + WEST:yfiles.graph.ILabelModelParameter; + Position:{ + NORTH:yfiles.drawing.StretchStripeLabelModel.Position_Interface; + EAST:yfiles.drawing.StretchStripeLabelModel.Position_Interface; + SOUTH:yfiles.drawing.StretchStripeLabelModel.Position_Interface; + WEST:yfiles.drawing.StretchStripeLabelModel.Position_Interface; + }; + /** + * Creates a new instance of this model with empty insets. + */ + new ():yfiles.drawing.StretchStripeLabelModel; + }; + /** + * A label model for labels that is especially tailored to be used as a model for the four default positions where the label of a stripe may lie. + * This label model supports four positions inside of the stripe bounds. The east and west positions are rotated automatically. The {@link yfiles.graph.ILabel#owner} is expected to be an {@link yfiles.graph.IStripe} instance, i.e. + * the parameter supports only {@link yfiles.graph.IStripe} instances. + */ + export interface StripeLabelModel extends Object,yfiles.graph.ILabelModel,yfiles.graph.ILabelModelParameterProvider{ + /** + * Whether to use the {@link yfiles.graph.StripeExtensions#getActualInsets actual insets} or the normal {@link yfiles.graph.IStripe#insets} of a stripe for centering the label inside the stripe + * header area. + * If true the header insets are used. Default is false + */ + useActualInsets:boolean; + /** + * The ratio how far the label should be positioned from the border in the header area. + * 0 means the label is positioned on the outer border, 1 means it is positioned at the inner border of the header or inset area. Default value is 0.5 + */ + ratio:number; + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * The geometry is calculated in table coordinates, i.e. relative to {@link yfiles.graph.ITable#relativeLocation}. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + /** + * Creates the parameter for the given position. + * @param {yfiles.drawing.StripeLabelModel.Position} position The position. + * @return {yfiles.graph.ILabelModelParameter} + */ + createParameter(position:yfiles.drawing.StripeLabelModel.Position_Interface):yfiles.graph.ILabelModelParameter; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,labelModel:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + } + export module StripeLabelModel{ + export interface Position_Interface{} + } + var StripeLabelModel:{ + $class:yfiles.lang.Class; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.StripeLabelModel#ratio} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + NORTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.StripeLabelModel#ratio} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + SOUTH:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.StripeLabelModel#ratio} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + EAST:yfiles.graph.ILabelModelParameter; + /** + * A convenience parameter instance that can be shared between + * label instances. + * Trying to change that instances' {@link yfiles.drawing.StripeLabelModel#ratio} + * will raise an {@link yfiles.system.InvalidOperationException}. + */ + WEST:yfiles.graph.ILabelModelParameter; + Position:{ + NORTH:yfiles.drawing.StripeLabelModel.Position_Interface; + EAST:yfiles.drawing.StripeLabelModel.Position_Interface; + SOUTH:yfiles.drawing.StripeLabelModel.Position_Interface; + WEST:yfiles.drawing.StripeLabelModel.Position_Interface; + }; + /** + * Creates a new instance of this model with empty insets. + */ + new ():yfiles.drawing.StripeLabelModel; + }; + export enum TableRenderingOrder{ + /** + * Draw columns, then rows. + */ + COLUMNS_FIRST, + /** + * Draw rows, then columns. + */ + ROWS_FIRST + } + /** + * Default implementation of {@link yfiles.drawing.AbstractTableNodeStyle} that stores the table instance in the style instance. + * For this implementations, style instances cannot be shared among different node instances. + */ + export interface TableNodeStyle extends yfiles.drawing.AbstractTableNodeStyle{ + /** + * Get or set the table instance that defines the tabular structure. + */ + table:yfiles.graph.ITable; + /** + * Gets or sets the implementation of the {@link yfiles.drawing.ITableProvider} + * interface that can yield + * a table object for each item that will be assigned this style. + * Value: This implementation always returns the style instance itself. + * @see Overrides {@link yfiles.drawing.AbstractTableNodeStyle#tableProvider} + * @see Specified by {@link yfiles.drawing.ITableNodeStyle#tableProvider}. + */ + tableProvider:yfiles.drawing.ITableProvider; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + /** + * Create a copy of the background style when this style instance is cloned. + * @param {yfiles.drawing.INodeStyle} nodeStyle The original background node style + * @return {yfiles.drawing.INodeStyle} This implementation always returns the original nodeStyle instance. + */ + copyBackgroundStyle(nodeStyle:yfiles.drawing.INodeStyle):yfiles.drawing.INodeStyle; + /** + * Create a copy of the table when this style instance is cloned. + * @param {yfiles.graph.ITable} originalTable The original table instance + * @return {yfiles.graph.ITable} This implementation always tries to {@link yfiles.system.ICloneable#clone} clone the original originalTable instance, if possible, otherwise it returns + * originalTable unchanged. + */ + copyTable(originalTable:yfiles.graph.ITable):yfiles.graph.ITable; + } + var TableNodeStyle:{ + $class:yfiles.lang.Class; + /** + * Default constructor that creates an empty table. + */ + new ():yfiles.drawing.TableNodeStyle; + /** + * Constructor that uses table as backing table model. + * @param {yfiles.graph.ITable} table The table instance that defines the tabular structure. + */ + TableNodeStyle:{ + new (table:yfiles.graph.ITable):yfiles.drawing.TableNodeStyle; + }; + }; + /** + * Default implementation of {@link yfiles.drawing.AbstractTableNodeStyle} that retrieves the table instance from the node's {@link yfiles.support.ITagOwner#tag}. + * For this implementations, style instances can be shared among different node instances, however, the user tag must be copied. + */ + export interface DynamicTableNodeStyle extends yfiles.drawing.AbstractTableNodeStyle{ + /** + * Gets or sets the implementation of the {@link yfiles.drawing.ITableProvider} + * interface that can yield + * a table object for each item that will be assigned this style. + * Value: This implementation always returns {@link yfiles.drawing.TagOwnerTableProvider#INSTANCE}. + * @see Overrides {@link yfiles.drawing.AbstractTableNodeStyle#tableProvider} + * @see Specified by {@link yfiles.drawing.ITableNodeStyle#tableProvider}. + */ + tableProvider:yfiles.drawing.ITableProvider; + } + var DynamicTableNodeStyle:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.DynamicTableNodeStyle; + }; + /** + * An implementation of {@link yfiles.drawing.ITableProvider} that delegates to the + * {@link yfiles.support.ITagOwner#tag} property of an {@link yfiles.graph.INode} instance. + */ + export interface TagOwnerTableProvider extends Object,yfiles.drawing.ITableProvider{ + /** + * Gets the table that is associated with the given item. + * @param {yfiles.graph.INode} node The node to get the table from. + * @param {yfiles.support.ILookup} context The context that can optional be queried for additional service implementations. + * @return {yfiles.graph.ITable} The table that is associated with the item or null. + * @see Specified by {@link yfiles.drawing.ITableProvider#getTable}. + */ + getTable(node:yfiles.graph.INode,context:yfiles.support.ILookup):yfiles.graph.ITable; + /** + * Sets a new table instance for the specified item. + * Implementations should store the table for the node + * and return whether they successfully stored the tag. + * @param {yfiles.graph.INode} node The node to store the new table with. + * @param {yfiles.graph.ITable} table The new table. + * @param {yfiles.support.ILookup} context The context that can optional be queried for additional service implementations. + * @return {boolean} Whether the table was successfully stored with the item. + * @see Specified by {@link yfiles.drawing.ITableProvider#setTable}. + */ + setTable(node:yfiles.graph.INode,table:yfiles.graph.ITable,context:yfiles.support.ILookup):boolean; + } + var TagOwnerTableProvider:{ + $class:yfiles.lang.Class; + /** + * A static singleton instance of this class. + */ + INSTANCE:yfiles.drawing.TagOwnerTableProvider; + }; + /** + * A {@link yfiles.drawing.INodeStyle} {@link yfiles.drawing.INodeStyleRenderer renderer} + * implementation that draws a simple floating shinyPlate with a slight gradient, a thin border and a simple drop shadow. + * @see {@link yfiles.drawing.IShinyPlateNodeStyle} + */ + export interface ShinyPlateNodeStyleRenderer extends yfiles.drawing.AbstractNodeStyleRenderer{ + /** + * This method is called by the framework to create a {@link yfiles.drawing.Visual} + * that will be included into the {@link yfiles.drawing.IRenderContext}. + * {@link yfiles.canvas.CanvasControl} uses this interface through the {@link yfiles.canvas.ICanvasObjectDescriptor} + * to populate the visual canvas object tree. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used. + * @return {yfiles.drawing.Visual} The visual to include in the canvas object visual tree. This may be null. + * @see {@link yfiles.drawing.IVisualCreator#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * This method updates or replaces a previously created {@link yfiles.drawing.Visual} for inclusion + * in the {@link yfiles.drawing.IRenderContext}. + * The {@link yfiles.canvas.CanvasControl} uses this method to give implementations a chance to + * update an existing Visual that has previously been created by the same instance during a call + * to {@link yfiles.drawing.IVisualCreator#createVisual}. Implementation may update the oldVisual + * and return that same reference, or create a new visual and return the new instance or null. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used in. + * @param {yfiles.drawing.Visual} oldVisual The visual instance that had been returned the last time the {@link yfiles.drawing.IVisualCreator#createVisual} + * method was called on this instance. + * @return {yfiles.drawing.Visual} oldVisual, if this instance modified the visual, or a new visual that should replace the + * existing one in the canvas object visual tree. + * @see {@link yfiles.drawing.IVisualCreator#createVisual} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasControl} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Returns the intersection for the given line with this shape's geometry. + * @param {yfiles.geometry.PointD} inner The first point of the line that is inside the shape. + * @param {yfiles.geometry.PointD} outer The second point of the line that is outside the shape. + * @return {yfiles.geometry.PointD} The coordinates of the intersection point, if an intersection was found. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getIntersection}. + */ + getIntersection(inner:yfiles.geometry.PointD,outer:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Checks whether the given coordinate is deemed to lie within the shape's geometric bounds. + * @param {yfiles.geometry.PointD} point The point to test. + * @return {boolean} True if the point lies within the shape. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#isInside}. + */ + isInside(point:yfiles.geometry.PointD):boolean; + /** + * Determines if something has been hit at the given coordinates + * in the world coordinate system. + * Implementations should inspect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * and take the value into account when performing hit tests. + * This allows the user to hit elements even if the zoom level is very + * small and allows for accurate hit tests at greater zoom levels. + * @param {yfiles.geometry.PointD} p the coordinates in world coordinate system + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns the outline of the shape or null. + * @return {yfiles.drawing.GeneralPath} The outline or null if no outline can be provided. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getOutline}. + */ + getOutline():yfiles.drawing.GeneralPath; + /** + * Prepares this instance for subsequent calls after the + * style and item have been initialized. + * Upon invocation the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} fields have + * been populated by the {@link yfiles.drawing.AbstractStyleRenderer#getVisualCreator}, + * {@link yfiles.drawing.AbstractStyleRenderer#getBoundsProvider}, {@link yfiles.drawing.AbstractStyleRenderer#getHitTestable}, or + * {@link yfiles.drawing.AbstractStyleRenderer#getMarqueeTestable} methods. + */ + configure():void; + /** + * Determines whether to draw the drop shadow. + * @return {boolean} {@link yfiles.drawing.IShinyPlateNodeStyle#drawShadow}. + */ + drawShadow():boolean; + /** + * Retrieves the brush from the style. + */ + brush:yfiles.system.Brush; + /** + * Retrieves the pen from the style. + */ + pen:yfiles.system.Pen; + /** + * Retrieves the radius from the style. + */ + radius:number; + /** + * Determines whether an element might intersect the visible region for a given context. + * Conservative implementations can always return true. + * @param {yfiles.geometry.RectD} clip The visible region clip. + * @param {yfiles.canvas.ICanvasContext} ctx The context to determine the visibility for. + * @return {boolean} false if and only if it is safe not to paint the element because + * it would not affect the given clipping region. + * @see Specified by {@link yfiles.drawing.IVisibilityTest#isVisible}. + */ + isVisible(clip:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns a tight rectangular area where the whole rendering + * would fit into. + * If calculating the bounds is too expensive or the painting is not + * bound to a certain area, this method may return {@link yfiles.geometry.RectD#INFINITE}. + * If nothing is painted, this method should return an empty rectangle, where + * either or both the width and height is non-positive or + * {@link yfiles.geometry.RectD#EMPTY}. + * @param {yfiles.canvas.ICanvasContext} ctx the context to calculate the bounds for + * @return {yfiles.geometry.RectD} the bounds or {@link yfiles.geometry.RectD#EMPTY} to indicate an unbound area + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + } + var ShinyPlateNodeStyleRenderer:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.ShinyPlateNodeStyleRenderer; + }; + /** + * Interface for node styles that can use an image for the visual representation of a node. + * This style can be used together with {@link yfiles.drawing.ImageNodeStyleRenderer} + * instances + */ + export interface IImageNodeStyle extends Object,yfiles.drawing.INodeStyle{ + /** + * Gets the image that is used for the style instance. + * @see Specified by {@link yfiles.drawing.IImageNodeStyle#image}. + */ + image:yfiles.drawing.ImageSource; + /** + * Get or set the fallback image that is used if loading the image fails. + * @see Specified by {@link yfiles.drawing.IImageNodeStyle#fallbackImage}. + */ + fallbackImage:yfiles.drawing.ImageSource; + /** + * Yields the shape of the outline of the node style which can then + * be used to calculate {@link yfiles.drawing.IHitTestable hit tests}, + * {@link yfiles.drawing.IMarqueeTestable marquee intersections}, etc. + * A value of null indicates that the default (rectangular) + * shape should not be changed. + * @see Specified by {@link yfiles.drawing.IImageNodeStyle#outlineShape}. + */ + outlineShape:yfiles.drawing.GeneralPath; + } + var IImageNodeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A style renderer implementation + * that can be used together with {@link yfiles.drawing.IImageNodeStyle} instances. + */ + export interface ImageNodeStyleRenderer extends yfiles.drawing.AbstractNodeStyleRenderer{ + /** + * Get the image that is currently used to render the style. + */ + getImage():yfiles.drawing.ImageSource; + /** + * Get the style's fallback image. + */ + getFallbackImage():yfiles.drawing.ImageSource; + /** + * This method is called by the framework to create a {@link yfiles.drawing.Visual} + * that will be included into the {@link yfiles.drawing.IRenderContext}. + * {@link yfiles.canvas.CanvasControl} uses this interface through the {@link yfiles.canvas.ICanvasObjectDescriptor} + * to populate the visual canvas object tree. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used. + * @return {yfiles.drawing.Visual} The visual to include in the canvas object visual tree. This may be null. + * @see {@link yfiles.drawing.IVisualCreator#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * This method updates or replaces a previously created {@link yfiles.drawing.Visual} for inclusion + * in the {@link yfiles.drawing.IRenderContext}. + * The {@link yfiles.canvas.CanvasControl} uses this method to give implementations a chance to + * update an existing Visual that has previously been created by the same instance during a call + * to {@link yfiles.drawing.IVisualCreator#createVisual}. Implementation may update the oldVisual + * and return that same reference, or create a new visual and return the new instance or null. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used in. + * @param {yfiles.drawing.Visual} oldVisual The visual instance that had been returned the last time the {@link yfiles.drawing.IVisualCreator#createVisual} + * method was called on this instance. + * @return {yfiles.drawing.Visual} oldVisual, if this instance modified the visual, or a new visual that should replace the + * existing one in the canvas object visual tree. + * @see {@link yfiles.drawing.IVisualCreator#createVisual} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasControl} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Tries to use {@link yfiles.drawing.IImageNodeStyle#outlineShape} to perform + * the hit test analysis, otherwise reverts to default (rectangular) behavior. + * @param {yfiles.geometry.PointD} p the coordinates in world coordinate system + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#isHit} + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Tries to use the {@link yfiles.drawing.IImageNodeStyle#outlineShape} to perform + * the marquee intersection analysis, otherwise reverts to default (rectangular) behavior. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#isInBox} + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Tries to use the {@link yfiles.drawing.IImageNodeStyle#outlineShape} to perform + * the intersection calculation, otherwise reverts to default (rectangular) behavior. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#getIntersection} + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getIntersection}. + */ + getIntersection(p1:yfiles.geometry.PointD,p2:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Tries to use the {@link yfiles.drawing.IImageNodeStyle#outlineShape} to perform + * the contains test, otherwise reverts to default (rectangular) behavior. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#isInside} + * @see Specified by {@link yfiles.drawing.IShapeGeometry#isInside}. + */ + isInside(point:yfiles.geometry.PointD):boolean; + /** + * Tries to use the {@link yfiles.drawing.IImageNodeStyle#outlineShape} to create + * the outline shape path, otherwise reverts to default (rectangular) behavior. + * @see Overrides {@link yfiles.drawing.AbstractNodeStyleRenderer#getOutline} + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getOutline}. + */ + getOutline():yfiles.drawing.GeneralPath; + /** + * Gets the value that determines whether the aspect ratio of the image + * should be preserved. + * @return {boolean} + * false + */ + getPreserveAspectRatio():boolean; + } + var ImageNodeStyleRenderer:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.ImageNodeStyleRenderer; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the fallback + * image url that will be used to render the node, if the style does not + * explicitly specify a {@link yfiles.drawing.IImageNodeStyle#fallbackImage fallback image}. + */ + TEMPLATE_KEY:yfiles.system.ResourceKey; + }; + /** + * Default implementation of {@link yfiles.drawing.IImageNodeStyle}. + */ + export interface ImageNodeStyle extends Object,yfiles.drawing.IImageNodeStyle{ + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given node and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(node, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.INodeStyle#renderer}. + */ + renderer:yfiles.drawing.INodeStyleRenderer; + /** + * Gets the image that is used for the style instance. + * @see Specified by {@link yfiles.drawing.IImageNodeStyle#image}. + */ + image:yfiles.drawing.ImageSource; + /** + * Get or set the fallback image that is used if loading the image fails. + * @see Specified by {@link yfiles.drawing.IImageNodeStyle#fallbackImage}. + */ + fallbackImage:yfiles.drawing.ImageSource; + /** + * Gets or sets the {@link yfiles.drawing.GeneralPath} of the outline of the image that will be displayed. + * This shape will be used to satisfy requests to {@link yfiles.drawing.IMarqueeTestable#isInBox} and + * {@link yfiles.drawing.IHitTestable#isHit} and may be left null to indicate default (rectangular) + * behavior. + * @see Specified by {@link yfiles.drawing.IImageNodeStyle#outlineShape}. + */ + outlineShape:yfiles.drawing.GeneralPath; + /** + * This implementation performs a shallow copy with respect to the {@link yfiles.drawing.ImageNodeStyle#image} property. + * If clients need to have a deep copy of this instance, they need to manually clone + * and reassign the {@link yfiles.drawing.ImageNodeStyle#image} to the clone. + * @return {Object} A shallow copy of this instance. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.INode):void; + } + var ImageNodeStyle:{ + $class:yfiles.lang.Class; + /** + * Create a new instance of this style with a default renderer. + */ + new ():yfiles.drawing.ImageNodeStyle; + /** + * Create a new instance of this style with a default renderer. + */ + WithImage:{ + new (imageSource:yfiles.drawing.ImageSource):yfiles.drawing.ImageNodeStyle; + }; + /** + * Create a new instance of this style with a custom renderer instance. + * @param {string} path The path to use for the image. + */ + WithPath:{ + new (path:string):yfiles.drawing.ImageNodeStyle; + }; + /** + * Create a new instance of this style with a custom renderer instance. + * @param {string} path The path to use for the image. + * @param {string} fallbackPath The path to use for the fallback image. + */ + WithPathAndFallbackPath:{ + new (path:string,fallbackPath:string):yfiles.drawing.ImageNodeStyle; + }; + /** + * Gets or sets the {@link yfiles.drawing.GeneralPath} of the outline of the image that will be displayed. + * @param {yfiles.drawing.ImageNodeStyleRenderer} styleRenderer The custom renderer for this instance + */ + WithRenderer:{ + new (styleRenderer:yfiles.drawing.ImageNodeStyleRenderer):yfiles.drawing.ImageNodeStyle; + }; + /** + * Create a new instance of this style with a custom renderer instance. + * @param {yfiles.drawing.ImageSource} imageSource The image to use. + * @param {yfiles.drawing.ImageNodeStyleRenderer} styleRenderer The custom renderer for this instance + */ + WithImageAndRenderer:{ + new (imageSource:yfiles.drawing.ImageSource,styleRenderer:yfiles.drawing.ImageNodeStyleRenderer):yfiles.drawing.ImageNodeStyle; + }; + /** + * Create a new instance of this style with a custom renderer instance. + * @param {yfiles.drawing.ImageSource} imageSource The image to use. + * @param {yfiles.drawing.ImageSource} fallbackImageSource The image to use if loading the default image fails. + * @param {yfiles.drawing.ImageNodeStyleRenderer} styleRenderer The custom renderer for this instance + */ + WithImageFallbackImageAndRenderer:{ + new (imageSource:yfiles.drawing.ImageSource,fallbackImageSource:yfiles.drawing.ImageSource,styleRenderer:yfiles.drawing.ImageNodeStyleRenderer):yfiles.drawing.ImageNodeStyle; + }; + }; + /** + * Simple basic implementation of the {@link yfiles.drawing.IBevelNodeStyle} + * that is used by the {@link yfiles.drawing.BevelNodeStyleRenderer} + * node style renderer implementation. + * @see {@link yfiles.drawing.IBevelNodeStyle} + * @see {@link yfiles.drawing.BevelNodeStyleRenderer} + */ + export interface BevelNodeStyle extends Object,yfiles.drawing.IBevelNodeStyle{ + /** + * The insets to use for the bevel. + * @see Specified by {@link yfiles.drawing.IBevelNodeStyle#inset}. + */ + inset:number; + /** + * The radius of the corner of the rounded rectangle. + * @see Specified by {@link yfiles.drawing.IBevelNodeStyle#radius}. + */ + radius:number; + /** + * The base color to use. + * @see Specified by {@link yfiles.drawing.IBevelNodeStyle#color}. + */ + color:yfiles.system.Color; + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given node and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(node, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.INodeStyle#renderer}. + */ + renderer:yfiles.drawing.INodeStyleRenderer; + /** + * Gets or sets a value indicating whether to draw a drop shadow. + * Value: true if node has a drop shadow; otherwise, false. + * @see Specified by {@link yfiles.drawing.IBevelNodeStyle#drawShadow}. + */ + drawShadow:boolean; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.INode):void; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var BevelNodeStyle:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using {@link yfiles.system.Colors#BLACK} as the background color. + */ + new ():yfiles.drawing.BevelNodeStyle; + /** + * Creates a new instance using {@link yfiles.system.Colors#BLACK} as the background color + * and the provided renderer to share. + */ + WithRenderer:{ + new (renderer:yfiles.drawing.BevelNodeStyleRenderer):yfiles.drawing.BevelNodeStyle; + }; + /** + * Creates a new instance using the given color as the background color. + */ + WithColor:{ + new (color:yfiles.system.Color):yfiles.drawing.BevelNodeStyle; + }; + /** + * Creates a new instance using the given color as the background color + * and the provided renderer to share. + */ + WithRendererAndColor:{ + new (renderer:yfiles.drawing.BevelNodeStyleRenderer,color:yfiles.system.Color):yfiles.drawing.BevelNodeStyle; + }; + }; + /** + * Interface for styles that can be used together with {@link yfiles.drawing.ArcEdgeStyleRenderer} instances. + * @see {@link yfiles.drawing.ArcEdgeStyle} + */ + export interface IArcEdgeStyle extends Object,yfiles.drawing.IEdgeStyle,yfiles.drawing.IArrowOwner{ + /** + * Gets the that is used to draw the arc. + * @see Specified by {@link yfiles.drawing.IArcEdgeStyle#pen}. + */ + pen:yfiles.system.Pen; + /** + * Gets the "height" of the arc. + * Depending on the setting of {@link yfiles.drawing.IArcEdgeStyle#ratio}, this value is interpreted differently: + * If Ratio is enabled, the height of the arc will depend on it's width. + * The width will be multiplied by this value to obtain the height. + * If the Ratio feature is disabled, this value will be interpreted as the + * absolute height. + * Value: The height of the arc, either relative or absolute. + * @see Specified by {@link yfiles.drawing.IArcEdgeStyle#height}. + */ + height:number; + /** + * Gets a value indicating whether this {@link yfiles.drawing.IArcEdgeStyle} interprets + * the {@link yfiles.drawing.IArcEdgeStyle#height} value as an absolute or relative value. + * Value: + * true if the height value should be interpreted as a relative value, otherwise, false. + * @see {@link yfiles.drawing.IArcEdgeStyle#height} + * @see Specified by {@link yfiles.drawing.IArcEdgeStyle#ratio}. + */ + ratio:boolean; + } + var IArcEdgeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.drawing.BevelNodeStyleRenderer} + * to query the properties from. + */ + export interface IBevelNodeStyle extends Object,yfiles.drawing.INodeStyle{ + /** + * The insets to use for the bevel. + * @see Specified by {@link yfiles.drawing.IBevelNodeStyle#inset}. + */ + inset:number; + /** + * The radius of the corner of the rounded rectangle. + * @see Specified by {@link yfiles.drawing.IBevelNodeStyle#radius}. + */ + radius:number; + /** + * The base color to use. + * @see Specified by {@link yfiles.drawing.IBevelNodeStyle#color}. + */ + color:yfiles.system.Color; + /** + * Gets or sets a value indicating whether to draw a drop shadow. + * Value: true if node has a drop shadow; otherwise, false. + * @see Specified by {@link yfiles.drawing.IBevelNodeStyle#drawShadow}. + */ + drawShadow:boolean; + } + var IBevelNodeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A {@link yfiles.drawing.INodeStyle} {@link yfiles.drawing.INodeStyleRenderer renderer} + * implementation that draws a rounded rectangle with a bevel border in a 'shiny plate' fashion. + */ + export interface BevelNodeStyleRenderer extends yfiles.drawing.AbstractNodeStyleRenderer{ + /** + * Retrieves the color from the style. + */ + color:yfiles.system.Color; + /** + * Retrieves the inset from the style. + */ + inset:number; + /** + * This method is called by the framework to create a {@link yfiles.drawing.Visual} + * that will be included into the {@link yfiles.drawing.IRenderContext}. + * {@link yfiles.canvas.CanvasControl} uses this interface through the {@link yfiles.canvas.ICanvasObjectDescriptor} + * to populate the visual canvas object tree. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used. + * @return {yfiles.drawing.Visual} The visual to include in the canvas object visual tree. This may be null. + * @see {@link yfiles.drawing.IVisualCreator#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * This method updates or replaces a previously created {@link yfiles.drawing.Visual} for inclusion + * in the {@link yfiles.drawing.IRenderContext}. + * The {@link yfiles.canvas.CanvasControl} uses this method to give implementations a chance to + * update an existing Visual that has previously been created by the same instance during a call + * to {@link yfiles.drawing.IVisualCreator#createVisual}. Implementation may update the oldVisual + * and return that same reference, or create a new visual and return the new instance or null. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used in. + * @param {yfiles.drawing.Visual} oldVisual The visual instance that had been returned the last time the {@link yfiles.drawing.IVisualCreator#createVisual} + * method was called on this instance. + * @return {yfiles.drawing.Visual} oldVisual, if this instance modified the visual, or a new visual that should replace the + * existing one in the canvas object visual tree. + * @see {@link yfiles.drawing.IVisualCreator#createVisual} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasControl} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Prepares this instance for subsequent calls after the + * style and item have been initialized. + * Upon invocation the {@link yfiles.drawing.AbstractStyleRenderer#styleF} and {@link yfiles.drawing.AbstractStyleRenderer#itemF} fields have + * been populated by the {@link yfiles.drawing.AbstractStyleRenderer#getVisualCreator}, + * {@link yfiles.drawing.AbstractStyleRenderer#getBoundsProvider}, {@link yfiles.drawing.AbstractStyleRenderer#getHitTestable}, or + * {@link yfiles.drawing.AbstractStyleRenderer#getMarqueeTestable} methods. + */ + configure():void; + /** + * Retrieves the radius to use from the style. + */ + radius:number; + /** + * Returns the intersection for the given line with this shape's geometry. + * @param {yfiles.geometry.PointD} inner The first point of the line that is inside the shape. + * @param {yfiles.geometry.PointD} outer The second point of the line that is outside the shape. + * @return {yfiles.geometry.PointD} The coordinates of the intersection point, if an intersection was found. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getIntersection}. + */ + getIntersection(inner:yfiles.geometry.PointD,outer:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Checks whether the given coordinate is deemed to lie within the shape's geometric bounds. + * @param {yfiles.geometry.PointD} point The point to test. + * @return {boolean} True if the point lies within the shape. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#isInside}. + */ + isInside(point:yfiles.geometry.PointD):boolean; + /** + * Determines if something has been hit at the given coordinates + * in the world coordinate system. + * Implementations should inspect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * and take the value into account when performing hit tests. + * This allows the user to hit elements even if the zoom level is very + * small and allows for accurate hit tests at greater zoom levels. + * @param {yfiles.geometry.PointD} p the coordinates in world coordinate system + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns the outline of the shape or null. + * @return {yfiles.drawing.GeneralPath} The outline or null if no outline can be provided. + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getOutline}. + */ + getOutline():yfiles.drawing.GeneralPath; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Gets or sets a property that determines whether this instance should provide an {@link yfiles.input.IHandle} + * for editing the radius of the shape. + * The default is false. This implementation will add an appropriate + * {@link yfiles.input.IHandleProvider} to the {@link yfiles.drawing.BevelNodeStyleRenderer#lookup} of this instance if this feature is + * enabled. + */ + provideRadiusHandle:boolean; + } + var BevelNodeStyleRenderer:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.BevelNodeStyleRenderer; + }; + /** + * A {@link yfiles.drawing.INodeStyle} {@link yfiles.drawing.INodeStyleRenderer renderer} + * implementation that draws a simple floating panel with a slight gradient, a thin border and a simple drop shadow. + * @see {@link yfiles.drawing.IPanelNodeStyle} + */ + export interface PanelNodeStyleRenderer extends yfiles.drawing.AbstractNodeStyleRenderer{ + /** + * Determines whether to draw the drop shadow. + * @return {boolean} true, always. + */ + drawShadow():boolean; + /** + * Retrieves the color from the style. + */ + color:yfiles.system.Color; + /** + * Determines whether an element might intersect the visible region for a given context. + * Conservative implementations can always return true. + * @param {yfiles.geometry.RectD} clip The visible region clip. + * @param {yfiles.canvas.ICanvasContext} ctx The context to determine the visibility for. + * @return {boolean} false if and only if it is safe not to paint the element because + * it would not affect the given clipping region. + * @see Specified by {@link yfiles.drawing.IVisibilityTest#isVisible}. + */ + isVisible(clip:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * This method is called by the framework to create a {@link yfiles.drawing.Visual} + * that will be included into the {@link yfiles.drawing.IRenderContext}. + * {@link yfiles.canvas.CanvasControl} uses this interface through the {@link yfiles.canvas.ICanvasObjectDescriptor} + * to populate the visual canvas object tree. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used. + * @return {yfiles.drawing.Visual} The visual to include in the canvas object visual tree. This may be null. + * @see {@link yfiles.drawing.IVisualCreator#updateVisual} + * @see Specified by {@link yfiles.drawing.IVisualCreator#createVisual}. + */ + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + /** + * This method updates or replaces a previously created {@link yfiles.drawing.Visual} for inclusion + * in the {@link yfiles.drawing.IRenderContext}. + * The {@link yfiles.canvas.CanvasControl} uses this method to give implementations a chance to + * update an existing Visual that has previously been created by the same instance during a call + * to {@link yfiles.drawing.IVisualCreator#createVisual}. Implementation may update the oldVisual + * and return that same reference, or create a new visual and return the new instance or null. + * @param {yfiles.drawing.IRenderContext} ctx The context that describes where the visual will be used in. + * @param {yfiles.drawing.Visual} oldVisual The visual instance that had been returned the last time the {@link yfiles.drawing.IVisualCreator#createVisual} + * method was called on this instance. + * @return {yfiles.drawing.Visual} oldVisual, if this instance modified the visual, or a new visual that should replace the + * existing one in the canvas object visual tree. + * @see {@link yfiles.drawing.IVisualCreator#createVisual} + * @see {@link yfiles.canvas.ICanvasObjectDescriptor} + * @see {@link yfiles.canvas.CanvasControl} + * @see Specified by {@link yfiles.drawing.IVisualCreator#updateVisual}. + */ + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns a tight rectangular area where the whole rendering + * would fit into. + * If calculating the bounds is too expensive or the painting is not + * bound to a certain area, this method may return {@link yfiles.geometry.RectD#INFINITE}. + * If nothing is painted, this method should return an empty rectangle, where + * either or both the width and height is non-positive or + * {@link yfiles.geometry.RectD#EMPTY}. + * @param {yfiles.canvas.ICanvasContext} ctx the context to calculate the bounds for + * @return {yfiles.geometry.RectD} the bounds or {@link yfiles.geometry.RectD#EMPTY} to indicate an unbound area + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + } + var PanelNodeStyleRenderer:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this style. + */ + new ():yfiles.drawing.PanelNodeStyleRenderer; + }; + /** + * Interface used by {@link yfiles.drawing.ShinyPlateNodeStyleRenderer} + * to query the properties from. + */ + export interface IShinyPlateNodeStyle extends Object,yfiles.drawing.INodeStyle{ + /** + * Provides the insets for the given item. + * The {@link yfiles.drawing.ShinyPlateNodeStyleRenderer} will use these insets and return them + * via an {@link yfiles.drawing.IInsetsProvider} if such an instance is queried through the + * {@link yfiles.drawing.IStyleRenderer#getContext context lookup}. + * @return A Thickness that describes the insets. + * @see {@link yfiles.drawing.IInsetsProvider} + * @see Specified by {@link yfiles.drawing.IShinyPlateNodeStyle#insets}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Gets the background color for this style. + * @see Specified by {@link yfiles.drawing.IShinyPlateNodeStyle#brush}. + */ + brush:yfiles.system.Brush; + /** + * Gets the pen to use for the outline. + * @see Specified by {@link yfiles.drawing.IShinyPlateNodeStyle#pen}. + */ + pen:yfiles.system.Pen; + /** + * Gets the corner radius of the rounded rectangle. + * @see Specified by {@link yfiles.drawing.IShinyPlateNodeStyle#radius}. + */ + radius:number; + /** + * Gets or sets a value indicating whether to draw a drop shadow. + * @see Specified by {@link yfiles.drawing.IShinyPlateNodeStyle#drawShadow}. + */ + drawShadow:boolean; + } + var IShinyPlateNodeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Simple basic implementation of the {@link yfiles.drawing.IShinyPlateNodeStyle} + * that is used by the {@link yfiles.drawing.ShinyPlateNodeStyleRenderer} + * node style renderer implementation. + * @see {@link yfiles.drawing.IShinyPlateNodeStyle} + * @see {@link yfiles.drawing.ShinyPlateNodeStyleRenderer} + */ + export interface ShinyPlateNodeStyle extends Object,yfiles.drawing.IShinyPlateNodeStyle{ + /** + * Gets or sets the background brush for this style. + * @see Specified by {@link yfiles.drawing.IShinyPlateNodeStyle#brush}. + */ + brush:yfiles.system.Brush; + /** + * Gets or sets the pen to use for the outline. + * @see Specified by {@link yfiles.drawing.IShinyPlateNodeStyle#pen}. + */ + pen:yfiles.system.Pen; + /** + * Gets or sets the corner radius of the rounded rectangle. + * @see Specified by {@link yfiles.drawing.IShinyPlateNodeStyle#radius}. + */ + radius:number; + /** + * Gets or sets a value indicating whether to draw a drop shadow. + * @see Specified by {@link yfiles.drawing.IShinyPlateNodeStyle#drawShadow}. + */ + drawShadow:boolean; + /** + * Gets or sets the instance to use that provides the insets for this style. + * The default insets are set to (5,5,5,5). + * @see Specified by {@link yfiles.drawing.IShinyPlateNodeStyle#insets}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given node and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(node, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.INodeStyle#renderer}. + */ + renderer:yfiles.drawing.INodeStyleRenderer; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.INode):void; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var ShinyPlateNodeStyle:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using {@link yfiles.system.Colors#BLACK} as the background brush. + */ + new ():yfiles.drawing.ShinyPlateNodeStyle; + /** + * Creates a new instance using {@link yfiles.system.Colors#BLACK} as the background brush + * and the provided renderer to share. + */ + WithRenderer:{ + new (renderer:yfiles.drawing.ShinyPlateNodeStyleRenderer):yfiles.drawing.ShinyPlateNodeStyle; + }; + /** + * Creates a new instance using the given brush as the background brush. + */ + WithColor:{ + new (color:yfiles.system.Color):yfiles.drawing.ShinyPlateNodeStyle; + }; + /** + * Creates a new instance using the given brush as the background brush. + */ + WithBrush:{ + new (brush:yfiles.system.Brush):yfiles.drawing.ShinyPlateNodeStyle; + }; + /** + * Creates a new instance using the given brush as the background brush. + */ + WithBrushAndPen:{ + new (brush:yfiles.system.Brush,pen:yfiles.system.Pen):yfiles.drawing.ShinyPlateNodeStyle; + }; + /** + * Creates a new instance using the given brush as the background brush + * and the provided renderer to share. + */ + WithRendererColorRadiusAndInsets:{ + new (renderer:yfiles.drawing.ShinyPlateNodeStyleRenderer,color:yfiles.system.Color,radius:number,insets:yfiles.geometry.InsetsD):yfiles.drawing.ShinyPlateNodeStyle; + }; + /** + * Creates a new instance using the given brush as the background brush + * and the provided renderer to share. + */ + WithRendererBrushRadiusAndInsets:{ + new (renderer:yfiles.drawing.ShinyPlateNodeStyleRenderer,brush:yfiles.system.Brush,radius:number,insets:yfiles.geometry.InsetsD):yfiles.drawing.ShinyPlateNodeStyle; + }; + }; + /** + * Simple basic implementation of the {@link yfiles.drawing.IPanelNodeStyle} + * that is used by the {@link yfiles.drawing.PanelNodeStyleRenderer} + * node style renderer implementation. + * @see {@link yfiles.drawing.IPanelNodeStyle} + * @see {@link yfiles.drawing.PanelNodeStyleRenderer} + */ + export interface PanelNodeStyle extends Object,yfiles.drawing.IPanelNodeStyle{ + /** + * The base color to use. + * @see Specified by {@link yfiles.drawing.IPanelNodeStyle#color}. + */ + color:yfiles.system.Color; + /** + * The base color to use for drawing the label insets background. + * Setting this to null effectively disables label insets background coloring. + * @see Specified by {@link yfiles.drawing.IPanelNodeStyle#labelInsetsColor}. + */ + labelInsetsColor:yfiles.system.Color; + /** + * Gets or sets the instance to use that provides the insets for this style. + * The default insets are set to (5,5,5,5). + * @see Specified by {@link yfiles.drawing.IPanelNodeStyle#insets}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Gets the renderer implementation that can be queried for implementations + * that provide details about the visual appearance and visual behavior + * for a given node and this style instance. + * The idiom for retrieving, e.g. an {@link yfiles.drawing.IVisualCreator} implementation + * for a given style is: + *

+      * var creator = style.renderer.getVisualCreator(node, style);
+      * var visual = creator.createVisual(renderContext);
+      * 
+ * @see Specified by {@link yfiles.drawing.INodeStyle#renderer}. + */ + renderer:yfiles.drawing.INodeStyleRenderer; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:yfiles.graph.INode):void; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var PanelNodeStyle:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using {@link yfiles.system.Colors#BLACK} as the background color. + */ + new ():yfiles.drawing.PanelNodeStyle; + /** + * Creates a new instance using {@link yfiles.system.Colors#BLACK} as the background color + * and the provided renderer to share. + */ + WithRenderer:{ + new (renderer:yfiles.drawing.PanelNodeStyleRenderer):yfiles.drawing.PanelNodeStyle; + }; + /** + * Creates a new instance using the given color as the background color. + */ + WithColor:{ + new (color:yfiles.system.Color):yfiles.drawing.PanelNodeStyle; + }; + /** + * Creates a new instance using the given color as the background color. + */ + WithColorAndInsetsColor:{ + new (color:yfiles.system.Color,labelInsetsColor:yfiles.system.Color):yfiles.drawing.PanelNodeStyle; + }; + /** + * Creates a new instance using the given color as the background color + * and the provided renderer to share. + */ + WithRendererAndColor:{ + new (renderer:yfiles.drawing.PanelNodeStyleRenderer,color:yfiles.system.Color,labelInsetsColor:yfiles.system.Color,insets:yfiles.geometry.InsetsD):yfiles.drawing.PanelNodeStyle; + }; + }; + /** + * Allows the use of an {@link yfiles.drawing.ILabelStyle} to render the selection, + * highlight or focus indicator of labels. + * The {@link yfiles.drawing.LabelStyleDecorationInstaller#zoomMode} property defines how the zoom level affects the + * rendering of the indicator. It can either scale according to the zoom + * level similar to regular graph items or have always to same thickness + * regardless of the zoom, similar to the default yFiles indicators. + *

+ * To use the {@link yfiles.drawing.DecorationZoomMode#VIEW_COORDINATES} zoom mode, the + * {@link yfiles.drawing.Visual} created by the label style must be at least a . + *

+ * @see {@link yfiles.drawing.EdgeStyleDecorationInstaller} + * @see {@link yfiles.drawing.NodeStyleDecorationInstaller} + */ + export interface LabelStyleDecorationInstaller extends Object,yfiles.model.ISelectionInstaller,yfiles.input.IHighlightInstaller,yfiles.input.IFocusIndicatorInstaller{ + /** + * Specifies how the style is affected by the current zoom level. + * Changes of the value of this property are propagated to all styles + * created by this instance and become immediately visible. + */ + zoomMode:yfiles.drawing.DecorationZoomMode; + /** + * Specifies the margin around the label layout. + * Actually, the bounds rendered by the style is the original label layout + * enlarged by this margin. + *

+ * Changes of the value of this property are propagated to all styles + * created by this instance and become immediately visible. + *

+ */ + margin:yfiles.geometry.InsetsD; + /** + * The style to use for the rendering. + * Changes of the value of this property are not propagated to + * already created styles. + */ + labelStyle:yfiles.drawing.ILabelStyle; + /** + * Installs a rendering for the item if it is an {@link yfiles.graph.ILabel}. + * @param {yfiles.model.IInstallerContext} context The context to use for the installation. + * @param {Object} item The item to install. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:Object):void; + } + var LabelStyleDecorationInstaller:{ + $class:yfiles.lang.Class; + /** + * Create a new instance of this class. + */ + new ():yfiles.drawing.LabelStyleDecorationInstaller; + }; + /** + * Allows the use of an {@link yfiles.drawing.INodeStyle} to render the selection, + * highlight or focus indicator of nodes. + * The {@link yfiles.drawing.NodeStyleDecorationInstaller#zoomMode} property defines how the zoom level affects the + * rendering of the indicator. It can either scale according to the zoom + * level similar to regular graph items or have always to same thickness + * regardless of the zoom, similar to the default yFiles indicators. + *

+ * To use the {@link yfiles.drawing.DecorationZoomMode#VIEW_COORDINATES} zoom mode, the + * {@link yfiles.drawing.Visual} created by the node style must be at least a . + *

+ * @see {@link yfiles.drawing.EdgeStyleDecorationInstaller} + * @see {@link yfiles.drawing.LabelStyleDecorationInstaller} + */ + export interface NodeStyleDecorationInstaller extends Object,yfiles.model.ISelectionInstaller,yfiles.input.IHighlightInstaller,yfiles.input.IFocusIndicatorInstaller{ + /** + * Specifies how the style is affected by the current zoom level. + * Changes of the value of this property are propagated to all styles + * created by this instance and become immediately visible. + */ + zoomMode:yfiles.drawing.DecorationZoomMode; + /** + * Specifies the margin around the node layout. + * Actually, the bounds rendered by the style is the original node layout + * enlarged by this margin. + *

+ * Changes of the value of this property are propagated to all styles + * created by this instance and become immediately visible. + *

+ */ + margin:yfiles.geometry.InsetsD; + /** + * The style to use for the rendering. + * Changes of the value of this property are not propagated to + * already created styles. + */ + nodeStyle:yfiles.drawing.INodeStyle; + /** + * Installs a rendering for the item if it is an {@link yfiles.graph.INode}. + * @param {yfiles.model.IInstallerContext} context The context to use for the installation. + * @param {Object} item The item to install. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:Object):void; + } + var NodeStyleDecorationInstaller:{ + $class:yfiles.lang.Class; + /** + * Create a new instance of this class. + */ + new ():yfiles.drawing.NodeStyleDecorationInstaller; + }; + /** + * Interface used by {@link yfiles.drawing.PanelNodeStyleRenderer} + * to query the properties from. + */ + export interface IPanelNodeStyle extends Object,yfiles.drawing.INodeStyle{ + /** + * Provides the insets for the given item. + * The {@link yfiles.drawing.PanelNodeStyleRenderer} will use these insets and return them + * via an {@link yfiles.drawing.IInsetsProvider} if such an instance is queried through the + * {@link yfiles.drawing.IStyleRenderer#getContext context lookup}. + * @return An insets object that describes the insets. + * @see {@link yfiles.drawing.IInsetsProvider} + * @see Specified by {@link yfiles.drawing.IPanelNodeStyle#insets}. + */ + insets:yfiles.geometry.InsetsD; + /** + * The base color to use. + * @see Specified by {@link yfiles.drawing.IPanelNodeStyle#color}. + */ + color:yfiles.system.Color; + /** + * The base color to use for drawing the label insets background. + * Setting this to null effectively disables label insets background coloring. + * @see Specified by {@link yfiles.drawing.IPanelNodeStyle#labelInsetsColor}. + */ + labelInsetsColor:yfiles.system.Color; + } + var IPanelNodeStyle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Creates the visual representation of a data object. + * Implementations of this class have the purpose of creating a + * {@link yfiles.drawing.ArrangeVisual} that serves as the visual + * representation of a data object associated with this instance. + */ + export interface DataTemplate extends Object{ + /** + * Creates the visual representation of this object. + * @param {yfiles.canvas.ICanvasContext} ctx The canvas context. + * @return {yfiles.drawing.ArrangeVisual} A {@link yfiles.drawing.ArrangeVisual} representing this object. + */ + loadContent(ctx:yfiles.canvas.ICanvasContext):yfiles.drawing.ArrangeVisual; + } + var DataTemplate:{ + $class:yfiles.lang.Class; + }; + /** + * A visual which represents an ellipse. + * The radius is implicitly specified through the bounds of the visual. + */ + export interface EllipseVisual extends yfiles.drawing.ArrangeVisual{ + /** + * Gets the SVG element that corresponds to this object. + * @see Overrides {@link yfiles.drawing.Visual#svgElement} + */ + svgElement:Element; + /** + * Gets the pen. + */ + pen:yfiles.system.Pen; + /** + * Sets the pen. + * @param {yfiles.system.Pen} pen The pen. + * @param {yfiles.canvas.ICanvasContext} context The context. + */ + setPen(pen:yfiles.system.Pen,context:yfiles.canvas.ICanvasContext):void; + /** + * Gets the brush. + */ + brush:yfiles.system.Brush; + /** + * Sets the brush. + * @param {yfiles.system.Brush} brush The brush. + * @param {yfiles.canvas.ICanvasContext} context The context. + */ + setBrush(brush:yfiles.system.Brush,context:yfiles.canvas.ICanvasContext):void; + /** + * Updates the layout. + * @param {yfiles.geometry.IRectangle} Layout The layout. + */ + updateLayout(Layout:yfiles.geometry.IRectangle):void; + /** + * Gets or sets the bounds. + * Value: + * The bounds. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#bounds} + */ + bounds:yfiles.geometry.RectD; + /** + * Gets or sets a value indicating whether this {@link yfiles.drawing.EllipseVisual} is visible. + * Value: + * true if visible; otherwise, false. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#visible} + */ + visible:boolean; + /** + * Gets or sets the transform. + * Value: + * The transform. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#transform} + */ + transform:yfiles.geometry.Matrix2D; + } + var EllipseVisual:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.EllipseVisual} class. + */ + new ():yfiles.drawing.EllipseVisual; + /** + * Initializes a new instance of the {@link yfiles.drawing.EllipseVisual} class. + * @param {yfiles.geometry.IRectangle} layout The layout. + */ + FromRectangleBounds:{ + new (layout:yfiles.geometry.IRectangle):yfiles.drawing.EllipseVisual; + }; + }; + /** + * Wraps a {@link SVGElement} as Visual. + */ + export interface DefaultVisual extends yfiles.drawing.Visual{ + /** + * Gets the SVG element that is wrapped by this object. + * @see Overrides {@link yfiles.drawing.Visual#svgElement} + */ + svgElement:Element; + } + var DefaultVisual:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.DefaultVisual} class which wraps the specified SVG element. + * @param {SVGElement} element The SVG element which this object wraps. + */ + new (element:SVGElement):yfiles.drawing.DefaultVisual; + }; + /** + * An interface that can enumerate hits of a given type for a certain + * position in world coordinates. + */ + export interface IHitTestEnumerator extends Object{ + /** + * Yields an enumerable that enumerates the hits for a given world coordinate. + * @param {yfiles.geometry.PointD} location the coordinates in the world coordinate system + * @return {yfiles.collections.IEnumerable.} an enumerable that yields hits for the given coordinates + * @see Specified by {@link yfiles.drawing.IHitTestEnumerator#enumerateHits}. + */ + enumerateHits(location:yfiles.geometry.PointD):yfiles.collections.IEnumerable; + } + var IHitTestEnumerator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A visual which can represent an arbitrary path. + */ + export interface PathVisual extends yfiles.drawing.ArrangeVisual{ + /** + * Updates the path with the data from the specified {@link yfiles.drawing.GeneralPath}. + * @param {yfiles.drawing.GeneralPath} generalPath The general path. + * @param {yfiles.geometry.Matrix2D} matrix The matrix. + * @param {yfiles.drawing.FillMode} fillMode The fill mode. + */ + update(generalPath:yfiles.drawing.GeneralPath,matrix:yfiles.geometry.Matrix2D,fillMode:yfiles.drawing.FillMode):void; + /** + * Gets the SVG element that corresponds to this object. + * @see Overrides {@link yfiles.drawing.Visual#svgElement} + */ + svgElement:Element; + /** + * Gets the pen. + */ + pen:yfiles.system.Pen; + /** + * Gets the brush. + */ + brush:yfiles.system.Brush; + /** + * Sets the brush. + * @param {yfiles.system.Brush} brush The brush. + * @param {yfiles.canvas.ICanvasContext} context The context. + */ + setBrush(brush:yfiles.system.Brush,context:yfiles.canvas.ICanvasContext):void; + /** + * Sets the pen. + * @param {yfiles.system.Pen} pen The pen. + * @param {yfiles.canvas.ICanvasContext} context The context. + */ + setPen(pen:yfiles.system.Pen,context:yfiles.canvas.ICanvasContext):void; + /** + * Gets or sets the bounds of this path. + * Important: This method is not implemented for this type of visual. + * Value: + * The bounds. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#bounds} + */ + bounds:yfiles.geometry.RectD; + /** + * Gets or sets a value indicating whether this {@link yfiles.drawing.PathVisual} is visible. + * Value: + * true if visible; otherwise, false. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#visible} + */ + visible:boolean; + /** + * Gets or sets the transform. + * Value: + * The transform. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#transform} + */ + transform:yfiles.geometry.Matrix2D; + } + var PathVisual:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.PathVisual} class. + */ + new ():yfiles.drawing.PathVisual; + /** + * Initializes a new instance of the {@link yfiles.drawing.PathVisual} class. + * @param {yfiles.drawing.GeneralPath} generalPath The general path. + * @param {yfiles.geometry.Matrix2D} matrix The matrix. + * @param {yfiles.drawing.FillMode} fillMode The fill mode. + */ + FromPathTransformAndFillMode:{ + new (generalPath:yfiles.drawing.GeneralPath,matrix:yfiles.geometry.Matrix2D,fillMode:yfiles.drawing.FillMode):yfiles.drawing.PathVisual; + }; + }; + /** + * Creates the visual representation of a data object using a {@link yfiles.drawing.DrawingTemplate#brush} + * and a {@link yfiles.drawing.DrawingTemplate#pen}. + *

+ * Implementations of this class have the purpose of creating a + * {@link yfiles.drawing.ArrangeVisual} that serves as the visual + * representation of a data object associated with this instance. + *

+ *

+ * This class provides a {@link yfiles.drawing.DrawingTemplate#brush} and a {@link yfiles.drawing.DrawingTemplate#pen} + * that can be used to fill and stroke the returned {@link yfiles.drawing.ArrangeVisual}. + *

+ *

+ * Subclasses should override {@link yfiles.drawing.DrawingTemplate#clone}. + *

+ */ + export interface DrawingTemplate extends yfiles.drawing.DataTemplate,yfiles.system.ICloneable{ + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + /** + * Gets or sets the brush that is applied to a newly created visual representation. + * Value: + * The brush that is applied to a newly created visual representation. + */ + brush:yfiles.system.Brush; + /** + * Gets or sets the pen that is applied to a newly created visual representation. + * Value: + * The pen that is applied to a newly created visual representation. + */ + pen:yfiles.system.Pen; + } + var DrawingTemplate:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.DrawingTemplate; + }; + /** + * A visual that embeds an image into the SVG document. + */ + export interface Image extends yfiles.drawing.ArrangeVisual{ + /** + * Gets or sets the {@link yfiles.drawing.ImageSource} for this visual. + * Value: + * The source. + */ + source:yfiles.drawing.ImageSource; + /** + * Updates the layout. + * @param {yfiles.geometry.IRectangle} layout The layout. + */ + updateLayout(layout:yfiles.geometry.IRectangle):void; + /** + * Gets or sets the bounds. + * Value: + * The bounds. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#bounds} + */ + bounds:yfiles.geometry.RectD; + /** + * Gets or sets a value indicating whether this {@link yfiles.drawing.Image} is visible. + * Value: + * true if visible; otherwise, false. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#visible} + */ + visible:boolean; + /** + * Gets or sets the transform. + * Value: + * The transform. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#transform} + */ + transform:yfiles.geometry.Matrix2D; + /** + * Gets or sets whether the aspect ratio of the source image should be preserved. + * The default is true. + */ + preserveAspectRatio:boolean; + /** + * Gets the SVG element that corresponds to this object. + * @see Overrides {@link yfiles.drawing.Visual#svgElement} + */ + svgElement:Element; + } + var Image:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.Image} class. + */ + new ():yfiles.drawing.Image; + /** + * Initializes a new instance of the {@link yfiles.drawing.Image} class. + * @param {string} url The URL of the embedded image. Can use any protocol supported by the browser, including data urls. + */ + WithSource:{ + new (url:string):yfiles.drawing.Image; + }; + }; + /** + * A visual that refers to an element in the defs part of the SVG document. + */ + export interface UseVisual extends yfiles.drawing.ArrangeVisual{ + /** + * Gets the SVG element that corresponds to this object. + * @see Overrides {@link yfiles.drawing.Visual#svgElement} + */ + svgElement:Element; + /** + * Updates the layout. + * @param {yfiles.geometry.IRectangle} layout The layout. + */ + updateLayout(layout:yfiles.geometry.IRectangle):void; + /** + * Gets or sets the bounds. + * Value: + * The bounds. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#bounds} + */ + bounds:yfiles.geometry.RectD; + /** + * A {@link yfiles.drawing.UseVisual} is always visible and can't be hidden. + * Accessing this property will cause an exception to be thrown. + * Value: + * true if visible; otherwise, false. + * @throws {yfiles.system.NotSupportedException} Occurs whenever this property is accessed. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#visible} + */ + visible:boolean; + /** + * Gets or sets the transform. + * Value: + * The transform. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#transform} + */ + transform:yfiles.geometry.Matrix2D; + } + var UseVisual:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.UseVisual} class. + * @param {string} id The id of the referenced element. + */ + WithId:{ + new (id:string):yfiles.drawing.UseVisual; + }; + /** + * Initializes a new instance of the {@link yfiles.drawing.UseVisual} class. + * @param {yfiles.geometry.IRectangle} layout The layout. + */ + FromLayout:{ + new (layout:yfiles.geometry.IRectangle):yfiles.drawing.UseVisual; + }; + }; + /** + * A visual that can be used to highlight a rectangular section. It is used for rendering the selection highlighting. + */ + export interface HighlightVisual extends yfiles.drawing.ArrangeVisual{ + /** + * Gets or sets the bounds. + * Value: + * The bounds. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#bounds} + */ + bounds:yfiles.geometry.RectD; + /** + * Gets or sets a value indicating whether this {@link yfiles.drawing.HighlightVisual} is visible. + * Value: + * true if visible; otherwise, false. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#visible} + */ + visible:boolean; + /** + * Gets or sets the transform. + * Value: + * The transform. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#transform} + */ + transform:yfiles.geometry.Matrix2D; + /** + * Gets the SVG element that corresponds to this object. + * @see Overrides {@link yfiles.drawing.Visual#svgElement} + */ + svgElement:Element; + } + var HighlightVisual:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.HighlightVisual} class. + * @param {yfiles.canvas.ICanvasContext} ctx The CTX. + */ + new (ctx:yfiles.canvas.ICanvasContext):yfiles.drawing.HighlightVisual; + }; + /** + * A visual for non focused candidates. + */ + export interface NonFocusedCandidateDrawingVisual extends yfiles.canvas.CanvasContainer{ + } + var NonFocusedCandidateDrawingVisual:{ + $class:yfiles.lang.Class; + new (brush:yfiles.system.Brush,ctx:yfiles.canvas.ICanvasContext):yfiles.drawing.NonFocusedCandidateDrawingVisual; + }; + /** + * A visual for drawing a focused candidate. + */ + export interface FocusedCandidateDrawingVisual extends yfiles.canvas.CanvasContainer{ + } + var FocusedCandidateDrawingVisual:{ + $class:yfiles.lang.Class; + new (brush:yfiles.system.Brush,ctx:yfiles.canvas.ICanvasContext):yfiles.drawing.FocusedCandidateDrawingVisual; + }; + /** + * A visual which can be used to display text. + */ + export interface TextVisual extends yfiles.drawing.ArrangeVisual{ + /** + * Gets the SVG element that corresponds to this object. + * @see Overrides {@link yfiles.drawing.Visual#svgElement} + */ + svgElement:Element; + /** + * Gets the pen. + */ + pen:yfiles.system.Pen; + /** + * Sets the pen. + * @param {yfiles.system.Pen} pen The pen. + * @param {yfiles.canvas.ICanvasContext} context The context. + */ + setPen(pen:yfiles.system.Pen,context:yfiles.canvas.ICanvasContext):void; + /** + * Gets the brush. + */ + brush:yfiles.system.Brush; + /** + * Sets the brush. + * @param {yfiles.system.Brush} brush The brush. + * @param {yfiles.canvas.ICanvasContext} context The context. + */ + setBrush(brush:yfiles.system.Brush,context:yfiles.canvas.ICanvasContext):void; + /** + * Updates the layout. + * @param {yfiles.geometry.IRectangle} layout The layout. + */ + updateLayout(layout:yfiles.geometry.IRectangle):void; + /** + * Gets or sets a value indicating whether this {@link yfiles.drawing.TextVisual} is visible. + * Value: + * true if visible; otherwise, false. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#visible} + */ + visible:boolean; + /** + * Gets or sets the transform. + * Value: + * The transform. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#transform} + */ + transform:yfiles.geometry.Matrix2D; + } + var TextVisual:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.TextVisual} class. + */ + new ():yfiles.drawing.TextVisual; + /** + * Initializes a new instance of the {@link yfiles.drawing.TextVisual} class. + * @param {yfiles.geometry.IRectangle} layout The layout. + */ + WithBounds:{ + new (layout:yfiles.geometry.IRectangle):yfiles.drawing.TextVisual; + }; + }; + /** + * Base class for all objects that support drawing in the context of a {@link yfiles.canvas.CanvasControl}. + * Instances of this type can wrap SVG elements and add additional logic, data, and behavior to them. + * The only property of this class is {@link yfiles.drawing.Visual#svgElement}. + * @see {@link yfiles.drawing.RenderVisual} + */ + export interface Visual extends Object{ + /** + * Gets the element that corresponds to this visual. + * Usually this will be an SVG element or the root of an SVG document fragment. + */ + svgElement:Element; + /** + * Sets the render data cache. + * This is a bridge method that delegates to {@link yfiles.canvas.SVGExtensions#setRenderDataCache}. + * @param {Object} renderData The render data. + */ + setRenderDataCache(renderData:Object):void; + /** + * Gets the render data cache. + * This is a bridge method that delegates to {@link yfiles.canvas.SVGExtensions#getRenderDataCache}. + * @return {T} The render data cache + */ + getRenderDataCache(tType:yfiles.lang.Class):T; + } + var Visual:{ + $class:yfiles.lang.Class; + }; + export enum ImageRenderingType{ + /** + * Indicates that the rendering engine should use a balanced setup with a + * slight preference of quality. + */ + AUTO, + /** + * Indicates that the rendering speed should be optimized. + */ + OPTIMIZE_SPEED, + /** + * Indicates that the rendering quality should be optimized. + */ + OPTIMIZE_QUALITY, + INHERIT + } + /** + * Specifies the origin of an image resource. + */ + export interface ImageSource extends Object{ + /** + * Gets or sets the path or URL of the image that is specified by this class. + * Value: + * The path or URL of the image that is specified by this class. + */ + path:string; + } + var ImageSource:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.ImageSource} class. + */ + new ():yfiles.drawing.ImageSource; + /** + * Initializes a new instance of the {@link yfiles.drawing.ImageSource} class. + * @param {string} path The path. + */ + WithSource:{ + new (path:string):yfiles.drawing.ImageSource; + }; + }; + /** + * Base class for {@link yfiles.drawing.Visual}s that use HTML5's Canvas for the visualization. + * Note that instances of this class cannot be used anywhere where a {@link yfiles.drawing.Visual} is required. + * {@link yfiles.drawing.RenderVisual#svgElement} will yield null, always and instead the visualization is + * implemented by the {@link yfiles.drawing.RenderVisual#paint} method. + * This means that this kind of visual does not work in a {@link yfiles.canvas.CanvasContainer} and wrapping the visual + * will not work by putting the {@link yfiles.drawing.RenderVisual#svgElement} into another SVG container. + * These kind of visuals can be used at the top-level of a {@link yfiles.canvas.CanvasControl}'s {@link yfiles.canvas.ICanvasObject}s, only. + * @see {@link yfiles.drawing.RenderVisual#paint} + */ + export interface RenderVisual extends yfiles.drawing.Visual{ + /** + * Returns null, always. + * The {@link yfiles.canvas.CanvasControl} will not evaluate this property for instances of {@link yfiles.drawing.RenderVisual}. + * Instead, the {@link yfiles.drawing.RenderVisual#paint} method will be invoked. + * @see {@link yfiles.drawing.RenderVisual#paint} + * @see Overrides {@link yfiles.drawing.Visual#svgElement} + */ + svgElement:Element; + /** + * Paints onto the context using HTML5 Canvas operations. + * Implementations should not destroy the context's state, but should make sure to restore the state to the previously active state. + * This is especially true for the transformation and clip. + * @param {yfiles.drawing.IRenderContext} renderContext The render context of the {@link yfiles.canvas.CanvasControl} + * @param {Object} htmlCanvasContext The HTML5 Canvas context to use for rendering. + */ + paint(renderContext:yfiles.drawing.IRenderContext,htmlCanvasContext:Object):void; + } + var RenderVisual:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.RenderVisual; + }; + /** + * A visual that represents a, possibly rounded, rectangle. + */ + export interface RectVisual extends yfiles.drawing.ArrangeVisual{ + /** + * Gets the SVG element that corresponds to this object. + * @see Overrides {@link yfiles.drawing.Visual#svgElement} + */ + svgElement:Element; + /** + * Gets the pen. + */ + pen:yfiles.system.Pen; + /** + * Sets the pen. + * @param {yfiles.system.Pen} pen The pen. + * @param {yfiles.canvas.ICanvasContext} context The context. + */ + setPen(pen:yfiles.system.Pen,context:yfiles.canvas.ICanvasContext):void; + /** + * Gets the brush. + */ + brush:yfiles.system.Brush; + /** + * Sets the brush. + * @param {yfiles.system.Brush} brush The brush. + * @param {yfiles.canvas.ICanvasContext} context The context. + */ + setBrush(brush:yfiles.system.Brush,context:yfiles.canvas.ICanvasContext):void; + /** + * Sets the radius of the corners of the rectangle. + * @param {number} roundRectArcRadius The round rect arc radius. + */ + setArcRadius(roundRectArcRadius:number):void; + /** + * Updates the layout. + * @param {yfiles.geometry.IRectangle} layout The layout. + */ + updateLayout(layout:yfiles.geometry.IRectangle):void; + /** + * Gets or sets the bounds. + * Value: + * The bounds. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#bounds} + */ + bounds:yfiles.geometry.RectD; + /** + * Gets or sets a value indicating whether this {@link yfiles.drawing.RectVisual} is visible. + * Value: + * true if visible; otherwise, false. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#visible} + */ + visible:boolean; + /** + * Gets or sets the transform. + * Value: + * The transform. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#transform} + */ + transform:yfiles.geometry.Matrix2D; + } + var RectVisual:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.RectVisual} class. + */ + new ():yfiles.drawing.RectVisual; + /** + * Initializes a new instance of the {@link yfiles.drawing.RectVisual} class. + * @param {yfiles.geometry.IRectangle} layout The layout. + */ + FromRectangle:{ + new (layout:yfiles.geometry.IRectangle):yfiles.drawing.RectVisual; + }; + }; + export enum ShapeRenderingType{ + /** + * Indicates that the rendering engine should use a balanced setup with a + * slight preference of geometric precision. + */ + AUTO, + /** + * Indicates that the rendering speed should be optimized. + */ + OPTIMIZE_SPEED, + /** + * Indicates that the rendering should be optimized for crisp edges. + */ + CRISP_EDGES, + /** + * Indicates that the rendering should be optimized for geometric + * precision. + */ + GEOMETRIC_PRECISION, + INHERIT + } + /** + * Represents an SVG element which has a location and size, a visibility state, + * and a transformation matrix. + * Subclasses should make sure that the values of {@link yfiles.drawing.ArrangeVisual#bounds}, {@link yfiles.drawing.ArrangeVisual#visible} + * and {@link yfiles.drawing.ArrangeVisual#transform} are used by the {@link yfiles.drawing.Visual#svgElement}. + */ + export interface ArrangeVisual extends yfiles.drawing.Visual{ + /** + * Gets or sets the bounds of this visual. + */ + bounds:yfiles.geometry.RectD; + /** + * Gets or sets whether this visual is visible. + */ + visible:boolean; + /** + * Gets or sets the transformation matrix of this visual. + */ + transform:yfiles.geometry.Matrix2D; + /** + * Gets or sets the shape-rendering type for this visual. + * and its children. + * Shape rendering can improve performance but affects the display quality of this visual. + */ + shapeRendering:yfiles.drawing.ShapeRenderingType; + /** + * Gets or sets the image-rendering type for this visual. + * and its children. + * Image rendering can improve performance but affects the display quality of images. + */ + imageRendering:yfiles.drawing.ImageRenderingType; + } + var ArrangeVisual:{ + $class:yfiles.lang.Class; + new ():yfiles.drawing.ArrangeVisual; + }; + export interface DOMElementExtensions extends Object{ + } + var DOMElementExtensions:{ + $class:yfiles.lang.Class; + /** + * Gets the absolute position of an HTML element and takes the scroll and offset into account. + * The returned location includes the border and padding of the element. + * This works in all recent browsers: http://www.quirksmode.org/dom/w3c_cssom.html + * @param {HTMLElement} element The element. + * @return {yfiles.geometry.Point} + */ + getAbsolutePosition(element:HTMLElement):yfiles.geometry.Point; + /** + * Sets the value of a {@link yfiles.system.DependencyProperty} on an element. + * @param {Node} element The element. + * @param {yfiles.system.DependencyProperty} property The property. + * @param {Object} value The value. + */ + setValue(element:Node,property:yfiles.system.DependencyProperty,value:Object):void; + /** + * Gets the value of a {@link yfiles.system.DependencyProperty} on an element. + * @param {Node} element The element. + * @param {yfiles.system.DependencyProperty} property The property. + * @return {T} + */ + getValue(element:Node,property:yfiles.system.DependencyProperty):T; + /** + * Determines whether the node is a child of the specified parent node. + * @param {Node} parent The parent node. + * @param {Node} child The possible child node. + * @return {boolean} + * true if the node is a child of the specified parent; otherwise, false. + */ + isAChildOf(parent:Node,child:Node):boolean; + /** + * Creates a deep clone of a DOM node in the specified document. + * If the node to clone does not have a valid nodeType, null is returned. + * @param {Node} node The node to clone + * @param {Document} document The document to clone the node in + * @return {Node} The cloned node, or null + */ + cloneNode(node:Node,document:Document):Node; + }; + /** + * A visual that wraps the HTML5 Canvas element. + */ + export interface CanvasVisual extends yfiles.drawing.ArrangeVisual{ + /** + * Gets the HTML5 canvas element. + */ + canvas:HTMLCanvasElement; + /** + * Gets the 2D context of the HTML5 canvas element. + */ + context:Object; + /** + * Gets the SVG element that corresponds to this object. + * Since the canvas element is embedded inside an SVG document, this property contains the SVG foreignElement element + * that contains the canvas element. + * @see Overrides {@link yfiles.drawing.Visual#svgElement} + */ + svgElement:Element; + /** + * Updates the layout. + * @param {yfiles.geometry.IRectangle} Layout The layout. + */ + updateLayout(Layout:yfiles.geometry.IRectangle):void; + /** + * Gets or sets the bounds. + * Value: + * The bounds. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#bounds} + */ + bounds:yfiles.geometry.RectD; + /** + * Gets or sets a value indicating whether this {@link yfiles.drawing.CanvasVisual} is visible. + * Value: + * true if visible; otherwise, false. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#visible} + */ + visible:boolean; + /** + * Gets or sets the transform. + * Value: + * The transform. + * @see Overrides {@link yfiles.drawing.ArrangeVisual#transform} + */ + transform:yfiles.geometry.Matrix2D; + } + var CanvasVisual:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.drawing.CanvasVisual} class. + */ + new ():yfiles.drawing.CanvasVisual; + /** + * Initializes a new instance of the {@link yfiles.drawing.CanvasVisual} class. + * @param {yfiles.geometry.IRectangle} layout The layout. + */ + WithRectangle:{ + new (layout:yfiles.geometry.IRectangle):yfiles.drawing.CanvasVisual; + }; + }; + /** + * Classes that implement this interface can be placed in the SVGs defs section by the {@link yfiles.canvas.DefsManager}. + * The {@link yfiles.canvas.DefsManager} can then create and update an element that can be used with a {@link yfiles.drawing.UseVisual}. + * The interface is also used to help the {@link yfiles.canvas.DefsManager} to find unused elements that can be removed from + * the defs section. + * When an element is created using this interface, the {@link yfiles.canvas.DefsManager} assigns an ID to it that is required to + * reference it through an {@link yfiles.drawing.UseVisual}. The ID that was assigned to it can be queried using the + * {@link yfiles.canvas.ICanvasContext#getDefsId} method when the {@link yfiles.drawing.IDefsSupport} object is passed in that was used to + * create the element. + */ + export interface IDefsSupport extends Object{ + /** + * Updates the defs element with the current gradient data. + * @param {SVGElement} oldElement + * @param {yfiles.canvas.ICanvasContext} context + * @see Specified by {@link yfiles.drawing.IDefsSupport#updateDefsElement}. + */ + updateDefsElement(oldElement:SVGElement,context:yfiles.canvas.ICanvasContext):void; + /** + * Creates the element that is put into the defs section of the SVG element. + * @param {yfiles.canvas.ICanvasContext} context The canvas context that can be used to register brushes etc. + * @return {SVGElement} An {@link SVGElement} that can be put into the defs section of the SVG element. + * @see Specified by {@link yfiles.drawing.IDefsSupport#createDefsElement}. + */ + createDefsElement(context:yfiles.canvas.ICanvasContext):SVGElement; + /** + * Checks if the specified node references the element represented by this object. + * @param {yfiles.canvas.ICanvasContext} context The current canvas context. + * @param {Node} node The SVG node. + * @param {string} id The defs id that has been stored for this instance by the provided context. + * @return {boolean} true if node references the element represented by this instance. + * @see Specified by {@link yfiles.drawing.IDefsSupport#accept}. + */ + accept(context:yfiles.canvas.ICanvasContext,node:Node,id:string):boolean; + } + var IDefsSupport:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export module common{ + /** + * A void implementation of the {@link yfiles.drawing.IStyleRenderer} + * interface that does nothing and behaves like an invisible style. + */ + export interface VoidStyleRenderer> extends Object,yfiles.drawing.IStyleRenderer{ + /** + * Yields the {@link yfiles.drawing.VoidVisualCreator#INSTANCE} that will do nothing. + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getVisualCreator}. + */ + getVisualCreator(item:TModelItem,style:TStyle):yfiles.drawing.IVisualCreator; + /** + * Yields the {@link yfiles.drawing.BoundsProvider#EMPTY} that will return empty bounds. + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getBoundsProvider}. + */ + getBoundsProvider(item:TModelItem,style:TStyle):yfiles.drawing.IBoundsProvider; + /** + * Yields the {@link yfiles.drawing.VisibilityTest#NEVER} that will always claim invisibility. + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getVisibilityTest}. + */ + getVisibilityTest(item:TModelItem,style:TStyle):yfiles.drawing.IVisibilityTest; + /** + * Yields the {@link yfiles.drawing.HitTestable#NEVER} that will always report misses. + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getHitTestable}. + */ + getHitTestable(item:TModelItem,style:TStyle):yfiles.drawing.IHitTestable; + /** + * Yields the {@link yfiles.drawing.MarqueeTestable#NEVER} that will always report misses. + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getMarqueeTestable}. + */ + getMarqueeTestable(item:TModelItem,style:TStyle):yfiles.drawing.IMarqueeTestable; + /** + * Yields the {@link yfiles.support.Lookups#EMPTY} that will not yield anything. + * @see Specified by {@link yfiles.drawing.IStyleRenderer#getContext}. + */ + getContext(item:TModelItem,style:TStyle):yfiles.support.ILookup; + } + var VoidStyleRenderer:{ + $class:yfiles.lang.Class; + }; + /** + * Void implementation of a {@link yfiles.drawing.IUserTagProvider} that + * always yields null and can not {@link yfiles.drawing.common.VoidUserTagProvider#setUserTag set} + * a new tag on the items. + */ + export interface VoidUserTagProvider extends Object,yfiles.drawing.IUserTagProvider{ + /** + * Always returns null. + * @param {yfiles.model.IModelItem} forItem The item to get the user associated data from. + * @param {yfiles.support.ILookup} context The context that can optional be queried for additional service implementations. + * @return {Object} + * null + * @see Specified by {@link yfiles.drawing.IUserTagProvider#getUserTag}. + */ + getUserTag(forItem:yfiles.model.IModelItem,context:yfiles.support.ILookup):Object; + /** + * Does not do anything. + * @param {yfiles.model.IModelItem} forItem The item to store the new tag with. + * @param {Object} newTag The new tag. + * @param {yfiles.support.ILookup} context The context that can optional be queried for additional service implementations. + * @return {boolean} + * Always false. + * @see Specified by {@link yfiles.drawing.IUserTagProvider#setUserTag}. + */ + setUserTag(forItem:yfiles.model.IModelItem,newTag:Object,context:yfiles.support.ILookup):boolean; + } + var VoidUserTagProvider:{ + $class:yfiles.lang.Class; + /** + * A singleton instance of this class. + */ + INSTANCE:yfiles.drawing.common.VoidUserTagProvider; + }; + /** + * A void implementation of a node style renderer that does nothing. + * This class implements the singleton pattern. Use the shared static + * {@link yfiles.drawing.common.VoidNodeStyleRenderer#INSTANCE} of this class instead of null + * where null is not allowed. For example you cannot assign + * null to the {@link yfiles.drawing.INodeStyle#renderer} property of an + * {@link yfiles.drawing.INodeStyle}. + */ + export interface VoidNodeStyleRenderer extends yfiles.drawing.common.VoidStyleRenderer,yfiles.drawing.INodeStyleRenderer{ + /** + * This implementation always returns the + * {@link yfiles.drawing.common.VoidShapeGeometry#INSTANCE VoidShapeGeometry instance}. + * @param {yfiles.graph.INode} node The node to provide an instance for + * @param {yfiles.drawing.INodeStyle} style The style to use for the painting + * @return {yfiles.drawing.IShapeGeometry} + * The {@link yfiles.drawing.common.VoidShapeGeometry#INSTANCE VoidShapeGeometry instance}. + * @see {@link yfiles.drawing.INodeStyleRenderer#getShapeGeometry INodeStyleRenderer.GetShapeGeometry} + * @see Specified by {@link yfiles.drawing.INodeStyleRenderer#getShapeGeometry}. + */ + getShapeGeometry(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):yfiles.drawing.IShapeGeometry; + } + var VoidNodeStyleRenderer:{ + $class:yfiles.lang.Class; + /** + * The {@link yfiles.drawing.common.VoidNodeStyleRenderer} singleton. + */ + INSTANCE:yfiles.drawing.INodeStyleRenderer; + }; + /** + * A void implementation of a port style renderer that does nothing. + * This class implements the singleton pattern. Use the shared static + * {@link yfiles.drawing.common.VoidPortStyleRenderer#INSTANCE} of this class instead of null + * where null is not allowed. For example you cannot assign + * null to the {@link yfiles.drawing.IPortStyle#renderer} property of an + * {@link yfiles.drawing.IPortStyle}. + */ + export interface VoidPortStyleRenderer extends yfiles.drawing.common.VoidStyleRenderer,yfiles.drawing.IPortStyleRenderer{ + } + var VoidPortStyleRenderer:{ + $class:yfiles.lang.Class; + /** + * The {@link yfiles.drawing.common.VoidPortStyleRenderer} singleton. + */ + INSTANCE:yfiles.drawing.IPortStyleRenderer; + }; + /** + * A void implementation of a port style that does nothing and behaves like + * an invisible style. + * This class implements the singleton pattern. Use the shared static + * {@link yfiles.drawing.common.VoidPortStyle#INSTANCE} of this class instead of null + * where null is not allowed. For example you cannot assign + * null to the {@link yfiles.graph.IPort#style} property of an + * {@link yfiles.graph.IPort}. + */ + export interface VoidPortStyle extends yfiles.drawing.common.VoidVisualStyle,yfiles.drawing.IPortStyle{ + /** + * Yields the {@link yfiles.drawing.common.VoidPortStyleRenderer#INSTANCE VoidPortStyleRenderer instance}. + * @see {@link yfiles.drawing.IPortStyle#renderer IPortStyle.Renderer} + * @see Specified by {@link yfiles.drawing.IPortStyle#renderer}. + */ + renderer:yfiles.drawing.IPortStyleRenderer; + } + var VoidPortStyle:{ + $class:yfiles.lang.Class; + /** + * The {@link yfiles.drawing.common.VoidPortStyle} singleton. + */ + INSTANCE:yfiles.drawing.IPortStyle; + }; + /** + * A void implementation of a label style that does nothing and behaves like + * an invisible style. + * This class implements the singleton pattern. Use the shared static + * {@link yfiles.drawing.common.VoidLabelStyle#INSTANCE} of this class instead of null + * where null is not allowed. For example you cannot assign + * null to the {@link yfiles.graph.ILabel#style} property of an + * {@link yfiles.graph.ILabel}. + */ + export interface VoidLabelStyle extends yfiles.drawing.common.VoidVisualStyle,yfiles.drawing.ILabelStyle{ + /** + * Yields the {@link yfiles.drawing.common.VoidLabelStyleRenderer#INSTANCE VoidLabelStyleRenderer instance}. + * @see {@link yfiles.drawing.ILabelStyle#renderer ILabelStyle.Renderer} + * @see Specified by {@link yfiles.drawing.ILabelStyle#renderer}. + */ + renderer:yfiles.drawing.ILabelStyleRenderer; + } + var VoidLabelStyle:{ + $class:yfiles.lang.Class; + /** + * The singleton instance of this style. + */ + INSTANCE:yfiles.drawing.ILabelStyle; + }; + /** + * A void implementation of a label style renderer that does nothing. + * This class implements the singleton pattern. Use the shared static + * {@link yfiles.drawing.common.VoidLabelStyleRenderer#INSTANCE} of this class instead of null + * where null is not allowed. For example you cannot assign + * null to the {@link yfiles.drawing.ILabelStyle#renderer} property of an + * {@link yfiles.drawing.ILabelStyle}. + */ + export interface VoidLabelStyleRenderer extends yfiles.drawing.common.VoidStyleRenderer,yfiles.drawing.ILabelStyleRenderer{ + /** + * Yields {@link yfiles.geometry.SizeD#EMPTY}. + * @see Specified by {@link yfiles.drawing.ILabelStyleRenderer#getPreferredSize}. + */ + getPreferredSize(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle):yfiles.geometry.SizeD; + } + var VoidLabelStyleRenderer:{ + $class:yfiles.lang.Class; + /** + * The singleton instance of this renderer. + */ + INSTANCE:yfiles.drawing.ILabelStyleRenderer; + }; + /** + * A void implementation of the {@link yfiles.drawing.IShapeGeometry} + * interface that does nothing and behaves like an empty geometry. + * This class implements the singleton pattern. Use the shared static + * {@link yfiles.drawing.common.VoidShapeGeometry#INSTANCE} of this class instead of + * null were null is not allowed. + * The {@link yfiles.drawing.common.VoidNodeStyleRenderer} does so for example. + */ + export interface VoidShapeGeometry extends Object,yfiles.drawing.IShapeGeometry{ + /** + * This implementation always returns null (a {@link system.Nullable} + * with no value). + * @param {yfiles.geometry.PointD} inner The first point of the line that is inside the shape. + * @param {yfiles.geometry.PointD} outer The second point of the line that is outside the shape. + * @return {yfiles.geometry.PointD} + * A {@link system.Nullable} with no value. + * @see {@link yfiles.drawing.IShapeGeometry#getIntersection IShapeGeometry.GetIntersection} + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getIntersection}. + */ + getIntersection(inner:yfiles.geometry.PointD,outer:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * This implementation always returns false. + * @param {yfiles.geometry.PointD} point The point to test. + * @return {boolean} false + * @see {@link yfiles.drawing.IShapeGeometry#isInside IShapeGeometry.IsInside} + * @see Specified by {@link yfiles.drawing.IShapeGeometry#isInside}. + */ + isInside(point:yfiles.geometry.PointD):boolean; + /** + * This implementation returns null. + * @return {yfiles.drawing.GeneralPath} null + * @see {@link yfiles.drawing.IShapeGeometry#getOutline IShapeGeometry.GetOutline} + * @see Specified by {@link yfiles.drawing.IShapeGeometry#getOutline}. + */ + getOutline():yfiles.drawing.GeneralPath; + } + var VoidShapeGeometry:{ + $class:yfiles.lang.Class; + /** + * The {@link yfiles.drawing.common.VoidShapeGeometry} singleton. + */ + INSTANCE:yfiles.drawing.IShapeGeometry; + }; + /** + * A void implementation of an edge style that does nothing and behaves like + * an invisible style. + * This class implements the singleton pattern. Use the shared static + * {@link yfiles.drawing.common.VoidEdgeStyle#INSTANCE} of this class instead of null + * where null is not allowed. For example you cannot assign + * null to the {@link yfiles.graph.IEdge#style} property of an + * {@link yfiles.graph.IEdge}. + */ + export interface VoidEdgeStyle extends yfiles.drawing.common.VoidVisualStyle,yfiles.drawing.IEdgeStyle{ + /** + * Yields the {@link yfiles.drawing.common.VoidEdgeStyleRenderer#INSTANCE + * VoidEdgeStyleRenderer instance}. + * @see {@link yfiles.drawing.IEdgeStyle#renderer IEdgeStyle.Renderer} + * @see Specified by {@link yfiles.drawing.IEdgeStyle#renderer}. + */ + renderer:yfiles.drawing.IEdgeStyleRenderer; + } + var VoidEdgeStyle:{ + $class:yfiles.lang.Class; + /** + * The {@link yfiles.drawing.common.VoidEdgeStyle} singleton. + */ + INSTANCE:yfiles.drawing.IEdgeStyle; + }; + /** + * A void implementation of an edge style renderer that does nothing. + * This class implements the singleton pattern. Use the shared static + * {@link yfiles.drawing.common.VoidEdgeStyleRenderer#INSTANCE} of this class instead of null + * where null is not allowed. For example you cannot assign + * null to the {@link yfiles.drawing.IEdgeStyle#renderer} property of an + * {@link yfiles.drawing.IEdgeStyle}. + */ + export interface VoidEdgeStyleRenderer extends yfiles.drawing.common.VoidStyleRenderer,yfiles.drawing.IEdgeStyleRenderer{ + /** + * This method always returns the {@link yfiles.drawing.common.VoidPathGeometry#INSTANCE VoidPathGeometry instance}. + * @param {yfiles.graph.IEdge} edge The edge to provide an instance for + * @param {yfiles.drawing.IEdgeStyle} style The style to use for the painting + * @return {yfiles.drawing.IPathGeometry} + * The {@link yfiles.drawing.common.VoidPathGeometry#INSTANCE VoidPathGeometry instance}. + * @see {@link yfiles.drawing.IEdgeStyleRenderer#getPathGeometry} + * @see Specified by {@link yfiles.drawing.IEdgeStyleRenderer#getPathGeometry}. + */ + getPathGeometry(edge:yfiles.graph.IEdge,style:yfiles.drawing.IEdgeStyle):yfiles.drawing.IPathGeometry; + } + var VoidEdgeStyleRenderer:{ + $class:yfiles.lang.Class; + /** + * The {@link yfiles.drawing.common.VoidEdgeStyleRenderer} singleton. + */ + INSTANCE:yfiles.drawing.IEdgeStyleRenderer; + }; + /** + * A void implementation of a node style that does nothing and behaves like + * an invisible style. + * This class implements the singleton pattern. Use the shared static + * {@link yfiles.drawing.common.VoidNodeStyle#INSTANCE} of this class instead of null + * where null is not allowed. For example you cannot assign + * null to the {@link yfiles.graph.INode#style} property of an + * {@link yfiles.graph.INode}. + */ + export interface VoidNodeStyle extends yfiles.drawing.common.VoidVisualStyle,yfiles.drawing.INodeStyle{ + /** + * Yields the {@link yfiles.drawing.common.VoidNodeStyleRenderer#INSTANCE + * VoidNodeStyleRenderer instance}. + * @see {@link yfiles.drawing.INodeStyle#renderer INodeStyle.Renderer} + * @see Specified by {@link yfiles.drawing.INodeStyle#renderer}. + */ + renderer:yfiles.drawing.INodeStyleRenderer; + } + var VoidNodeStyle:{ + $class:yfiles.lang.Class; + /** + * The {@link yfiles.drawing.common.VoidNodeStyle} singleton. + */ + INSTANCE:yfiles.drawing.INodeStyle; + }; + /** + * A void implementation of the {@link yfiles.drawing.IPathGeometry} + * interface that does nothing and behaves like an empty path. + * This class implements the singleton pattern. Use the shared static + * {@link yfiles.drawing.common.VoidPathGeometry#INSTANCE} of this class instead of + * null were null is not allowed. + * The {@link yfiles.drawing.common.VoidEdgeStyleRenderer} does so for example. + */ + export interface VoidPathGeometry extends Object,yfiles.drawing.IPathGeometry{ + getTangent(ratio:number,p:{value:yfiles.geometry.PointD;},tangent:{value:yfiles.geometry.PointD;}):boolean; + getTangentForIndex(segmentIndex:number,ratio:number,p:{value:yfiles.geometry.PointD;},tangent:{value:yfiles.geometry.PointD;}):boolean; + getSegmentCount():number; + getPath():yfiles.drawing.GeneralPath; + } + var VoidPathGeometry:{ + $class:yfiles.lang.Class; + /** + * The {@link yfiles.drawing.common.VoidPathGeometry} singleton. + */ + INSTANCE:yfiles.drawing.IPathGeometry; + }; + /** + * A void implementation of the {@link yfiles.drawing.IVisualStyle} + * interface that does nothing, i.e. {@link yfiles.drawing.common.VoidVisualStyle#install} returns silently. + * This class uses the singleton pattern. + */ + export interface VoidVisualStyle extends Object,yfiles.drawing.IVisualStyle{ + /** + * Returns this. + * @return {Object} + * this + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + /** + * Returns silently. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:TModelItem):void; + } + var VoidVisualStyle:{ + $class:yfiles.lang.Class; + /** + * A static shareable singleton instance. + */ + INSTANCE:yfiles.drawing.common.VoidVisualStyle; + }; + } + } + export module genealogy{ + export enum VerticalNodeAlignment{ + /** + * @see {@link yfiles.genealogy.FamilyTreeLayouter#alignment} + * @see {@link yfiles.genealogy.FamilyTreeLayouter#alignment} + */ + TOP, + /** + * @see {@link yfiles.genealogy.FamilyTreeLayouter#alignment} + * @see {@link yfiles.genealogy.FamilyTreeLayouter#alignment} + */ + CENTER, + /** + * @see {@link yfiles.genealogy.FamilyTreeLayouter#alignment} + * @see {@link yfiles.genealogy.FamilyTreeLayouter#alignment} + */ + BOTTOM + } + /** + * This class implements a layout algorithm for genealogical data (family trees). + *

+ * To be suitable for this layouter the graphs have to be organized in the following way: + * Individuals as well as their marriage or partnership are represented by nodes, in the following referred to as + * INDI nodes for individuals and FAM nodes for family nodes, corresponding to the INDI and FAM entries in + * Gedcom encoded genealogical data (GEDCOM is a widely used format to store genealogical data, see + * http://www.phpgedview.net/ged551-5.pdf for the most recent specifications). + *

+ *

+ * In order to determine whether a node represents an individual or a partnership, the data provider + * {@link yfiles.genealogy.FamilyTreeLayouter#DP_KEY_FAMILY_TYPE} has to be registered, otherwise an {@link yfiles.system.ArgumentException} will be thrown. + * That data provider should return: + *

    + *
  • {@link yfiles.genealogy.FamilyTreeLayouter#TYPE_MALE} for a node representing a male individual.
  • + *
  • {@link yfiles.genealogy.FamilyTreeLayouter#TYPE_FEMALE} for a node representing a female individual.
  • + *
  • {@link yfiles.genealogy.FamilyTreeLayouter#TYPE_FAMILY} for a node representing a family.
  • + *
+ * All other values will be interpreted as if the node represents an individual. + *

+ *

+ * A FAM node is linked to the INDI nodes representing husband and wife by ingoing edges and to INDI nodes representing + * the children by outgoing edges. Two nodes of the same type (INDI or FAM) which are linked directly together + * will cause a {@link yfiles.algorithms.InvalidGraphStructureException} exception. A FAM node with more than two parents + * will also cause a {@link yfiles.algorithms.InvalidGraphStructureException} exception. + *

+ * The layout is calculated basically in two steps: + *
    + *
  • The families are laid out by the inner layouter in a compact way: INDI->FAM<-INDI->FAM<-INDI
  • + *
  • The relation between these "family groups" and their children and other families are laid out by the top layouter
  • + *
+ * The top layouter can be accessed by {@link yfiles.genealogy.FamilyTreeLayouter#topLayouter} and {@link yfiles.genealogy.FamilyTreeLayouter#topLayouter}. + * By default, an {@link yfiles.hierarchic.IncrementalHierarchicLayouter} is used. + */ + export interface FamilyTreeLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * The layouter which is responsible for the layout between the family groups. + * If no layouter is set, + * a new instance of {@link yfiles.hierarchic.IncrementalHierarchicLayouter} is created. + */ + topLayouter:yfiles.layout.ILayouter; + /** + * The (horizontal) space between two nodes representing members of the same family. + */ + spacingBetweenFamilyMembers:number; + /** + * The offset by which a family node will be shifted down if its parents are not direct neighbours. + */ + offsetForFamilyNodes:number; + /** + * Determines the treatment of individuals who have only children but no partners. + * If set to true, + * the family node will be placed centered below the individual node. Thus, a direct male inheritance line for + * example will be depicted in a more obvious way. + */ + partnerlessBelow:boolean; + /** + * Determines whether family/marriage nodes will be placed between the partners or below them. + */ + familyNodesAlwaysBelow:boolean; + /** + * The vertical alignment of the individual nodes. + * @throws {yfiles.system.ArgumentException} if the given value is not defined. + */ + alignment:number; + /** + * Returns true if the given graph can be laid out by this algorithm. + * Calling doLayout + * with the given graph as it's argument will only succeed if this method returns true. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * The policy the individuals of a family will be sorted by their sex. + * Default is no sorting ({@link yfiles.genealogy.FamilyMembersSortingPolicy#DO_NOT_SORT_BY_SEX}). + */ + sortFamilyMembers:yfiles.genealogy.FamilyMembersSortingPolicy; + /** + * Main layout routine that assigns new layout information to the given graph. + * @param {yfiles.layout.LayoutGraph} graph The graph to run the layout on + * @throws {yfiles.system.InvalidOperationException} + * If the data provider {@link yfiles.genealogy.FamilyTreeLayouter#DP_KEY_FAMILY_TYPE} is not registered + * @throws {yfiles.algorithms.InvalidGraphStructureException} If a family node has more than two parents, or two nodes of the same type are linked together + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + } + var FamilyTreeLayouter:{ + $class:yfiles.lang.Class; + /** + * Data provider key which defines a data provider for nodes which returns a String which defines the type of the + * node as defined in {@link yfiles.genealogy.FamilyTreeLayouter#TYPE_FAMILY}, {@link yfiles.genealogy.FamilyTreeLayouter#TYPE_MALE}, {@link yfiles.genealogy.FamilyTreeLayouter#TYPE_FEMALE}. + * Nodes for which null is returned will be treated like nodes which represent individuals. + */ + DP_KEY_FAMILY_TYPE:string; + /** + * Returned by the DataProvider {@link yfiles.genealogy.FamilyTreeLayouter#DP_KEY_FAMILY_TYPE} for nodes which represent a family. + */ + TYPE_FAMILY:string; + /** + * Returned by the DataProvider {@link yfiles.genealogy.FamilyTreeLayouter#DP_KEY_FAMILY_TYPE} for nodes which represent a male individual. + */ + TYPE_MALE:string; + /** + * Returned by the DataProvider {@link yfiles.genealogy.FamilyTreeLayouter#DP_KEY_FAMILY_TYPE} for nodes which represent a female individual. + */ + TYPE_FEMALE:string; + /** + * Creates a new instance of this. + */ + new ():yfiles.genealogy.FamilyTreeLayouter; + }; + export enum FamilyMembersSortingPolicy{ + /** + * Disables sorting the individuals according to their sex. + * @see {@link yfiles.genealogy.FamilyTreeLayouter#sortFamilyMembers} + * @see {@link yfiles.genealogy.FamilyTreeLayouter#sortFamilyMembers} + */ + DO_NOT_SORT_BY_SEX, + /** + * Places female individuals before their male siblings and partners if possible. + * @see {@link yfiles.genealogy.FamilyTreeLayouter#sortFamilyMembers} + * @see {@link yfiles.genealogy.FamilyTreeLayouter#sortFamilyMembers} + */ + FEMALE_FIRST, + /** + * Places female individuals before their male siblings and partners. + * @see {@link yfiles.genealogy.FamilyTreeLayouter#sortFamilyMembers} + * @see {@link yfiles.genealogy.FamilyTreeLayouter#sortFamilyMembers} + */ + FEMALE_ALWAYS_FIRST, + /** + * Places female individuals before their male siblings and partners if possible. + * @see {@link yfiles.genealogy.FamilyTreeLayouter#sortFamilyMembers} + * @see {@link yfiles.genealogy.FamilyTreeLayouter#sortFamilyMembers} + */ + MALE_FIRST, + /** + * Places female individuals before their male siblings and partners. + * @see {@link yfiles.genealogy.FamilyTreeLayouter#sortFamilyMembers} + * @see {@link yfiles.genealogy.FamilyTreeLayouter#sortFamilyMembers} + */ + MALE_ALWAYS_FIRST + } + } + export module geometry{ + /** + * Interface that is implemented by geometric objects that + * can be moved. + * This interface allows for moving an instance given an offset. + * @see {@link yfiles.geometry.Point} + * @see {@link yfiles.geometry.Rectangle} + */ + export interface IMovable extends Object{ + /** + * Moves the instances coordinates by the given offsets. + * It is up to the implementation to decide whether to perform the move. + * The return value indicates whether the instance has been moved at all. + * @param {yfiles.geometry.PointD} delta The offset to move the instance's coordinates by. + * @return {boolean} Whether the instance has been moved. + * @see Specified by {@link yfiles.geometry.IMovable#moveBy}. + */ + moveBy(delta:yfiles.geometry.PointD):boolean; + } + var IMovable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface that checks for containment of a point in 2D coordinate space. + * Currently, this interface is only used to determine which bends of edges that connect child nodes + * are moved when the parent node is moved. Therefore, special care has to be taken + * if you want to provide this interface in the node lookup for other purposes, as this can also affect implicit bend movement. + */ + export interface IContainsTest extends Object{ + /** + * Determines whether the provided point is deemed to lie within the shape + * this test is implemented for. + * Currently, this method is only used to determine which bends of edges that connect child nodes + * are moved when the parent node is moved. If an implementation of {@link yfiles.geometry.IContainsTest} is present + * in the node's {@link yfiles.support.ILookup#lookup}, this + * method is called with the bend's location as location and the bend will be moved + * together with the parent node iff true is returned. + * If no implemention is provided, only bends that + * lie inside the bounds of the parent node are moved. + * @param {yfiles.geometry.PointD} location The coordinates of the point to test. + * @return {boolean} true iff the point is contained within the shape. + * @see Specified by {@link yfiles.geometry.IContainsTest#contains}. + */ + contains(location:yfiles.geometry.PointD):boolean; + } + var IContainsTest:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for mutable oriented rectangles in 2D coordinate space with double precision coordinates. + * @see {@link yfiles.geometry.ISizeSetter} + * @see {@link yfiles.geometry.ISize} + * @see {@link yfiles.geometry.IOrientedRectangle} + * @see {@link yfiles.geometry.OrientedRectangle} + */ + export interface IMutableOrientedRectangle extends Object,yfiles.geometry.IOrientedRectangle,yfiles.geometry.IMutableSize{ + /** + * Gets or sets the x coordinate for the anchor of the rectangle. + * Implementations may adjust the coordinates internally, e.g. to automatically + * snap the coordinates to grid points. So depending on context the value that can + * be read might not necessarily be the exact same value that has just been written. + * @see Specified by {@link yfiles.geometry.IMutableOrientedRectangle#anchorX}. + */ + anchorX:number; + /** + * Gets or sets the y coordinate for the anchor of the rectangle. + * Implementations may adjust the coordinates internally, e.g. to automatically + * snap the coordinates to grid points. So depending on context the value that can + * be read might not necessarily be the exact same value that has just been written. + * @see Specified by {@link yfiles.geometry.IMutableOrientedRectangle#anchorY}. + */ + anchorY:number; + /** + * Sets the orientation of this oriented rectangle + * by modifying the up vector components. + * It is up to the caller to assure that the values describe a vector of + * length 1. + * @param {number} upx The x component of the normalized up vector. + * @param {number} upy The y component of the normalized up vector. + * @see {@link yfiles.geometry.IOrientedRectangle#upX} + * @see {@link yfiles.geometry.IOrientedRectangle#upY} + * @see Specified by {@link yfiles.geometry.IMutableOrientedRectangle#setUpVectorValues}. + */ + setUpVectorValues(upx:number,upy:number):void; + /** + * Sets up vector of the oriented rectangle to the given value. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#setUpVector}. + * @param {yfiles.geometry.PointD} up The coordinates of the new up vector. + */ + setUpVector(up:yfiles.geometry.PointD):void; + /** + * Sets the size of the rectangle to the provided value. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#setSizeD}. + * @param {yfiles.geometry.SizeD} size The size to set. + */ + setSizeD(size:yfiles.geometry.SizeD):void; + /** + * Sets the size of the rectangle to the provided value. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#setSize}. + * @param {yfiles.geometry.ISize} size The size to set. + */ + setSize(size:yfiles.geometry.ISize):void; + /** + * Sets the center of the oriented rectangle to the given value. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#setCenter}. + * @param {yfiles.geometry.PointD} center The coordinates of the new center. + */ + setCenter(center:yfiles.geometry.PointD):void; + /** + * Sets the anchor vector of the oriented rectangle to the given value. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#setAnchor}. + * @param {yfiles.geometry.PointD} newAnchorLocation The coordinates of the new anchor location. + */ + setAnchor(newAnchorLocation:yfiles.geometry.PointD):void; + } + var IMutableOrientedRectangle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for a mutable size in 2D coordinate space with double precision width and height. + * This interface provides read and write access to the size. + * It combines the read only interface {@link yfiles.geometry.ISize} and write only interface + * {@link yfiles.geometry.ISizeSetter} into one. + * @see {@link yfiles.geometry.ISize} + * @see {@link yfiles.geometry.ISizeSetter} + * @see {@link yfiles.geometry.Size} + */ + export interface IMutableSize extends Object,yfiles.geometry.ISize,yfiles.geometry.ISizeSetter{ + /** + * Gets or sets the width of this instance. + * Implementations may adjust the values internally, e.g. to automatically + * snap the values to grid sizes. So depending on context the value that can + * be read might not necessarily be the exact same value that has just been written. + * @see {@link yfiles.geometry.ISize#width} + * @see {@link yfiles.geometry.ISizeSetter#width} + * @see Specified by {@link yfiles.geometry.IMutableSize#width}. + */ + width:number; + /** + * Gets or sets the height of this instance. + * Implementations may adjust the values internally, e.g. to automatically + * snap the values to grid sizes. So depending on context the value that can + * be read might not necessarily be the exact same value that has just been written. + * @see {@link yfiles.geometry.ISize#height} + * @see {@link yfiles.geometry.ISizeSetter#height} + * @see Specified by {@link yfiles.geometry.IMutableSize#height}. + */ + height:number; + } + var IMutableSize:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for mutable rectangles aligned to the axes in 2D coordinate space with double precision coordinates. + * This interface provides read and write access to the features of the rectangle. + * This interface does not declare any additional methods. It combines the {@link yfiles.geometry.IMutablePoint} + * interface that describes the upper left corner of the rectangle with + * the {@link yfiles.geometry.IMutableSize} interface that describes the width and height of the rectangle, as + * well as the {@link yfiles.geometry.IReshapeable} interface that allows for setting the bounds of the rectangle + * in one call. + * @see {@link yfiles.geometry.ISizeSetter} + * @see {@link yfiles.geometry.IPointSetter} + * @see {@link yfiles.geometry.ISize} + * @see {@link yfiles.geometry.IPoint} + * @see {@link yfiles.geometry.Rectangle} + */ + export interface IMutableRectangle extends Object,yfiles.geometry.IMutableSize,yfiles.geometry.IMutablePoint,yfiles.geometry.IRectangle,yfiles.geometry.IReshapeable{ + /** + * Sets the center of the rectangle to the provided value. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#setCenter}. + * @param {yfiles.geometry.PointD} center The new center coordinates. + */ + setCenter(center:yfiles.geometry.PointD):void; + /** + * Sets the size of the rectangle to the values of a {@link yfiles.geometry.SizeD} struct. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#setSize}. + * @param {yfiles.geometry.SizeD} newSize The new size to set to the rectangle. + */ + setSize(newSize:yfiles.geometry.SizeD):void; + /** + * Create a dynamic {@link yfiles.geometry.IMutablePoint} implementation + * that always points to the center of the given rectangle. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#getMutableRectangleDynamicCenter}. + * @return {yfiles.geometry.IMutablePoint} A live view of the rectangle's center. + */ + getMutableRectangleDynamicCenter():yfiles.geometry.IMutablePoint; + /** + * Creates the union of two rectangles, placing the result in the this parameter. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#setToUnion}. + * @param {yfiles.geometry.IRectangle} rect1 The first rectangle to create the union of. + * @param {yfiles.geometry.IRectangle} rect2 The second rectangle to create the union of. + */ + setToUnion(rect1:yfiles.geometry.IRectangle,rect2:yfiles.geometry.IRectangle):void; + /** + * Adds a rectangle to another one. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#addRectangle}. + * @param {yfiles.geometry.IRectangle} rect2 The rectangle to be added. + * @return {void} The first rectangle. + */ + addRectangle(rect2:yfiles.geometry.IRectangle):void; + /** + * Adds a point to a rectangle, possibly enlarging the rectangle. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#addPoint}. + * @param {yfiles.geometry.IPoint} p The coordinate to include in the bounds. + * @return {void} the resulting rectangle, which is rect + */ + addPoint(p:yfiles.geometry.IPoint):void; + } + var IMutableRectangle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for a mutable point in 2D coordinate space with double precision coordinates. + * This interface provides read and write access to the coordinates. + * It combines the read only interface {@link yfiles.geometry.IPoint} and write only interface + * {@link yfiles.geometry.IPointSetter} into one. + * @see {@link yfiles.geometry.IPoint} + * @see {@link yfiles.geometry.IPointSetter} + * @see {@link yfiles.geometry.Point} + */ + export interface IMutablePoint extends Object,yfiles.geometry.IPoint,yfiles.geometry.IPointSetter{ + /** + * Gets or sets the x coordinate for this point. + * Implementations may adjust the coordinates internally, e.g. to automatically + * snap the coordinates to grid points. So depending on context the value that can + * be read might not necessarily be the exact same value that has just been written. + * @see {@link yfiles.geometry.IPoint#x} + * @see {@link yfiles.geometry.IPointSetter#x} + * @see Specified by {@link yfiles.geometry.IMutablePoint#x}. + */ + x:number; + /** + * Gets or sets the y coordinate for this point. + * Implementations may adjust the coordinates internally, e.g. to automatically + * snap the coordinates to grid points. So depending on context the value that can + * be read might not necessarily be the exact same value that has just been written. + * @see {@link yfiles.geometry.IPoint#y} + * @see {@link yfiles.geometry.IPointSetter#y} + * @see Specified by {@link yfiles.geometry.IMutablePoint#y}. + */ + y:number; + } + var IMutablePoint:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An implementation of an {@link yfiles.geometry.ISize} whose state cannot + * be changed. + */ + export interface ImmutableSize extends Object,yfiles.geometry.ISize{ + /** + * Returns the width of this instance. + * An instance of this type will always return the same value. + * @see Specified by {@link yfiles.geometry.ISize#width}. + */ + width:number; + /** + * Returns the height of this instance. + * An instance of this type will always return the same value. + * @see Specified by {@link yfiles.geometry.ISize#height}. + */ + height:number; + } + var ImmutableSize:{ + $class:yfiles.lang.Class; + /** + * An immutable instance that is treated as an unbound size. Both width and height + * are always {@link Number#MAX_VALUE}. + */ + UNBOUND:yfiles.geometry.ImmutableSize; + /** + * An immutable instance that is treated as an empty size. Both width and height + * are always 0.0d. + */ + EMPTY:yfiles.geometry.ImmutableSize; + /** + * An immutable instance that is the zero size. Both width and height + * are always 0.0d. + */ + ZERO:yfiles.geometry.ImmutableSize; + /** + * Creates an immutable instance using the given width and height. + * @param {number} width The width. + * @param {number} height The height + */ + create(width:number,height:number):yfiles.geometry.ImmutableSize; + /** + * Creates an instance using the given width and height. + * @param {number} width The width. + * @param {number} height The height + */ + new (width:number,height:number):yfiles.geometry.ImmutableSize; + }; + /** + * An implementation of an {@link yfiles.geometry.IPoint} whose state cannot + * be changed. + */ + export interface ImmutablePoint extends Object,yfiles.geometry.IPoint,yfiles.system.ICloneable{ + /** + * Returns the x coordinate of this instance. + * An instance of this type will always return the same value. + * @see Specified by {@link yfiles.geometry.IPoint#x}. + */ + x:number; + /** + * Returns the y coordinate of this instance. + * An instance of this type will always return the same value. + * @see Specified by {@link yfiles.geometry.IPoint#y}. + */ + y:number; + /** + * Returns itself as this instance is immutable. + * @return {Object} this + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var ImmutablePoint:{ + $class:yfiles.lang.Class; + /** + * An instance of an immutable point whose coordinates are (0,0) always. + */ + ORIGIN:yfiles.geometry.IPoint; + /** + * Creates an instance using the given coordinate pair. + * @param {number} x The x coordinate + * @param {number} y The y coordinate + */ + new (x:number,y:number):yfiles.geometry.ImmutablePoint; + /** + * Creates an immutable {@link yfiles.geometry.IPoint} instance + * using the given coordinate pair. + * @param {number} x The x coordinate. + * @param {number} y The y coordinate. + * @return {yfiles.geometry.IPoint} An immutable instance. + */ + createWithXAndY(x:number,y:number):yfiles.geometry.IPoint; + /** + * Creates an immutable {@link yfiles.geometry.IPoint} instance + * using coordinate of the provided point. + * @param {yfiles.geometry.IPoint} p The p to retrieve the initial state from. + */ + createFromIPoint(p:yfiles.geometry.IPoint):yfiles.geometry.IPoint; + /** + * Creates a read-only view instance of the given point. + * Note that the values returned by {@link yfiles.geometry.IPoint#x} and {@link yfiles.geometry.IPoint#y} + * will always reflect the values of the point provided, which means that + * the point returned may not be truly immutable and it's properties might change + * over time. However it is not possible to change the values of the point using + * the instance returned as it provides no write access to the reference. + * @param {yfiles.geometry.IPoint} p The point to create an immutable view from. + * @return {yfiles.geometry.IPoint} An instance that always reflects the state of the provided point instance. + */ + createView(p:yfiles.geometry.IPoint):yfiles.geometry.IPoint; + /** + * Creates a read-only view instance of the given {@link yfiles.geometry.ISize} as a point. + * The {@link yfiles.geometry.ISize#width} property is mapped to the {@link yfiles.geometry.IPoint#x} + * property and {@link yfiles.geometry.ISize#height} is mapped to {@link yfiles.geometry.IPoint#y}. + * Note that the values returned by {@link yfiles.geometry.IPoint#x} and {@link yfiles.geometry.IPoint#y} + * will always reflect the values of the size provided, which means that + * the point returned may not be truly immutable and it's properties might change + * over time. However it is not possible to change the values of the point using + * the instance returned as it provides no write access to the reference. + * @param {yfiles.geometry.ISize} size The size to create an immutable point view from. + * @return {yfiles.geometry.IPoint} An instance that always reflects the state of the provided size instance. + */ + createViewFromSize(size:yfiles.geometry.ISize):yfiles.geometry.IPoint; + /** + * Creates a read-only view instance of point in the coordinate + * system provided by anchor. + * Note that the values returned by {@link yfiles.geometry.IPoint#x} and {@link yfiles.geometry.IPoint#y} + * will always reflect the values that can be calculated from the two points provided, which means that + * the point returned may not be truly immutable and it's properties might change + * over time. However it is not possible to change the values of the point using + * the instance returned as it provides no write access to the reference. + * @param {yfiles.geometry.IPoint} anchor The point which will serve as the origin of the coordinate system in + * which the second point will be expressed. + * @return {yfiles.geometry.IPoint} An instance that always reflects the relative location of the second point with respect to the first. + * @param {yfiles.geometry.IPoint} point The point to provide a relative view for. + */ + createRelativeView(anchor:yfiles.geometry.IPoint,point:yfiles.geometry.IPoint):yfiles.geometry.IPoint; + }; + /** + * An implementation of an {@link yfiles.geometry.IRectangle} whose state cannot + * be changed. + */ + export interface ImmutableRectangle extends Object,yfiles.geometry.IRectangle,yfiles.system.ICloneable{ + /** + * Gets the x coordinate of the upper left corner of the rectangle. + * Value: + * This instance will always return the same value. + * @see Specified by {@link yfiles.geometry.IPoint#x}. + */ + x:number; + /** + * Gets the y coordinate of the upper left corner of the rectangle. + * Value: + * This instance will always return the same value. + * @see Specified by {@link yfiles.geometry.IPoint#y}. + */ + y:number; + /** + * Gets the width of the rectangle. + * Value: + * This instance will always return the same value. + * @see Specified by {@link yfiles.geometry.ISize#width}. + */ + width:number; + /** + * Gets the height of the rectangle. + * Value: + * This instance will always return the same value. + * @see Specified by {@link yfiles.geometry.ISize#height}. + */ + height:number; + /** + * Returns itself. + * @return {Object} this + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + toString():string; + } + var ImmutableRectangle:{ + $class:yfiles.lang.Class; + /** + * An immutable empty IRectangle with width and height of -1. + */ + EMPTY:yfiles.geometry.IRectangle; + /** + * An immutable empty IRectangle with x, y, width, and height of 0. + */ + ZERO_INSETS:yfiles.geometry.IRectangle; + /** + * An infinitely large IRectangle with with and height of double.PositiveInfinity + * positioned at (double.NegativeInfinity, double.NegativeInfinity) + */ + INFINITE:yfiles.geometry.IRectangle; + /** + * Creates a new immutable instance using the provided values to initialize + * the position and size. + * @param {number} x The x coordinate of the upper left corner of the rectangle. + * @param {number} y The y coordinate of the upper left corner of the rectangle. + * @param {number} width The width of the rectangle. + * @param {number} height The height of the rectangle. + */ + createWithValues(x:number,y:number,width:number,height:number):yfiles.geometry.IRectangle; + /** + * Creates a new immutable instance using the provided values to initialize + * the position and size. + * This will not be a dynamic instance. The instance will provide a copy of the state. + * @param {yfiles.geometry.IPoint} position The initial upper left corner of the rectangle. + * @param {yfiles.geometry.ISize} size The initial size of the rectangle. + * @see {@link yfiles.geometry.ImmutableRectangle#createDynamic} + */ + create(position:yfiles.geometry.IPoint,size:yfiles.geometry.ISize):yfiles.geometry.IRectangle; + /** + * Creates a new immutable instance using the provided values to initialize + * the position and size. + * @param {yfiles.geometry.IRectangle} rect The rectangle to get the initial values from. + */ + FromRectangle:{ + new (rect:yfiles.geometry.IRectangle):yfiles.geometry.ImmutableRectangle; + }; + /** + * Creates a new immutable instance using the provided values to initialize + * the position and size. + * @param {number} x The x coordinate of the upper left corner of the rectangle. + * @param {number} y The y coordinate of the upper left corner of the rectangle. + * @param {number} width The width of the rectangle. + * @param {number} height The height of the rectangle. + */ + FromXYWidthAndHeight:{ + new (x:number,y:number,width:number,height:number):yfiles.geometry.ImmutableRectangle; + }; + /** + * Creates an externally immutable {@link yfiles.geometry.IRectangle} implementation + * using the given values to dynamically delegate requests to. + * Note that the instance returned remains mutable if the point and size is mutated after the creation of + * the instance, however the instance cannot be mutated using the reference obtained from this method. + * @param {yfiles.geometry.IPoint} point The point implementation to use for the position of the rectangle. + * @param {yfiles.geometry.ISize} size The size implementation to use for the size of the rectangle. + * @return {yfiles.geometry.IRectangle} An instance that cannot be cast to anything mutable. + * @see {@link yfiles.geometry.ImmutableRectangle#create} + */ + createDynamic(point:yfiles.geometry.IPoint,size:yfiles.geometry.ISize):yfiles.geometry.IRectangle; + }; + /** + * An implementation of an {@link yfiles.geometry.IOrientedRectangle} whose state cannot + * be changed. + * @see {@link yfiles.geometry.OrientedRectangle} + */ + export interface ImmutableOrientedRectangle extends Object,yfiles.geometry.IOrientedRectangle,yfiles.system.ICloneable{ + /** + * Returns the x coordinate of the anchor of the oriented rectangle. + * Value: + * The anchor is the lower left corner of the oriented rectangle if the up vector + * is (0,-1). + * @see Specified by {@link yfiles.geometry.IOrientedRectangle#anchorX}. + */ + anchorX:number; + /** + * Returns the y coordinate of the anchor of the oriented rectangle. + * Value: + * The anchor is the lower left corner of the oriented rectangle if the up vector + * is (0,-1). + * @see Specified by {@link yfiles.geometry.IOrientedRectangle#anchorY}. + */ + anchorY:number; + /** + * Returns the x value of the up vector. + * Value: + * The up vector points from the lower left corner to the upper left corner and + * is always normalized, i.e. it's length is always 1. + * @see Specified by {@link yfiles.geometry.IOrientedRectangle#upX}. + */ + upX:number; + /** + * Returns the y value of the up vector. + * Value: + * The up vector points from the lower left corner to the upper left corner and + * is always normalized, i.e. it's length is always 1. + * @see Specified by {@link yfiles.geometry.IOrientedRectangle#upY}. + */ + upY:number; + /** + * Gets the current width of this oriented rectangle. + * Depending on context the values returned may change over time. + * @see Specified by {@link yfiles.geometry.ISize#width}. + */ + width:number; + /** + * Gets the current width of this instance. + * @see Specified by {@link yfiles.geometry.ISize#height}. + */ + height:number; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var ImmutableOrientedRectangle:{ + $class:yfiles.lang.Class; + /** + * An immutable empty IOrientedRectangle with width and height of -1. + */ + EMPTY:yfiles.geometry.IOrientedRectangle; + /** + * Creates an externally immutable {@link yfiles.geometry.IOrientedRectangle} implementation + * using the given values to dynamically delegate requests to. + * Note that the instance returned remains mutable if the point and size is mutated after the creation of + * the instance, however the instance cannot be mutated using the reference obtained from this method. + * @param {yfiles.geometry.IPoint} anchor The point implementation to use for the anchor of the oriented rectangle. + * @param {yfiles.geometry.ISize} size The size implementation to use for the size of the rectangle. + * @return {yfiles.geometry.IOrientedRectangle} An instance that cannot be cast to anything mutable. + * @see {@link yfiles.geometry.ImmutableOrientedRectangle#createWithUpVector} + */ + createDynamic(anchor:yfiles.geometry.IPoint,size:yfiles.geometry.ISize):yfiles.geometry.IOrientedRectangle; + /** + * Creates an externally immutable {@link yfiles.geometry.IOrientedRectangle} implementation + * using the given values to dynamically delegate requests to. + * Note that the instance returned remains mutable if the point and size is mutated after the creation of + * the instance, however the instance cannot be mutated using the reference obtained from this method. + * @param {yfiles.geometry.IPoint} anchor The point implementation to use for the anchor of the oriented rectangle. + * @param {yfiles.geometry.ISize} size The size implementation to use for the size of the rectangle. + * @param {number} upX The x component of the up vector. + * @param {number} upY The y component of the up vector. + * @return {yfiles.geometry.IOrientedRectangle} An instance that cannot be cast to anything mutable. + * @see {@link yfiles.geometry.ImmutableOrientedRectangle#createWithUpVector} + */ + createDynamicWithUpVector(anchor:yfiles.geometry.IPoint,size:yfiles.geometry.ISize,upX:number,upY:number):yfiles.geometry.IOrientedRectangle; + /** + * Creates an immutable {@link yfiles.geometry.IOrientedRectangle} implementation + * using the given values to initialize the state. + * @param {yfiles.geometry.IPoint} anchor The point implementation to use for the anchor of the oriented rectangle. + * @param {yfiles.geometry.ISize} size The size implementation to use for the size of the rectangle. + * @return {yfiles.geometry.IOrientedRectangle} An immutable instance. + * @see {@link yfiles.geometry.ImmutableOrientedRectangle#createDynamic} + */ + create(anchor:yfiles.geometry.IPoint,size:yfiles.geometry.ISize):yfiles.geometry.IOrientedRectangle; + /** + * Creates an immutable {@link yfiles.geometry.IOrientedRectangle} implementation + * using the given values to initialize the state. + * @param {yfiles.geometry.IPoint} anchor The point implementation to use for the anchor of the oriented rectangle. + * @param {yfiles.geometry.ISize} size The size implementation to use for the size of the rectangle. + * @param {number} upX The x component of the up vector. + * @param {number} upY The y component of the up vector. + * @return {yfiles.geometry.IOrientedRectangle} An immutable instance. + * @see {@link yfiles.geometry.ImmutableOrientedRectangle#createDynamicWithUpVector} + */ + createWithUpVector(anchor:yfiles.geometry.IPoint,size:yfiles.geometry.ISize,upX:number,upY:number):yfiles.geometry.IOrientedRectangle; + /** + * Creates an externally immutable {@link yfiles.geometry.IOrientedRectangle} implementation + * using the given values to dynamically delegate requests to. + * Note that the instance returned remains mutable if the point and size is mutated after the creation of + * the instance, however the instance cannot be mutated using the reference obtained from this method. + * @param {yfiles.geometry.IPoint} anchor The point implementation to use for the anchor of the oriented rectangle. + * @param {yfiles.geometry.ISize} size The size implementation to use for the size of the rectangle. + * @param {number} upX The x component of the up vector. + * @param {number} upY The y component of the up vector. + */ + FromLocationSizeAndAngle:{ + new (anchor:yfiles.geometry.IPoint,size:yfiles.geometry.ISize,upX:number,upY:number):yfiles.geometry.ImmutableOrientedRectangle; + }; + /** + * Creates an externally immutable {@link yfiles.geometry.IOrientedRectangle} implementation + * using the given values to dynamically delegate requests to. + * Note that the instance returned remains mutable if the point and size is mutated after the creation of + * the instance, however the instance cannot be mutated using the reference obtained from this method. + * @param {number} anchorX The x coordinate to use for the anchor of the oriented rectangle. + * @param {number} anchorY The y coordinate to use for the anchor of the oriented rectangle. + * @param {number} width The width to use for the size of the rectangle. + * @param {number} height The height to use for the size of the rectangle. + * @param {number} upX The x component of the up vector. + * @param {number} upY The y component of the up vector. + */ + new (anchorX:number,anchorY:number,width:number,height:number,upX:number,upY:number):yfiles.geometry.ImmutableOrientedRectangle; + }; + /** + * Interface for write access to a point in 2D coordinate space with double precision coordinates. + * This interface provides write access to the coordinates only. Methods that will + * only need to write a point's coordinates should use this interface. + * {@link yfiles.geometry.IMutablePoint} combines the read access interface {@link yfiles.geometry.IPoint} with this + * interface. + * @see {@link yfiles.geometry.IPoint} + * @see {@link yfiles.geometry.IMutablePoint} + * @see {@link yfiles.geometry.Point} + */ + export interface IPointSetter extends Object{ + /** + * Sets the x coordinate for the point. + * @see {@link yfiles.geometry.IPoint#x} + * @see Specified by {@link yfiles.geometry.IPointSetter#x}. + */ + x:number; + /** + * Sets the y coordinate for the point. + * @see {@link yfiles.geometry.IPoint#y} + * @see Specified by {@link yfiles.geometry.IPointSetter#y}. + */ + y:number; + /** + * Sets the coordinates of the point to the given values. + * This is a bridge method that delegates to {@link yfiles.support.PointExtensions#setPointDLocation}. + * @param {yfiles.geometry.PointD} newLocation The new location. + */ + setPointDLocation(newLocation:yfiles.geometry.PointD):void; + /** + * Sets the coordinates of the point to the given values. + * This is a bridge method that delegates to {@link yfiles.support.PointExtensions#setPointLocation}. + * @param {yfiles.geometry.IPoint} newLocation The new location. + */ + setPointLocation(newLocation:yfiles.geometry.IPoint):void; + } + var IPointSetter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for rectangles aligned to the axes in 2D coordinate space with double precision coordinates. + * This interface provides read access to the features of the rectangle only, however this does not + * mean that an instance that implements IRectangle will always return the same values + * for its properties. Often times the instance provides a dynamic read access + * to the current state of a rectangle. It depends on the context whether it is allowed to or + * even necessary to copy the state of the properties or whether the reference + * to the instance should always be used to query the values. + * This interface does not declare any additional methods. It combines the {@link yfiles.geometry.IPoint} + * interface that describes the upper left corner of the rectangle with + * the {@link yfiles.geometry.ISize} interface that describes the width and height of the rectangle. + * @see {@link yfiles.geometry.IMutableRectangle} + * @see {@link yfiles.geometry.IMutablePoint} + * @see {@link yfiles.geometry.ISize} + * @see {@link yfiles.geometry.IPoint} + * @see {@link yfiles.geometry.Rectangle} + */ + export interface IRectangle extends Object,yfiles.geometry.ISize,yfiles.geometry.IPoint{ + /** + * Gets the current size of the rectangle as a {@link yfiles.geometry.SizeD} struct. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#getRectangleSize}. + * @return {yfiles.geometry.SizeD} The current size of the rectangle. + */ + getRectangleSize():yfiles.geometry.SizeD; + /** + * Create a dynamic {@link yfiles.geometry.IPoint} implementation + * that always points to the center of the given rectangle. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#getRectangleDynamicCenter}. + * @return {yfiles.geometry.IPoint} A live view of the rectangle's center. + */ + getRectangleDynamicCenter():yfiles.geometry.IPoint; + /** + * Create a dynamic {@link yfiles.geometry.IPoint} implementation + * that always points to the specified position at the given rectangle. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#getDynamicPoint}. + * @param {yfiles.input.HandlePositions} position The position to use. + * @return {yfiles.geometry.IPoint} A live view of the rectangle's center. + */ + getDynamicPoint(position:yfiles.input.HandlePositions):yfiles.geometry.IPoint; + /** + * Determines whether the given rectangle contains the provided point. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#containsPoint}. + * @param {yfiles.geometry.IPoint} point The point to test. + * @return {boolean} true iff the point lies inside the rectangle. + */ + containsPoint(point:yfiles.geometry.IPoint):boolean; + /** + * Determines whether the given rectangle contains the provided point. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#containsPointD}. + * @param {yfiles.geometry.PointD} point The point to test. + * @return {boolean} true iff the point lies inside the rectangle. + */ + containsPointD(point:yfiles.geometry.PointD):boolean; + /** + * Copies the current values of the rectangle to {@link yfiles.geometry.RectD} struct. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#toRectD}. + * @return {yfiles.geometry.RectD} A {@link yfiles.geometry.RectD} that holds the values of the rectangle + * at the time of the invocation. + * @see {@link yfiles.support.RectangleExtensions#reshapeToRectD} + * @see {@link yfiles.geometry.RectD#toMutableRectangle} + * @see {@link yfiles.geometry.RectD#toImmutableRectangle} + */ + toRectD():yfiles.geometry.RectD; + /** + * Gets the coordinates of the top left corner of the rectangle as a {@link yfiles.geometry.PointD}. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#getTopLeft}. + * @return {yfiles.geometry.PointD} The current coordinates of the corner. + */ + getTopLeft():yfiles.geometry.PointD; + /** + * Gets the coordinates of the bottom left corner of the rectangle as a {@link yfiles.geometry.PointD}. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#getBottomLeft}. + * @return {yfiles.geometry.PointD} The current coordinates of the corner. + */ + getBottomLeft():yfiles.geometry.PointD; + /** + * Gets the coordinates of the center of the rectangle as a {@link yfiles.geometry.PointD}. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#getRectangleCenter}. + * @return {yfiles.geometry.PointD} The current coordinates of the center. + */ + getRectangleCenter():yfiles.geometry.PointD; + /** + * Gets the maximum X coordinate of the rectangle. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#getMaxX}. + * @return {number} The maximum x coordinate of the rectangle's corners. + */ + getMaxX():number; + /** + * Determines whether the specified rectangle is empty. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#isEmpty}. + * @return {boolean} + * true if the specified rectangle is empty; otherwise, false. + */ + isEmpty():boolean; + /** + * Gets the maximum Y coordinate of the rectangle. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#getMaxY}. + * @return {number} The maximum y coordinate of the rectangle's corners. + */ + getMaxY():number; + /** + * Gets the coordinates of the top right corner of the rectangle as a {@link yfiles.geometry.PointD}. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#getTopRight}. + * @return {yfiles.geometry.PointD} The current coordinates of the corner. + */ + getTopRight():yfiles.geometry.PointD; + /** + * Gets the coordinates of the bottom right corner of the rectangle as a {@link yfiles.geometry.PointD}. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#getBottomRight}. + * @return {yfiles.geometry.PointD} The current coordinates of the corner. + */ + getBottomRight():yfiles.geometry.PointD; + } + var IRectangle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for oriented rectangles in 2D coordinate space with double precision coordinates. + * The rectangle described by this interface has its lower left corner at the anchor as described + * by the {@link yfiles.geometry.IOrientedRectangle#anchorX} and {@link yfiles.geometry.IOrientedRectangle#anchorY} properties and is oriented in space + * so that its upper left corner lies in direction of the ({@link yfiles.geometry.IOrientedRectangle#upX},{@link yfiles.geometry.IOrientedRectangle#upY}) vector. + * The size of the instance does not describe the bounds of the instance but the lengths of + * the sides of the rectangle. + * An {@link yfiles.geometry.IRectangle} would thus be an oriented rectangle, whose anchor is the lower left + * corner of the rectangle, whose size is the same as that of the rectangle and + * whose up vector is (0,-1). + * This interface provides read access to the features of the oriented rectangle only, however this does not + * mean that an instance that implements IOrientedRectangle will always return the same values + * for its properties. Often times the instance provides a dynamic read access + * to the current state of a rectangle. It depends on the context whether it is allowed to or + * even necessary to copy the state of the properties or whether the reference + * to the instance should always be used to query the values. + * @see {@link yfiles.geometry.ISize} + * @see {@link yfiles.geometry.IRectangle} + * @see {@link yfiles.geometry.OrientedRectangle} + * @see {@link yfiles.geometry.Rectangle} + */ + export interface IOrientedRectangle extends Object,yfiles.geometry.ISize{ + /** + * Returns the x coordinate of the anchor of the oriented rectangle. + * The anchor is the lower left corner of the oriented rectangle if the up vector + * is (0,-1). + * @see Specified by {@link yfiles.geometry.IOrientedRectangle#anchorX}. + */ + anchorX:number; + /** + * Returns the y coordinate of the anchor of the oriented rectangle. + * The anchor is the lower left corner of the oriented rectangle if the up vector + * is (0,-1). + * @see Specified by {@link yfiles.geometry.IOrientedRectangle#anchorY}. + */ + anchorY:number; + /** + * Returns the x value of the up vector. + * The up vector points from the lower left corner to the upper left corner and + * is always normalized, i.e. it's length is always 1. + * @see Specified by {@link yfiles.geometry.IOrientedRectangle#upX}. + */ + upX:number; + /** + * Returns the y value of the up vector. + * The up vector points from the lower left corner to the upper left corner and + * is always normalized, i.e. it's length is always 1. + * @see Specified by {@link yfiles.geometry.IOrientedRectangle#upY}. + */ + upY:number; + /** + * Gets the up vector of the oriented rectangle as a {@link yfiles.geometry.PointD} struct. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#getUp}. + * @return {yfiles.geometry.PointD} The value of the up vector of the rectangle at the time of the invocation. + */ + getUp():yfiles.geometry.PointD; + /** + * Determines whether the given oriented rectangle contains the provided point, using + * an epsilon value. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#containsPointWithEps}. + * @param {yfiles.geometry.PointD} point The coordinates of the point 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} true iff the point lies inside the rectangle. + */ + containsPointWithEps(point:yfiles.geometry.PointD,eps:number):boolean; + /** + * Gets the transform that can be used to transform points that are in the local + * coordinate system of the oriented rectangle if the top-left corner is the origin. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#getTransform}. + * @return {yfiles.geometry.Matrix2D} A matrix that can be used to transform from oriented rectangle coordinates to world coordinates. + */ + getTransform():yfiles.geometry.Matrix2D; + /** + * Gets the anchor location of the oriented rectangle as a {@link yfiles.geometry.PointD} struct. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#getAnchorLocation}. + * @return {yfiles.geometry.PointD} The anchor location of the rectangle at the time of the invocation. + */ + getAnchorLocation():yfiles.geometry.PointD; + /** + * Gets the location of the top left corner of the oriented rectangle as a {@link yfiles.geometry.PointD}. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#getTopLeftLocation}. + * @return {yfiles.geometry.PointD} The top left location of the rectangle at the time of the invocation. + */ + getTopLeftLocation():yfiles.geometry.PointD; + /** + * Gets the size of the oriented rectangle. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#getSize}. + * @return {yfiles.geometry.SizeD} The width and height of the oriented rectangle. + */ + getSize():yfiles.geometry.SizeD; + /** + * Create a dynamic {@link yfiles.geometry.IPoint} implementation + * that always points to the center of the given oriented rectangle. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#getOrientedRectangleDynamicCenter}. + * @return {yfiles.geometry.IPoint} A live view of the rectangle's center. + */ + getOrientedRectangleDynamicCenter():yfiles.geometry.IPoint; + /** + * Gets the current center of the oriented rectangle as a {@link yfiles.geometry.PointD} struct. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#getCenter}. + * @return {yfiles.geometry.PointD} The current coordinates of the center. + */ + getCenter():yfiles.geometry.PointD; + /** + * Determines whether the oriented rectangle contains the provided point, using + * an epsilon value. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#hits}. + * @param {yfiles.geometry.PointD} location The coordinates of the point 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} true iff the point lies inside the rectangle. + */ + hits(location:yfiles.geometry.PointD,eps:number):boolean; + /** + * Determines the bounds of an oriented rectangle. + * This is a bridge method that delegates to {@link yfiles.support.OrientedRectangleExtensions#getBounds}. + * @return {yfiles.geometry.RectD} The bounds. + */ + getBounds():yfiles.geometry.RectD; + /** + * Creates a {@link yfiles.algorithms.YOrientedRectangle} from a given {@link yfiles.geometry.IOrientedRectangle}. + * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toOrientedRectangle}. + * @return {yfiles.algorithms.YOrientedRectangle} The {@link yfiles.algorithms.YOrientedRectangle}. + */ + toOrientedRectangle():yfiles.algorithms.YOrientedRectangle; + } + var IOrientedRectangle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for a point in 2D coordinate space with double precision coordinates. + * This interface provides read access to the coordinates only, however this does not + * mean that an instance that implements IPoint will always return the same values + * for the coordinate properties. Often times the instance provides a dynamic read access + * to the current state of a point. It depends on the context whether it is allowed to or + * even necessary to copy the state of the properties or whether the reference + * to the instance should always be used to query the values. + * @see {@link yfiles.geometry.IPointSetter} + * @see {@link yfiles.geometry.IMutablePoint} + * @see {@link yfiles.geometry.Point} + * @see {@link yfiles.geometry.ImmutablePoint} + */ + export interface IPoint extends Object{ + /** + * Gets the current x coordinate of this point. + * Depending on context the values returned may change over time. + * @see Specified by {@link yfiles.geometry.IPoint#x}. + */ + x:number; + /** + * Gets the current y coordinate of this point. + * Depending on context the values returned may change over time. + * @see Specified by {@link yfiles.geometry.IPoint#y}. + */ + y:number; + /** + * Copies the current values of the coordinates of the point to a {@link yfiles.geometry.PointD} struct. + * This is a bridge method that delegates to {@link yfiles.support.PointExtensions#toPoint}. + * @return {yfiles.geometry.PointD} The current values of the coordinates of the point. + * @see {@link yfiles.geometry.PointD#toImmutablePoint} + * @see {@link yfiles.geometry.PointD#toMutablePoint} + * @see {@link yfiles.support.PointExtensions#setPointDLocation} + */ + toPoint():yfiles.geometry.PointD; + /** + * Calculates the Euclidean distance between two points. + * This is a bridge method that delegates to {@link yfiles.support.PointExtensions#distanceTo}. + * @param {yfiles.geometry.IPoint} q The second point. + * @return {number} The distance between the two points. + */ + distanceTo(q:yfiles.geometry.IPoint):number; + } + var IPoint:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for geometric primitives that can be reshaped, e.g. {@link yfiles.geometry.IMutableRectangle} + */ + export interface IReshapeable extends Object{ + /** + * Set the bounds of the instance to the new values. + * @param {number} x The x coordinate of the upper left corner of the bounds. + * @param {number} y The y coordinate of the upper left corner of the bounds. + * @param {number} w The width of the bounds. + * @param {number} h The height of the bounds + * @see Specified by {@link yfiles.geometry.IReshapeable#reshapeToValues}. + */ + reshapeToValues(x:number,y:number,w:number,h:number):void; + /** + * Reshapes the specified reshapeable to the given new bounds. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#reshapeToRectangle}. + * @param {yfiles.geometry.IRectangle} newBounds The bounds to set to the reshapeable. + */ + reshapeToRectangle(newBounds:yfiles.geometry.IRectangle):void; + /** + * Reshapes the specified reshapeable to the given new bounds. + * This is a bridge method that delegates to {@link yfiles.support.RectangleExtensions#reshapeToRectD}. + * @param {yfiles.geometry.RectD} newBounds The bounds to set to the reshapeable. + */ + reshapeToRectD(newBounds:yfiles.geometry.RectD):void; + } + var IReshapeable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A {@link yfiles.geometry.IPoint} that models a point in 2-d Cartesian coordinate space with double coordinates. + * This class implements the {@link yfiles.geometry.IPoint} interface so that it can be used in methods + * that require that interface. + */ + export interface PointD extends yfiles.lang.Struct,yfiles.geometry.IPoint{ + /** + * Gets or sets the X coordinate of the point. + * Value: The X coordinate. + * @see Specified by {@link yfiles.geometry.IPoint#x}. + */ + x:number; + /** + * Gets or sets the Y coordinate of the point. + * Value: The Y coordinate. + * @see Specified by {@link yfiles.geometry.IPoint#y}. + */ + y:number; + clone():yfiles.geometry.PointD; + /** + * Yields the length of the vector that has {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y} as its components. + * Value: The length of the vector which is the square root of X*X + Y*Y. + */ + vectorLength:number; + /** + * Yields the squared length of the vector that has {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y} as its components. + * Value: The squared length of the vector which is X*X + Y*Y. + */ + squaredVectorLength:number; + /** + * Gets the normalized version of this vector. + * Value: The normalized version of this vector or (1,0) if this vector has 0.0d length. + */ + normalized:yfiles.geometry.PointD; + /** + * Calculates the scalar product of this and the given vector. + * @param {yfiles.geometry.PointD} other The other vector. + * @return {number} The scalar product (X*other.X + Y*other.Y) + */ + scalarProduct(other:yfiles.geometry.PointD):number; + /** + * Creates an {@link yfiles.geometry.IMutablePoint} that has the same coordinates as this struct. + * @return {yfiles.geometry.IMutablePoint} A {@link yfiles.geometry.IMutablePoint} with the same coordinates. + */ + toMutablePoint():yfiles.geometry.IMutablePoint; + /** + * Creates an {@link yfiles.geometry.ImmutablePoint} that has the same coordinates as this instance. + * @return {yfiles.geometry.IPoint} A {@link yfiles.geometry.ImmutablePoint} with the same coordinates. + */ + toImmutablePoint():yfiles.geometry.IPoint; + /** + * Determines if the point lies close to this point given an epsilon. + * @param {yfiles.geometry.PointD} other The coordinates of the other point. + * @param {number} hitTestRadius The hit test epsilon. + * @return {boolean} Whether the distance between the two points is smaller than hitTestRadius + */ + hits(other:yfiles.geometry.PointD,hitTestRadius:number):boolean; + /** + * Calculates the Euclidean distance to the given point. + * @param {yfiles.geometry.PointD} other The other point. + * @return {number} The Euclidean distance between the points. + */ + distanceToPointD(other:yfiles.geometry.PointD):number; + /** + * Calculates the projection of this point onto a segment. + * If the perpendicular projection onto the line is outside of the segment + * the nearest segment endpoint is returned. + * @param {yfiles.geometry.PointD} segStart The start of the segment. + * @param {yfiles.geometry.PointD} segEnd The end of the segment. + * @return {yfiles.geometry.PointD} The point on the segment that is closest to this point. + */ + getProjectionOnSegment(segStart:yfiles.geometry.PointD,segEnd:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Calculates the projection of this point onto a ray. + * If the perpendicular projection onto the line is outside of the ray ("behind" the rayStart) + * the rayStart is returned instead. + * @param {yfiles.geometry.PointD} rayStart The start of the segment. + * @param {yfiles.geometry.PointD} direction The direction of the ray. + * @return {yfiles.geometry.PointD} The point on the ray that is closest to this point. + */ + getProjectionOnRay(rayStart:yfiles.geometry.PointD,direction:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Indicates whether this instance is a vertically oriented vector. + * Value: + * true iff Math.Abs(Y) > Math.Abs(X). + */ + isVerticalVector:boolean; + /** + * Indicates whether this instance is a horizontally oriented vector. + * Value: + * true iff Math.Abs(X) > Math.Abs(Y). + */ + isHorizontalVector:boolean; + /** + * Calculates the projection of this point onto a line. + * @param {yfiles.geometry.PointD} lineAnchor An anchor for the infinite line. + * @param {yfiles.geometry.PointD} direction A direction vector for the infinite line. + * @return {yfiles.geometry.PointD} The point on the line that is closest to this point. + */ + getProjectionOnLine(lineAnchor:yfiles.geometry.PointD,direction:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Determines the distance between this point and a line segment. + * @param {yfiles.geometry.PointD} l1 The coordinates of the first point of the line. + * @param {yfiles.geometry.PointD} l2 The coordinates of the second point of the line. + * @return {number} The distance between this point and the closest point on the line segment. + */ + distanceToSegment(l1:yfiles.geometry.PointD,l2:yfiles.geometry.PointD):number; + /** + * Returns a human readable string of this point. + */ + toString():string; + /** + * Determines whether this point hits the line segment with respect to a given hitTestRadius. + * @param {yfiles.geometry.PointD} startPoint The starting point of the line segment to test. + * @param {yfiles.geometry.PointD} endPoint The ending point of the line segment to test. + * @param {number} hitTestRadius The hit test radius. + * @return {boolean} Whether this point hits the given line segment within the radius. + */ + hitsLineSegment(startPoint:yfiles.geometry.PointD,endPoint:yfiles.geometry.PointD,hitTestRadius:number):boolean; + /** + * Determines whether a polygonal line is hit by this point given an epsilon. + * @param {yfiles.collections.IEnumerable.} points The list of points that is treated as a polygon + * @param {number} hitTestRadius 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 the point hits the polygon. + */ + hitsPolyline(points:yfiles.collections.IEnumerable,hitTestRadius:number):boolean; + /** + * Determines whether this instance has the same coordinates as the provided point. + * @param {yfiles.geometry.PointD} other The other point. + * @return {boolean} Whether {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y} are the same. + */ + equalsPointD(other:yfiles.geometry.PointD):boolean; + /** + * Indicates whether this instance and a specified object are equal. + * @param {Object} obj Another object to compare to. + * @return {boolean} + * true if obj and this instance are the same type and represent the same value; otherwise, false. + * @see {@link yfiles.geometry.PointD#equalsPointD} + */ + equals(obj:Object):boolean; + /** + * Returns the hash code for this instance that is calculated using the {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y} values. + * @return {number} + * A 32-bit signed integer that is the hash code for this instance. + */ + hashCode():number; + /** + * Create a constrained copy of this instance that lies within the given non-empty rectangle. + * If the given rectangle is {@link yfiles.geometry.RectD#EMPTY}, this implementation will silently return. + * @param {yfiles.geometry.RectD} rectangle The rectangle to constrain this instance by. + * @return {yfiles.geometry.PointD} A constrained copy of this instance. + */ + getConstrained(rectangle:yfiles.geometry.RectD):yfiles.geometry.PointD; + /** + * Determines whether the two given points have the same coordinates with respect to a certain given epsilon. + * @param {yfiles.geometry.PointD} otherPoint The other point to check for equality against this point. + * @param {number} epsilon The epsilon value. + * @return {boolean} Whether both coordinates are equal with respect for the given epsilon. + */ + equalsEps(otherPoint:yfiles.geometry.PointD,epsilon:number):boolean; + /** + * Creates a new instance that contains the same values as this one, however {@link yfiles.system.Math#roundDecimal rounded}. + * @return {yfiles.geometry.PointD} A new point with rounded {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y} values. + */ + getRounded():yfiles.geometry.PointD; + /** + * Creates a {@link yfiles.algorithms.YPoint} from a given {@link yfiles.geometry.PointD}. + * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toYPoint}. + * @return {yfiles.algorithms.YPoint} The {@link yfiles.algorithms.YPoint}. + */ + toYPoint():yfiles.algorithms.YPoint; + /** + * Creates a {@link yfiles.algorithms.Point2D.Double} from a given {@link yfiles.geometry.PointD}. + * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toPoint2D}. + * @return {yfiles.algorithms.Point2D.Double} The {@link yfiles.algorithms.Point2D.Double}. + */ + toPoint2D():yfiles.algorithms.Point2D.Double; + /** + * Creates a {@link yfiles.algorithms.YVector} from a given {@link yfiles.geometry.PointD}. + * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toYVector}. + * @return {yfiles.algorithms.YVector} The {@link yfiles.algorithms.YVector}. + */ + toYVector():yfiles.algorithms.YVector; + } + var PointD:{ + $class:yfiles.lang.Class; + /** + * Yields an instance that has {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y} set to 0.0d. + */ + ORIGIN:yfiles.geometry.PointD; + /** + * Initializes a new instance using the given values + * for the {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y} properties. + * @param {number} x The x coordinate. + * @param {number} y The y coordinate. + */ + new (x:number,y:number):yfiles.geometry.PointD; + /** + * Initializes a new instance using the coordinates of the provided {@link yfiles.geometry.IPoint}. + * @param {yfiles.geometry.IPoint} p The point to get the initial coordinates from. + */ + FromPoint:{ + new (p:yfiles.geometry.IPoint):yfiles.geometry.PointD; + }; + /** + * Initializes a new instance using the coordinates of the provided point. + * @param {yfiles.geometry.PointD} p The point to get the initial coordinates from. + */ + FromPointD:{ + new (p:yfiles.geometry.PointD):yfiles.geometry.PointD; + }; + /** + * Creates a new instance using the coordinates of the given point. + * @param {yfiles.geometry.IPoint} p The point to get the coordinates from. + * @return {yfiles.geometry.PointD} An instance with the same coordinates. + */ + fromPoint(p:yfiles.geometry.IPoint):yfiles.geometry.PointD; + /** + * Implements the vector addition operator. + * This operator is applied componentwise to {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y}. + * @param {yfiles.geometry.PointD} p1 The first point. + * @param {yfiles.geometry.PointD} p2 The second point. + * @return {yfiles.geometry.PointD} The result of the operation. + */ + add(p1:yfiles.geometry.PointD,p2:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Implements the vector addition operator. + * This operator is applied componentwise to {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y}. + * @param {yfiles.geometry.PointD} p1 The first point. + * @param {yfiles.geometry.IPoint} p2 The second point. + * @return {yfiles.geometry.PointD} The result of the operation. + */ + addIPoint(p1:yfiles.geometry.PointD,p2:yfiles.geometry.IPoint):yfiles.geometry.PointD; + /** + * Implements the vector subtraction operator. + * This operator is applied componentwise to {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y}. + * @param {yfiles.geometry.PointD} p1 The first point. + * @param {yfiles.geometry.PointD} p2 The second point. + * @return {yfiles.geometry.PointD} The result of the operation. + */ + subtract(p1:yfiles.geometry.PointD,p2:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Implements the vector subtraction operator. + * This operator is applied componentwise to {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y}. + * @param {yfiles.geometry.PointD} p1 The first point. + * @param {yfiles.geometry.IPoint} p2 The second point. + * @return {yfiles.geometry.PointD} The result of the operation. + */ + subtractIPoint(p1:yfiles.geometry.PointD,p2:yfiles.geometry.IPoint):yfiles.geometry.PointD; + /** + * Implements the negation operator. + * This negation is applied componentwise to {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y}. + * @param {yfiles.geometry.PointD} p1 The point to negate the components of. + * @return {yfiles.geometry.PointD} The result of the operation. + */ + negate(p1:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Yields the point itself. + * @param {yfiles.geometry.PointD} p1 The point to return. + * @return {yfiles.geometry.PointD} The point itself. + */ + plus(p1:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Implements the operator == which is applied componentwise to {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y}. + * @param {yfiles.geometry.PointD} p1 The first point. + * @param {yfiles.geometry.PointD} p2 The second point. + * @return {boolean} Whether {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y} are equal for both points. + */ + equals(p1:yfiles.geometry.PointD,p2:yfiles.geometry.PointD):boolean; + /** + * Implements the operator != which is the inverse of the == operator. + * @return {boolean} The inverse of the == operator. + */ + notEquals(p1:yfiles.geometry.PointD,p2:yfiles.geometry.PointD):boolean; + /** + * Implements scalar multiplication. + * This factor is applied componentwise to {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y}. + * @param {yfiles.geometry.PointD} p The point to scale the components of. + * @param {number} factor The factor to scale the components by. + * @return {yfiles.geometry.PointD} The result of the operation. + */ + scale(p:yfiles.geometry.PointD,factor:number):yfiles.geometry.PointD; + /** + * Implements the operator * by calling {@link yfiles.geometry.Matrix2D#transform}. + * @param {yfiles.geometry.Matrix2D} m The matrix to use for the transformation. + * @param {yfiles.geometry.PointD} vector The vector to transform. + * @return {yfiles.geometry.PointD} The result of the transformation. + */ + matrixTimes(m:yfiles.geometry.Matrix2D,vector:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Implements scalar division. + * The factor is applied componentwise to {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y}. + * @param {yfiles.geometry.PointD} p The point to divide the components of. + * @param {number} factor The factor to divide the components by. + * @return {yfiles.geometry.PointD} The result of the operation. + */ + div(p:yfiles.geometry.PointD,factor:number):yfiles.geometry.PointD; + /** + * Implements scalar multiplication. + * This factor is applied componentwise to {@link yfiles.geometry.PointD#x} and {@link yfiles.geometry.PointD#y}. + * @param {yfiles.geometry.PointD} p The point to scale the components of. + * @param {number} factor The factor to scale the components by. + * @return {yfiles.geometry.PointD} The result of the operation. + */ + times(factor:number,p:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Calculates the scalar product of the two given points. + * @param {yfiles.geometry.PointD} p1 The first point. + * @param {yfiles.geometry.PointD} p2 The second point. + * @return {number} The scalar product of the two points. + */ + scalarProduct(p1:yfiles.geometry.PointD,p2:yfiles.geometry.PointD):number; + /** + * Performs an implicit conversion from {@link yfiles.geometry.PointD} to {@link yfiles.geometry.Point}. + * @param {yfiles.geometry.PointD} p The point to convert. + * @return {yfiles.geometry.Point} + */ + convertToPoint(p:yfiles.geometry.PointD):yfiles.geometry.Point; + convertFrom(p:yfiles.geometry.Point):yfiles.geometry.PointD; + }; + /** + * Interface for an object that has a size in 2D coordinate space + * with double precision floating point size values. + * This interface provides read access to the size only, however this does not + * mean that an instance that implements ISize will always return the same values + * for the size properties. Often times the instance provides a dynamic read access + * to the current state of an instance. It depends on the context whether it is allowed to or + * even necessary to copy the state of the properties or whether the reference + * to the instance should always be used to query the values. + * @see {@link yfiles.geometry.ISizeSetter} + * @see {@link yfiles.geometry.IMutableSize} + * @see {@link yfiles.geometry.Size} + * @see {@link yfiles.geometry.ImmutableSize} + */ + export interface ISize extends Object{ + /** + * Gets the current width of this instance. + * Depending on context the values returned may change over time. + * @see Specified by {@link yfiles.geometry.ISize#width}. + */ + width:number; + /** + * Gets the current height of this instance. + * Depending on context the values returned may change over time. + * @see Specified by {@link yfiles.geometry.ISize#height}. + */ + height:number; + /** + * Converts the {@link yfiles.geometry.ISize} to a {@link yfiles.geometry.SizeD} struct. + * This is a bridge method that delegates to {@link yfiles.support.SizeExtensions#toSize}. + * @return {yfiles.geometry.SizeD} A {@link yfiles.geometry.SizeD} struct that has been initialized with the current values of size. + */ + toSize():yfiles.geometry.SizeD; + } + var ISize:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum MatrixOrder{ + /** + * Constant that defines a prepend operation for matrix multiplications. + */ + PREPEND, + /** + * Constant that defines an append operation for matrix multiplications. + */ + APPEND + } + /** + * Interface for write access to an instance that has a size in 2D coordinate space + * with double precision floating point width and height. + * This interface provides write access to the size only. Methods that will + * only need to write an object's size should use this interface. + * {@link yfiles.geometry.IMutableSize} combines the read access interface {@link yfiles.geometry.ISize} with this + * interface. + * @see {@link yfiles.geometry.ISize} + * @see {@link yfiles.geometry.IMutableSize} + * @see {@link yfiles.geometry.Size} + */ + export interface ISizeSetter extends Object{ + /** + * Sets the width of this instance. + * @see {@link yfiles.geometry.ISize#width} + * @see Specified by {@link yfiles.geometry.ISizeSetter#width}. + */ + width:number; + /** + * Sets the height of this instance. + * @see {@link yfiles.geometry.ISize#height} + * @see Specified by {@link yfiles.geometry.ISizeSetter#height}. + */ + height:number; + } + var ISizeSetter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An {@link yfiles.geometry.ISize} implementation that holds two {@link Number}s for {@link yfiles.geometry.SizeD#width} + * and {@link yfiles.geometry.SizeD#height} to describe a size in two dimensional space. + * This type implements the {@link yfiles.geometry.ISize} interface so that it can be used in methods + * that require that interface. + */ + export interface SizeD extends yfiles.lang.Struct,yfiles.geometry.ISize{ + /** + * Gets or sets the width. + * Negative values for the width indicate an {@link yfiles.geometry.SizeD#isEmpty empty} size. + * Value: The width. + * @see Specified by {@link yfiles.geometry.ISize#width}. + */ + width:number; + /** + * Gets the height. + * Negative values for the height indicate an {@link yfiles.geometry.SizeD#isEmpty empty} size. + * Value: The height. + * @see Specified by {@link yfiles.geometry.ISize#height}. + */ + height:number; + /** + * Gets the area of this instance which is the product of {@link yfiles.geometry.SizeD#width} and {@link yfiles.geometry.SizeD#height}. + * Value: The area. + */ + area:number; + /** + * Gets a value indicating whether this instance is deemed empty. + * Value: true if this at least one of {@link yfiles.geometry.SizeD#width} or {@link yfiles.geometry.SizeD#height} is negative; otherwise, false. + */ + isEmpty:boolean; + /** + * Gets a value indicating whether this instance is finite, i.e. neither {@link yfiles.geometry.SizeD#width} + * nor {@link yfiles.geometry.SizeD#height} are {@link yfiles.system.PrimitiveExtensions#isInfinity infinite}. + * Value: true if this instance is finite; otherwise, false. + */ + isFinite:boolean; + /** + * Converts this instance to an {@link yfiles.geometry.ImmutableSize} instance. + * @return {yfiles.geometry.ImmutableSize} The {@link yfiles.geometry.ImmutableSize} instance, whose attributes have been initialized with + * the values of this instance. + */ + toImmutableSize():yfiles.geometry.ImmutableSize; + /** + * Converts this instance to an {@link yfiles.geometry.Size} instance. + * @return {yfiles.geometry.Size} The {@link yfiles.geometry.Size} instance, whose attributes have been initialized with + * the values of this instance. + */ + toMutableSize():yfiles.geometry.Size; + /** + * Returns a human readable string that contains information about the + * values of this instance. + * @return {string} + * A {@link String} containing the width and height. + */ + toString():string; + /** + * Returns whether this instance has the same width and height as the given instance. + * @param {yfiles.geometry.SizeD} obj The other instance. + * @return {boolean} Whether they have the same width and height values. + */ + equalsSizeD(obj:yfiles.geometry.SizeD):boolean; + equals(obj:Object):boolean; + hashCode():number; + clone():yfiles.geometry.SizeD; + /** + * Creates a {@link yfiles.algorithms.YDimension} from a given {@link yfiles.geometry.SizeD}. + * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toYDimension}. + * @return {yfiles.algorithms.YDimension} The {@link yfiles.algorithms.YDimension}. + */ + toYDimension():yfiles.algorithms.YDimension; + } + var SizeD:{ + $class:yfiles.lang.Class; + /** + * Yields the "empty" size that has {@link yfiles.geometry.SizeD#width} and {@link yfiles.geometry.SizeD#height} + * set to -1.0d. + */ + EMPTY:yfiles.geometry.SizeD; + /** + * Yields the "zero" size that has {@link yfiles.geometry.SizeD#width} and {@link yfiles.geometry.SizeD#height} + * set to 0.0d. + * This size is not treated as {@link yfiles.geometry.SizeD#isEmpty}. + */ + ZERO:yfiles.geometry.SizeD; + /** + * Yields the "infinite" size that has {@link yfiles.geometry.SizeD#width} and {@link yfiles.geometry.SizeD#height} + * set to {@link Number#POSITIVE_INFINITY}. + */ + INFINITE:yfiles.geometry.SizeD; + /** + * Creates a new size using the provided width and height. + * @param {number} width The new width. + * @param {number} height The new height. + */ + new (width:number,height:number):yfiles.geometry.SizeD; + /** + * Initializes a new instance of {@link yfiles.geometry.SizeD} using the values of the provided {@link yfiles.geometry.ISize}. + * @param {yfiles.geometry.ISize} s The size to get the initial values from. + */ + FromISize:{ + new (s:yfiles.geometry.ISize):yfiles.geometry.SizeD; + }; + /** + * Initializes a new instance of {@link yfiles.geometry.SizeD} using the values of the provided {@link yfiles.geometry.SizeD}. + * @param {yfiles.geometry.SizeD} s The size to get the initial values from. + */ + FromSizeD:{ + new (s:yfiles.geometry.SizeD):yfiles.geometry.SizeD; + }; + /** + * Creates a new instance from the provided {@link yfiles.geometry.ISize}, initializing + * the {@link yfiles.geometry.SizeD#width} and {@link yfiles.geometry.SizeD#height} properties from + * the corresponding properties. + * @param {yfiles.geometry.ISize} size The size to retrieve the initial values from. + * @return {yfiles.geometry.SizeD} A new size that is initialized with the values from the given size. + */ + fromSize(size:yfiles.geometry.ISize):yfiles.geometry.SizeD; + convertFromSize(theSize:yfiles.geometry.Size):yfiles.geometry.SizeD; + /** + * Performs an explicit conversion from {@link yfiles.geometry.SizeD} to {@link yfiles.geometry.Size}. + * @param {yfiles.geometry.SizeD} theSize The size. + * @return {yfiles.geometry.Size} The result of the conversion. + */ + convertToSize(theSize:yfiles.geometry.SizeD):yfiles.geometry.Size; + /** + * Performs an explicit conversion from {@link yfiles.geometry.SizeD} to {@link yfiles.geometry.ImmutableSize}. + * @param {yfiles.geometry.SizeD} theSize The size. + * @return {yfiles.geometry.ImmutableSize} The result of the conversion. + */ + convertToImmutableSize(theSize:yfiles.geometry.SizeD):yfiles.geometry.ImmutableSize; + convertFromImmutableSize(theSize:yfiles.geometry.ImmutableSize):yfiles.geometry.SizeD; + /** + * Implements the operator ==. + * @param {yfiles.geometry.SizeD} p1 The first size. + * @param {yfiles.geometry.SizeD} p2 The second size. + * @return {boolean} The result of the operator, which is true iff the {@link yfiles.geometry.SizeD#width} + * and {@link yfiles.geometry.SizeD#height} of the two instances are identical. + */ + equals(p1:yfiles.geometry.SizeD,p2:yfiles.geometry.SizeD):boolean; + /** + * Implements the operator * that multiplies the {@link yfiles.geometry.SizeD#width} and {@link yfiles.geometry.SizeD#height} + * by the given factor. + * @param {yfiles.geometry.SizeD} size The size to multiply the width and height of. + * @param {number} factor The factor to multiply the width and height by. + * @return {yfiles.geometry.SizeD} The result of the operator, which is a new size that has the width and height multiplied by the factor. + */ + scale(size:yfiles.geometry.SizeD,factor:number):yfiles.geometry.SizeD; + /** + * Implements the operator * that multiplies the {@link yfiles.geometry.SizeD#width} and {@link yfiles.geometry.SizeD#height} + * by the given factor. + * @param {yfiles.geometry.SizeD} size The size to multiply the width and height of. + * @param {number} factor The factor to multiply the width and height by. + * @return {yfiles.geometry.SizeD} The result of the operator, which is a new size that has the width and height multiplied by the factor. + */ + scaleBy(factor:number,size:yfiles.geometry.SizeD):yfiles.geometry.SizeD; + /** + * Implements the operator / that divides the {@link yfiles.geometry.SizeD#width} and {@link yfiles.geometry.SizeD#height} + * by the given factor. + * @param {yfiles.geometry.SizeD} size The size to divide the width and height of. + * @param {number} factor The factor to divide the width and height by. + * @return {yfiles.geometry.SizeD} The result of the operator, which is a new size that has the width and height divided by the factor. + */ + div(size:yfiles.geometry.SizeD,factor:number):yfiles.geometry.SizeD; + /** + * Implements the operator !=. + * @param {yfiles.geometry.SizeD} p1 The first size. + * @param {yfiles.geometry.SizeD} p2 The second size. + * @return {boolean} The result of the operator, which is the inverse of the == operator. + */ + notEquals(p1:yfiles.geometry.SizeD,p2:yfiles.geometry.SizeD):boolean; + /** + * Returns a size whose {@link yfiles.geometry.SizeD#width} and {@link yfiles.geometry.SizeD#height} + * is the {@link Math#max} of the respecting properties + * of the two parameters. + * @param {yfiles.geometry.SizeD} size1 The first size. + * @param {yfiles.geometry.SizeD} size2 The second size. + * @return {yfiles.geometry.SizeD} A size whose {@link yfiles.geometry.SizeD#width} and {@link yfiles.geometry.SizeD#height} + * is the {@link Math#max} of the respecting properties + * of the two parameters. + */ + max(size1:yfiles.geometry.SizeD,size2:yfiles.geometry.SizeD):yfiles.geometry.SizeD; + /** + * Returns a size whose {@link yfiles.geometry.SizeD#width} and {@link yfiles.geometry.SizeD#height} + * is the {@link Math#min} of the respecting properties + * of the two parameters. + * @param {yfiles.geometry.SizeD} size1 The first size. + * @param {yfiles.geometry.SizeD} size2 The second size. + * @return {yfiles.geometry.SizeD} A size whose {@link yfiles.geometry.SizeD#width} and {@link yfiles.geometry.SizeD#height} + * is the {@link Math#min} of the respecting properties + * of the two parameters. + */ + min(size1:yfiles.geometry.SizeD,size2:yfiles.geometry.SizeD):yfiles.geometry.SizeD; + }; + /** + * Utility class that performs all kind of geometric operations. + * Also it serves as a factory for various implementations of geometric + * primitives. + */ + export interface GeomSupport extends Object{ + } + var GeomSupport:{ + $class:yfiles.lang.Class; + /** + * Finds the intersection between a line segment and an infinite ray. + * The ray is described using an anchor point and a ray direction. The direction + * vector does not need to be normalized. + * In order to obtain the intersection point do the following: + *

+      * var factor = findRayIntersection(l1, l2, ly2, anchor, ray);
+      * if (factor < Number.POSITIVE_INFINITY){
+      *   var intersection = anchor + ray * factor;
+      * }
+      * 
+ * @param {yfiles.geometry.PointD} l1 The coordinates of the first end point of the line segment. + * @param {yfiles.geometry.PointD} l2 The coordinates of the second end point of the line segment. + * @param {yfiles.geometry.PointD} anchor The coordinates of the starting point of the ray. + * @param {yfiles.geometry.PointD} rayDirection The direction vector of the ray. + * @return {number} The distance factor or {@link Number#POSITIVE_INFINITY} if the ray does not intersect the line. + */ + findRayIntersection(l1:yfiles.geometry.PointD,l2:yfiles.geometry.PointD,anchor:yfiles.geometry.PointD,rayDirection:yfiles.geometry.PointD):number; + /** + * Checks whether an ellipse contains the given point. + * @param {yfiles.geometry.RectD} ellipseBounds The coordinates of the bounds of the ellipse's enclosing rectangle. + * @param {yfiles.geometry.PointD} testPoint The coordinates of the point to test. + * @param {number} epsilon 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 the point lies within the ellipse + */ + ellipseContains(ellipseBounds:yfiles.geometry.RectD,testPoint:yfiles.geometry.PointD,epsilon:number):boolean; + /** + * Returns the ellipse/line intersection point for the given point pair. + * This will always return the intersection point that lies in the direction from inner to outer. + * @param {yfiles.geometry.RectD} ellipseBounds The coordinates of the bounds of the ellipse's enclosing rectangle. + * @param {yfiles.geometry.PointD} inner The coordinates of a point lying inside the ellipse. + * @param {yfiles.geometry.PointD} outer The coordinates of a point lying outside the ellipse. + * @return {yfiles.geometry.PointD} The intersection point iff the inner point lies inside the ellipse and an intersection point has been found, otherwise null. + */ + findEllipseLineIntersection(ellipseBounds:yfiles.geometry.RectD,inner:yfiles.geometry.PointD,outer:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Creates a new path based on the given one where corners are smoothed with a quadratic B�zier arc starting at + * smoothingLength away from the corner. + * @param {yfiles.drawing.GeneralPath} path The path to smooth. + * @param {number} smoothingLength Distance from the corner where the arc begins. + * @return {yfiles.drawing.GeneralPath} A new path, with its corners smoothed. + */ + createSmoothedPath(path:yfiles.drawing.GeneralPath,smoothingLength:number):yfiles.drawing.GeneralPath; + }; + /** + * Provides implementations of the {@link yfiles.geometry.IMutablePoint} + * interface that are dynamically updated depending on the state of + * another geometric primitive they are being anchored to. + * Implementations implement the {@link yfiles.geometry.IMutablePoint} interface + * by modifying their internally held offset to the point they are being + * anchored to. Changing the properties of instances of this type will + * not change the state of the point they are being anchored at. + * @see {@link yfiles.geometry.Point} + */ + export interface AnchoredPoint extends Object,yfiles.geometry.IMutablePoint{ + /** + * Gets the point this instance is anchored to. + */ + anchor:yfiles.geometry.IPoint; + /** + * Gets the mutable offset this instance uses to calculate its + * position. + */ + offset:yfiles.geometry.IMutablePoint; + /** + * Gets or sets the x coordinate of this instance modifying the offset + * according to the current state of the anchor. + * The coordinates of this instance are defined as follows: + *

+      * x = anchor.x + offset.x;
+      * y = anchor.y + offset.y;
+      * 
+ * @see Specified by {@link yfiles.geometry.IMutablePoint#x}. + */ + x:number; + /** + * Gets or sets the y coordinate of this instance modifying the offset + * according to the current state of the anchor. + * The coordinates of this instance are defined as follows: + *

+      * x = anchor.x + offset.x;
+      * y = anchor.y + offset.y;
+      * 
+ * @see Specified by {@link yfiles.geometry.IMutablePoint#y}. + */ + y:number; + toString():string; + } + var AnchoredPoint:{ + $class:yfiles.lang.Class; + /** + * Creates an implementation using the given anchor and offset. + * @param {yfiles.geometry.IPoint} anchor The anchor. + * @param {yfiles.geometry.IMutablePoint} offset The offset. + * @see {@link yfiles.geometry.AnchoredPoint#x} + * @see {@link yfiles.geometry.AnchoredPoint#y} + */ + createWithOffset(anchor:yfiles.geometry.IPoint,offset:yfiles.geometry.IMutablePoint):yfiles.geometry.AnchoredPoint; + /** + * Creates an implementation using the given anchor and an initial offset of (0,0). + * @param {yfiles.geometry.IPoint} anchor The anchor. + * @see {@link yfiles.geometry.AnchoredPoint#x} + * @see {@link yfiles.geometry.AnchoredPoint#y} + */ + create(anchor:yfiles.geometry.IPoint):yfiles.geometry.AnchoredPoint; + /** + * Creates an implementation using the given anchor and initializing + * the initial offsets so that the resulting point will have its + * initial position at the coordinates provided. + * @param {yfiles.geometry.IPoint} anchor The anchor. + * @param {number} x The initial x coordinate of this point. + * @param {number} y The initial y coordinate of this point. + * @see {@link yfiles.geometry.AnchoredPoint#createOffset} + * @see {@link yfiles.geometry.AnchoredPoint#x} + * @see {@link yfiles.geometry.AnchoredPoint#y} + */ + createWithOffsetAt(anchor:yfiles.geometry.IPoint,x:number,y:number):yfiles.geometry.AnchoredPoint; + /** + * Creates an implementation using the given anchor and offsets. + * @param {yfiles.geometry.IPoint} anchor The anchor. + * @param {number} xOffset The initial x offset. + * @param {number} yOffset The initial y offset. + * @see {@link yfiles.geometry.AnchoredPoint#x} + * @see {@link yfiles.geometry.AnchoredPoint#y} + */ + createOffset(anchor:yfiles.geometry.IPoint,xOffset:number,yOffset:number):yfiles.geometry.AnchoredPoint; + /** + * Creates an implementation that is anchored to the center of the given rectangle at all times. + * Changing the state of the rectangle provided will thus indirectly change the state of + * the instance returned. + * @param {yfiles.geometry.IRectangle} rect The rectangle that will be dynamically queried to obtain the center from. + * @param {yfiles.geometry.PointD} relativeLocation The initial offset to the center of the rectangle. + * @see {@link yfiles.geometry.AnchoredPoint#x} + * @see {@link yfiles.geometry.AnchoredPoint#y} + * @see {@link yfiles.support.RectangleExtensions#getRectangleDynamicCenter} + */ + createCenterOffset(rect:yfiles.geometry.IRectangle,relativeLocation:yfiles.geometry.PointD):yfiles.geometry.AnchoredPoint; + /** + * Creates an implementation that is anchored to the center of the given rectangle at all times. + * The actual offset to the center of the rectangle depends on the {@link yfiles.geometry.ISize} of the + * rectangle. + * An xRatio of 0.5 will result in a point being anchored to the right border of + * the rectangle, whereas a ratio of 0.0 will anchor the point to the center of + * the rectangle. + * Modifying the state of instance returned will modify the ratios, not the rectangle. + * @param {yfiles.geometry.IRectangle} rect The rectangle that will be dynamically queried to obtain the center and size from. + * @param {number} xRatio The initial x offset to {@link yfiles.geometry.ISize#width} ratio. + * @param {number} yRatio The initial y offset to {@link yfiles.geometry.ISize#height} ratio. + * @see {@link yfiles.geometry.ISize} + */ + createCenterOffsetScaled(rect:yfiles.geometry.IRectangle,xRatio:number,yRatio:number):yfiles.geometry.IMutablePoint; + /** + * Creates an implementation that is anchored to the center of the given rectangle at all times and that will + * never lie outside of the bounds of the rectangle. + * The actual offset to the center of the rectangle depends on the {@link yfiles.geometry.ISize} of the + * rectangle. + * An xRatio of 0.5 will result in a point being anchored to center of + * the rectangle, whereas a ratio of 0.0 will anchor the point to the left border of + * the rectangle. + * Modifying the state of this instance returned will modify the ratios, not the rectangle. + * The ratios are always cropped to [0,1]. + * @param {yfiles.geometry.IRectangle} rect The rectangle that will be dynamically queried to obtain the center and size from. + * @param {number} xRatio The initial x offset to {@link yfiles.geometry.ISize#width} ratio. + * @param {number} yRatio The initial y offset to {@link yfiles.geometry.ISize#height} ratio. + * @see {@link yfiles.geometry.ISize} + * @see {@link yfiles.geometry.AnchoredPoint#createCenterOffsetScaled} + */ + createCroppedCenterOffsetScaled(rect:yfiles.geometry.IRectangle,xRatio:number,yRatio:number):yfiles.geometry.IMutablePoint; + /** + * Creates an implementation using the given anchor and offset. + * @param {yfiles.geometry.IPoint} anchor The anchor. + * @param {yfiles.geometry.IMutablePoint} offset The offset. + * @see {@link yfiles.geometry.AnchoredPoint#x} + * @see {@link yfiles.geometry.AnchoredPoint#y} + */ + new (anchor:yfiles.geometry.IPoint,offset:yfiles.geometry.IMutablePoint):yfiles.geometry.AnchoredPoint; + }; + /** + * A simple default implementation of a mutable size in 2D coordinate space + * with double precision values. + * This implementation stores the values of the width and height in double precision floating point + * members. + * @see {@link yfiles.geometry.ISize} + * @see {@link yfiles.geometry.ISizeSetter} + */ + export interface Size extends Object,yfiles.geometry.IMutableSize{ + /** + * Gets or sets the width. + * @see Specified by {@link yfiles.geometry.IMutableSize#width}. + */ + width:number; + /** + * Gets or sets the height. + * @see Specified by {@link yfiles.geometry.IMutableSize#height}. + */ + height:number; + /** + * Returns a memberwise clone of this instance. + * @return {Object} A clone that holds the same state initially as the current state of + * this instance. + */ + clone():Object; + } + var Size:{ + $class:yfiles.lang.Class; + /** + * Creates the initially empty size, i.e. both {@link yfiles.geometry.Size#width} and {@link yfiles.geometry.Size#height} + * are 0.0d. + */ + Empty:{ + new ():yfiles.geometry.Size; + }; + /** + * Creates an instance using the given width and height. + * @param {number} width The width. + * @param {number} height The height + */ + new (width:number,height:number):yfiles.geometry.Size; + /** + * Creates an instance using the values provided by the size instance. + * This will not create a dynamic instance. The values will be copied from size + * immediately and no reference is held to that instance thereafter. + * @param {yfiles.geometry.ISize} size A size to retrieve the initial values from. + * @return {yfiles.geometry.Size} A instance of the Size class. + */ + createFromSize(size:yfiles.geometry.ISize):yfiles.geometry.Size; + /** + * Creates an instance using the given width and height. + * @param {number} width The width. + * @param {number} height The height + */ + create(width:number,height:number):yfiles.geometry.Size; + /** + * Creates a size instance that is dynamically bound to the + * given point instances. + * The size of the instance returned is dynamically calculated + * using the following code: + *

+      * width = p2.x - p1.x;
+      * height = p2.y - p1.y;
+      * 
+ * Changing this instances properties will change the state of the + * second point, depending on the current state of the first point. + * @param {yfiles.geometry.IPoint} p1 The upper left corner of the size. + * @param {yfiles.geometry.IMutablePoint} p2 The lower right corner of the size. + * @return {yfiles.geometry.IMutableSize} A mutable size instance that is dynamically composed using the + * provided instances. + */ + createFromPoints(p1:yfiles.geometry.IPoint,p2:yfiles.geometry.IMutablePoint):yfiles.geometry.IMutableSize; + }; + /** + * A simple default implementation of a mutable rectangle in 2D coordinate space + * with double precision values stored in an instance of {@link yfiles.geometry.IMutablePoint} + * and {@link yfiles.geometry.IMutableSize}. + * This implementation delegates the storage to implementations of + * {@link yfiles.geometry.IMutablePoint} for the upper left corner of the rectangle + * and {@link yfiles.geometry.IMutableSize} for the size of the rectangle. + * members. As a convenience it implements the {@link yfiles.geometry.IMovable}, the + * {@link yfiles.geometry.IOrientedRectangle}, and the {@link yfiles.system.ICloneable} + * interfaces. + * @see {@link yfiles.geometry.IRectangle} + * @see {@link yfiles.geometry.IMutableRectangle} + */ + export interface Rectangle extends Object,yfiles.geometry.IMutableRectangle,yfiles.geometry.IMovable,yfiles.geometry.IOrientedRectangle,yfiles.system.ICloneable{ + /** + * Returns whether this instance has negative width or height. + */ + empty:boolean; + /** + * Creates a copy of the current state of this instance using + * {@link yfiles.geometry.Point} and {@link yfiles.geometry.Rectangle#size} to store the position + * and size. + * @return {Object} A new instance of {@link yfiles.geometry.Rectangle} + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + toString():string; + /** + * Returns the instance that stores the position of this rectangle. + * This will return a live view of the position of this rectangle. + * However setting a position instance will only copy the values + * of the point provided to the current position. + */ + position:yfiles.geometry.IPoint; + /** + * Returns the instance that stores the size of this rectangle. + * This will return a live view of the size of this rectangle. + * However setting a size instance will only copy the values + * of the size provided to the current size. + */ + size:yfiles.geometry.ISize; + /** + * Applies a new position and size in that order to the instances + * that hold the state of this rectangle. + * @param {number} x The new x coordinate of the upper left corner of the rectangle. + * @param {number} y The new y coordinate of the upper left corner of the rectangle. + * @param {number} w The new width of the rectangle. + * @param {number} h The new height of the rectangle. + * @see {@link yfiles.geometry.Rectangle#position} + * @see {@link yfiles.geometry.Rectangle#size} + * @see Specified by {@link yfiles.geometry.IReshapeable#reshapeToValues}. + */ + reshapeToValues(x:number,y:number,w:number,h:number):void; + /** + * Calls {@link yfiles.geometry.Rectangle#reshapeToValues} + * using the respective values obtained from the provided instance. + * @param {yfiles.geometry.IRectangle} rect The rectangle to read the state from. + */ + reshapeRectangleToIRectangle(rect:yfiles.geometry.IRectangle):void; + /** + * Calls {@link yfiles.geometry.Rectangle#reshapeToValues} + * using the respective values obtained from the provided instance. + * @param {yfiles.geometry.Rectangle} rect The rectangle to read the state from. + */ + reshapeRectangleToRectangle(rect:yfiles.geometry.Rectangle):void; + /** + * Gets or sets the width of this instance from the + * {@link yfiles.geometry.Rectangle#size} instance. + * Note that depending on the implementation used for holding + * the size the results may vary. However the default implementation + * will do just that: read and write the values without modifying them in any way. + * @see Specified by {@link yfiles.geometry.IMutableSize#width}. + */ + width:number; + /** + * Gets or sets the height of this instance from the + * {@link yfiles.geometry.Rectangle#size} instance. + * Note that that depending on the implementation used for holding + * the size the results may vary. However the default implementation + * will do just that: read and write the values without modifying them in any way. + * @see Specified by {@link yfiles.geometry.IMutableSize#height}. + */ + height:number; + /** + * Gets or sets the x coordinate of the upper left corner of this instance from the + * {@link yfiles.geometry.Rectangle#position} instance. + * Note that depending on the implementation used for holding + * the position the results may vary. However the default implementation + * will do just that: read and write the values without modifying them in any way. + * @see Specified by {@link yfiles.geometry.IMutablePoint#x}. + */ + x:number; + /** + * Gets or sets the y coordinate of the upper left corner of this instance from the + * {@link yfiles.geometry.Rectangle#position} instance. + * Note that depending on the implementation used for holding + * the position the results may vary. However the default implementation + * will do just that: read and write the values without modifying them in any way. + * @see Specified by {@link yfiles.geometry.IMutablePoint#y}. + */ + y:number; + /** + * Gets or sets the x coordinate of the lower right corner of this instance using the + * {@link yfiles.geometry.Rectangle#position} and {@link yfiles.geometry.Rectangle#size} instances. + * Setting this value will set the size according to this formula: + *

+      * X2 = position.x + size.width;
+      * 
+ * Note that depending on the implementation used for holding + * the size the results may vary. However the default implementation + * will do just that: read and write the values without modifying them in any way. + */ + x2:number; + /** + * Gets or sets the y coordinate of the lower right corner of this instance using the + * {@link yfiles.geometry.Rectangle#position} and {@link yfiles.geometry.Rectangle#size} instances. + * Setting this value will set the size according to this formula: + *

+      * Y2 = position.y + size.height;
+      * 
+ * Note that depending on the implementation used for holding + * the size the results may vary. However the default implementation + * will do just that: read and write the values without modifying them in any way. + */ + y2:number; + /** + * Implements the {@link yfiles.geometry.IOrientedRectangle} and will return the + * x coordinate of the {@link yfiles.geometry.Rectangle#position}. + * This implementation behaves like an {@link yfiles.geometry.IOrientedRectangle} + * that is anchored at the lower left corner of this rectangle and + * whose up vector is (0, -1). + * @see Specified by {@link yfiles.geometry.IOrientedRectangle#anchorX}. + */ + anchorX:number; + /** + * Implements the {@link yfiles.geometry.IOrientedRectangle} and will return the + * y coordinate of the {@link yfiles.geometry.Rectangle#position} plus the {@link yfiles.geometry.ISize#height}. + * This implementation behaves like an {@link yfiles.geometry.IOrientedRectangle} + * that is anchored at the lower left corner of this rectangle and + * whose up vector is (0, -1). + * @see Specified by {@link yfiles.geometry.IOrientedRectangle#anchorY}. + */ + anchorY:number; + /** + * Always returns 0. + * This implementation behaves like an {@link yfiles.geometry.IOrientedRectangle} + * that is anchored at the lower left corner of this rectangle and + * whose up vector is (0, -1). + * @see Specified by {@link yfiles.geometry.IOrientedRectangle#upX}. + */ + upX:number; + /** + * Always returns -1. + * This implementation behaves like an {@link yfiles.geometry.IOrientedRectangle} + * that is anchored at the lower left corner of this rectangle and + * whose up vector is (0, -1). + * @see Specified by {@link yfiles.geometry.IOrientedRectangle#upY}. + */ + upY:number; + /** + * Moves this rectangle by applying the offset to the {@link yfiles.geometry.Rectangle#position}. + * @param {yfiles.geometry.PointD} delta The offset to move the rectangle's position by. + * @return {boolean} true iff dx != 0 || dy != 0 + * @see Specified by {@link yfiles.geometry.IMovable#moveBy}. + */ + moveBy(delta:yfiles.geometry.PointD):boolean; + /** + * {@link yfiles.geometry.Rectangle#reshapeToValues Reshapes} this + * instance to the values provided by the given rectangle. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle to copy the state from + * @see {@link yfiles.geometry.Rectangle#reshapeRectangleToIRectangle} + */ + setToRectangle(rectangle:yfiles.geometry.IRectangle):void; + /** + * Add the given rectangle to this instance using the logic described + * in {@link yfiles.support.RectangleExtensions#addRectangle}. + * This will grow this instance if the provided bounds lie outside of this + * instance. + * @param {yfiles.geometry.IRectangle} bounds The bounds to include in this instance. + */ + addRectangleWithBounds(bounds:yfiles.geometry.IRectangle):void; + } + var Rectangle:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the provided values to initialize + * the position and size. + * @param {number} x The x coordinate of the upper left corner of the rectangle. + * @param {number} y The y coordinate of the upper left corner of the rectangle. + * @param {number} w The width of the rectangle. + * @param {number} h The height of the rectangle. + */ + create(x:number,y:number,w:number,h:number):yfiles.geometry.Rectangle; + /** + * Creates a new instance using the provided implementation for the + * storage of the position and size of the rectangle. + * The instances provided will be referenced by this instance. This instance + * will be used as a live view over the provided instances. Changes to them will + * indirectly change the state of this instance and changes applied through this + * instance will be written to the referenced implementations. + * @param {yfiles.geometry.IMutablePoint} position The provider for the dynamic position of this instance. + * @param {yfiles.geometry.IMutableSize} size The provider for the dynamic size of this instance. + */ + createFromMutablePointAndSize(position:yfiles.geometry.IMutablePoint,size:yfiles.geometry.IMutableSize):yfiles.geometry.Rectangle; + /** + * Creates a new instance using the provided implementation for the + * storage of the position and the combination of the two for the size of the rectangle. + * The instances provided will be referenced by this instance. This instance + * will be used as a live view over the provided instances. Changes to them will + * indirectly change the state of this instance and changes applied through this + * instance will be written to the referenced implementations. + * Thus changes to the position of this rectangle will indirectly change its size + * accordingly, since the lower right corner of the rectangle will stay fixed. + * @param {yfiles.geometry.IMutablePoint} p1 The provider for the dynamic position of the rectangle. + * @param {yfiles.geometry.IMutablePoint} p2 The provider for lower right corner of the rectangle. + * @see {@link yfiles.geometry.Size#createFromPoints} + */ + createFromMutablePoints(p1:yfiles.geometry.IMutablePoint,p2:yfiles.geometry.IMutablePoint):yfiles.geometry.Rectangle; + /** + * Creates an empty rectangle with width and height of -1 positioned at (0,0). + * @return {yfiles.geometry.Rectangle} A new rectangle (0,0,-1,-1) + */ + createEmpty():yfiles.geometry.Rectangle; + /** + * Creates an instance using the values provided by the rectangle instance. + * This will not create a dynamic instance. The values will be copied from rect + * immediately and no reference is held to that instance thereafter. + * @param {yfiles.geometry.IRectangle} rect A rectangle to retrieve the initial values from. + * @return {yfiles.geometry.Rectangle} A instance of the Rectangle class. + */ + createFromRectangle(rect:yfiles.geometry.IRectangle):yfiles.geometry.Rectangle; + /** + * Creates a new instance using the provided implementation for the + * storage of the position and size of the rectangle. + * The instances provided will be referenced by this instance. This instance + * will be used as a live view over the provided instances. Changes to them will + * indirectly change the state of this instance and changes applied through this + * instance will be written to the referenced implementations. + * @param {yfiles.geometry.IMutablePoint} position The provider for the dynamic position of this instance. + * @param {yfiles.geometry.IMutableSize} size The provider for the dynamic size of this instance. + */ + FromMutableLocationAndSize:{ + new (position:yfiles.geometry.IMutablePoint,size:yfiles.geometry.IMutableSize):yfiles.geometry.Rectangle; + }; + /** + * Creates a new instance using the provided values to initialize + * the position and size. + * An instance of {@link yfiles.geometry.Point} will be used to store the position + * and an instance of {@link yfiles.geometry.Rectangle#size} will be used to store the size. + * @param {number} x The x coordinate of the upper left corner of the rectangle. + * @param {number} y The y coordinate of the upper left corner of the rectangle. + * @param {number} w The width of the rectangle. + * @param {number} h The height of the rectangle. + */ + new (x:number,y:number,w:number,h:number):yfiles.geometry.Rectangle; + /** + * Creates a new instance using the provided values to initialize + * the position and size. + * An instance of {@link yfiles.geometry.Point} will be used to store the position + * and an instance of {@link yfiles.geometry.Rectangle#size} will be used to store the size. + * @param {yfiles.geometry.PointD} location The coordinates of the upper left corner of the rectangle. + * @param {yfiles.geometry.SizeD} size The size of the rectangle. + */ + FromLocationAndSize:{ + new (location:yfiles.geometry.PointD,size:yfiles.geometry.SizeD):yfiles.geometry.Rectangle; + }; + /** + * Creates a new empty instance located at the origin. + */ + Empty:{ + new ():yfiles.geometry.Rectangle; + }; + /** + * Creates a new instance initialized to the values of the provided argument. + */ + FromRectangle:{ + new (rect:yfiles.geometry.IRectangle):yfiles.geometry.Rectangle; + }; + /** + * Creates a new instance initialized to the values of the provided argument. + */ + FromRectD:{ + new (rect:yfiles.geometry.RectD):yfiles.geometry.Rectangle; + }; + /** + * Returns the x coordinate of the center of the given rectangle. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle. + * @return {number} The x coordinate of the center. + */ + getCenterX(rectangle:yfiles.geometry.IRectangle):number; + /** + * Returns the y coordinate of the center of the given rectangle. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle. + * @return {number} The y coordinate of the center. + */ + getCenterY(rectangle:yfiles.geometry.IRectangle):number; + }; + /** + * A class that models a rectangle in 2-d cartesian coordinate space with double coordinates. + * This class differs from other possible implementation in the way negative {@link yfiles.geometry.RectD#width} + * and {@link yfiles.geometry.RectD#height} properties are handled and interpreted. + * Width and/or height values may be negative in which case the rectangle is considered {@link yfiles.geometry.RectD#isEmptyRectD empty} + * and non-existent. Empty rectangles are not considered in {@link yfiles.geometry.RectD#add union-like} + * operations, whereas rectangles with {@link yfiles.geometry.RectD#width} and {@link yfiles.geometry.RectD#height} of 0.0d are. + * This class implements the {@link yfiles.geometry.IRectangle} interface so that it can be used in methods + * that require that interface. + */ + export interface RectD extends yfiles.lang.Struct,yfiles.geometry.IRectangle{ + /** + * Gets or sets the X coordinate of the upper left corner of the rectangle. + * Value: The X coordinate. + * @see Specified by {@link yfiles.geometry.IPoint#x}. + */ + x:number; + /** + * Gets or sets the Y coordinate of the upper left corner of the rectangle. + * Value: The Y coordinate. + * @see Specified by {@link yfiles.geometry.IPoint#y}. + */ + y:number; + /** + * Gets or sets the width of the rectangle. + * Value: The width. Negative values make the rectangle {@link yfiles.geometry.RectD#isEmptyRectD empty}. + * @see Specified by {@link yfiles.geometry.ISize#width}. + */ + width:number; + /** + * Gets or sets the height of the rectangle. + * Value: The height. Negative values make the rectangle {@link yfiles.geometry.RectD#isEmptyRectD empty}. + * @see Specified by {@link yfiles.geometry.ISize#height}. + */ + height:number; + /** + * Gets the center X coordinate of the rectangle. + * Value: The center x coordinate, or {@link yfiles.geometry.RectD#x} if the {@link yfiles.geometry.RectD#width} is non-positive. + */ + centerX:number; + /** + * Gets the center Y coordinate of the rectangle. + * Value: The center y coordinate, or {@link yfiles.geometry.RectD#y} if the {@link yfiles.geometry.RectD#height} is non-positive. + */ + centerY:number; + /** + * Gets or sets the center of the rectangle using {@link yfiles.geometry.RectD#centerX} and {@link yfiles.geometry.RectD#centerY}. + * Value: A copy of the center of the rectangle. + */ + center:yfiles.geometry.PointD; + /** + * Gets the coordinates of the top left corner of the rectangle. + * Value: The top left corner, which is always {@link yfiles.geometry.RectD#x} and {@link yfiles.geometry.RectD#y}. + */ + topLeft:yfiles.geometry.PointD; + /** + * Gets the coordinates of the top right corner of the rectangle. + * Value: The top right corner, which is always {@link yfiles.geometry.RectD#maxX} and {@link yfiles.geometry.RectD#y}. + */ + topRight:yfiles.geometry.PointD; + /** + * Gets the coordinates of the bottom left corner of the rectangle. + * Value: The bottom left corner, which is always {@link yfiles.geometry.RectD#x} and {@link yfiles.geometry.RectD#maxY}. + */ + bottomLeft:yfiles.geometry.PointD; + /** + * Gets the coordinates of the bottom right corner of the rectangle. + * Value: The bottom right corner, which is always {@link yfiles.geometry.RectD#maxX} and {@link yfiles.geometry.RectD#maxY}. + */ + bottomRight:yfiles.geometry.PointD; + /** + * Gets the size of this instance. + * Value: The size, which is {@link yfiles.geometry.RectD#width} and {@link yfiles.geometry.RectD#height}. + */ + size:yfiles.geometry.SizeD; + clone():yfiles.geometry.RectD; + /** + * Returns a translated instance of this which has modified {@link yfiles.geometry.RectD#x} and {@link yfiles.geometry.RectD#y} by the given amount. + * @param {yfiles.geometry.PointD} delta The delta to add to {@link yfiles.geometry.RectD#x} and {@link yfiles.geometry.RectD#y}. + */ + getTranslated(delta:yfiles.geometry.PointD):yfiles.geometry.RectD; + /** + * Gets a value indicating whether this instance is considered empty. + * Yields true if this at least one of {@link yfiles.geometry.RectD#width} or {@link yfiles.geometry.RectD#height} is negative; otherwise, false. + * Note that a width and height of both 0.0d is not considered empty for this implementation. + */ + isEmptyRectD:boolean; + /** + * Creates an {@link yfiles.geometry.IRectangle} using the values from this instance. + * @return {yfiles.geometry.IRectangle} An instance that has been initialized from the values of this instance. + */ + rectDtoRect():yfiles.geometry.IRectangle; + /** + * Creates an {@link yfiles.geometry.IMutableRectangle} using the values from this instance. + * @return {yfiles.geometry.IMutableRectangle} An instance that has been initialized from the values of this instance. + */ + toMutableRectangle():yfiles.geometry.IMutableRectangle; + /** + * Creates an {@link yfiles.geometry.IRectangle} using the values from this instance. + * @return {yfiles.geometry.IRectangle} An instance that has been initialized from the values of this instance. + */ + toImmutableRectangle():yfiles.geometry.IRectangle; + /** + * Gets a value indicating whether this instance is finite. + * Value: true if this both {@link yfiles.geometry.RectD#width} and {@link yfiles.geometry.RectD#height} are not {@link yfiles.system.PrimitiveExtensions#isInfinity infinity}; otherwise, false. + */ + isFinite:boolean; + /** + * Gets or sets the coordinates of the right border for this instance. + * Value: The maximum X value. This is either the sum of {@link yfiles.geometry.RectD#x} and {@link yfiles.geometry.RectD#width} or simply + * {@link yfiles.geometry.RectD#x} if the width is non-positive. + */ + maxX:number; + /** + * Gets or sets the coordinates of the lower border for this instance. + * Value: The maximum Y value. This is either the sum of {@link yfiles.geometry.RectD#y} and {@link yfiles.geometry.RectD#height} or simply + * {@link yfiles.geometry.RectD#y} if the height is non-positive. + */ + maxY:number; + /** + * Gets or sets the X coordinates of the left side of this instance without modifying the {@link yfiles.geometry.RectD#maxX} + * by adjusting the {@link yfiles.geometry.RectD#width} correspondingly. + * Value: The minimum X. + */ + minX:number; + /** + * Gets or sets the Y coordinates of the top side of this instance without modifying the {@link yfiles.geometry.RectD#maxY} + * by adjusting the {@link yfiles.geometry.RectD#height} correspondingly. + * Value: The minimum Y. + */ + minY:number; + /** + * Determines whether this rectangle contains the specified point. + * @param {yfiles.geometry.PointD} p The point to test. + * @return {boolean} + * true if this rectangle contains the specified point; otherwise, false. + * An {@link yfiles.geometry.RectD#isEmptyRectD empty} instance never contains any point. A point is considered to + * be contained in the rectangle when the coordinates are not smaller than {@link yfiles.geometry.RectD#minX} and + * {@link yfiles.geometry.RectD#minY} nor greater than {@link yfiles.geometry.RectD#maxX} and {@link yfiles.geometry.RectD#maxY}. + */ + rectDcontainsPointD(p:yfiles.geometry.PointD):boolean; + /** + * Determines whether this rectangle contains the specified point with respect to a given epsilon. + * @param {yfiles.geometry.PointD} p The point to test. + * @param {number} eps The positive epsilon distance that the point may lie outside the rectangle and still + * be considered contained. + * @return {boolean} + * true if this rectangle contains the specified point; otherwise, false. + * An {@link yfiles.geometry.RectD#isEmptyRectD empty} instance never contains any point. A point is considered to + * be contained in the rectangle when the coordinates are not smaller than {@link yfiles.geometry.RectD#minX} and + * {@link yfiles.geometry.RectD#minY} minus eps nor greater than {@link yfiles.geometry.RectD#maxX} and {@link yfiles.geometry.RectD#maxY} + * plus eps. + */ + containsPointDEps(p:yfiles.geometry.PointD,eps:number):boolean; + /** + * Creates an enlarged instance that is the same as this one but enlarged by the specified insets. + * If this instance {@link yfiles.geometry.RectD#isEmptyRectD}, the same will be returned. + * @param {yfiles.geometry.InsetsD} insets The insets to use to add to the instance. + */ + getInsetsEnlarged(insets:yfiles.geometry.InsetsD):yfiles.geometry.RectD; + /** + * Creates an enlarged instance of this rectangle using the same insets for all sides. + * If this instance {@link yfiles.geometry.RectD#isEmptyRectD}, the result will be the same. + * @param {number} size The inset to add to each of the sides to grow the new instance. + * @see {@link yfiles.geometry.RectD#getInsetsEnlarged} + */ + getEnlarged(size:number):yfiles.geometry.RectD; + /** + * Gets the area of this instance which is the product of {@link yfiles.geometry.RectD#width} and {@link yfiles.geometry.RectD#height}. + * Value: The area. + */ + area:number; + /** + * Determines whether the bounds of this instance intersect with the bounds of the specified rectangle. + * @param {yfiles.geometry.RectD} other The rectangle to check. + * @return {boolean} Whether both instance are non-empty and have an intersection with positive {@link yfiles.geometry.RectD#area}. + */ + intersectsRectD(other:yfiles.geometry.RectD):boolean; + /** + * Determines whether this rectangle intersects an oriented rectangle, given an epsilon. + * @param {yfiles.geometry.IOrientedRectangle} orientedRectangle The oriented 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. + */ + intersectsOrientedRectangleEps(orientedRectangle:yfiles.geometry.IOrientedRectangle,eps:number):boolean; + /** + * Determines whether this rectangle intersects a line. + * @param {yfiles.geometry.PointD} p1 The first end point of the line. + * @param {yfiles.geometry.PointD} p2 The second end point of the line. + * @return {boolean} Whether the line intersects the rectangle. + */ + intersectsLine(p1:yfiles.geometry.PointD,p2:yfiles.geometry.PointD):boolean; + /** + * Determines whether a rectangle intersects a polygonal line. + * @param {yfiles.collections.IEnumerable.} controlPointList The list of points that is interpreted as a number of line segments. + * @return {boolean} true if the rectangle intersects at least one segment of the line. + */ + intersectsPolyline(controlPointList:yfiles.collections.IEnumerable):boolean; + /** + * Finds the intersection between a rectangle and a line. + * @param {yfiles.geometry.PointD} inner The coordinates of a point lying inside the rectangle. + * @param {yfiles.geometry.PointD} outer The coordinates of a point lying outside the rectangle. + * @return {yfiles.geometry.PointD} The intersection point if the inner point lies inside the rectangle, the outer point lies outside the rectangle + * and thus an intersection point has been found, or null otherwise. + */ + findLineIntersection(inner:yfiles.geometry.PointD,outer:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Creates a human readable from of this instance. + * @return {string} + * A string describing the properties of this instance. + */ + toString():string; + /** + * Transforms this instance using specified transform storing the bounds in place. + * @param {yfiles.geometry.Matrix2D} transform The transform matrix to apply to this instance. + */ + getTransformed(transform:yfiles.geometry.Matrix2D):yfiles.geometry.RectD; + /** + * Determines whether this instance has the same values as the given one. + * The equality is determined by comparing {@link yfiles.geometry.RectD#x} and {@link yfiles.geometry.RectD#y} + * and {@link yfiles.geometry.RectD#width} and {@link yfiles.geometry.RectD#height} for equality. + * @param {yfiles.geometry.RectD} obj The second operand to compare with this instance. + * @return {boolean} Whether the {@link yfiles.geometry.RectD#x}, {@link yfiles.geometry.RectD#y}, {@link yfiles.geometry.RectD#width}, and {@link yfiles.geometry.RectD#height} + * properties of the instances are equal. + */ + equalsRectD(obj:yfiles.geometry.RectD):boolean; + /** + * Indicates whether this instance and a specified object are equal. + * @param {Object} obj Another object to compare to. + * @return {boolean} + * true if obj and this instance are the same type and represent the same value; otherwise, false. + * @see {@link yfiles.geometry.RectD#equalsRectD} + */ + equals(obj:Object):boolean; + /** + * Returns the hash code for this instance. + * @return {number} + * A 32-bit signed integer that is the hash code for this instance. + * The hash code is computed using the {@link yfiles.geometry.RectD#x}, {@link yfiles.geometry.RectD#y}, {@link yfiles.geometry.RectD#width}, and {@link yfiles.geometry.RectD#height} + * property. + */ + hashCode():number; + /** + * Creates a {@link yfiles.algorithms.Rectangle2D.Double Rectangle2D.Double} from a given {@link yfiles.geometry.RectD}. + * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toRectangle2D}. + * @return {yfiles.algorithms.Rectangle2D.Double} The {@link yfiles.algorithms.Rectangle2D.Double Rectangle2D.Double}. + */ + toRectangle2D():yfiles.algorithms.Rectangle2D.Double; + /** + * Creates a {@link yfiles.algorithms.YRectangle} from a given {@link yfiles.geometry.RectD}. + * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toYRectangle}. + * @return {yfiles.algorithms.YRectangle} The {@link yfiles.algorithms.YRectangle}. + */ + toYRectangle():yfiles.algorithms.YRectangle; + } + var RectD:{ + $class:yfiles.lang.Class; + /** + * Gets an {@link yfiles.geometry.RectD#isEmptyRectD empty} rectangle. + * {@link yfiles.geometry.RectD#width} and {@link yfiles.geometry.RectD#height} are set to -1.0d, {@link yfiles.geometry.RectD#x} and {@link yfiles.geometry.RectD#y} + * are set to 0.0d. + */ + EMPTY:yfiles.geometry.RectD; + /** + * Gets an infinite rectangle. + * {@link yfiles.geometry.RectD#width} and {@link yfiles.geometry.RectD#height} are set to {@link Number#POSITIVE_INFINITY}, {@link yfiles.geometry.RectD#x} and {@link yfiles.geometry.RectD#y} + * are set to {@link Number#NEGATIVE_INFINITY}. + */ + INFINITE:yfiles.geometry.RectD; + /** + * Initializes a new instance. + * @param {number} x The {@link yfiles.geometry.RectD#x} coordinate of the top left corner. + * @param {number} y The {@link yfiles.geometry.RectD#y} coordinate of the top left corner. + * @param {number} width The {@link yfiles.geometry.RectD#width} of the rectangle. + * @param {number} height The {@link yfiles.geometry.RectD#height} of the rectangle. + */ + new (x:number,y:number,width:number,height:number):yfiles.geometry.RectD; + /** + * Initializes a new instance using two point to define the bounds. + * This will always result in non-{@link yfiles.geometry.RectD#isEmptyRectD} rectangles as the coordinates of the points are sorted + * so that the smaller gets assigned to {@link yfiles.geometry.RectD#x} and {@link yfiles.geometry.RectD#y} respectively and the greater ones + * define the {@link yfiles.geometry.RectD#width} and {@link yfiles.geometry.RectD#height}. + * @param {yfiles.geometry.PointD} p1 The first point to determine the bounds. + * @param {yfiles.geometry.PointD} p2 The second point to determine the bounds. + */ + FromPoints:{ + new (p1:yfiles.geometry.PointD,p2:yfiles.geometry.PointD):yfiles.geometry.RectD; + }; + /** + * Initializes a new instance using the {@link yfiles.geometry.RectD#topLeft} corner + * and the {@link yfiles.geometry.RectD#size}. + * @param {yfiles.geometry.PointD} topLeft The top left corner. + * @param {yfiles.geometry.SizeD} size The size to use. + */ + FromTopLeftAndSize:{ + new (topLeft:yfiles.geometry.PointD,size:yfiles.geometry.SizeD):yfiles.geometry.RectD; + }; + /** + * Factory method that creates a {@link yfiles.geometry.RectD} using the values form the given + * {@link yfiles.geometry.IRectangle}. + * @param {yfiles.geometry.IRectangle} rect The rectangle to get the initial values from. + * @return {yfiles.geometry.RectD} An instance that is initialized using the values of rect + */ + fromRectangle(rect:yfiles.geometry.IRectangle):yfiles.geometry.RectD; + /** + * Adds the point to the given rectangle by enlarging the rectangle to {@link yfiles.geometry.RectD#rectDcontainsPointD} + * the point, if it is not yet contained. + * @param {yfiles.geometry.RectD} rect The rectangle to modify. + * @param {yfiles.geometry.PointD} point The point to include in the rectangle's bounds. + * @return {yfiles.geometry.RectD} The enlarged rectangle. + */ + addPoint(rect:yfiles.geometry.RectD,point:yfiles.geometry.PointD):yfiles.geometry.RectD; + /** + * Combines the two rectangles creating a union. + * {@link yfiles.geometry.RectD#isEmptyRectD empty} rectangles will not be considered. + * @param {yfiles.geometry.RectD} firstRect The first rectangle to use for the union. + * @param {yfiles.geometry.RectD} secondRect The second rectangle to use for the union. + * @return {yfiles.geometry.RectD} A rectangle that encompasses the area of the two given rectangles. + */ + add(firstRect:yfiles.geometry.RectD,secondRect:yfiles.geometry.RectD):yfiles.geometry.RectD; + /** + * Implements the + operator. + * If rect {@link yfiles.geometry.RectD#isEmptyRectD}, the point will be used to set the {@link yfiles.geometry.RectD#x} + * and {@link yfiles.geometry.RectD#y} coordinates and {@link yfiles.geometry.RectD#width} and {@link yfiles.geometry.RectD#height} + * will be set to 0.0d, making it non-{@link yfiles.geometry.RectD#isEmptyRectD empty}. + * @param {yfiles.geometry.RectD} rect The rectangle to enlarge. + * @param {yfiles.geometry.PointD} point The point to add to the rectangle. + * @return {yfiles.geometry.RectD} The result of the union. + */ + addPointD(rect:yfiles.geometry.RectD,point:yfiles.geometry.PointD):yfiles.geometry.RectD; + /** + * Implements the + operator. + * If rect {@link yfiles.geometry.RectD#isEmptyRectD}, the point will be used to set the {@link yfiles.geometry.RectD#x} + * and {@link yfiles.geometry.RectD#y} coordinates and {@link yfiles.geometry.RectD#width} and {@link yfiles.geometry.RectD#height} + * will be set to 0.0d, making it non-{@link yfiles.geometry.RectD#isEmptyRectD empty}. + * @param {yfiles.geometry.RectD} rect The rectangle to enlarge. + * @param {yfiles.geometry.IPoint} point The point to add to the rectangle. + * @return {yfiles.geometry.RectD} The result of the union. + */ + addIPoint(rect:yfiles.geometry.RectD,point:yfiles.geometry.IPoint):yfiles.geometry.RectD; + /** + * Implements the operator + mapping it to the {@link yfiles.geometry.RectD#getInsetsEnlarged} method. + * @param {yfiles.geometry.RectD} rect The rectangle to enlarge. + * @param {yfiles.geometry.InsetsD} insets The insets to use. + * @return {yfiles.geometry.RectD} The result of the operation. + */ + addInsets(rect:yfiles.geometry.RectD,insets:yfiles.geometry.InsetsD):yfiles.geometry.RectD; + /** + * Implements the operator + mapping it to the {@link yfiles.geometry.RectD#add} method. + * @param {yfiles.geometry.RectD} firstRect The first rectangle. + * @param {yfiles.geometry.RectD} secondRect The second rectangle. + * @return {yfiles.geometry.RectD} The result of the operation. + */ + addRectD(firstRect:yfiles.geometry.RectD,secondRect:yfiles.geometry.RectD):yfiles.geometry.RectD; + /** + * Implements the operator + for {@link yfiles.geometry.IRectangle} like in {@link yfiles.geometry.RectD#add}. + * @param {yfiles.geometry.RectD} firstRect The first rectangle. + * @param {yfiles.geometry.IRectangle} secondRect The second rectangle. + * @return {yfiles.geometry.RectD} The result of the operation. + */ + addRectangle(firstRect:yfiles.geometry.RectD,secondRect:yfiles.geometry.IRectangle):yfiles.geometry.RectD; + convertFromRect(rect:yfiles.geometry.Rectangle):yfiles.geometry.RectD; + convertFromImmutableRectangle(rect:yfiles.geometry.ImmutableRectangle):yfiles.geometry.RectD; + /** + * Performs an explicit conversion from {@link yfiles.geometry.RectD} to {@link yfiles.geometry.Rectangle}. + * @param {yfiles.geometry.RectD} rect The rectangle to convert. + * @return {yfiles.geometry.Rectangle} The result of the conversion. + */ + convertToRectangle(rect:yfiles.geometry.RectD):yfiles.geometry.Rectangle; + /** + * Performs an implicit conversion from {@link yfiles.geometry.RectD} to {@link yfiles.geometry.ImmutableRectangle}. + * @param {yfiles.geometry.RectD} rect The rectangle to convert. + * @return {yfiles.geometry.ImmutableRectangle} The result of the conversion. + */ + convertToImmutableRectangle(rect:yfiles.geometry.RectD):yfiles.geometry.ImmutableRectangle; + /** + * Implements the equality operation on {@link yfiles.geometry.RectD} comparing {@link yfiles.geometry.RectD#x} and {@link yfiles.geometry.RectD#y} + * and {@link yfiles.geometry.RectD#width} and {@link yfiles.geometry.RectD#height} for equality. + * @param {yfiles.geometry.RectD} p1 The first operand. + * @param {yfiles.geometry.RectD} p2 The second operand. + * @return {boolean} Whether the {@link yfiles.geometry.RectD#x}, {@link yfiles.geometry.RectD#y}, {@link yfiles.geometry.RectD#width}, and {@link yfiles.geometry.RectD#height} + * properties of the instances are equal. + */ + equals(p1:yfiles.geometry.RectD,p2:yfiles.geometry.RectD):boolean; + /** + * Implements the inequality operation on {@link yfiles.geometry.RectD} comparing {@link yfiles.geometry.RectD#x} and {@link yfiles.geometry.RectD#y} + * and {@link yfiles.geometry.RectD#width} and {@link yfiles.geometry.RectD#height} for equality. + * @param {yfiles.geometry.RectD} p1 The first operand. + * @param {yfiles.geometry.RectD} p2 The second operand. + * @return {boolean} Whether the at least one of {@link yfiles.geometry.RectD#x}, {@link yfiles.geometry.RectD#y}, {@link yfiles.geometry.RectD#width}, or {@link yfiles.geometry.RectD#height} + * properties of the instances are not equal. + */ + notEquals(p1:yfiles.geometry.RectD,p2:yfiles.geometry.RectD):boolean; + /** + * Creates a new instance given the center of the rectangle and its size. + * @param {yfiles.geometry.PointD} center The center to use. + * @param {yfiles.geometry.SizeD} size The size to assign. + * @return {yfiles.geometry.RectD} An instance whose center is set to center + * and size is size + */ + fromCenter(center:yfiles.geometry.PointD,size:yfiles.geometry.SizeD):yfiles.geometry.RectD; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface InsetsDConverter extends yfiles.system.TypeConverter{ + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#canConvertFromWithContext} + */ + canConvertFromWithContext(context:yfiles.system.ITypeDescriptorContext,sourceType:yfiles.lang.Class):boolean; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#canConvertToWithContext} + */ + canConvertToWithContext(context:yfiles.system.ITypeDescriptorContext,destinationType:yfiles.lang.Class):boolean; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#convertFromWithContextAndCulture} + */ + convertFromWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object):Object; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#convertToWithContextAndCulture} + */ + convertToWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object,destinationType:yfiles.lang.Class):Object; + } + var InsetsDConverter:{ + $class:yfiles.lang.Class; + new ():yfiles.geometry.InsetsDConverter; + }; + /** + * A class that models the thickness of insets as double precision floating point values. + */ + export interface InsetsD extends yfiles.lang.Struct{ + /** + * Gets or sets the top inset. + * Value: The top inset. + */ + top:number; + /** + * Gets or sets the left inset. + * Value: The left inset. + */ + left:number; + /** + * Gets or sets the bottom inset. + * Value: The bottom inset. + */ + bottom:number; + /** + * Gets or sets the right inset. + * Value: The right inset. + */ + right:number; + /** + * Gets the vertical insets, which is the sum of {@link yfiles.geometry.InsetsD#top} and {@link yfiles.geometry.InsetsD#bottom}. + * Value: The vertical insets ({@link yfiles.geometry.InsetsD#top} + {@link yfiles.geometry.InsetsD#bottom}. + */ + verticalInsets:number; + /** + * Gets the horizontal insets, which is the sum of {@link yfiles.geometry.InsetsD#left} and {@link yfiles.geometry.InsetsD#right}. + * Value: The horizontal insets ({@link yfiles.geometry.InsetsD#left} + {@link yfiles.geometry.InsetsD#right}. + */ + horizontalInsets:number; + /** + * Gets a value indicating whether this instance is empty, i.e. all insets are 0.0d. + * Value: true if this instance has all properties set to 0.0d; otherwise, false. + */ + isEmpty:boolean; + /** + * Creates an enlarged instance by adding the insets of the specified insets to this instance + * and returning the result. + * @param {yfiles.geometry.InsetsD} insets The insets to add to this instance. + */ + getEnlarged(insets:yfiles.geometry.InsetsD):yfiles.geometry.InsetsD; + /** + * Calculates the union of this instance and the given inset which + * is done by performing {@link Math#max} on + * all four inset values. + * @param {yfiles.geometry.InsetsD} insets The insets to max with these insets. + */ + createUnion(insets:yfiles.geometry.InsetsD):yfiles.geometry.InsetsD; + /** + * Determines whether this instance has the same values as the given one. + * The equality is determined by comparing {@link yfiles.geometry.InsetsD#left} and {@link yfiles.geometry.InsetsD#right} + * and {@link yfiles.geometry.InsetsD#top} and {@link yfiles.geometry.InsetsD#bottom} for equality. + * @param {yfiles.geometry.InsetsD} obj The second operand to compare with this struct. + * @return {boolean} Whether the {@link yfiles.geometry.InsetsD#left}, {@link yfiles.geometry.InsetsD#right}, {@link yfiles.geometry.InsetsD#bottom}, and {@link yfiles.geometry.InsetsD#right} + * properties of the instances are equal. + */ + equalsInsets(obj:yfiles.geometry.InsetsD):boolean; + /** + * Indicates whether this instance and a specified object are equal. + * @param {Object} obj Another object to compare to. + * @return {boolean} + * true if obj and this instance are the same type and represent the same value; otherwise, false. + * @see {@link yfiles.geometry.InsetsD#equalsInsets} + */ + equals(obj:Object):boolean; + /** + * Returns the hash code for this instance. + * @return {number} + * A 32-bit signed integer that is the hash code for this instance. + * The hash code is computed using the {@link yfiles.geometry.InsetsD#left}, {@link yfiles.geometry.InsetsD#right}, {@link yfiles.geometry.InsetsD#top}, and {@link yfiles.geometry.InsetsD#bottom} + * property. + */ + hashCode():number; + clone():yfiles.geometry.InsetsD; + /** + * Returns a {@link String} that represents this instance. + * @return {string} + * A {@link String} that represents this instance. + */ + toString():string; + /** + * Creates a {@link yfiles.algorithms.Insets} from a given {@link yfiles.geometry.InsetsD}. + * This is a bridge method that delegates to {@link yfiles.algorithms.GeomExtensions#toInsets}. + * @return {yfiles.algorithms.Insets} The {@link yfiles.geometry.InsetsD}. + */ + toInsets():yfiles.algorithms.Insets; + } + var InsetsD:{ + $class:yfiles.lang.Class; + /** + * Yields the "empty" insets that has all properties set to 0.0d. + */ + EMPTY:yfiles.geometry.InsetsD; + /** + * Initializes a new instance using the provided inset for all four sides. + * @param {number} inset The inset to use for all sides. + */ + new (inset:number):yfiles.geometry.InsetsD; + /** + * Initializes a new instance. + * @param {number} left The left inset. + * @param {number} top The top inset. + * @param {number} right The right inset. + * @param {number} bottom The bottom inset. + */ + FromLeftTopRightAndBottom:{ + new (left:number,top:number,right:number,bottom:number):yfiles.geometry.InsetsD; + }; + /** + * Implements the equality operation on {@link yfiles.geometry.InsetsD} comparing {@link yfiles.geometry.InsetsD#left} and {@link yfiles.geometry.InsetsD#top} + * and {@link yfiles.geometry.InsetsD#bottom} and {@link yfiles.geometry.InsetsD#right} for equality. + * @param {yfiles.geometry.InsetsD} one The first operand. + * @param {yfiles.geometry.InsetsD} two The second operand. + * @return {boolean} Whether the {@link yfiles.geometry.InsetsD#left}, {@link yfiles.geometry.InsetsD#top}, {@link yfiles.geometry.InsetsD#bottom}, and {@link yfiles.geometry.InsetsD#right} + * properties of the instances are equal. + */ + equals(one:yfiles.geometry.InsetsD,two:yfiles.geometry.InsetsD):boolean; + /** + * Implements the inequality operation on {@link yfiles.geometry.InsetsD} comparing {@link yfiles.geometry.InsetsD#left} and {@link yfiles.geometry.InsetsD#top} + * and {@link yfiles.geometry.InsetsD#bottom} and {@link yfiles.geometry.InsetsD#right} for inequality. + * @param {yfiles.geometry.InsetsD} one The first operand. + * @param {yfiles.geometry.InsetsD} two The second operand. + * @return {boolean} Whether any of the {@link yfiles.geometry.InsetsD#left}, {@link yfiles.geometry.InsetsD#top}, {@link yfiles.geometry.InsetsD#bottom}, and {@link yfiles.geometry.InsetsD#right} + * properties of the instances are not equal. + */ + notEquals(one:yfiles.geometry.InsetsD,two:yfiles.geometry.InsetsD):boolean; + }; + /** + * A very simple Matrix class that contains transformation information. + *

+ * The matrix is interpreted row-major. The rows are + * defined as follows: + * [ m11 m12 dx ], [ m21 m22 dy ], ([ 0 0 1 ] implicitly). + *

+ *

+ * When transforming a vector V using this matrix, the multiplication + * is done in this order: V' = M * V. + *

+ *

+ * {@link yfiles.geometry.MatrixOrder#PREPEND Prepending} a matrix T to + * this instance results in the operation M' = M * T. In concept, + * this means that T is applied before M when applying M' to a vector. + * {@link yfiles.geometry.MatrixOrder#APPEND Appending} T to M results in + * M' = T * M. + *

+ */ + export interface Matrix2D extends Object,yfiles.system.ICloneable,yfiles.system.IEquatable{ + /** + * Returns a new double[] of the elements describing the matrix. + * The order is m11, m12, m21, m22, dx, dy. + */ + elements:number[]; + /** + * Transforms the given coordinate pair in place. + * @param {number} x The x coordinate. + * @param {number} y The y coordinate. + */ + transformValues(x:{value:number;},y:{value:number;}):void; + /** + * Transforms the given coordinate. + * @param {yfiles.geometry.PointD} p The coordinate to transform. + * @return {yfiles.geometry.PointD} The transformed coordinates. + */ + transform(p:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Transforms the given point. + * @param {yfiles.geometry.IPoint} point The point to transform. + * @param {T} result The point to put the result in and that will be returned. + * @return {T} result + */ + transformPoint(point:yfiles.geometry.IPoint,result:T):T; + /** + * Transforms the given point in place. + * @param {T} point The point to transform and return. + * @return {T} point + */ + transformInplace(point:T):T; + /** + * Prepends a translation to this instance. + */ + translate(delta:yfiles.geometry.PointD):void; + /** + * Appends or Prepends a translation to this instance. + */ + translateWithOrder(delta:yfiles.geometry.PointD,order:yfiles.geometry.MatrixOrder):void; + /** + * Resets this instance to the identity. + */ + reset():void; + /** + * Sets all elements of this instance. + */ + set(m0:number,m1:number,m2:number,m3:number,tx:number,ty:number):void; + /** + * Clones this instance. + */ + cloneMatrix():yfiles.geometry.Matrix2D; + clone():Object; + /** + * Inverts this instance. + */ + invert():void; + /** + * Sets the values of the given matrix to this instance. + */ + setFrom(m:yfiles.geometry.Matrix2D):void; + /** + * Prepends a scale operation to this instance. + */ + scale(x:number,y:number):void; + /** + * Appends or prepends a scale operation to this instance. + */ + scaleWithOrder(x:number,y:number,order:yfiles.geometry.MatrixOrder):void; + /** + * Prepends a rotate operation to this matrix. + * @param {number} theta The angle to rotate in radians. + */ + rotate(theta:number):void; + /** + * Prepends a rotation operation to this matrix around the specified rotation center. + * @param {number} theta The rotation angle in radians + * @param {yfiles.geometry.PointD} centerPoint The coordinates of the center of the rotation. + */ + rotateWithCenter(theta:number,centerPoint:yfiles.geometry.PointD):void; + /** + * Prepends or appends a rotation operation to this matrix around the specified rotation center. + * @param {number} theta The rotation angle in radians + * @param {yfiles.geometry.PointD} centerPoint The coordinate of the center of the rotation. + * @param {yfiles.geometry.MatrixOrder} order Whether to append or prepend the rotation matrix. + */ + rotateWithCenterAndOrder(theta:number,centerPoint:yfiles.geometry.PointD,order:yfiles.geometry.MatrixOrder):void; + /** + * Prepends or appends a rotation operation to this matrix around the origin. + * @param {number} theta The rotation angle in radians + * @param {yfiles.geometry.MatrixOrder} order Whether to append or prepend the rotation matrix. + */ + rotateWithOrder(theta:number,order:yfiles.geometry.MatrixOrder):void; + /** + * Multiplies this matrix instance by the given instance using the given order. + * @param {yfiles.geometry.Matrix2D} m The matrix to multiply with this one. + * @param {yfiles.geometry.MatrixOrder} matrixOrder The order of the multiplication. + */ + multiply(m:yfiles.geometry.Matrix2D,matrixOrder:yfiles.geometry.MatrixOrder):void; + equalsTyped(matrix2D:yfiles.geometry.Matrix2D):boolean; + /** + * Converts the Matrix2D object to a SVG transform. + * This is a bridge method that delegates to {@link yfiles.canvas.SVGExtensions#toSVGTransform}. + * @return {string} + */ + toSVGTransform():string; + } + var Matrix2D:{ + $class:yfiles.lang.Class; + /** + * Create an identity matrix. + */ + new ():yfiles.geometry.Matrix2D; + /** + * Create a matrix using the provided matrix entries. + */ + FromValues:{ + new (m11:number,m12:number,m21:number,m22:number,dx:number,dy:number):yfiles.geometry.Matrix2D; + }; + /** + * Creates a matrix rotation instance around the origin. + * @param {number} theta The rotation angle in radians. + * @return {yfiles.geometry.Matrix2D} A new matrix. + */ + createRotateInstance(theta:number):yfiles.geometry.Matrix2D; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface SizeDConverter extends yfiles.system.TypeConverter{ + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#canConvertFromWithContext} + */ + canConvertFromWithContext(context:yfiles.system.ITypeDescriptorContext,sourceType:yfiles.lang.Class):boolean; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#canConvertToWithContext} + */ + canConvertToWithContext(context:yfiles.system.ITypeDescriptorContext,destinationType:yfiles.lang.Class):boolean; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#convertFromWithContextAndCulture} + */ + convertFromWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object):Object; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#convertToWithContextAndCulture} + */ + convertToWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object,destinationType:yfiles.lang.Class):Object; + } + var SizeDConverter:{ + $class:yfiles.lang.Class; + new ():yfiles.geometry.SizeDConverter; + }; + /** + * A simple default implementation of a mutable oriented rectangle in 2D coordinate space + * with double precision values stored in an instance of {@link yfiles.geometry.IMutablePoint} + * and {@link yfiles.geometry.IMutableSize} as well as two doubles for the up vector components. + * This implementation delegates the storage to implementations of + * {@link yfiles.geometry.IMutablePoint} for the anchor of the oriented rectangle. + * and {@link yfiles.geometry.IMutableSize} for the size of the oriented rectangle. + * members. As a convenience it implements the {@link yfiles.geometry.IMovable}, the + * {@link yfiles.geometry.IMutablePoint} and the {@link yfiles.system.ICloneable} interfaces. + * @see {@link yfiles.geometry.IOrientedRectangle} + * @see {@link yfiles.geometry.IMutableOrientedRectangle} + */ + export interface OrientedRectangle extends Object,yfiles.geometry.IMutablePoint,yfiles.geometry.IMovable,yfiles.geometry.IMutableOrientedRectangle,yfiles.system.ICloneable{ + /** + * Creates a copy of the current state of this instance using + * {@link yfiles.geometry.Point} and {@link yfiles.geometry.OrientedRectangle#size} to store the anchor + * and size. + * @return {Object} A new instance of {@link yfiles.geometry.Rectangle} + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + /** + * Returns whether this instance has negative width or height. + */ + empty:boolean; + /** + * Returns the instance that stores the anchor of this oriented rectangle. + * This will return a live view of the anchor of this rectangle. + * However setting an anchor instance will only copy the values + * of the point provided to the current anchor. + */ + anchor:yfiles.geometry.IPoint; + /** + * Returns the instance that stores the size of this rectangle. + * This will return a live view of the size of this rectangle. + * However setting a size instance will only copy the values + * of the size provided to the current size. + */ + size:yfiles.geometry.ISize; + /** + * Gets or sets the width of this instance from the + * {@link yfiles.geometry.OrientedRectangle#size} instance. + * Note that depending on the implementation used for holding + * the size the results may vary. However the default implementation + * will do just that: read and write the values without modifying them in any way. + * @see Specified by {@link yfiles.geometry.ISize#width}. + */ + width:number; + /** + * Gets or sets the height of this instance from the + * {@link yfiles.geometry.OrientedRectangle#size} instance. + * Note that that depending on the implementation used for holding + * the size the results may vary. However the default implementation + * will do just that: read and write the values without modifying them in any way. + * @see Specified by {@link yfiles.geometry.ISize#height}. + */ + height:number; + /** + * Gets or sets the x coordinate of the anchor of this instance from the + * {@link yfiles.geometry.OrientedRectangle#anchor} instance. + * Note that depending on the implementation used for holding + * the anchor the results may vary. However the default implementation + * will do just that: read and write the values without modifying them in any way. + * @see Specified by {@link yfiles.geometry.IMutablePoint#x}. + */ + x:number; + /** + * Gets or sets the y coordinate of the anchor of this instance from the + * {@link yfiles.geometry.OrientedRectangle#anchor} instance. + * Note that depending on the implementation used for holding + * the anchor the results may vary. However the default implementation + * will do just that: read and write the values without modifying them in any way. + * @see Specified by {@link yfiles.geometry.IMutablePoint#y}. + */ + y:number; + /** + * Gets or sets the x coordinate of the anchor of this instance from the + * {@link yfiles.geometry.OrientedRectangle#anchor} instance. + * Note that depending on the implementation used for holding + * the anchor the results may vary. However the default implementation + * will do just that: read and write the values without modifying them in any way. + * @see Specified by {@link yfiles.geometry.IMutableOrientedRectangle#anchorX}. + */ + anchorX:number; + /** + * Gets or sets the y coordinate of the anchor of this instance from the + * {@link yfiles.geometry.OrientedRectangle#anchor} instance. + * Note that depending on the implementation used for holding + * the anchor the results may vary. However the default implementation + * will do just that: read and write the values without modifying them in any way. + * @see Specified by {@link yfiles.geometry.IMutableOrientedRectangle#anchorY}. + */ + anchorY:number; + /** + * Sets the components of the up vector to the new values. + * It is up to the caller to assure that the values describe a vector of + * length 1. + * @param {number} upx The x component of the normalized up vector. + * @param {number} upy The y component of the normalized up vector. + * @see {@link yfiles.geometry.OrientedRectangle#angle} + * @see Specified by {@link yfiles.geometry.IMutableOrientedRectangle#setUpVectorValues}. + */ + setUpVectorValues(upx:number,upy:number):void; + /** + * Gets or sets the x component of the up vector to the new value. + * It is up to the caller to assure that the values describe a vector of + * length 1. + * @see {@link yfiles.geometry.OrientedRectangle#angle} + * @see {@link yfiles.geometry.OrientedRectangle#setUpVectorValues} + * @see {@link yfiles.geometry.OrientedRectangle#upY} + * @see Specified by {@link yfiles.geometry.IOrientedRectangle#upX}. + */ + upX:number; + /** + * Gets or sets the y component of the up vector to the new value. + * It is up to the caller to assure that the values describe a vector of + * length 1. + * @see {@link yfiles.geometry.OrientedRectangle#angle} + * @see {@link yfiles.geometry.OrientedRectangle#setUpVectorValues} + * @see {@link yfiles.geometry.OrientedRectangle#upX} + * @see Specified by {@link yfiles.geometry.IOrientedRectangle#upY}. + */ + upY:number; + /** + * Gets or sets the angle for the orientation of this rectangle. + * An angle of 0 means the up vector points up in direction + * (0,-1). + * An angle of 0 means the up vector points up in direction + * (0,-1). The value is not stored and will be recalculated + * using Math.atan2(-upX, -upY); every time this is invoked, so + * this is a costly method. + * Setting the angle results in: + *

+      *    upX = -Math.sin(value);
+      *    upY = -Math.cos(value);
+      * 
+ */ + angle:number; + /** + * Moves this rectangle by applying the offset to the {@link yfiles.geometry.OrientedRectangle#anchor}. + * @param {yfiles.geometry.PointD} delta The offset to move the rectangle's anchor by. + * @return {boolean} true iff dx != 0 || dy != 0 + * @see Specified by {@link yfiles.geometry.IMovable#moveBy}. + */ + moveBy(delta:yfiles.geometry.PointD):boolean; + /** + * Sets the values of this instance to the values provided by the given instance. + * @param {yfiles.geometry.IOrientedRectangle} rectangle The instance to retrieve the values from. + */ + setWithRectangle(rectangle:yfiles.geometry.IOrientedRectangle):void; + } + var OrientedRectangle:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the provided values to initialize + * the anchor and size. + * The up vector will be initialized to (0, -1). + * @param {number} x The x coordinate of the anchor of the oriented rectangle. + * @param {number} y The y coordinate of the anchor of the oriented rectangle. + * @param {number} w The width of the rectangle. + * @param {number} h The height of the rectangle. + */ + createWithValues(x:number,y:number,w:number,h:number):yfiles.geometry.OrientedRectangle; + /** + * Creates a new instance using the provided values to initialize + * the anchor and size. + * It is up to the caller to ensure that the up vector is normalized. + * @param {number} x The x coordinate of the anchor of the oriented rectangle. + * @param {number} y The y coordinate of the anchor of the oriented rectangle. + * @param {number} w The width of the rectangle. + * @param {number} h 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. + */ + createWithValuesAndUp(x:number,y:number,w:number,h:number,upX:number,upY:number):yfiles.geometry.OrientedRectangle; + /** + * Creates a new instance using the provided values to initialize + * the anchor and size. + * The up vector will be initialized to (0, -1). + * The instances provided will be referenced by this instance. This instance + * will be used as a live view over the provided instances. Changes to them will + * indirectly change the state of this instance and changes applied through this + * instance will be written to the referenced implementations. + * @param {yfiles.geometry.IMutablePoint} anchor The provider for the dynamic anchor of this instance. + * @param {yfiles.geometry.IMutableSize} size The provider for the dynamic size of this instance. + */ + createWithAnchorAndSize(anchor:yfiles.geometry.IMutablePoint,size:yfiles.geometry.IMutableSize):yfiles.geometry.OrientedRectangle; + /** + * Creates a default OrientedRectangle anchored at (0,0) with + * a size of (-1, -1) and an up vector of (0,-1). + * @return {yfiles.geometry.OrientedRectangle} An empty oriented rectangle instance. + */ + create():yfiles.geometry.OrientedRectangle; + /** + * Creates a new instance using the provided rectangle to initialize + * the anchor and size. + * The anchor will be set to the lower left corner of the provided rectangle. + * Thus this instance will have the exact same bounds as the rectangle initially. + * The up vector will be initialized to (0, -1). + * @param {yfiles.geometry.IRectangle} rect The rectangle to initialize the anchor and size from. + */ + createWithRectangle(rect:yfiles.geometry.IRectangle):yfiles.geometry.OrientedRectangle; + /** + * Creates a new instance using the provided rectangle to initialize + * itself. + * This will basically create a copy of the given rectangle + * @param {yfiles.geometry.IOrientedRectangle} rect The rectangle to initialize the anchor and size from. + */ + createWithOrientedRectangle(rect:yfiles.geometry.IOrientedRectangle):yfiles.geometry.OrientedRectangle; + convertFrom(rect:yfiles.geometry.Rectangle):yfiles.geometry.OrientedRectangle; + /** + * Creates a new instance using the provided values to initialize + * the anchor and size. + * The up vector will be initialized to (0, -1). + * The instances provided will be referenced by this instance. This instance + * will be used as a live view over the provided instances. Changes to them will + * indirectly change the state of this instance and changes applied through this + * instance will be written to the referenced implementations. + * @param {yfiles.geometry.IMutablePoint} position The provider for the dynamic anchor of this instance. + * @param {yfiles.geometry.IMutableSize} size The provider for the dynamic size of this instance. + */ + FromMutablePointAndSize:{ + new (position:yfiles.geometry.IMutablePoint,size:yfiles.geometry.IMutableSize):yfiles.geometry.OrientedRectangle; + }; + /** + * Initializes a new instance of the {@link yfiles.geometry.OrientedRectangle} class + * located at 0.0d,0.0d with empty width and height (-1.0d). + */ + new ():yfiles.geometry.OrientedRectangle; + /** + * Creates a new instance using the provided values to initialize + * the anchor and size. + * The up vector will be initialized to (0, -1). + * @param {number} x The x coordinate of the anchor of the oriented rectangle. + * @param {number} y The y coordinate of the anchor of the oriented rectangle. + * @param {number} w The width of the rectangle. + * @param {number} h The height of the rectangle. + */ + FromXYWAndH:{ + new (x:number,y:number,w:number,h:number):yfiles.geometry.OrientedRectangle; + }; + /** + * Creates a new instance using the provided values to initialize + * the anchor and size. + * It is up to the caller to ensure that the up vector is normalized. + * @param {number} x The x coordinate of the anchor of the oriented rectangle. + * @param {number} y The y coordinate of the anchor of the oriented rectangle. + * @param {number} w The width of the rectangle. + * @param {number} h 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. + */ + FromXYWHUpXAndUpY:{ + new (x:number,y:number,w:number,h:number,upX:number,upY:number):yfiles.geometry.OrientedRectangle; + }; + }; + /** + * A simple default implementation of a mutable point in 2D coordinate space + * with double precision coordinates. + * This implementation stores the values of the coordinates in double precision floating point + * members. As a convenience it implements the {@link yfiles.geometry.IMovable} and {@link yfiles.system.ICloneable} + * interface. + * @see {@link yfiles.geometry.IPoint} + * @see {@link yfiles.geometry.IPointSetter} + */ + export interface Point extends Object,yfiles.geometry.IMutablePoint,yfiles.geometry.IMovable,yfiles.system.ICloneable{ + /** + * Gets or sets the x coordinate. + * @see Specified by {@link yfiles.geometry.IMutablePoint#x}. + */ + x:number; + /** + * Gets or sets the y coordinate. + * @see Specified by {@link yfiles.geometry.IMutablePoint#y}. + */ + y:number; + /** + * Normalizes this point as if it was a vector. + * After this the "length" of this point is 1.0d if it + * is treated as a vector. + * @see {@link yfiles.geometry.PointD#normalized} + */ + normalize():void; + /** + * Creates an immutable copy of the current state of this point. + * @return {yfiles.geometry.IPoint} An instance whose coordinates cannot be changed. + * @see {@link yfiles.geometry.ImmutablePoint} + */ + createImmutableCopy():yfiles.geometry.IPoint; + /** + * Creates an immutable view of this point. + * @return {yfiles.geometry.IPoint} An instance that cannot be used to change the coordinates, + * whoever whose state always reflects the state of this instance. + * @see {@link yfiles.geometry.ImmutablePoint} + */ + createImmutableView():yfiles.geometry.IPoint; + /** + * Sets both coordinates at the same time. + * @param {number} newX The new x coordinate. + * @param {number} newY The new y coordinate. + */ + setValues(newX:number,newY:number):void; + /** + * Sets the coordinates of this instance to the current state of the + * coordinates of the point provided. + * @param {yfiles.geometry.IPoint} point The point to obtain the values from. + */ + setToPoint(point:yfiles.geometry.IPoint):void; + /** + * Sets the coordinates of this instance to the current state of the + * coordinates of the point provided. + * @param {yfiles.geometry.PointD} point The point to obtain the values from. + */ + setToPointD(point:yfiles.geometry.PointD):void; + /** + * Returns a clone of this instance. + * @return {Object} An instance of {@link yfiles.geometry.Point} initialized to the current + * state of this instance. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + toString():string; + /** + * A variant of {@link yfiles.geometry.Point#clone} that automatically casts to + * this type. + * @return {yfiles.geometry.Point} A {@link yfiles.geometry.Point#clone} of this. + */ + clonePoint():yfiles.geometry.Point; + /** + * Moves this instance by adding the provided offsets to the coordinates of this + * point. + * @param {yfiles.geometry.PointD} delta The offset to add to this point's x coordinate + * @return {boolean} true iff dx != 0 || dy != 0 + * @see Specified by {@link yfiles.geometry.IMovable#moveBy}. + */ + moveBy(delta:yfiles.geometry.PointD):boolean; + } + var Point:{ + $class:yfiles.lang.Class; + /** + * Creates an instance using the given coordinate pair. + * @param {number} x The x coordinate + * @param {number} y The y coordinate + * @return {yfiles.geometry.Point} A instance of the Point class. + */ + create(x:number,y:number):yfiles.geometry.Point; + /** + * Creates an instance of a point that is implicitly defined by two + * neighboring points. + * The x coordinate of the resulting point will be mapped to the x coordinate of + * the first point provided and the y coordinate will be mapped to the y coordinate + * of the second point. + * Note that the type of the returned instance is not assignable to {@link yfiles.geometry.Point}. + * Changes to the coordinates of the instance returned are written to the underlying + * points. + * @param {yfiles.geometry.IMutablePoint} p1 The first point that defines the x coordinate of the instance + * @param {yfiles.geometry.IMutablePoint} p2 The second point that defines the y coordinate of the instance + * @return {yfiles.geometry.IMutablePoint} an instance of {@link yfiles.geometry.IMutablePoint} that is a dynamically + * built point using p1 and p2. + */ + createOrthogonal(p1:yfiles.geometry.IMutablePoint,p2:yfiles.geometry.IMutablePoint):yfiles.geometry.IMutablePoint; + /** + * Creates an instance initialized to (0,0). + * @return {yfiles.geometry.Point} A instance of the Point class. + */ + createOrigin():yfiles.geometry.Point; + /** + * Creates an instance using the values provided by the point instance. + * This will not create a dynamic instance. The values will be copied from p + * immediately and no reference is held to that instance thereafter. + * @param {yfiles.geometry.IPoint} p A point to retrieve the initial values from. + * @return {yfiles.geometry.Point} A instance of the Point class. + */ + createFromPoint(p:yfiles.geometry.IPoint):yfiles.geometry.Point; + /** + * Creates the point with initially 0.0d values for {@link yfiles.geometry.Point#x} and {@link yfiles.geometry.Point#y}. + */ + Empty:{ + new ():yfiles.geometry.Point; + }; + /** + * Creates an instance using the given coordinate pair. + * @param {yfiles.geometry.PointD} coordinates The coordinates. + */ + FromPointD:{ + new (coordinates:yfiles.geometry.PointD):yfiles.geometry.Point; + }; + /** + * Creates an instance using the given coordinate pair. + * @param {number} x The x coordinate + * @param {number} y The y coordinate + */ + new (x:number,y:number):yfiles.geometry.Point; + /** + * Creates a dynamic {@link yfiles.geometry.IMutablePoint} implementation that delegates to the given instances. + * Note that the implementation implements {@link yfiles.geometry.IMutablePoint} only. It cannot be cast to {@link yfiles.geometry.Point}. + * @param {yfiles.geometry.IPoint} getter The instance used to read the state of the point. + * @param {yfiles.geometry.IPointSetter} setter The instance used to write the state of the point. + * @return {yfiles.geometry.IMutablePoint} An instance that provides a live view of the two given instances. + */ + createDynamic(getter:yfiles.geometry.IPoint,setter:yfiles.geometry.IPointSetter):yfiles.geometry.IMutablePoint; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface RectDConverter extends yfiles.system.TypeConverter{ + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#canConvertFromWithContext} + */ + canConvertFromWithContext(context:yfiles.system.ITypeDescriptorContext,sourceType:yfiles.lang.Class):boolean; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#canConvertToWithContext} + */ + canConvertToWithContext(context:yfiles.system.ITypeDescriptorContext,destinationType:yfiles.lang.Class):boolean; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#convertFromWithContextAndCulture} + */ + convertFromWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object):Object; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#convertToWithContextAndCulture} + */ + convertToWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object,destinationType:yfiles.lang.Class):Object; + } + var RectDConverter:{ + $class:yfiles.lang.Class; + new ():yfiles.geometry.RectDConverter; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface PointDConverter extends yfiles.system.TypeConverter{ + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#canConvertFromWithContext} + */ + canConvertFromWithContext(context:yfiles.system.ITypeDescriptorContext,sourceType:yfiles.lang.Class):boolean; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#canConvertToWithContext} + */ + canConvertToWithContext(context:yfiles.system.ITypeDescriptorContext,destinationType:yfiles.lang.Class):boolean; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#convertFromWithContextAndCulture} + */ + convertFromWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object):Object; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#convertToWithContextAndCulture} + */ + convertToWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object,destinationType:yfiles.lang.Class):Object; + } + var PointDConverter:{ + $class:yfiles.lang.Class; + new ():yfiles.geometry.PointDConverter; + }; + } + export module graph{ + /** + * Default implementation of {@link yfiles.graph.IStripeInputVisualizationHelper} that uses {@link yfiles.drawing.DrawingTemplate}s for the actual visualization. + * If you want to change the global behavior, you can just provide a different {@link yfiles.drawing.DrawingTemplate} for the various predefined template keys in the application + * resources. If you want to override the visualization for a specific stripe only, assign a different {@link yfiles.drawing.DrawingTemplate} to the instance that is already present in the stripe's lookup. + */ + export interface DefaultStripeInputVisualizationHelper extends Object,yfiles.graph.IStripeInputVisualizationHelper{ + /** + * Return a visual creator that is used to visualize the input operation specified by type. + * This implementation uses {@link yfiles.drawing.DrawingTemplate}s for the actual visualization. + * @param {yfiles.input.IInputModeContext} context The input mode context which provides further information. + * @param {yfiles.graph.INode} tableNode The node where the stripe's owner is currently bound to. + * @param {yfiles.graph.StripeVisualizationType} type The actual visualization type + * @return {yfiles.drawing.IVisualCreator} A {@link yfiles.drawing.IVisualCreator} instance that renders a representation for the current operation. + * @see {@link yfiles.graph.DefaultStripeInputVisualizationHelper#resizeStripeTemplate} + * @see Specified by {@link yfiles.graph.IStripeInputVisualizationHelper#getVisualCreator}. + */ + getVisualCreator(context:yfiles.input.IInputModeContext,tableNode:yfiles.graph.INode,type:yfiles.graph.StripeVisualizationType):yfiles.drawing.IVisualCreator; + /** + * Provide a {@link yfiles.drawing.DrawingTemplate} that is used to visualize type. + * @param {yfiles.input.IInputModeContext} context The input mode context. Allows you to access the {@link yfiles.canvas.CanvasControl} to retrieve the resources. + * @param {yfiles.graph.StripeVisualizationType} type The visualization type + * @return {yfiles.drawing.DrawingTemplate} A {@link yfiles.drawing.DrawingTemplate} that is used to visualize type. + */ + findTemplate(context:yfiles.input.IInputModeContext,type:yfiles.graph.StripeVisualizationType):yfiles.drawing.DrawingTemplate; + /** + * Data template that is used to visualize the current stripe resize operation. + * This template is used for {@link yfiles.graph.StripeVisualizationType#RESIZE} + * Value: The template for the stripe resize visualization or null in which case the default template that is stored under {@link yfiles.graph.DefaultStripeInputVisualizationHelper#RESIZE_STRIPE_TEMPLATE_KEY} is used. + * @see {@link yfiles.graph.DefaultStripeInputVisualizationHelper#getVisualCreator} + */ + resizeStripeTemplate:yfiles.drawing.DrawingTemplate; + /** + * Data template that is used to visualize the current stripe resize operation. + * This template is used for {@link yfiles.graph.StripeVisualizationType#SELECTION} + * Value: The template for the stripe resize visualization or null in which case the default template that is stored under {@link yfiles.graph.DefaultStripeInputVisualizationHelper#SELECTED_STRIPE_TEMPLATE_KEY} is used. + * @see {@link yfiles.graph.DefaultStripeInputVisualizationHelper#getVisualCreator} + */ + selectedStripeTemplate:yfiles.drawing.DrawingTemplate; + /** + * Data template that is used to visualize the current source of a stripe reparent operation. + * This template is used for {@link yfiles.graph.StripeVisualizationType#DRAG_SOURCE} + * Value: The template for the stripe resize visualization or null in which case the default template that is stored under {@link yfiles.graph.DefaultStripeInputVisualizationHelper#DRAG_SOURCE_STRIPE_TEMPLATE_KEY} is used. + * @see {@link yfiles.graph.DefaultStripeInputVisualizationHelper#getVisualCreator} + */ + dragSourceStripeTemplate:yfiles.drawing.DrawingTemplate; + /** + * Data template that is used to visualize the current target of a stripe reparent operation. + * This template is used for {@link yfiles.graph.StripeVisualizationType#DROP_TARGET} + * Value: The template for the stripe resize visualization or null in which case the default template that is stored under {@link yfiles.graph.DefaultStripeInputVisualizationHelper#DROP_TARGET_STRIPE_TEMPLATE_KEY} is used. + * @see {@link yfiles.graph.DefaultStripeInputVisualizationHelper#getVisualCreator} + */ + dropTargetStripeTemplate:yfiles.drawing.DrawingTemplate; + } + var DefaultStripeInputVisualizationHelper:{ + $class:yfiles.lang.Class; + /** + * Default constructor. + * @param {yfiles.graph.IStripe} stripe The stripe for which the visualizations are intended + */ + new (stripe:yfiles.graph.IStripe):yfiles.graph.DefaultStripeInputVisualizationHelper; + /** + * A {@link yfiles.system.ResourceKey} that can be used to store a {@link yfiles.drawing.DrawingTemplate} that can + * be used to create the visual that will be used to draw the highlight for the stripe that is resized. + * This template is used for {@link yfiles.graph.StripeVisualizationType#RESIZE} + * @see {@link yfiles.graph.DefaultStripeInputVisualizationHelper#getVisualCreator} + */ + RESIZE_STRIPE_TEMPLATE_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used to store a {@link yfiles.drawing.DrawingTemplate} that can + * be used to create the visual that will be used to draw the highlight for the stripe that is selected. + * This template is used for {@link yfiles.graph.StripeVisualizationType#SELECTION} + * @see {@link yfiles.graph.DefaultStripeInputVisualizationHelper#getVisualCreator} + */ + SELECTED_STRIPE_TEMPLATE_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used to store a {@link yfiles.drawing.DrawingTemplate} that can + * be used to create the visual that will be used to draw the highlight for the current source of a stripe reparent operation. + * This template is used for {@link yfiles.graph.StripeVisualizationType#DRAG_SOURCE} + * @see {@link yfiles.graph.DefaultStripeInputVisualizationHelper#getVisualCreator} + */ + DRAG_SOURCE_STRIPE_TEMPLATE_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used to store a {@link yfiles.drawing.DrawingTemplate} that can + * be used to create the visual that will be used to draw the highlight for the current target of a stripe reparent operation. + * This template is used for {@link yfiles.graph.StripeVisualizationType#DROP_TARGET} + * @see {@link yfiles.graph.DefaultStripeInputVisualizationHelper#getVisualCreator} + */ + DROP_TARGET_STRIPE_TEMPLATE_KEY:yfiles.system.ResourceKey; + }; + /** + * Helper class that further describes the result of a hit test on a stripe or table. + * Instances of this class are returned by the default {@link yfiles.drawing.StripeHitTestEnumerator} implementation. + */ + export interface StripeSubregionDescriptor extends Object{ + /** + * Gets the specific subregion that this instance describes. + */ + subregion:yfiles.graph.StripeSubregion; + /** + * Gets the stripe that this instance describes. + */ + stripe:yfiles.graph.IStripe; + } + var StripeSubregionDescriptor:{ + $class:yfiles.lang.Class; + /** + * Create a new instance that describes the specific subregion. + * @param {yfiles.graph.StripeSubregion} subregion The specific subregion + * @param {yfiles.graph.IStripe} stripe The stripe + */ + new (subregion:yfiles.graph.StripeSubregion,stripe:yfiles.graph.IStripe):yfiles.graph.StripeSubregionDescriptor; + }; + export enum StripeVisualizationType{ + /** + * Visualization for a selected stripe. + */ + SELECTION, + /** + * Visualization for the source stripe of a reparent operation. + * @see {@link yfiles.input.ReparentStripeInputMode} + */ + DRAG_SOURCE, + /** + * Visualization for the target stripe of a reparent or drag and drop operation. + * @see {@link yfiles.input.ReparentStripeInputMode} + * @see {@link yfiles.input.StripeDropInputMode} + */ + DROP_TARGET, + /** + * Visualization for resize operations that are triggered for example by {@link yfiles.input.ResizeStripeInputMode}. + */ + RESIZE + } + /** + * This interface allows to change the visualization for different input gestures. + * A stripe should provide an implementation of this interface in its lookup which is queried by the various table related input modes. + */ + export interface IStripeInputVisualizationHelper extends Object{ + /** + * Return a visual creator that is used to visualize the input operation specified by type. + * @param {yfiles.input.IInputModeContext} context The input mode context which provides further information. + * @param {yfiles.graph.INode} tableNode The node where the stripe's owner is currently bound to. + * @param {yfiles.graph.StripeVisualizationType} type The actual visualization type + * @return {yfiles.drawing.IVisualCreator} A {@link yfiles.drawing.IVisualCreator} instance that renders a representation for the current operation. + * @see Specified by {@link yfiles.graph.IStripeInputVisualizationHelper#getVisualCreator}. + */ + getVisualCreator(context:yfiles.input.IInputModeContext,tableNode:yfiles.graph.INode,type:yfiles.graph.StripeVisualizationType):yfiles.drawing.IVisualCreator; + } + var IStripeInputVisualizationHelper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A simple {@link yfiles.collections.Dictionary}-based implementation of the {@link yfiles.graph.IMapperRegistry} + * interface. + */ + export interface MapperRegistry extends Object,yfiles.graph.IMapperRegistry{ + /** + * Returns a mapper that has previously been registered with this instance for the given tag. + * @param {Object} tag The tag to use to look up the mapper. + * @return {yfiles.model.IMapper.} The previously registered instance or null. + * @see Specified by {@link yfiles.graph.IMapperRegistry#getMapper}. + */ + getMapper(tag:Object):yfiles.model.IMapper; + /** + * Registers a mapper for the given tag. + * If there already was a mapper for tag, it will be replaced. + * @param {Object} tag The tag to use. + * @param {yfiles.model.IMapper.} mapper The mapper to register. + * @see Specified by {@link yfiles.graph.IMapperRegistry#addMapper}. + */ + addMapper(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,tag:Object,mapper:yfiles.model.IMapper):void; + /** + * Removes a previously registered mapper for the given tag. + * @param {Object} tag The tag that has been used for registering the mapper. + * @see Specified by {@link yfiles.graph.IMapperRegistry#removeMapper}. + */ + removeMapper(tag:Object):void; + /** + * Gets an enumerable over all tags that have been used to + * register mapper implementations with this interface. + * @see Specified by {@link yfiles.graph.IMapperRegistry#registeredTags}. + */ + registeredTags:yfiles.collections.IEnumerable; + /** + * Gets the mapper {@link yfiles.graph.IMapperMetadata meta data} for the mapper + * that is registered using the tag. + * @param {Object} tag The tag. + * @return {yfiles.graph.IMapperMetadata} The meta data or null if there is no such mapper registered for the given tag. + * @see Specified by {@link yfiles.graph.IMapperRegistry#getMapperMetadata}. + */ + getMapperMetadata(tag:Object):yfiles.graph.IMapperMetadata; + /** + * Sets the mapper meta data for the mapper that has been {@link yfiles.graph.IMapperRegistry#addMapper registered} + * using the provided tag. + * @param {Object} tag The tag. + * @param {yfiles.graph.IMapperMetadata} metadata The meta data to store with the mapper. + * @throws {yfiles.system.ArgumentOutOfRangeException} If the {@link yfiles.graph.IMapperMetadata#keyType} + * or {@link yfiles.graph.IMapperMetadata#valueType} mismatch the mapper instance in the registry. + * @see Specified by {@link yfiles.graph.IMapperRegistry#setMapperMetadata}. + */ + setMapperMetadata(tag:Object,metadata:yfiles.graph.IMapperMetadata):void; + } + var MapperRegistry:{ + $class:yfiles.lang.Class; + new ():yfiles.graph.MapperRegistry; + }; + /** + * A simple mutable implementation of the {@link yfiles.model.IListEnumerable} + * interface for {@link yfiles.graph.IPort}s. + */ + export interface ListPortCollection extends Object,yfiles.model.IListEnumerable{ + /** + * The node this collection is using. + */ + node:yfiles.graph.INode; + /** + * Adds the specified port. + * @param {yfiles.graph.IPort} port The port. + */ + add(port:yfiles.graph.IPort):void; + /** + * Adds a port at the specified position. + * @param {number} pos The position. + * @param {yfiles.graph.IPort} port The port. + */ + addAtIndex(pos:number,port:yfiles.graph.IPort):void; + /** + * Creates and adds a new port at the specified relative location. + * The port will be added at the end of this collection. The new {@link yfiles.graph.IPort} instance is anchored relatively to the owner center + * @param {yfiles.geometry.PointD} relativeLocation The relative location. + * @return {yfiles.graph.IPort} A newly created port at the given relative location. + */ + addRelative(relativeLocation:yfiles.geometry.PointD):yfiles.graph.IPort; + /** + * Creates a new port at the specified relativeLocation and adds it at the given list index. + * The new {@link yfiles.graph.IPort} instance is anchored relatively to the owner center + * @param {number} pos The list index where the port will be inserted. + * @param {yfiles.geometry.PointD} relativeLocation The relative location. + * @return {yfiles.graph.IPort} A newly created port at the given relative location. + */ + addRelativeAtIndex(pos:number,relativeLocation:yfiles.geometry.PointD):yfiles.graph.IPort; + /** + * Utility method that creates a node center anchored port. + */ + createCenterAnchoredPort(offset:yfiles.geometry.PointD):yfiles.graph.SimplePort; + /** + * Removes the given port from this collection. + * @param {yfiles.graph.IPort} port The port to remove + */ + removePort(port:yfiles.graph.IPort):void; + /** + * Not supported by this implementation. + */ + remove(index:number):void; + /** + * Returns the number of elements in this collection. + * @see Specified by {@link yfiles.model.IListEnumerable#count}. + */ + count:number; + /** + * Returns the i-th element in the collection. + * @param {number} i the zero-based index of the item in this collection + * @return {T} the item for the given index + * @see Specified by {@link yfiles.model.IListEnumerable#getItem}. + */ + getItem(i:number):yfiles.graph.IPort; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + } + var ListPortCollection:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.ListPortCollection} class + * using the specified node and ports list. + * @param {yfiles.graph.INode} node The node. + * @param {yfiles.collections.IList.} ports The ports. + */ + ForNodeWithPorts:{ + new (node:yfiles.graph.INode,ports:yfiles.collections.IList):yfiles.graph.ListPortCollection; + }; + /** + * Initializes a new instance of the {@link yfiles.graph.ListPortCollection} class + * using the provided node as the owner. + * @param {yfiles.graph.INode} node The node. + */ + ForNode:{ + new (node:yfiles.graph.INode):yfiles.graph.ListPortCollection; + }; + }; + export enum StripeSubregion{ + /** + * No active hotspot region. + */ + NONE, + /** + * Flag for the stripe itself. + * @see {@link yfiles.graph.IStripeHitTestHelper#getStripeHitTestable} + */ + STRIPE, + /** + * Flag for the leading stripe header. + * @see {@link yfiles.graph.IStripeHitTestHelper#getLeadingHeaderHitTestable} + */ + LEADING_HEADER, + /** + * Flag for the trailing stripe header. + * @see {@link yfiles.graph.IStripeHitTestHelper#getTrailingHeaderHitTestable} + */ + TRAILING_HEADER, + /** + * Flag for both stripe headers. + * This is a bitwise combination of {@link yfiles.graph.StripeSubregion#LEADING_HEADER} and {@link yfiles.graph.StripeSubregion#TRAILING_HEADER} + * @see {@link yfiles.graph.IStripeHitTestHelper#getTrailingHeaderHitTestable} + */ + HEADER, + /** + * Flag for the stripe near border region. + * @see {@link yfiles.graph.IStripeHitTestHelper#getNearBorderHitTestable} + */ + NEAR_BORDER, + /** + * Flag for the stripe far border region. + * @see {@link yfiles.graph.IStripeHitTestHelper#getFarBorderHitTestable} + */ + FAR_BORDER, + /** + * Flag for any stripe region. + */ + ALL + } + /** + * An adapter implementation that wraps an {@link yfiles.model.IMapper} to + * an {@link yfiles.algorithms.IDataProvider}. + */ + export interface DataProviderAdapter extends Object,yfiles.algorithms.IDataProvider{ + /** + * 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 DataProviderAdapter:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that adapts the provided mapper instance. + * @param {yfiles.model.IMapper.} mapper The mapper to adapt. + */ + new (keyType:yfiles.lang.Class,mapper:yfiles.model.IMapper):yfiles.graph.DataProviderAdapter; + }; + /** + * An adapter implementation that wraps an {@link yfiles.model.IMapper} to + * an {@link yfiles.algorithms.IDataMap}. + * @see {@link yfiles.graph.DataProviderAdapter} + */ + export interface DataMapAdapter extends yfiles.graph.DataProviderAdapter,yfiles.algorithms.IDataMap{ + /** + * 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 DataMapAdapter:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.DataMapAdapter} class. + * @param {yfiles.model.IMapper.} mapper The mapper to adapt. + */ + new (kType:yfiles.lang.Class,vType:yfiles.lang.Class,mapper:yfiles.model.IMapper):yfiles.graph.DataMapAdapter; + }; + /** + * This is the default implementation of an {@link yfiles.graph.IColumn}'s + * {@link yfiles.support.ILookup#lookup} method. + */ + export interface DefaultColumnLookup extends yfiles.graph.DefaultItemLookup{ + /** + * Subclasses need to override this method. + * @param {T} item The context item to lookup an implementation for. + * @param {yfiles.lang.Class} type The type of the implementation to find. + * @param {yfiles.support.ILookup} nextLookup The lookup to use for another type. + * @param {yfiles.support.ILookup} lastLookup The lookup to use as a fallback for the type. + * @return {Object} + */ + chainedLookup(column:yfiles.graph.IColumn,type:yfiles.lang.Class,nextLookup:yfiles.support.ILookup,lastLookup:yfiles.support.ILookup):Object; + } + var DefaultColumnLookup:{ + $class:yfiles.lang.Class; + /** + * Create a new instance without a context. + */ + new ():yfiles.graph.DefaultColumnLookup; + /** + * Create a new instance with the given stripe as context. + */ + ForColumn:{ + new (stripe:yfiles.graph.IColumn):yfiles.graph.DefaultColumnLookup; + }; + }; + /** + * Helper interface that allows to bundle {@link yfiles.drawing.IHitTestable} implementations + * for the main regions of a {@link yfiles.graph.IStripe} instance. + * The default {@link yfiles.graph.IRow} and {@link yfiles.graph.IColumn} implementations provide + * default implementations of this interface. + */ + export interface IStripeHitTestHelper extends Object{ + /** + * Return a {@link yfiles.drawing.IHitTestable} that should report hits on the leading header region of the stripe. + * The leading header is the region that is used by default for click selection and as start location for a stripe drag. Typically, this + * is the area occupied by the left insets for an {@link yfiles.graph.IRow} instance and by the top insets for an {@link yfiles.graph.IColumn} instance. + * @return {yfiles.drawing.IHitTestable} a {@link yfiles.drawing.IHitTestable} that should report hits on the header region of the stripe. + * @see {@link yfiles.graph.StripeSubregionDescriptor} + * @see {@link yfiles.graph.StripeSubregion#HEADER} + * @see Specified by {@link yfiles.graph.IStripeHitTestHelper#getLeadingHeaderHitTestable}. + */ + getLeadingHeaderHitTestable():yfiles.drawing.IHitTestable; + /** + * Return a {@link yfiles.drawing.IHitTestable} that should report hits on the trailing header region of the stripe. + * The trailing header is the region that is used by default for click selection and as start location for a stripe drag. Typically, this + * is the area occupied by the right insets for an {@link yfiles.graph.IRow} instance and by the bottom insets for an {@link yfiles.graph.IColumn} instance. + * @return {yfiles.drawing.IHitTestable} a {@link yfiles.drawing.IHitTestable} that should report hits on the header region of the stripe. + * @see {@link yfiles.graph.StripeSubregionDescriptor} + * @see {@link yfiles.graph.StripeSubregion#HEADER} + * @see Specified by {@link yfiles.graph.IStripeHitTestHelper#getTrailingHeaderHitTestable}. + */ + getTrailingHeaderHitTestable():yfiles.drawing.IHitTestable; + /** + * Return a {@link yfiles.drawing.IHitTestable} that should report hits on the whole stripe. + * @return {yfiles.drawing.IHitTestable} a {@link yfiles.drawing.IHitTestable} that should report hits on the whole stripe. + * @see {@link yfiles.graph.StripeSubregionDescriptor} + * @see {@link yfiles.graph.StripeSubregion#STRIPE} + * @see Specified by {@link yfiles.graph.IStripeHitTestHelper#getStripeHitTestable}. + */ + getStripeHitTestable():yfiles.drawing.IHitTestable; + /** + * Return a {@link yfiles.drawing.IHitTestable} that should report hits on the near border region of the stripe. + * The near border is the region that is used for the resize gesture in {@link yfiles.input.ResizeStripeInputMode} to expand the stripe to the top or the left. This is typically the upper border + * for an {@link yfiles.graph.IRow} instance and the left border for an {@link yfiles.graph.IColumn}. + * @return {yfiles.drawing.IHitTestable} a {@link yfiles.drawing.IHitTestable} that should report hits on the near border region of the stripe. + * @see {@link yfiles.graph.StripeSubregionDescriptor} + * @see {@link yfiles.graph.StripeSubregion#NEAR_BORDER} + * @see Specified by {@link yfiles.graph.IStripeHitTestHelper#getNearBorderHitTestable}. + */ + getNearBorderHitTestable():yfiles.drawing.IHitTestable; + /** + * Return a {@link yfiles.drawing.IHitTestable} that should report hits on the far border region of the stripe. + * The far border is the region that is used for the resize gesture in {@link yfiles.input.ResizeStripeInputMode} to expand the stripe to the bottom or the right. This is typically the bottom border + * for an {@link yfiles.graph.IRow} instance and the right border for an {@link yfiles.graph.IColumn}. + * @return {yfiles.drawing.IHitTestable} a {@link yfiles.drawing.IHitTestable} that should report hits on the far border region of the stripe. + * @see {@link yfiles.graph.StripeSubregionDescriptor} + * @see {@link yfiles.graph.StripeSubregion#FAR_BORDER} + * @see Specified by {@link yfiles.graph.IStripeHitTestHelper#getFarBorderHitTestable}. + */ + getFarBorderHitTestable():yfiles.drawing.IHitTestable; + } + var IStripeHitTestHelper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This is the default implementation of an {@link yfiles.graph.IRow}'s + * {@link yfiles.support.ILookup#lookup} method. + */ + export interface DefaultRowLookup extends yfiles.graph.DefaultItemLookup{ + /** + * Subclasses need to override this method. + * @param {T} item The context item to lookup an implementation for. + * @param {yfiles.lang.Class} type The type of the implementation to find. + * @param {yfiles.support.ILookup} nextLookup The lookup to use for another type. + * @param {yfiles.support.ILookup} lastLookup The lookup to use as a fallback for the type. + * @return {Object} + */ + chainedLookup(row:yfiles.graph.IRow,type:yfiles.lang.Class,nextLookup:yfiles.support.ILookup,lastLookup:yfiles.support.ILookup):Object; + } + var DefaultRowLookup:{ + $class:yfiles.lang.Class; + /** + * Create a new instance without a context. + */ + new ():yfiles.graph.DefaultRowLookup; + /** + * Create a new instance with the given stripe as context. + */ + ForRow:{ + new (stripe:yfiles.graph.IRow):yfiles.graph.DefaultRowLookup; + }; + }; + /** + * This is the default implementation of an {@link yfiles.graph.IStripe}'s + * {@link yfiles.support.ILookup#lookup} method. + */ + export interface DefaultStripeLookup extends yfiles.graph.DefaultItemLookup{ + /** + * Provides several default implementations for the various aspects of an {@link yfiles.graph.IRow}. + * @param {yfiles.graph.IStripe} stripe The row to find an implementation for. + * @param {yfiles.lang.Class} type The type. + * @param {yfiles.support.ILookup} nextLookup The next lookup. + * @param {yfiles.support.ILookup} lastLookup The last lookup. + * @return {Object} An implementation or null. + * @see Overrides {@link yfiles.graph.DefaultItemLookup#chainedLookup} + */ + chainedLookup(stripe:yfiles.graph.IStripe,type:yfiles.lang.Class,nextLookup:yfiles.support.ILookup,lastLookup:yfiles.support.ILookup):Object; + } + var DefaultStripeLookup:{ + $class:yfiles.lang.Class; + /** + * Create a new instance without a context. + */ + new ():yfiles.graph.DefaultStripeLookup; + /** + * Create a new instance with the given stripe as context. + */ + ForStripe:{ + new (stripe:yfiles.graph.IStripe):yfiles.graph.DefaultStripeLookup; + }; + }; + /** + * The interface used in an {@link yfiles.graph.IGraph} implementation + * for {@link yfiles.graph.IEdge}s to connect to. + * This interface provides read-only access to the properties of a port. + * In order to modify the state of an instance use the various methods provided by the + * {@link yfiles.graph.IGraph} this instance belongs to. + * Ports are owned by {@link yfiles.graph.IPortOwner IPortOwners}, normally + * an {@link yfiles.graph.INode}, but this can also be an {@link yfiles.graph.IEdge} in + * special graph implementations. + * To obtain the {@link yfiles.graph.IEdge} instances that are connected to a certain + * port instance, applications need to use the {@link yfiles.graph.IGraph#typedEdgesAtPort} + * method provided by {@link yfiles.graph.IGraph} or the corresponding convenience extension methods + * in {@link yfiles.graph.GraphExtensions}. + * Zero or more edges may be connected to a port, depending on the implementation of + * the graph. + * Like all items in an IGraph, this item supports the + * {@link yfiles.support.ILookup#lookup} method that can be used + * to query additional aspects of the item. + *
+ * Related Information in the Developers Guide: + *

+ * The graph model with all relevant types and their relationships is presented in detail + * in the section Graph Structure. + *

+ *

+ * Using the look-up mechanism is explained in the section + * Look-up Mechanism. + *

+ */ + export interface IPort extends Object,yfiles.model.IModelItem{ + /** + * Returns the owner of this port. + * In traditional {@link yfiles.graph.IGraph} implementations, this will be + * an {@link yfiles.graph.INode} and can safely be cast to one. In order to get to + * the {@link yfiles.graph.IEdge}s that connect to this instance, use + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.IGraph#typedEdgesAtPort} + * method. + * @see Specified by {@link yfiles.graph.IPort#owner}. + */ + owner:yfiles.graph.IPortOwner; + /** + * Returns a live view of the location of the port in world coordinates. + * The location is the anchor for the edges, that connect to this port, + * however it is up to the visualization + * logic where exactly the visual part of an edge will end. + * As this will yield a live view, it is up to the client to copy the values if + * a snapshot of the state is needed. + * In order to modify the location of a port, use the {@link yfiles.graph.IGraph#setLocationModelParameter} + * in {@link yfiles.graph.IGraph}. + * @see {@link yfiles.graph.IPort#locationModelParameter} + * @see Specified by {@link yfiles.graph.IPort#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Returns the style that is responsible for the visual representation + * of this port in a {@link yfiles.canvas.CanvasControl}. + * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setPortStyle} + * method. + * Note that the style instance associated with a port instance may be shared + * between multiple port instances and that the modification of this style will + * result in a change of the appearance of all ports that are associated with the same style instance. + * @see Specified by {@link yfiles.graph.IPort#style}. + */ + style:yfiles.drawing.IPortStyle; + /** + * Gets the {@link yfiles.graph.IPortLocationModelParameter} that + * is used to determine the {@link yfiles.graph.IPort#location} of this port. + * The implementations will use the {@link yfiles.graph.IPortLocationModelParameter#model}'s + * {@link yfiles.graph.IPortLocationModel#getLocation} method to update the {@link yfiles.graph.IPort#location} + * property dynamically. Note that parameters may be shared across port instances. + * @see {@link yfiles.graph.IGraph#setLocationModelParameter} + * @see Specified by {@link yfiles.graph.IPort#locationModelParameter}. + */ + locationModelParameter:yfiles.graph.IPortLocationModelParameter; + } + var IPort:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Support interface in the context of {@link yfiles.graph.IHierarchy} whose implementations + * can be found in the {@link yfiles.support.ILookup#lookup lookup} of a {@link yfiles.graph.DefaultHierarchy}. + * This interface provides access to {@link yfiles.collections.INotifyCollectionChanged observable collections} + * of children of the nodes in a hierarchy. + */ + export interface IObservableHierarchy extends Object{ + /** + * Provides a collection view of the children of parent + * that implements {@link yfiles.collections.INotifyCollectionChanged}. + * @param {T} parent The parent to provide a child collection of. + * @return {yfiles.collections.IEnumerable.} The observable live collection of the children of parent. + * @see Specified by {@link yfiles.graph.IObservableHierarchy#getChildrenWithParent}. + */ + getChildrenWithParent(parent:T):yfiles.collections.IEnumerable; + } + var IObservableHierarchy:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The common interface for items in an {@link yfiles.graph.IGraph} + * that may own {@link yfiles.graph.IPort ports}. + * Typically this interface is actively implemented by {@link yfiles.graph.INode}'s + * in an {@link yfiles.graph.IGraph}. + * To get to the edge instances that connect to the ports, the + * {@link yfiles.graph.IGraph#typedEdgesAtOwner} method + * can be used. Alternatively for each {@link yfiles.graph.IPort} + * in {@link yfiles.graph.IPortOwner#ports}, one can use the {@link yfiles.graph.IGraph#typedEdgesAtPort} + * method provided by {@link yfiles.graph.IGraph}. + * Like all items in an IGraph, this item supports the + * {@link yfiles.support.ILookup#lookup} method that can be used + * to query additional aspects of the item. + * @see {@link yfiles.graph.INode} + * @see {@link yfiles.graph.IEdge} + */ + export interface IPortOwner extends Object,yfiles.model.IModelItem{ + /** + * Provides access to a collection of {@link yfiles.graph.IPort ports} that + * are owned by this instance. + * This gives access to a read-only live view of the ports, i.e. the collection + * can change over time, as well as the ports contained in it. If a snapshot of the + * current state is needed, one needs to copy the collection. + * @see Specified by {@link yfiles.graph.IPortOwner#ports}. + */ + ports:yfiles.model.IListEnumerable; + } + var IPortOwner:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Extension helper methods to work with {@link yfiles.graph.IStripe} instances. + */ + export interface StripeExtensions extends Object{ + } + var StripeExtensions:{ + $class:yfiles.lang.Class; + /** + * Checks whether stripe is the root item of a stripe hierarchy. + * @param {yfiles.graph.IStripe} stripe the item to query. This is a this parameter, so that the method can be used + * as an extension method. + * @return {boolean} true iff stripe is a root stripe. + * @see {@link yfiles.graph.StripeExtensions#getRoot} + */ + isRoot(stripe:yfiles.graph.IStripe):boolean; + /** + * Gets the index of stripe in its {@link yfiles.graph.StripeExtensions#getParent} collection of {@link yfiles.graph.StripeExtensions#getChildren}. + * The stripe is the GetIndexth child of its parent. + * @param {yfiles.graph.IStripe} stripe the item to query. This is a this parameter, so that the method can be used + * as an extension method. + * @return {number} the children of stripe + * @see {@link yfiles.graph.IColumn#columns} + * @see {@link yfiles.graph.IRow#rows} + */ + getIndex(stripe:yfiles.graph.IStripe):number; + /** + * Returns the actual minimum size a stripe can acquire. + * This is the maximum of {@link yfiles.graph.IStripe#minimumSize} and the horizontal or vertical {@link yfiles.graph.IStripe#insets}. + */ + getEffectiveMinSize(item:yfiles.graph.IStripe):number; + /** + * Gets the direct children of stripe in a table hierarchy. + * For {@link yfiles.graph.IColumn} instances, this returns {@link yfiles.graph.IColumn#columns}, for {@link yfiles.graph.IRow} instances, this returns {@link yfiles.graph.IRow#rows} + * @param {yfiles.graph.IStripe} stripe the item to query. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.collections.IEnumerable.} the children of stripe + * @see {@link yfiles.graph.IColumn#columns} + * @see {@link yfiles.graph.IRow#rows} + */ + getChildren(stripe:yfiles.graph.IStripe):yfiles.collections.IEnumerable; + /** + * Gets the parent of stripe in a table hierarchy. + * For {@link yfiles.graph.IColumn} instances, this returns {@link yfiles.graph.IColumn#owner}, for {@link yfiles.graph.IRow} instances, this returns {@link yfiles.graph.IRow#owner} + * @param {yfiles.graph.IStripe} stripe the item to query. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.IStripe} the parent of stripe + * @see {@link yfiles.graph.IColumn#owner} + * @see {@link yfiles.graph.IRow#owner} + */ + getParent(stripe:yfiles.graph.IStripe):yfiles.graph.IStripe; + /** + * Gets the root of the stripe hierarchy of stripe in a table hierarchy. + * If the stripe is part of an {@link yfiles.graph.ITable} instance, this returns {@link yfiles.graph.ITable#rootColumn} for {@link yfiles.graph.IColumn} instances and {@link yfiles.graph.IRow#owner} for {@link yfiles.graph.ITable#rootRow} instances + * @param {yfiles.graph.IStripe} stripe the item to query. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.IStripe} the root of stripe + * @see {@link yfiles.graph.ITable#rootColumn} + * @see {@link yfiles.graph.ITable#rootRow} + * @see {@link yfiles.graph.StripeExtensions#isRoot} + */ + getRoot(stripe:yfiles.graph.IStripe):yfiles.graph.IStripe; + /** + * Returns a collection of all descendants of stripe that are leaves and therefore don't have any child stripes. + * @param {yfiles.graph.IStripe} stripe The stripe to query. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.collections.IEnumerable.} A collection of all leaf descendants of stripe + */ + getLeaves(stripe:yfiles.graph.IStripe):yfiles.collections.IEnumerable; + /** + * Returns a collection of all descendants of stripe. + * The descendants are returned in top to bottom order. + * @param {yfiles.graph.IStripe} stripe The stripe to query. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.collections.IEnumerable.} A collection of all descendants of stripe + */ + getDescendants(stripe:yfiles.graph.IStripe):yfiles.collections.IEnumerable; + /** + * Returns the layout of item in absolute coordinates. + * Since {@link yfiles.graph.IStripe#layout} is relative to the owning node's left corner, you need to provide + * an owner node to calculate the absolute layout. + * @param {yfiles.graph.IStripe} item The stripe to calculate the layout for. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.INode} owner The node relative to which the stripe layout is calculated. This should be the same node where {@link yfiles.graph.IStripe#table} for item is associated to. + * @return {yfiles.geometry.RectD} + */ + getAbsoluteBounds(item:yfiles.graph.IStripe,owner:yfiles.graph.INode):yfiles.geometry.RectD; + /** + * Gets the insets that are currently in effect for this stripe. + * This value is determined by the accumulated insets of all ancestor, sibling and descendant insets. These insets may be larger than {@link yfiles.graph.IStripe#insets}. + * @param {yfiles.graph.IStripe} stripe The stripe to calculate the actual insets for. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.geometry.InsetsD} The actual insets of the stripe. + */ + getActualInsets(stripe:yfiles.graph.IStripe):yfiles.geometry.InsetsD; + /** + * The current actual dimension of the stripe. + * This is always the stripe size which is actually used for the stripe. For leaf stripes, this is the same as {@link yfiles.graph.IStripe#size}, otherwise, it is the + * accumulated size of all descendants with taking nested insets into account. + * @param {yfiles.graph.IStripe} stripe The stripe to calculate the actual size for. This is a this parameter, so that the method can be used + * as an extension method. + * @return {number} The actual size of the stripe. + */ + getActualSize(stripe:yfiles.graph.IStripe):number; + }; + /** + * A specialized {@link yfiles.graph.IGraphSelection} implementation that wraps an existing {@link yfiles.graph.IGraphSelection} and an existing + * {@link yfiles.graph.IStripeSelection} and synchronizes their state. + * An instance of this class is returned by {@link yfiles.input.GraphEditorInputMode#graphSelection} if a {@link yfiles.input.TableEditorInputMode} is installed as a child mode + * and its {@link yfiles.input.TableEditorInputMode#synchronizeWithGraphSelection} property is true. + */ + export interface CompositeStripeSelection extends Object,yfiles.graph.IGraphSelection,yfiles.system.IDisposable,yfiles.support.ILookup{ + /** + * The wrapped {@link yfiles.graph.IStripeSelection} instance. + */ + stripeSelection:yfiles.graph.IStripeSelection; + /** + * Raises the {@link yfiles.graph.CompositeStripeSelection#addItemSelectedListener ItemSelected} event. + * @param {yfiles.model.ItemEventArgs.} itemEventArgs The parameters for the event + */ + onItemSelected(itemEventArgs:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.CompositeStripeSelection#addItemDeselectedListener ItemDeselected} event. + * @param {yfiles.model.ItemEventArgs.} itemEventArgs The parameters for the event + */ + onItemDeselected(itemEventArgs:yfiles.model.ItemEventArgs):void; + /** + * Returns the number of selected items. + * @see Specified by {@link yfiles.model.ISelectionModel#count}. + */ + count:number; + /** + * An event that will be triggered if an item changed its selection state from + * unselected to selected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + addItemSelectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * unselected to selected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + removeItemSelectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * selected to unselected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + addItemDeselectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * selected to unselected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + removeItemDeselectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Whether to allow mixed selections of graph elements and table elements. + * Default is true. + */ + mixedSelectionAllowed:boolean; + /** + * Clears the selection. + * This is a convenience method that will set the selection state of all elements to + * unselected. + * @see {@link yfiles.model.ISelectionModel#addItemDeselectedListener ItemDeselected} + * @see Specified by {@link yfiles.model.ISelectionModel#clear}. + */ + clear():void; + /** + * Determines whether an item is currently selected. + * @param {T} o The item to check. + * @return {boolean} Whether it is currently selected. + * @see Specified by {@link yfiles.model.ISelectionModel#isSelected}. + */ + isSelected(o:yfiles.model.IModelItem):boolean; + /** + * Sets the selection state of an item. + * If the state changes, this will trigger the {@link yfiles.model.ISelectionModel#addItemSelectedListener ItemSelected} or + * {@link yfiles.model.ISelectionModel#addItemDeselectedListener ItemDeselected} events respectively. + * @param {T} o The object to set the selection state for. + * @param {boolean} selected Whether to select the object. + * @see Specified by {@link yfiles.model.ISelectionModel#setSelected}. + */ + setSelected(o:yfiles.model.IModelItem,selected:boolean):void; + /** + * An {@link yfiles.model.ISelectionModel} of the selected nodes. + * This is the node part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedNodes}. + */ + selectedNodes:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of the selected labels. + * This is the label part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedLabels}. + */ + selectedLabels:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of the selected edges. + * This is the edge part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedEdges}. + */ + selectedEdges:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of the selected ports. + * This is the ports part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedPorts}. + */ + selectedPorts:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of the selected bends. + * This is the bend part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedBends}. + */ + selectedBends:yfiles.model.ISelectionModel; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Lookup implementation for this class. + * If this instances wraps a {@link yfiles.graph.GraphSelection} instance, queries to {@link yfiles.graph.GraphSelection} + * return that instance. Otherwise, this method returns null. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} The {@link yfiles.graph.GraphSelection} instance that is wrapped by this implementation, if any. + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + } + var CompositeStripeSelection:{ + $class:yfiles.lang.Class; + /** + * Wraps two existing selection models. + * @param {yfiles.graph.IGraphSelection} graphSelection The original graph selection + * @param {yfiles.graph.IStripeSelection} stripeSelection The stripe selection + */ + new (graphSelection:yfiles.graph.IGraphSelection,stripeSelection:yfiles.graph.IStripeSelection):yfiles.graph.CompositeStripeSelection; + }; + /** + * Default implementation of the {@link yfiles.graph.ITable} interface. + */ + export interface Table extends Object,yfiles.graph.ITable,yfiles.system.ICloneable{ + /** + * The toplevel {@link yfiles.graph.IRow}s in this table. + */ + rows:yfiles.collections.IEnumerable; + /** + * The toplevel {@link yfiles.graph.IColumn}s in this table. + */ + columns:yfiles.collections.IEnumerable; + /** + * Gets or sets the insets for this table. + * These insets are applied in addition to any implicit insets provided by the child stripes. + * @see Specified by {@link yfiles.graph.ITable#insets}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Gets or sets the relative location of the upper left corner of the table. + * The actual interpretation of this value depends on the context. If the table is bound to a node, this location is usually interpreted + * relative to the upper left corner of the node layout. + * @see {@link yfiles.graph.ITable#layout} + * @see Specified by {@link yfiles.graph.ITable#relativeLocation}. + */ + relativeLocation:yfiles.geometry.PointD; + /** + * Gets or relative layout of the table. + * The upper left corner of the layout always coincides with {@link yfiles.graph.Table#relativeLocation}. + * @see {@link yfiles.graph.Table#relativeLocation} + * @see Specified by {@link yfiles.graph.ITable#layout}. + */ + layout:yfiles.geometry.IRectangle; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Create a new row as the indexth child of owner with the given parameters. + * @param {yfiles.graph.IRow} owner The owner of the new row. + * @param {number} index The position in the child list. + * @param {number} height The actual height of the row. + * @param {number} minHeight The minimal height of the row. + * @param {yfiles.geometry.InsetsD} insets The insets of the row. + * @param {yfiles.drawing.INodeStyle} style The style of the row. + * @param {Object} tag The tag of the row + * @return {yfiles.graph.IRow} A new row instance + * @see Specified by {@link yfiles.graph.ITable#createRowAtIndexWithSizeInsetsStyleAndTag}. + */ + createRowAtIndexWithSizeInsetsStyleAndTag(owner:yfiles.graph.IRow,index:number,height:number,minHeight:number,insets:yfiles.geometry.InsetsD,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IRow; + /** + * Create a new column as the indexth child of owner with the given parameters. + * @param {yfiles.graph.IColumn} owner The owner of the new column. + * @param {number} index The position in the child list. + * @param {number} width The actual width of the column. + * @param {number} minWidth The minimal width of the column. + * @param {yfiles.geometry.InsetsD} insets The insets of the column. + * @param {yfiles.drawing.INodeStyle} style The style of the column. + * @param {Object} tag The tag of the column + * @return {yfiles.graph.IColumn} A new column instance + * @see Specified by {@link yfiles.graph.ITable#createColumnAtIndexWithSizeInsetsStyleAndTag}. + */ + createColumnAtIndexWithSizeInsetsStyleAndTag(owner:yfiles.graph.IColumn,index:number,width:number,minWidth:number,insets:yfiles.geometry.InsetsD,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IColumn; + /** + * Called after a stripe has been added to a table. + * This method triggers the corresponding events. + * @param {yfiles.graph.IStripe} stripe The stripe that has just been added. + */ + onStripeAdded(stripe:yfiles.graph.IStripe):void; + /** + * Event that is triggered if a stripe has been added. + * @see {@link yfiles.graph.ITable#createRowAtIndexWithSizeInsetsStyleAndTag} + * @see {@link yfiles.graph.ITable#createColumnAtIndexWithSizeInsetsStyleAndTag} + */ + addStripeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a stripe has been added. + * @see {@link yfiles.graph.ITable#createRowAtIndexWithSizeInsetsStyleAndTag} + * @see {@link yfiles.graph.ITable#createColumnAtIndexWithSizeInsetsStyleAndTag} + */ + removeStripeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Removes stripe from its parent container. + * This method reparents all children of stripe to the parent of the stripe. + * @param {yfiles.graph.IStripe} stripe The stripe to remove + * @see Specified by {@link yfiles.graph.ITable#removeStripe}. + */ + removeStripe(stripe:yfiles.graph.IStripe):void; + /** + * Called after a label has been removed from its stripe. + * This method triggers the corresponding events. + * @param {yfiles.graph.IStripe} label The label that has just been removed. + * @param {yfiles.graph.IStripe} owner The old owner of the label. + */ + onStripeRemoved(owner:yfiles.graph.IStripe,label:yfiles.graph.IStripe):void; + /** + * Event that is triggered if a stripe has been removed from its parent. + * @see {@link yfiles.graph.Table#removeStripe} + */ + addStripeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a stripe has been removed from its parent. + * @see {@link yfiles.graph.Table#removeStripe} + */ + removeStripeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Allows to provide an own implementation of {@link yfiles.support.IUndoSupport} + * for this table. + * This implementation tries to find the {@link yfiles.support.IUndoSupport} either + * directly in the table {@link yfiles.graph.Table#lookup} or from a graph instance that is available through + * {@link yfiles.graph.Table#lookup}. If this method returns null, undo is disabled for this table instance. + * @return {yfiles.support.IUndoSupport} + */ + getUndoSupport():yfiles.support.IUndoSupport; + /** + * Register an {@link yfiles.support.IUndoSupport} instance on a concrete table instance. + */ + registerUndoSupport(support:yfiles.support.IUndoSupport):void; + /** + * Remove an {@link yfiles.support.IUndoSupport} instance that has been previously registered with {@link yfiles.graph.Table#registerUndoSupport}. + */ + removeUndoSupport():void; + /** + * Sets the actual size of stripe. + * This method sets the {@link yfiles.graph.IStripe#size} of stripe. + * @param {yfiles.graph.IStripe} stripe The stripe to change + * @param {number} newSize The new size of the stripe + * @see Specified by {@link yfiles.graph.ITable#setSize}. + */ + setSize(stripe:yfiles.graph.IStripe,newSize:number):void; + /** + * Sets the minimum size of stripe. + * This method sets the {@link yfiles.graph.IStripe#minimumSize} of stripe. + * @param {yfiles.graph.IStripe} stripe The stripe to change + * @param {number} minimumSize The new minimum size of the stripe + * @see Specified by {@link yfiles.graph.ITable#setMinimumSize}. + */ + setMinimumSize(stripe:yfiles.graph.IStripe,minimumSize:number):void; + /** + * Sets the insets of stripe. + * @param {yfiles.graph.IStripe} stripe The stripe to change + * @param {yfiles.geometry.InsetsD} insets The new insets of the stripe + * @see Specified by {@link yfiles.graph.ITable#setInsets}. + */ + setInsets(stripe:yfiles.graph.IStripe,insets:yfiles.geometry.InsetsD):void; + /** + * Sets the style of stripe. + * @param {yfiles.graph.IStripe} stripe The stripe to change + * @param {yfiles.drawing.INodeStyle} style The new style of the stripe + * @see Specified by {@link yfiles.graph.ITable#setStripeStyle}. + */ + setStripeStyle(stripe:yfiles.graph.IStripe,style:yfiles.drawing.INodeStyle):void; + /** + * Callback that is invoked after a stripe has changed. + * This will trigger the {@link yfiles.graph.Table#addStripeChangedListener StripeChanged} event. + * @param {yfiles.graph.IStripe} owner The original owner + * @param {yfiles.graph.IStripe} stripe The stripe that has changed. + */ + onStripeChanged(owner:yfiles.graph.IStripe,stripe:yfiles.graph.IStripe):void; + /** + * Event that is triggered if a stripe has been changed, e.g. if its style + * has been replaced. + * @see {@link yfiles.graph.ITable#setStripeStyle} + * @see {@link yfiles.graph.ITable#setInsets} + * @see {@link yfiles.graph.ITable#setSize} + * @see {@link yfiles.graph.ITable#setMinimumSize} + */ + addStripeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a stripe has been changed, e.g. if its style + * has been replaced. + * @see {@link yfiles.graph.ITable#setStripeStyle} + * @see {@link yfiles.graph.ITable#setInsets} + * @see {@link yfiles.graph.ITable#setSize} + * @see {@link yfiles.graph.ITable#setMinimumSize} + */ + removeStripeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Sets owner as new parent of row. + * The row will be inserted at position index in the child list of the new parent. + * @param {yfiles.graph.IRow} owner + * @param {yfiles.graph.IRow} row + * @param {number} index + * @see Specified by {@link yfiles.graph.ITable#setRowParentAtIndex}. + */ + setRowParentAtIndex(owner:yfiles.graph.IRow,row:yfiles.graph.IRow,index:number):void; + /** + * Sets owner as new parent of column. + * The column will be inserted at position index in the child list of the new parent. + * @param {yfiles.graph.IColumn} owner + * @param {yfiles.graph.IColumn} column + * @param {number} index + * @see Specified by {@link yfiles.graph.ITable#setColumnParentAtIndex}. + */ + setColumnParentAtIndex(owner:yfiles.graph.IColumn,column:yfiles.graph.IColumn,index:number):void; + /** + * Add a label to the given item using the text as the initial label text and label model parameter and style. + * @param {yfiles.graph.IStripe} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} labelModelParameter The label model parameter instance to use. + * @param {string} text the initial text of the label + * @param {yfiles.drawing.ILabelStyle} style The style to use for the label + * @param {yfiles.geometry.SizeD} preferredSize The initial values to use for the {@link yfiles.graph.ILabel#preferredSize}. + * @param {Object} tag the initial {@link yfiles.support.ITagOwner#tag} to assign. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.ITable#setLabelText} + * @see {@link yfiles.graph.ITable#setLabelModelParameter} + * @see {@link yfiles.graph.ITable#setLabelStyle} + * @see Specified by {@link yfiles.graph.ITable#addLabelWithParameterStylePreferredSizeAndTag}. + */ + addLabelWithParameterStylePreferredSizeAndTag(item:yfiles.graph.IStripe,labelModelParameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,preferredSize:yfiles.geometry.SizeD,tag:Object):yfiles.graph.ILabel; + /** + * Sets the label text of the given label. + * @param {yfiles.graph.ILabel} label the label to modify + * @param {string} text the new text of the label + * @throws {yfiles.system.ArgumentException} If the label is not associated with this table instance. + * @see {@link yfiles.graph.ILabel#text} + * @see Specified by {@link yfiles.graph.ITable#setLabelText}. + */ + setLabelText(label:yfiles.graph.ILabel,text:string):void; + /** + * Removes the given label from its owner. + * This will trigger the corresponding event. + * @param {yfiles.graph.ILabel} label the label to remove + * @throws {yfiles.system.ArgumentException} If the label is not associated with this table instance. + * @see Specified by {@link yfiles.graph.ITable#removeLabel}. + */ + removeLabel(label:yfiles.graph.ILabel):void; + /** + * Sets the preferred size of the label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.geometry.SizeD} preferredSize The new preferred size. + * @throws {yfiles.system.ArgumentException} If the label is not associated with this table instance. + * @see {@link yfiles.graph.ILabel#preferredSize} + * @see Specified by {@link yfiles.graph.ITable#setPreferredSize}. + */ + setPreferredSize(label:yfiles.graph.ILabel,preferredSize:yfiles.geometry.SizeD):void; + /** + * Sets the label model parameter for the given label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.graph.ILabelModelParameter} parameter The new parameter. + * @throws {yfiles.system.ArgumentException} If the parameter cannot be used for this label or if the label is not associated with this table instance. + * @see Specified by {@link yfiles.graph.ITable#setLabelModelParameter}. + */ + setLabelModelParameter(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):void; + /** + * Assigns the given style instance by reference to the label. + * Style instances can be shared. + * @param {yfiles.graph.ILabel} label The label that will be assigned the new style + * @param {yfiles.drawing.ILabelStyle} style The style instance that will be assigned to the label. + * @see {@link yfiles.graph.ILabel#style} + * @see Specified by {@link yfiles.graph.ITable#setLabelStyle}. + */ + setLabelStyle(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle):void; + /** + * Called after a label has been added to a stripe. + * This method triggers the corresponding events. + * @param {yfiles.graph.ILabel} label The label that has just been added. + */ + onLabelAdded(label:yfiles.graph.ILabel):void; + /** + * Callback that is invoked after a label has changed. + * This will trigger the {@link yfiles.graph.Table#addLabelChangedListener LabelChanged} event. + * @param {yfiles.graph.ILabel} label The label that has changed. + */ + onLabelChanged(label:yfiles.graph.ILabel):void; + /** + * Called after a label has been removed from its stripe. + * This method triggers the corresponding events. + * @param {yfiles.graph.ILabel} label The label that has just been removed. + * @param {yfiles.graph.ILabeledItem} owner The old owner of the label. + */ + onLabelRemoved(owner:yfiles.graph.ILabeledItem,label:yfiles.graph.ILabel):void; + /** + * Event that is triggered if a label has been added to this graph instance. + * @see {@link yfiles.graph.ITable#addLabelWithParameterStylePreferredSizeAndTag} + */ + addLabelAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been added to this graph instance. + * @see {@link yfiles.graph.ITable#addLabelWithParameterStylePreferredSizeAndTag} + */ + removeLabelAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been removed from this graph instance. + * This event will also be triggered, prior to the removal of the {@link yfiles.graph.ILabel#owner owner} + * of the label. + * Implementations may choose to use the {@link yfiles.graph.StripeEventArgs} to carry + * additional label owner information. The {@link yfiles.graph.StripeEventArgs#owner} + * property will be set to the the owner of the label + * that owned it before the removal. + * @see {@link yfiles.graph.ITable#removeLabel} + */ + addLabelRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been removed from this graph instance. + * This event will also be triggered, prior to the removal of the {@link yfiles.graph.ILabel#owner owner} + * of the label. + * Implementations may choose to use the {@link yfiles.graph.StripeEventArgs} to carry + * additional label owner information. The {@link yfiles.graph.StripeEventArgs#owner} + * property will be set to the the owner of the label + * that owned it before the removal. + * @see {@link yfiles.graph.ITable#removeLabel} + */ + removeLabelRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been changed, e.g. if its style + * has been replaced. + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + addLabelChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been changed, e.g. if its style + * has been replaced. + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + removeLabelChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Gets or sets the defaults for rows. + * The settings that are obtained from the instance influence newly + * created elements only. Setting different defaults later + * does not influence existing elements. + * @see Specified by {@link yfiles.graph.ITable#rowDefaults}. + */ + rowDefaults:yfiles.graph.IStripeDefaults; + /** + * Callback method that creates the row defaults. + * @return {yfiles.graph.IStripeDefaults} A new instance of the {@link yfiles.graph.StripeDefaults} class that is populated + * using the return values of {@link yfiles.graph.Table#createDefaultRowStyle}, {@link yfiles.graph.Table#createRowLabelDefaults} and {@link yfiles.graph.Table#createDefaultRowInsets}. + */ + createRowDefaults():yfiles.graph.IStripeDefaults; + /** + * Factory method for the default Row insets. This method will be called + * upon first access to the {@link yfiles.graph.Table#rowDefaults} property. + */ + createDefaultRowInsets():yfiles.geometry.InsetsD; + /** + * Callback method that creates the row label defaults. + * @return {yfiles.graph.ILabelDefaults} A new instance of the {@link yfiles.graph.LabelDefaults} class that is populated + * using the return values of {@link yfiles.graph.Table#createDefaultRowLabelStyle} and {@link yfiles.graph.Table#createDefaultRowLabelModelParameter}. + */ + createRowLabelDefaults():yfiles.graph.ILabelDefaults; + /** + * Factory method for the default row style. This method will be called + * upon first access to the {@link yfiles.graph.Table#rowDefaults} property. + * @return {yfiles.drawing.INodeStyle} a new instance of {@link yfiles.drawing.ShapeNodeStyle} + */ + createDefaultRowStyle():yfiles.drawing.INodeStyle; + /** + * Factory method for the default row label style. This method will be called + * upon first access to the {@link yfiles.graph.Table#rowDefaults} property. + * @return {yfiles.drawing.ILabelStyle} a new instance of {@link yfiles.drawing.SimpleLabelStyle} + */ + createDefaultRowLabelStyle():yfiles.drawing.ILabelStyle; + /** + * Factory method that obtains a {@link yfiles.graph.ILabelModelParameter} + * to use for a newly created row label. + * This implementation returns the {@link yfiles.drawing.StretchStripeLabelModel#WEST} parameter. + * @return {yfiles.graph.ILabelModelParameter} A model parameter instance to use for the newly created row label. + */ + createDefaultRowLabelModelParameter():yfiles.graph.ILabelModelParameter; + /** + * Gets or sets the defaults for Columns. + * The settings that are obtained from the instance influence newly + * created elements only. Setting different defaults later + * does not influence existing elements. + * @see Specified by {@link yfiles.graph.ITable#columnDefaults}. + */ + columnDefaults:yfiles.graph.IStripeDefaults; + /** + * Callback method that creates the Column defaults. + * @return {yfiles.graph.IStripeDefaults} A new instance of the {@link yfiles.graph.StripeDefaults} class that is populated + * using the return values of {@link yfiles.graph.Table#createDefaultColumnStyle}, {@link yfiles.graph.Table#createColumnLabelDefaults} and {@link yfiles.graph.Table#createDefaultColumnInsets}. + */ + createColumnDefaults():yfiles.graph.IStripeDefaults; + /** + * Factory method for the default Column insets. This method will be called + * upon first access to the {@link yfiles.graph.Table#columnDefaults} property. + */ + createDefaultColumnInsets():yfiles.geometry.InsetsD; + /** + * Callback method that creates the Column label defaults. + * @return {yfiles.graph.ILabelDefaults} A new instance of the {@link yfiles.graph.LabelDefaults} class that is populated + * using the return values of {@link yfiles.graph.Table#createDefaultColumnLabelStyle} and {@link yfiles.graph.Table#createDefaultColumnLabelModelParameter}. + */ + createColumnLabelDefaults():yfiles.graph.ILabelDefaults; + /** + * Factory method for the default Column style. This method will be called + * upon first access to the {@link yfiles.graph.Table#columnDefaults} property. + * @return {yfiles.drawing.INodeStyle} a new instance of {@link yfiles.drawing.ShapeNodeStyle} + */ + createDefaultColumnStyle():yfiles.drawing.INodeStyle; + /** + * Factory method for the default Column label style. This method will be called + * upon first access to the {@link yfiles.graph.Table#columnDefaults} property. + * @return {yfiles.drawing.ILabelStyle} a new instance of {@link yfiles.drawing.SimpleLableStyle} + */ + createDefaultColumnLabelStyle():yfiles.drawing.ILabelStyle; + /** + * Factory method that obtains a {@link yfiles.graph.ILabelModelParameter} + * to use for a newly created Column label. + * This implementation returns the {@link yfiles.drawing.StretchStripeLabelModel#NORTH} parameter. + * @return {yfiles.graph.ILabelModelParameter} A model parameter instance to use for the newly created Column label. + */ + createDefaultColumnLabelModelParameter():yfiles.graph.ILabelModelParameter; + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + /** + * Called during {@link yfiles.graph.Table#clone} to create a copy of originalDefaults. + * This implementation returns an unchanged reference to originalDefaults. If you need to create a deep clone of originalDefaults, you'll have to + * perform the cloning yourself. + * @param {yfiles.graph.IStripeDefaults} originalDefaults The default settings that should be copied during a clone operation. + * @return {yfiles.graph.IStripeDefaults} The original reference to originalDefaults + */ + copyDefaults(originalDefaults:yfiles.graph.IStripeDefaults):yfiles.graph.IStripeDefaults; + /** + * Called during {@link yfiles.graph.Table#clone} to create a copy of row. + * If row implements the {@link yfiles.system.ICloneable} interface, the row instance is {@link yfiles.system.ICloneable#clone}d, otherwise, the original instance is returned unchanged. + * @param {yfiles.graph.IRow} row The row that should be copied during a clone operation. + * @return {yfiles.graph.IRow} A clone of row if possible, otherwise the original reference to row + */ + copyRow(row:yfiles.graph.IRow):yfiles.graph.IRow; + /** + * Called during {@link yfiles.graph.Table#clone} to create a copy of column. + * If column implements the {@link yfiles.system.ICloneable} interface, the column instance is {@link yfiles.system.ICloneable#clone}d, otherwise, the original instance is returned unchanged. + * @param {yfiles.graph.IColumn} column The column that should be copied during a clone operation. + * @return {yfiles.graph.IColumn} A clone of column if possible, otherwise the original reference to column + */ + copyColumn(column:yfiles.graph.IColumn):yfiles.graph.IColumn; + /** + * Gets the virtual root of the row hierarchy. + * This row should not be queried except for the {@link yfiles.graph.IRow#owner} and the associated {@link yfiles.graph.IStripe#table} + * @see {@link yfiles.graph.ITable#setRowParentAtIndex} + * @see {@link yfiles.graph.ITable#createRowAtIndexWithSizeInsetsStyleAndTag} + * @see Specified by {@link yfiles.graph.ITable#rootRow}. + */ + rootRow:yfiles.graph.IRow; + /** + * Gets the virtual root of the column hierarchy. + * This column should not be queried except for the {@link yfiles.graph.IColumn#owner} and the associated {@link yfiles.graph.IStripe#table} + * @see {@link yfiles.graph.ITable#setColumnParentAtIndex} + * @see {@link yfiles.graph.ITable#createColumnAtIndexWithSizeInsetsStyleAndTag} + * @see Specified by {@link yfiles.graph.ITable#rootColumn}. + */ + rootColumn:yfiles.graph.IColumn; + } + var Table:{ + $class:yfiles.lang.Class; + /** + * Default constructor that creates an empty table. + */ + new ():yfiles.graph.Table; + /** + * Register a fixed undoSupport instance for use with all tables that are bound to nodes in graph. + * This method registers undoSupport both for existing nodes in graph as well as for newly created or changed + * nodes. + * @param {yfiles.graph.IGraph} graph The graph where the nodes exist or will be created/changed. + * @param {yfiles.support.IUndoSupport} undoSupport The undo support that should be used for table nodes in graph + * @see {@link yfiles.graph.Table#unregisterStaticUndoSupport} + */ + registerStaticUndoSupport(graph:yfiles.graph.IGraph,undoSupport:yfiles.support.IUndoSupport):void; + /** + * Register a dynamic {@link yfiles.support.IUndoSupport} for use with all tables that are bound to nodes in graph. + * This method retrieves the {@link yfiles.support.IUndoSupport} implementation from graph dynamically whenever undo support is queried in the table. + * @param {yfiles.graph.IGraph} graph The graph where the nodes exist or will be created/changed and where the undo support should come from. + * @see {@link yfiles.graph.Table#unregisterDynamicUndoSupport} + */ + registerDynamicUndoSupport(graph:yfiles.graph.IGraph):void; + /** + * Unregisters an {@link yfiles.support.IUndoSupport} implementation that has previously been registered with {@link yfiles.graph.Table#registerStaticUndoSupport}. + * @param {yfiles.graph.IGraph} graph The graph where the tables are installed for which the undo support should be cleared. + */ + unregisterStaticUndoSupport(graph:yfiles.graph.IGraph):void; + /** + * Unregisters an {@link yfiles.support.IUndoSupport} implementation that has previously been registered with {@link yfiles.graph.Table#registerDynamicUndoSupport}. + * @param {yfiles.graph.IGraph} graph The graph where the tables are installed for which the undo support should be cleared. + */ + unregisterDynamicUndoSupport(graph:yfiles.graph.IGraph):void; + }; + /** + * Manages the selection state of items in an {@link yfiles.graph.ITable} + * instance. + * This interface provides access to the {@link yfiles.model.ISelectionModel} + * instances that manage the selection of rows and columns. + * The generic methods that use {@link yfiles.model.IModelItem} parameters + * delegate to the corresponding domain-specific selection models. + * @see {@link yfiles.model.ISelectionModel} + */ + export interface IStripeSelection extends Object,yfiles.model.ISelectionModel{ + /** + * An {@link yfiles.model.ISelectionModel} of the selected rows. + * This is the row part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IStripeSelection#selectedRows}. + */ + selectedRows:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of the selected columns. + * This is the column part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IStripeSelection#selectedColumns}. + */ + selectedColumns:yfiles.model.ISelectionModel; + /** + * Whether to allow mixed row/column selections. + * @see Specified by {@link yfiles.graph.IStripeSelection#mixedSelectionAllowed}. + */ + mixedSelectionAllowed:boolean; + /** + * Whether to allow the selection to span multiple table instances. + * The default is false + * @see Specified by {@link yfiles.graph.IStripeSelection#crossTableSelectionAllowed}. + */ + crossTableSelectionAllowed:boolean; + /** + * An {@link yfiles.model.ISelectionModel} of all selected items. + * @see Specified by {@link yfiles.graph.IStripeSelection#selectedStripes}. + */ + selectedStripes:yfiles.model.ICollectionModel; + } + var IStripeSelection:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Default implementation of the {@link yfiles.graph.IStripeSelection} interface. + */ + export interface StripeSelection extends Object,yfiles.graph.IStripeSelection{ + /** + * Whether to allow mixed row/column selections. + * The default is false + * @see Specified by {@link yfiles.graph.IStripeSelection#mixedSelectionAllowed}. + */ + mixedSelectionAllowed:boolean; + /** + * Whether to allow the selection to span multiple table instances. + * The default is true + * @see Specified by {@link yfiles.graph.IStripeSelection#crossTableSelectionAllowed}. + */ + crossTableSelectionAllowed:boolean; + /** + * Raises the {@link yfiles.graph.StripeSelection#addItemSelectedListener ItemSelected} event. + * @param {yfiles.model.ItemEventArgs.} itemEventArgs The parameters for the event + */ + onItemSelected(itemEventArgs:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.StripeSelection#addItemDeselectedListener ItemDeselected} event. + * @param {yfiles.model.ItemEventArgs.} itemEventArgs The parameters for the event + */ + onItemDeselected(itemEventArgs:yfiles.model.ItemEventArgs):void; + /** + * An {@link yfiles.model.ISelectionModel} of the selected rows. + * This is the row part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IStripeSelection#selectedRows}. + */ + selectedRows:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of the selected columns. + * This is the column part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IStripeSelection#selectedColumns}. + */ + selectedColumns:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of all selected items. + * @see Specified by {@link yfiles.graph.IStripeSelection#selectedStripes}. + */ + selectedStripes:yfiles.model.ICollectionModel; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Return whether row is currently selected. + * @param {yfiles.graph.IRow} row The column to test + * @return {boolean} true iff row is currently selected + */ + isSelectedRow(row:yfiles.graph.IRow):boolean; + /** + * Return whether column is currently selected. + * @param {yfiles.graph.IColumn} column The column to test + * @return {boolean} true iff column is currently selected + */ + isSelectedColumn(column:yfiles.graph.IColumn):boolean; + /** + * Return whether stripe is currently selected. + * @param {yfiles.graph.IStripe} stripe The stripe to test + * @return {boolean} true iff stripe is currently selected + * @see Specified by {@link yfiles.model.ISelectionModel#isSelected}. + */ + isSelected(stripe:yfiles.graph.IStripe):boolean; + /** + * Changes the selection state of row to selected. + * @param {yfiles.graph.IRow} row The row whose selection state should be changed + * @param {boolean} selected true if row should be selected + */ + setSelectedRow(row:yfiles.graph.IRow,selected:boolean):void; + /** + * Changes the selection state of column to selected. + * @param {yfiles.graph.IColumn} column The column whose selection state should be changed + * @param {boolean} selected true if column should be selected + */ + setSelectedColumn(column:yfiles.graph.IColumn,selected:boolean):void; + /** + * Sets the selection state of an item. + * If the state changes, this will trigger the {@link yfiles.model.ISelectionModel#addItemSelectedListener ItemSelected} or + * {@link yfiles.model.ISelectionModel#addItemDeselectedListener ItemDeselected} events respectively. + * @param {T} o The object to set the selection state for. + * @param {boolean} selected Whether to select the object. + * @see Specified by {@link yfiles.model.ISelectionModel#setSelected}. + */ + setSelected(o:yfiles.graph.IStripe,selected:boolean):void; + /** + * Returns the number of selected items. + * @see Specified by {@link yfiles.model.ISelectionModel#count}. + */ + count:number; + /** + * An event that will be triggered if an item changed its selection state from + * unselected to selected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + addItemSelectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * unselected to selected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + removeItemSelectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * selected to unselected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + addItemDeselectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * selected to unselected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + removeItemDeselectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Clears the selection. + * This is a convenience method that will set the selection state of all elements to + * unselected. + * @see {@link yfiles.model.ISelectionModel#addItemDeselectedListener ItemDeselected} + * @see Specified by {@link yfiles.model.ISelectionModel#clear}. + */ + clear():void; + } + var StripeSelection:{ + $class:yfiles.lang.Class; + /** + * Default constructor that creates empty selection models. + */ + new ():yfiles.graph.StripeSelection; + }; + /** + * Interface that describes a column in a {@link yfiles.graph.ITable} instance. + * Default implementations of this interface are created by the factory methods in the {@link yfiles.graph.ITable} interface + * and its implementations, therefore, it usually shouldn't be necessary to implement this interface yourself. + * @see {@link yfiles.graph.ITable#createColumnAtIndexWithSizeInsetsStyleAndTag} + */ + export interface IColumn extends Object,yfiles.graph.IStripe{ + /** + * Returns the parent of this column. + * In a table, each column has a parent, except for the {@link yfiles.graph.ITable#rootColumn} hierarchy root. + * @see Specified by {@link yfiles.graph.IColumn#owner}. + */ + owner:yfiles.graph.IColumn; + /** + * Returns the child columns. + * This collection may be empty. Each entry in this collection has this instance as {@link yfiles.graph.IColumn#owner}. + * @see Specified by {@link yfiles.graph.IColumn#columns}. + */ + columns:yfiles.collections.IEnumerable; + } + var IColumn:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that describes a row in a {@link yfiles.graph.ITable} instance. + * Default implementations of this interface are created by the factory methods in the {@link yfiles.graph.ITable} interface + * and its implementations, therefore, it usually shouldn't be necessary to implement this interface yourself. + * @see {@link yfiles.graph.ITable#createRowAtIndexWithSizeInsetsStyleAndTag} + */ + export interface IRow extends Object,yfiles.graph.IStripe{ + /** + * Returns the parent of this row. + * In a table, each row has a parent, except for the {@link yfiles.graph.ITable#rootRow} hierarchy root. + * @see Specified by {@link yfiles.graph.IRow#owner}. + */ + owner:yfiles.graph.IRow; + /** + * Returns the child rows. + * This collection may be empty. Each entry in this collection has this instance as {@link yfiles.graph.IRow#owner}. + * @see Specified by {@link yfiles.graph.IRow#rows}. + */ + rows:yfiles.collections.IEnumerable; + } + var IRow:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A simple implementation of the {@link yfiles.model.IListEnumerable} + * interface for {@link yfiles.graph.ILabel}s that is backed by a list. + */ + export interface ListLabelCollection extends Object,yfiles.model.IListEnumerable{ + /** + * The backing list. + */ + labels:yfiles.collections.IList; + /** + * Returns the number of elements in this collection. + * @see Specified by {@link yfiles.model.IListEnumerable#count}. + */ + count:number; + /** + * Returns the i-th element in the collection. + * @param {number} i the zero-based index of the item in this collection + * @return {T} the item for the given index + * @see Specified by {@link yfiles.model.IListEnumerable#getItem}. + */ + getItem(i:number):yfiles.graph.ILabel; + /** + * Add a new label to this collection. + * @param {yfiles.graph.ILabel} label The label to add. + */ + add(label:yfiles.graph.ILabel):void; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Remove a label from this collection. + * @param {yfiles.graph.ILabel} label The label to remove + */ + remove(label:yfiles.graph.ILabel):void; + } + var ListLabelCollection:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.ListLabelCollection} class + * using the provided instance as the backing store. + * @param {yfiles.collections.IList.} labels The labels collection. + */ + FromList:{ + new (labels:yfiles.collections.IList):yfiles.graph.ListLabelCollection; + }; + /** + * Initializes a new instance of the {@link yfiles.graph.ListLabelCollection} class + * using a default backing store. + */ + new ():yfiles.graph.ListLabelCollection; + }; + /** + * This interface defines a table structure. + */ + export interface ITable extends Object,yfiles.support.ILookup{ + /** + * Gets or sets the insets for this table. + * These insets are applied in addition to any implicit insets provided by the child stripes. + * @see Specified by {@link yfiles.graph.ITable#insets}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Gets or sets the relative location of the upper left corner of the table. + * The actual interpretation of this value depends on the context. If the table is bound to a node, this location is usually interpreted + * relative to the upper left corner of the node layout. + * @see {@link yfiles.graph.ITable#layout} + * @see Specified by {@link yfiles.graph.ITable#relativeLocation}. + */ + relativeLocation:yfiles.geometry.PointD; + /** + * Gets the relative layout of the table. + * The upper left corner of the layout always coincides with {@link yfiles.graph.ITable#relativeLocation}. + * @see {@link yfiles.graph.ITable#relativeLocation} + * @see Specified by {@link yfiles.graph.ITable#layout}. + */ + layout:yfiles.geometry.IRectangle; + /** + * Gets or sets the defaults for rows. + * The settings that are obtained from the instance influence newly + * created elements only. Setting different defaults later + * does not influence existing elements. + * @see Specified by {@link yfiles.graph.ITable#rowDefaults}. + */ + rowDefaults:yfiles.graph.IStripeDefaults; + /** + * Gets or sets the defaults for Columns. + * The settings that are obtained from the instance influence newly + * created elements only. Setting different defaults later + * does not influence existing elements. + * @see Specified by {@link yfiles.graph.ITable#columnDefaults}. + */ + columnDefaults:yfiles.graph.IStripeDefaults; + /** + * Gets the virtual root of the row hierarchy. + * This row should not be queried except for the {@link yfiles.graph.IRow#owner} and the associated {@link yfiles.graph.IStripe#table} + * @see {@link yfiles.graph.ITable#setRowParentAtIndex} + * @see {@link yfiles.graph.ITable#createRowAtIndexWithSizeInsetsStyleAndTag} + * @see Specified by {@link yfiles.graph.ITable#rootRow}. + */ + rootRow:yfiles.graph.IRow; + /** + * Gets the virtual root of the column hierarchy. + * This column should not be queried except for the {@link yfiles.graph.IColumn#owner} and the associated {@link yfiles.graph.IStripe#table} + * @see {@link yfiles.graph.ITable#setColumnParentAtIndex} + * @see {@link yfiles.graph.ITable#createColumnAtIndexWithSizeInsetsStyleAndTag} + * @see Specified by {@link yfiles.graph.ITable#rootColumn}. + */ + rootColumn:yfiles.graph.IColumn; + /** + * Add a label to the given item using the text as the initial label text and label model parameter and style. + * @param {yfiles.graph.IStripe} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} labelModelParameter The label model parameter instance to use. + * @param {string} text the initial text of the label + * @param {yfiles.drawing.ILabelStyle} style The style to use for the label + * @param {yfiles.geometry.SizeD} preferredSize The initial values to use for the {@link yfiles.graph.ILabel#preferredSize}. + * @param {Object} tag the initial {@link yfiles.support.ITagOwner#tag} to assign. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.ITable#setLabelText} + * @see {@link yfiles.graph.ITable#setLabelModelParameter} + * @see {@link yfiles.graph.ITable#setLabelStyle} + * @see Specified by {@link yfiles.graph.ITable#addLabelWithParameterStylePreferredSizeAndTag}. + */ + addLabelWithParameterStylePreferredSizeAndTag(item:yfiles.graph.IStripe,labelModelParameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,preferredSize:yfiles.geometry.SizeD,tag:Object):yfiles.graph.ILabel; + /** + * Sets the label text of the given label. + * @param {yfiles.graph.ILabel} label the label to modify + * @param {string} text the new text of the label + * @see {@link yfiles.graph.ILabel#text} + * @see Specified by {@link yfiles.graph.ITable#setLabelText}. + */ + setLabelText(label:yfiles.graph.ILabel,text:string):void; + /** + * Removes the given label from its owner. + * This will trigger the corresponding event. + * @param {yfiles.graph.ILabel} label the label to remove + * @see Specified by {@link yfiles.graph.ITable#removeLabel}. + */ + removeLabel(label:yfiles.graph.ILabel):void; + /** + * Sets the preferred size of the label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.geometry.SizeD} preferredSize The new preferred size. + * @see {@link yfiles.graph.ILabel#preferredSize} + * @see Specified by {@link yfiles.graph.ITable#setPreferredSize}. + */ + setPreferredSize(label:yfiles.graph.ILabel,preferredSize:yfiles.geometry.SizeD):void; + /** + * Sets the label model parameter for the given label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.graph.ILabelModelParameter} parameter The new parameter. + * @throws {yfiles.system.ArgumentException} If the parameter cannot be used for this label. + * @see Specified by {@link yfiles.graph.ITable#setLabelModelParameter}. + */ + setLabelModelParameter(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):void; + /** + * Assigns the given style instance by reference to the label. + * Style instances can be shared. + * @param {yfiles.graph.ILabel} label The label that will be assigned the new style + * @param {yfiles.drawing.ILabelStyle} style The style instance that will be assigned to the label. + * @see {@link yfiles.graph.ILabel#style} + * @see Specified by {@link yfiles.graph.ITable#setLabelStyle}. + */ + setLabelStyle(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle):void; + /** + * Event that is triggered if a label has been added to this graph instance. + * @see {@link yfiles.graph.ITable#addLabelWithParameterStylePreferredSizeAndTag} + */ + addLabelAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been added to this graph instance. + * @see {@link yfiles.graph.ITable#addLabelWithParameterStylePreferredSizeAndTag} + */ + removeLabelAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been removed from this graph instance. + * This event will also be triggered, prior to the removal of the {@link yfiles.graph.ILabel#owner owner} + * of the label. + * Implementations may choose to use the {@link yfiles.graph.StripeEventArgs} to carry + * additional label owner information. The {@link yfiles.graph.StripeEventArgs#owner} + * property will be set to the the owner of the label + * that owned it before the removal. + * @see {@link yfiles.graph.ITable#removeLabel} + */ + addLabelRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been removed from this graph instance. + * This event will also be triggered, prior to the removal of the {@link yfiles.graph.ILabel#owner owner} + * of the label. + * Implementations may choose to use the {@link yfiles.graph.StripeEventArgs} to carry + * additional label owner information. The {@link yfiles.graph.StripeEventArgs#owner} + * property will be set to the the owner of the label + * that owned it before the removal. + * @see {@link yfiles.graph.ITable#removeLabel} + */ + removeLabelRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been changed, e.g. if its style + * has been replaced. + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + addLabelChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been changed, e.g. if its style + * has been replaced. + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + removeLabelChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Create a new row as the indexth child of owner with the given parameters. + * @param {yfiles.graph.IRow} owner The owner of the new row. + * @param {number} index The position in the child list. + * @param {number} height The actual height of the row. + * @param {number} minHeight The minimal height of the row. + * @param {yfiles.geometry.InsetsD} insets The insets of the row. + * @param {yfiles.drawing.INodeStyle} style The style of the row. + * @param {Object} tag The tag of the row + * @return {yfiles.graph.IRow} A new row instance + * @see Specified by {@link yfiles.graph.ITable#createRowAtIndexWithSizeInsetsStyleAndTag}. + */ + createRowAtIndexWithSizeInsetsStyleAndTag(owner:yfiles.graph.IRow,index:number,height:number,minHeight:number,insets:yfiles.geometry.InsetsD,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IRow; + /** + * Create a new column as the indexth child of owner with the given parameters. + * @param {yfiles.graph.IColumn} owner The owner of the new column. + * @param {number} index The position in the child list. + * @param {number} width The actual width of the column. + * @param {number} minWidth The minimal width of the column. + * @param {yfiles.geometry.InsetsD} insets The insets of the column. + * @param {yfiles.drawing.INodeStyle} style The style of the column. + * @param {Object} tag The tag of the column + * @return {yfiles.graph.IColumn} A new column instance + * @see Specified by {@link yfiles.graph.ITable#createColumnAtIndexWithSizeInsetsStyleAndTag}. + */ + createColumnAtIndexWithSizeInsetsStyleAndTag(owner:yfiles.graph.IColumn,index:number,width:number,minWidth:number,insets:yfiles.geometry.InsetsD,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IColumn; + /** + * Event that is triggered if a stripe has been added. + * @see {@link yfiles.graph.ITable#createRowAtIndexWithSizeInsetsStyleAndTag} + * @see {@link yfiles.graph.ITable#createColumnAtIndexWithSizeInsetsStyleAndTag} + */ + addStripeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a stripe has been added. + * @see {@link yfiles.graph.ITable#createRowAtIndexWithSizeInsetsStyleAndTag} + * @see {@link yfiles.graph.ITable#createColumnAtIndexWithSizeInsetsStyleAndTag} + */ + removeStripeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a stripe has been removed from its parent. + * @see {@link yfiles.graph.Table#removeStripe} + */ + addStripeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a stripe has been removed from its parent. + * @see {@link yfiles.graph.Table#removeStripe} + */ + removeStripeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Sets the actual size of stripe. + * This method sets the {@link yfiles.graph.IStripe#size} of stripe. + * @param {yfiles.graph.IStripe} stripe The stripe to change + * @param {number} newSize The new size of the stripe + * @see Specified by {@link yfiles.graph.ITable#setSize}. + */ + setSize(stripe:yfiles.graph.IStripe,newSize:number):void; + /** + * Sets the minimum size of stripe. + * This method sets the {@link yfiles.graph.IStripe#minimumSize} of stripe. + * @param {yfiles.graph.IStripe} stripe The stripe to change + * @param {number} minimumSize The new minimum size of the stripe + * @see Specified by {@link yfiles.graph.ITable#setMinimumSize}. + */ + setMinimumSize(stripe:yfiles.graph.IStripe,minimumSize:number):void; + /** + * Sets the insets of stripe. + * @param {yfiles.graph.IStripe} stripe The stripe to change + * @param {yfiles.geometry.InsetsD} insets The new insets of the stripe + * @see Specified by {@link yfiles.graph.ITable#setInsets}. + */ + setInsets(stripe:yfiles.graph.IStripe,insets:yfiles.geometry.InsetsD):void; + /** + * Sets the style of stripe. + * @param {yfiles.graph.IStripe} stripe The stripe to change + * @param {yfiles.drawing.INodeStyle} style The new style of the stripe + * @see Specified by {@link yfiles.graph.ITable#setStripeStyle}. + */ + setStripeStyle(stripe:yfiles.graph.IStripe,style:yfiles.drawing.INodeStyle):void; + /** + * Event that is triggered if a stripe has been changed, e.g. if its style + * has been replaced. + * @see {@link yfiles.graph.ITable#setStripeStyle} + * @see {@link yfiles.graph.ITable#setInsets} + * @see {@link yfiles.graph.ITable#setSize} + * @see {@link yfiles.graph.ITable#setMinimumSize} + */ + addStripeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a stripe has been changed, e.g. if its style + * has been replaced. + * @see {@link yfiles.graph.ITable#setStripeStyle} + * @see {@link yfiles.graph.ITable#setInsets} + * @see {@link yfiles.graph.ITable#setSize} + * @see {@link yfiles.graph.ITable#setMinimumSize} + */ + removeStripeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Sets owner as new parent of row. + * The row will be inserted at position index in the child list of the new parent. + * @param {yfiles.graph.IRow} owner + * @param {yfiles.graph.IRow} row + * @param {number} index + * @see Specified by {@link yfiles.graph.ITable#setRowParentAtIndex}. + */ + setRowParentAtIndex(owner:yfiles.graph.IRow,row:yfiles.graph.IRow,index:number):void; + /** + * Sets owner as new parent of column. + * The column will be inserted at position index in the child list of the new parent. + * @param {yfiles.graph.IColumn} owner + * @param {yfiles.graph.IColumn} column + * @param {number} index + * @see Specified by {@link yfiles.graph.ITable#setColumnParentAtIndex}. + */ + setColumnParentAtIndex(owner:yfiles.graph.IColumn,column:yfiles.graph.IColumn,index:number):void; + /** + * Removes stripe from its parent container. + * This method reparents all children of stripe to the parent of the stripe. + * @param {yfiles.graph.IStripe} stripe The stripe to remove + * @see Specified by {@link yfiles.graph.ITable#removeStripe}. + */ + removeStripe(stripe:yfiles.graph.IStripe):void; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter and style. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#addLabelWithParameterAndStyle}. + * @param {yfiles.graph.IStripe} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {yfiles.drawing.ILabelStyle} style The style to assign to the new label. + * @param {string} text the initial text of the label + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.ITable#setLabelText} + * @see {@link yfiles.graph.ITable#setLabelModelParameter} + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + addLabelWithParameterAndStyle(item:yfiles.graph.IStripe,parameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter, preferred size, and style. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#addLabelWithParameterStyleAndPreferredSize}. + * @param {yfiles.graph.IStripe} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {yfiles.drawing.ILabelStyle} style The style to assign to the new label. + * @param {string} text the initial text of the label + * @param {yfiles.geometry.SizeD} preferredSize The initial preferred size to assign. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.ITable#setLabelText} + * @see {@link yfiles.graph.ITable#setLabelModelParameter} + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + addLabelWithParameterStyleAndPreferredSize(item:yfiles.graph.IStripe,parameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,preferredSize:yfiles.geometry.SizeD):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter and style. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#addLabelWithParameterStyleAndTag}. + * @param {yfiles.graph.IStripe} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {yfiles.drawing.ILabelStyle} style The style to assign to the new label. + * @param {string} text the initial text of the label + * @param {Object} tag The {@link yfiles.support.ITagOwner#tag} to assign to the new label. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.ITable#setLabelText} + * @see {@link yfiles.graph.ITable#setLabelModelParameter} + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + addLabelWithParameterStyleAndTag(item:yfiles.graph.IStripe,parameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,tag:Object):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#addLabelWithParameter}. + * @param {yfiles.graph.IStripe} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {string} text the initial text of the label + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.ITable#setLabelText} + * @see {@link yfiles.graph.ITable#setLabelModelParameter} + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + addLabelWithParameter(item:yfiles.graph.IStripe,parameter:yfiles.graph.ILabelModelParameter,text:string):yfiles.graph.ILabel; + /** + * Convenience method that delegates to the {@link yfiles.graph.ILabelDefaults#getStyleInstance} + * method for the given {@link yfiles.graph.IStripe stripe}. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createLabelStyle}. + * @param {yfiles.graph.IStripe} item The item the newly created label will belong to. + * @return {yfiles.drawing.ILabelStyle} The style instance to use for newly created stripes. + */ + createLabelStyle(item:yfiles.graph.IStripe):yfiles.drawing.ILabelStyle; + /** + * Creates the label model parameter for a given {@link yfiles.graph.ILabeledItem}. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createLabelModelParameter}. + * @param {yfiles.graph.IStripe} item The item that is the {@link yfiles.graph.ILabel#owner} of the label in question. + * @return {yfiles.graph.ILabelModelParameter} The default label model parameter to use for newly created labels at the item. + * @see {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance} + */ + createLabelModelParameter(item:yfiles.graph.IStripe):yfiles.graph.ILabelModelParameter; + /** + * Add a label to the given item using the text as the initial label text. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#addLabel}. + * @param {yfiles.graph.IStripe} item the item to add the label to. + * @param {string} text the initial text of the label + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.ITable#setLabelText} + * @see {@link yfiles.graph.ITable#setLabelModelParameter} + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + addLabel(item:yfiles.graph.IStripe,text:string):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text and a given tag. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#addLabelWithTag}. + * @param {yfiles.graph.IStripe} item the item to add the label to. + * @param {string} text the initial text of the label + * @param {Object} tag The tag to assign to the label. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.ITable#setLabelText} + * @see {@link yfiles.graph.ITable#setLabelModelParameter} + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + addLabelWithTag(item:yfiles.graph.IStripe,text:string,tag:Object):yfiles.graph.ILabel; + /** + * Calculates the preferred size of a label with the given properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#calculatePreferredSize}. + * @param {yfiles.graph.IStripe} item The item that will own the label. + * @param {yfiles.drawing.ILabelStyle} labelStyle The label style. + * @param {yfiles.graph.ILabelModelParameter} labelModelParameter The label model parameter. + * @param {string} text The text. + * @param {Object} tag The tag for the label. + * @return {yfiles.geometry.SizeD} The size as calculated by the {@link yfiles.drawing.ILabelStyleRenderer}. + */ + calculatePreferredSize(item:yfiles.graph.IStripe,labelStyle:yfiles.drawing.ILabelStyle,labelModelParameter:yfiles.graph.ILabelModelParameter,text:string,tag:Object):yfiles.geometry.SizeD; + /** + * Creates and returns a row as last child of owner using default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRow}. + * @param {yfiles.graph.IRow} owner The owner of the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRow(owner:yfiles.graph.IRow):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of owner with a given size value and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRowWithSize}. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} size The size to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowWithSize(owner:yfiles.graph.IRow,size:number):yfiles.graph.IRow; + /** + * Creates and returns a row as indexth child of owner with a given size value and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRowAtIndexWithSize}. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} index The index of the newly created row in its parent child list + * @param {number} size The size to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowAtIndexWithSize(owner:yfiles.graph.IRow,index:number,size:number):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of owner with a given style value and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRowWithStyle}. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowWithStyle(owner:yfiles.graph.IRow,style:yfiles.drawing.INodeStyle):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of owner with given style and size values and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRowWithSizeAndStyle}. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} size The size to use for the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowWithSizeAndStyle(owner:yfiles.graph.IRow,size:number,style:yfiles.drawing.INodeStyle):yfiles.graph.IRow; + /** + * Creates and returns a row as indexth child of owner with given style and size values and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRowAtIndexWithSizeAndStyle}. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} index The index of the newly created row in its parent child list + * @param {number} size The size to use for the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowAtIndexWithSizeAndStyle(owner:yfiles.graph.IRow,index:number,size:number,style:yfiles.drawing.INodeStyle):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of owner with a given tag value and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRowWithTag}. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowWithTag(owner:yfiles.graph.IRow,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of owner with given size and tag values and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRowWithSizeAndTag}. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} size The size to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowWithSizeAndTag(owner:yfiles.graph.IRow,size:number,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as indexth child of owner with given size and tag values and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRowAtIndexWithSizeAndTag}. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} index The index of the newly created row in its parent child list + * @param {number} size The size to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowAtIndexWithSizeAndTag(owner:yfiles.graph.IRow,index:number,size:number,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of owner with given style and tag values and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRowWithStyleAndTag}. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowWithStyleAndTag(owner:yfiles.graph.IRow,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of owner with given style, size and tag values and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRowWithSizeStyleAndTag}. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} size The size to use for the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowWithSizeStyleAndTag(owner:yfiles.graph.IRow,size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as indexth child of owner with given style, size and tag values and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRowAtIndexWithSizeStyleAndTag}. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} index The index of the newly created row in its parent child list + * @param {number} size The size to use for the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowAtIndexWithSizeStyleAndTag(owner:yfiles.graph.IRow,index:number,size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table using default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootRow}. + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRow():yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table with a given size value and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootRowWithSize}. + * @param {number} size The size to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowWithSize(size:number):yfiles.graph.IRow; + /** + * Creates and returns a row as indexth child of table with a given size value and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootRowAtIndexWithSize}. + * @param {number} index The index of the newly created row in its parent child list + * @param {number} size The size to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowAtIndexWithSize(index:number,size:number):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table with a given style value and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootRowWithStyle}. + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowWithStyle(style:yfiles.drawing.INodeStyle):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table with given style and size values and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootRowWithSizeAndStyle}. + * @param {number} size The size to use for the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowWithSizeAndStyle(size:number,style:yfiles.drawing.INodeStyle):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table with a given tag value and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootRowWithTag}. + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowWithTag(tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table with given size and tag values and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootRowWithSizeAndTag}. + * @param {number} size The size to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowWithSizeAndTag(size:number,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as indexth child of table with given size and tag values and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootRowAtIndexWithSizeAndTag}. + * @param {number} index The index of the newly created row in its parent child list + * @param {number} size The size to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowAtIndexWithSizeAndTag(index:number,size:number,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table with given style and tag values and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootRowWithStyleAndTag}. + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowWithStyleAndTag(style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table with given style, size and tag values and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootRowWithSizeStyleAndTag}. + * @param {number} size The size to use for the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowWithSizeStyleAndTag(size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as indexth child of table with given style, size and tag values and default values for all other row properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootRowAtIndexWithSizeStyleAndTag}. + * @param {number} index The index of the newly created row in its parent child list + * @param {number} size The size to use for the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowAtIndexWithSizeStyleAndTag(index:number,size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a column as last child of owner using default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createColumn}. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumn(owner:yfiles.graph.IColumn):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of owner with a given size value and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createColumnWithSize}. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} size The size to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnWithSize(owner:yfiles.graph.IColumn,size:number):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of owner with a given size value and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createColumnAtIndexWithSize}. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnAtIndexWithSize(owner:yfiles.graph.IColumn,index:number,size:number):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of owner with a given style value and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createColumnWithStyle}. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnWithStyle(owner:yfiles.graph.IColumn,style:yfiles.drawing.INodeStyle):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of owner with given style and size values and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createColumnWithSizeAndStyle}. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnWithSizeAndStyle(owner:yfiles.graph.IColumn,size:number,style:yfiles.drawing.INodeStyle):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of owner with given style and size values and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createColumnAtIndexWithSizeAndStyle}. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnAtIndexWithSizeAndStyle(owner:yfiles.graph.IColumn,index:number,size:number,style:yfiles.drawing.INodeStyle):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of owner with a given tag value and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createColumnWithTag}. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnWithTag(owner:yfiles.graph.IColumn,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of owner with given size and tag values and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createColumnWithSizeAndTag}. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} size The size to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnWithSizeAndTag(owner:yfiles.graph.IColumn,size:number,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of owner with given size and tag values and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createColumnAtIndexWithSizeAndTag}. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnAtIndexWithSizeAndTag(owner:yfiles.graph.IColumn,index:number,size:number,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of owner with given style and tag values and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createColumnWithStyleAndTag}. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnWithStyleAndTag(owner:yfiles.graph.IColumn,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of owner with given style, size and tag values and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createColumnWithSizeStyleAndTag}. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnWithSizeStyleAndTag(owner:yfiles.graph.IColumn,size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of owner with given style, size and tag values and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createColumnAtIndexWithSizeStyleAndTag}. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnAtIndexWithSizeStyleAndTag(owner:yfiles.graph.IColumn,index:number,size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table using default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootColumn}. + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumn():yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table with a given size value and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootColumnWithSize}. + * @param {number} size The size to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnWithSize(size:number):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of table with a given size value and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootColumnAtIndexWithSize}. + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnAtIndexWithSize(index:number,size:number):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table with a given style value and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootColumnWithStyle}. + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnWithStyle(style:yfiles.drawing.INodeStyle):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table with given style and size values and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootColumnWithSizeAndStyle}. + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnWithSizeAndStyle(size:number,style:yfiles.drawing.INodeStyle):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of table with given style and size values and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootColumnAtIndexWithSizeAndStyle}. + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnAtIndexWithSizeAndStyle(index:number,size:number,style:yfiles.drawing.INodeStyle):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table with a given tag value and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootColumnWithTag}. + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnWithTag(tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table with given size and tag values and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootColumnWithSizeAndTag}. + * @param {number} size The size to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnWithSizeAndTag(size:number,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of table with given size and tag values and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootColumnAtIndexWithSizeAndTag}. + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnAtIndexWithSizeAndTag(index:number,size:number,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table with given style and tag values and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootColumnWithStyleAndTag}. + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnWithStyleAndTag(style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table with given style, size and tag values and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootColumnWithSizeStyleAndTag}. + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnWithSizeStyleAndTag(size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of table with given style, size and tag values and default values for all other column properties. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createRootColumnAtIndexWithSizeStyleAndTag}. + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnAtIndexWithSizeStyleAndTag(index:number,size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IColumn; + /** + * Sets owner as new parent of row. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#setRowParent}. + * @param {yfiles.graph.IRow} owner The new owner of the stripe + * @param {yfiles.graph.IRow} row The row to reparent + */ + setRowParent(owner:yfiles.graph.IRow,row:yfiles.graph.IRow):void; + /** + * Sets owner as new parent of column. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#setColumnParent}. + * @param {yfiles.graph.IColumn} owner The new owner of the stripe + * @param {yfiles.graph.IColumn} column The column to reparent + */ + setColumnParent(owner:yfiles.graph.IColumn,column:yfiles.graph.IColumn):void; + /** + * {@link yfiles.graph.ITable#removeStripe}s stripe from table and resizes all affected stripes + * so that the table size does not change if possible. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#removeWithResize}. + * @param {yfiles.graph.IStripe} stripe The stripe to remove + */ + removeWithResize(stripe:yfiles.graph.IStripe):void; + /** + * {@link yfiles.graph.ITable#removeStripe}s stripe and all of its descendants from table. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#removeRecursively}. + * @param {yfiles.graph.IStripe} stripe The stripe to remove + */ + removeRecursively(stripe:yfiles.graph.IStripe):void; + /** + * {@link yfiles.graph.TableExtensions#removeWithResize Removes} the given stripe and all of its descendants from table and resizes all affected stripes + * so that the table size does not change if possible. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#removeRecursivelyWithResize}. + * @param {yfiles.graph.IStripe} stripe The stripe to remove + */ + removeRecursivelyWithResize(stripe:yfiles.graph.IStripe):void; + /** + * Convenience method to find all stripes underneath a certain point. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#findStripesInNode}. + * @param {yfiles.graph.INode} node The node this table is currently bound to + * @param {yfiles.geometry.PointD} location The location to test. + * @param {yfiles.graph.StripeTypes} stripeTypes An enumeration value of {@link yfiles.graph.StripeTypes} to specify the stripe type. + * @param {function(yfiles.graph.IStripe):boolean} predicate Additional predicate to further restrict the hit test results. + * @return {yfiles.collections.IEnumerable.} The stripes that have been found for the location or null. + */ + findStripes(node:yfiles.graph.INode,location:yfiles.geometry.PointD,stripeTypes:yfiles.graph.StripeTypes,predicate:(obj:yfiles.graph.IStripe)=>boolean):yfiles.collections.IEnumerable; + /** + * Convenience method that creates a columns x rows. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#createGrid}. + * @param {number} columns The number of columns to test. + * @param {number} rows The number of rows to test. + */ + createGrid(columns:number,rows:number):void; + /** + * Convenience method that clears all stripes from a table. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#clear}. + */ + clear():void; + /** + * Adjusts the {@link yfiles.graph.ILabel#preferredSize} property of a label to + * fit the suggested size of its {@link yfiles.drawing.ILabelStyleRenderer}. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#adjustPreferredSize}. + * @see {@link yfiles.graph.ILabelDefaults#autoAdjustPreferredSize} + * @param {yfiles.graph.ILabel} label The label to adjust the size for. + */ + adjustPreferredSize(label:yfiles.graph.ILabel):void; + /** + * Return the accumulated insets for the table. + * This is a bridge method that delegates to {@link yfiles.graph.TableExtensions#getAccumulatedInsets}. + */ + getAccumulatedInsets():yfiles.geometry.InsetsD; + } + var ITable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Determines the location of {@link yfiles.graph.IPort} instances. + * Port location models can be used to describe the location of ports, respecting + * their associated {@link yfiles.graph.IPortLocationModelParameter}. + * Typically, a port model is used as a factory for port location model parameters that + * can be associated with different port instances, e.g. using the + * {@link yfiles.graph.IGraph#setLocationModelParameter} method. + * Port model instances are designed to be shared by multiple model parameters, + * which themselves can be shared by multiple port instances. + * This interface supports the + * {@link yfiles.support.ILookup#lookup} method that can be used + * to query additional aspects of the implementation. + * @see {@link yfiles.graph.IPortLocationModelParameter} + * @see {@link yfiles.graph.IPort} + * @see {@link yfiles.graph.IGraph} + */ + export interface IPortLocationModel extends Object,yfiles.support.ILookup{ + /** + * Determines the location of the port for the given parameter. + * @param {yfiles.graph.IPort} port The port to determine the location for. + * @param {yfiles.graph.IPortLocationModelParameter} parameter The parameter to use. The parameter can be expected to be created by this instance + * having the {@link yfiles.graph.IPortLocationModelParameter#model} property set to this instance.. + * @return {yfiles.geometry.PointD} The calculated location of the port. + * @see Specified by {@link yfiles.graph.IPortLocationModel#getLocation}. + */ + getLocation(port:yfiles.graph.IPort,parameter:yfiles.graph.IPortLocationModelParameter):yfiles.geometry.PointD; + /** + * Factory method that creates a parameter for the given port that tries to match the provided location + * in absolute world coordinates. + * @param {yfiles.graph.IPortOwner} portOwner The port owner that will own the port for which the parameter shall be created. + * @param {yfiles.geometry.PointD} location The location in the world coordinate system that should be matched as best as possible. + * @return {yfiles.graph.IPortLocationModelParameter} A new instance that can be used to describe the location of an {@link yfiles.graph.IPort} at the given + * portOwner. + * @see Specified by {@link yfiles.graph.IPortLocationModel#createParameter}. + */ + createParameter(portOwner:yfiles.graph.IPortOwner,location:yfiles.geometry.PointD):yfiles.graph.IPortLocationModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of port + * and parameter. + * @param {yfiles.graph.IPort} port The port to use in the context. + * @param {yfiles.graph.IPortLocationModelParameter} parameter The parameter to use for the port in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the port/parameter combination. + * @see Specified by {@link yfiles.graph.IPortLocationModel#getContext}. + */ + getContext(port:yfiles.graph.IPort,parameter:yfiles.graph.IPortLocationModelParameter):yfiles.support.ILookup; + } + var IPortLocationModel:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.graph.IGraph} to declare and obtain the defaults + * for ports at nodes and edges. + * @see {@link yfiles.graph.INodeDefaults#ports} + * @see {@link yfiles.graph.IEdgeDefaults#ports} + * @see {@link yfiles.graph.IGraph#nodeDefaults} + * @see {@link yfiles.graph.IGraph#edgeDefaults} + */ + export interface IPortDefaults extends Object{ + /** + * Gets or sets the style to use for ports. + * Depending on the setting of {@link yfiles.graph.IPortDefaults#shareStyleInstance}, the {@link yfiles.graph.IPortDefaults#getStyleInstance} + * method should return a {@link yfiles.system.ICloneable#clone clone} of this instance or the very same instance. + * Value: The style to use as a template. + * @see {@link yfiles.graph.IPortDefaults#shareStyleInstance} + * @see Specified by {@link yfiles.graph.IPortDefaults#style}. + */ + style:yfiles.drawing.IPortStyle; + /** + * Determines whether unused ports should automatically be removed from their owners + * as soon as no further edge is connected to them. + * @see {@link yfiles.graph.IGraph#removePort} + * @see {@link yfiles.graph.IGraph#removeEdge} + * @see Specified by {@link yfiles.graph.IPortDefaults#autoCleanup}. + */ + autoCleanup:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.IPortDefaults#style} + * instance should be shared referentially or {@link yfiles.system.ICloneable#clone cloned} + * upon a call to {@link yfiles.graph.IPortDefaults#getStyleInstance}. + * Value: + * true if the reference should be shared; otherwise, false. + * @see {@link yfiles.graph.IPortDefaults#getStyleInstance} + * @see {@link yfiles.graph.IPortDefaults#style} + * @see Specified by {@link yfiles.graph.IPortDefaults#shareStyleInstance}. + */ + shareStyleInstance:boolean; + /** + * Factory method that returns a style instance for use with newly created ports. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IPortDefaults#style} property, if {@link yfiles.graph.IPortDefaults#shareStyleInstance} + * is enabled, but they might use more complicated logic, too. + * @param {yfiles.graph.IPortOwner} owner The owner of the port that will be created. + * @return {yfiles.drawing.IPortStyle} The style to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IPortDefaults#style} property, if {@link yfiles.graph.IPortDefaults#shareStyleInstance} + * is enabled. + * @see Specified by {@link yfiles.graph.IPortDefaults#getStyleInstance}. + */ + getStyleInstance(owner:yfiles.graph.IPortOwner):yfiles.drawing.IPortStyle; + /** + * Gets or sets the location model parameter to use for ports. + * Depending on the setting of {@link yfiles.graph.IPortDefaults#shareLocationModelParameterInstance}, the {@link yfiles.graph.IPortDefaults#getLocationModelParameterInstance} + * method should return a {@link yfiles.system.ICloneable#clone clone} of this instance or the very same instance. + * Value: The parameter to use as a template. + * @see {@link yfiles.graph.IPortDefaults#shareLocationModelParameterInstance} + * @see {@link yfiles.graph.IPortDefaults#getLocationModelParameterInstance} + * @see Specified by {@link yfiles.graph.IPortDefaults#locationModelParameter}. + */ + locationModelParameter:yfiles.graph.IPortLocationModelParameter; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.IPortDefaults#locationModelParameter} + * instance should be shared referentially or {@link yfiles.system.ICloneable#clone cloned} + * upon a call to {@link yfiles.graph.IPortDefaults#getLocationModelParameterInstance}. + * Value: + * true if the reference should be shared; otherwise, false. + * @see {@link yfiles.graph.IPortDefaults#getLocationModelParameterInstance} + * @see {@link yfiles.graph.IPortDefaults#locationModelParameter} + * @see Specified by {@link yfiles.graph.IPortDefaults#shareLocationModelParameterInstance}. + */ + shareLocationModelParameterInstance:boolean; + /** + * Factory method that returns a location model parameter instance for use with newly created ports. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IPortDefaults#locationModelParameter} property, if {@link yfiles.graph.IPortDefaults#shareLocationModelParameterInstance} + * is enabled, but they might use more complicated logic, too. + * @param {yfiles.graph.IPortOwner} owner The owner of the port that will be created. + * @return {yfiles.graph.IPortLocationModelParameter} The parameter to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IPortDefaults#locationModelParameter} property, if {@link yfiles.graph.IPortDefaults#shareLocationModelParameterInstance} + * is enabled. + * @see Specified by {@link yfiles.graph.IPortDefaults#getLocationModelParameterInstance}. + */ + getLocationModelParameterInstance(owner:yfiles.graph.IPortOwner):yfiles.graph.IPortLocationModelParameter; + } + var IPortDefaults:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface defines a child element of a table or a table element container. + */ + export interface IStripe extends Object,yfiles.graph.ILabeledItem{ + /** + * Gets the insets for this stripe. + * These insets are applied in addition to any implicit insets provided by the child stripes. To find out the actual insets that are currently in effect, use {@link yfiles.graph.IStripe#getActualInsets}. + * @see Specified by {@link yfiles.graph.IStripe#insets}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Returns a live view of the relative layout of the stripe. + * The layout of a stripe is a rectangle in the coordinate system + * that is relative to the upper left corner of the parent. + * Since this method will yield a live view, it is up to the client to copy the values of + * the instance if a snapshot of the state is needed. + * @see Specified by {@link yfiles.graph.IStripe#layout}. + */ + layout:yfiles.geometry.IRectangle; + /** + * Gets the style for this stripe. + * @see Specified by {@link yfiles.graph.IStripe#style}. + */ + style:yfiles.drawing.INodeStyle; + /** + * The current changeable dimension of the stripe. + * This is always the stripe size which is not implicitly determined by other stripes, i.e. the height for {@link yfiles.graph.IRow} + * instances and the width for {@link yfiles.graph.IColumn} instances. + * @see Specified by {@link yfiles.graph.IStripe#size}. + */ + size:number; + /** + * The minimal permissible value for {@link yfiles.graph.IStripe#size}. + * This value determines how much the stripe may be shrunk by interactive manipulation. + * @see Specified by {@link yfiles.graph.IStripe#minimumSize}. + */ + minimumSize:number; + /** + * The {@link yfiles.graph.ITable} instance where this stripe is installed. + * @see Specified by {@link yfiles.graph.IStripe#table}. + */ + table:yfiles.graph.ITable; + /** + * Checks whether stripe is the root item of a stripe hierarchy. + * This is a bridge method that delegates to {@link yfiles.graph.StripeExtensions#isRoot}. + * @return {boolean} true iff stripe is a root stripe. + * @see {@link yfiles.graph.StripeExtensions#getRoot} + */ + isRoot():boolean; + /** + * Gets the index of stripe in its {@link yfiles.graph.StripeExtensions#getParent} collection of {@link yfiles.graph.StripeExtensions#getChildren}. + * This is a bridge method that delegates to {@link yfiles.graph.StripeExtensions#getIndex}. + * @return {number} the children of stripe + * @see {@link yfiles.graph.IColumn#columns} + * @see {@link yfiles.graph.IRow#rows} + */ + getIndex():number; + /** + * Returns the actual minimum size a stripe can acquire. + * This is a bridge method that delegates to {@link yfiles.graph.StripeExtensions#getEffectiveMinSize}. + */ + getEffectiveMinSize():number; + /** + * Gets the direct children of stripe in a table hierarchy. + * This is a bridge method that delegates to {@link yfiles.graph.StripeExtensions#getChildren}. + * @return {yfiles.collections.IEnumerable.} the children of stripe + * @see {@link yfiles.graph.IColumn#columns} + * @see {@link yfiles.graph.IRow#rows} + */ + getChildren():yfiles.collections.IEnumerable; + /** + * Gets the parent of stripe in a table hierarchy. + * This is a bridge method that delegates to {@link yfiles.graph.StripeExtensions#getParent}. + * @return {yfiles.graph.IStripe} the parent of stripe + * @see {@link yfiles.graph.IColumn#owner} + * @see {@link yfiles.graph.IRow#owner} + */ + getParent():yfiles.graph.IStripe; + /** + * Gets the root of the stripe hierarchy of stripe in a table hierarchy. + * This is a bridge method that delegates to {@link yfiles.graph.StripeExtensions#getRoot}. + * @return {yfiles.graph.IStripe} the root of stripe + * @see {@link yfiles.graph.ITable#rootColumn} + * @see {@link yfiles.graph.ITable#rootRow} + * @see {@link yfiles.graph.StripeExtensions#isRoot} + */ + getRoot():yfiles.graph.IStripe; + /** + * Returns a collection of all descendants of stripe that are leaves and therefore don't have any child stripes. + * This is a bridge method that delegates to {@link yfiles.graph.StripeExtensions#getLeaves}. + * @return {yfiles.collections.IEnumerable.} A collection of all leaf descendants of stripe + */ + getLeaves():yfiles.collections.IEnumerable; + /** + * Returns a collection of all descendants of stripe. + * This is a bridge method that delegates to {@link yfiles.graph.StripeExtensions#getDescendants}. + * @return {yfiles.collections.IEnumerable.} A collection of all descendants of stripe + */ + getDescendants():yfiles.collections.IEnumerable; + /** + * Returns the layout of item in absolute coordinates. + * This is a bridge method that delegates to {@link yfiles.graph.StripeExtensions#getAbsoluteBounds}. + * @param {yfiles.graph.INode} owner The node relative to which the stripe layout is calculated. This should be the same node where {@link yfiles.graph.IStripe#table} for item is associated to. + * @return {yfiles.geometry.RectD} + */ + getAbsoluteBounds(owner:yfiles.graph.INode):yfiles.geometry.RectD; + /** + * Gets the insets that are currently in effect for this stripe. + * This is a bridge method that delegates to {@link yfiles.graph.StripeExtensions#getActualInsets}. + * @return {yfiles.geometry.InsetsD} The actual insets of the stripe. + */ + getActualInsets():yfiles.geometry.InsetsD; + /** + * The current actual dimension of the stripe. + * This is a bridge method that delegates to {@link yfiles.graph.StripeExtensions#getActualSize}. + * @return {number} The actual size of the stripe. + */ + getActualSize():number; + } + var IStripe:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that can be used to find ports at specific locations in the canvas. + * This interface is mostly provided through the {@link yfiles.support.ILookup#lookup} of + * {@link yfiles.graph.IPortOwner} implementations such as {@link yfiles.graph.INode}. + */ + export interface IPortSelectionTester extends Object{ + /** + * Returns the port at the given world coordinate position or null if there + * is no such port. + * @param {yfiles.geometry.PointD} location The coordinates of the position in the world coordinate system. + * @param {yfiles.canvas.ICanvasContext} ctx The canvas context to use for querying the position. + * @return {yfiles.graph.IPort} The port at the position or null. + * @see Specified by {@link yfiles.graph.IPortSelectionTester#getPort}. + */ + getPort(location:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):yfiles.graph.IPort; + /** + * Returns the ports for the given marquee rectangle. + * @param {yfiles.geometry.RectD} box The marquee selection box in the world coordinate system. + * @param {yfiles.canvas.ICanvasContext} ctx The canvas context to use for querying the position. + * @return {yfiles.collections.IEnumerable.} An enumerable over the ports inside the marquee selection box. + * @see Specified by {@link yfiles.graph.IPortSelectionTester#getPorts}. + */ + getPorts(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):yfiles.collections.IEnumerable; + } + var IPortSelectionTester:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface that all parameters for {@link yfiles.graph.IPortLocationModel}s need + * to implement. + * Note that implementations of this interface are provided by the {@link yfiles.graph.IPortLocationModel} + * implementations and don't need to be implemented by custom code unless a custom model + * is implemented. + * This interface extends the {@link yfiles.system.ICloneable} to support the creation of additional + * instances. However the implementation may return this if it is immutable. + */ + export interface IPortLocationModelParameter extends Object,yfiles.system.ICloneable{ + /** + * Gets the model that has created this parameter. + * Value: The model. + * @see Specified by {@link yfiles.graph.IPortLocationModelParameter#model}. + */ + model:yfiles.graph.IPortLocationModel; + /** + * Predicate function that can be used to decide whether it is legal to use this parameter and model + * combination with {@link yfiles.graph.IPort} instances at the given {@link yfiles.graph.IPortOwner}. + * @param {yfiles.graph.IPortOwner} portOwner The port owner that owns a port which will be associated with this location parameter. + * @return {boolean} Whether this parameter supports port instances for the given owner. + * @see Specified by {@link yfiles.graph.IPortLocationModelParameter#supports}. + */ + supports(portOwner:yfiles.graph.IPortOwner):boolean; + } + var IPortLocationModelParameter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Adapter class that can be used to obtain a {@link yfiles.layout.IGraphLayout} and {@link yfiles.algorithms.IGraphInterface} + * from an {@link yfiles.graph.IGraph}. + * This adapter needs to be used in order to apply layout algorithms to {@link yfiles.graph.IGraph} instances. + * The following pattern should be used: + *

+    *     // build the adapter
+    *     var adapter = new yfiles.graph.LayoutGraphAdapter.ForGraphAndSelectionModel(graph, selectionModel);
+    *     // create a copy for improved performance and stability
+    *     var layoutGraph = new yfiles.layout.CopiedLayoutGraph.FromGraphAndLayout(adapter, adapter);
+    *     
+    *     // perform the layout on the copy
+    *     layouter.doLayout(layoutGraph);
+    *     
+    *     // apply the results to the original IGraph
+    *     layoutGraph.commitLayoutToOriginalGraph();
+    * 
+ * Alternatively one can use the {@link yfiles.canvas.LayoutMorpherWrapper} to morph the layout: + *

+    *     // build the adapter
+    *     var adapter = new yfiles.graph.LayoutGraphAdapter.ForGraphAndSelectionModel(graph, selectionModel);
+    *     // create a copy for improved performance and stability
+    *     var layoutGraph = new yfiles.layout.CopiedLayoutGraph.FromGraphAndLayout(adapter, adapter);
+    *     
+    *     // perform the layout on the copy
+    *     layouter.doLayout(layoutGraph);
+    *     
+    *     // create the animation object
+    *     var morpher = new yfiles.canvas.LayoutMorpherWrapper(graph, layoutGraph, yfiles.system.TimeSpan.fromSeconds(1));
+    *     
+    *     // and play
+    *     var animator = new yfiles.canvas.Animator.FromCanvasControl(canvasControl);
+    *     animator.animate(morpher);
+    * 
+ * Class {@link yfiles.graph.CopiedLayoutIGraph} is a convenience class that can be used + * to quickly assign new layouts to an IGraph: + *

+    *     // build the adapter copy
+    *     var copy = new yfiles.graph.CopiedLayoutIGraph.FromGraph(graph);
+    *     // perform the layout on the copy
+    *     layouter.doLayout(copy);
+    *     
+    *     // apply the results to the original IGraph
+    *     copy.commitLayoutToOriginalGraph();
+    * 
+ * or even: + *

+    *   CopiedLayoutIGraph.applyLayout(graph, layouter);
+    * 
+ *

+ * This class will use the provided {@link yfiles.graph.LayoutGraphAdapter#selectionModel} + * to attach {@link yfiles.algorithms.IDataProvider} instances to the GraphInterface + * for the {@link yfiles.layout.LayouterKeys#SELECTED_NODES_DP_KEY} and {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY} + * data provider keys. Also it will automatically wrap {@link yfiles.model.IMapper} instances + * registered with the {@link yfiles.graph.IMapperRegistry} found in the {@link yfiles.support.ILookup#lookup} + * of the {@link yfiles.graph.IGraph} and wrap those instances in {@link yfiles.algorithms.IDataProvider} instances. + *

+ *

+ * Also this class provides a mechanism to adapt the edge to edge connection feature that is available for {@link yfiles.graph.IGraph}s, where + * {@link yfiles.graph.IEdge}s can also be adjacent to other edges. Since this construct is not available for {@link yfiles.algorithms.IGraphInterface}, using + * the {@link yfiles.graph.LayoutGraphAdapter#edgeToEdgeConnectionsIncluded} property, this type can be told to insert small {@link yfiles.graph.LayoutGraphAdapter#createEdgePortLayout dummy nodes} + * into the graph as the end points for edges connected to other edges. + *

+ *
+ * Related Information in the Developers Guide: + *

+ * The chapter Using yFiles Layout Functionality From @COMPONENT_NAME@ + * describes how automatic layout and graph analysis algorithms from the yFiles Layout and yFiles Basic library + * components can be accessed from @COMPONENT_NAME@. + *

+ * @see {@link yfiles.graph.CopiedLayoutIGraph} + * @see {@link yfiles.layout.ILayouter} + */ + export interface LayoutGraphAdapter extends Object,yfiles.layout.IGraphLayout,yfiles.algorithms.IGraphInterface{ + /** + * Callback method that gets the label candidate descriptor provider for the given {@link yfiles.graph.IGraph}. + * This implementation uses the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup} + * to find an implementation of the {@link yfiles.graph.ILabelCandidateDescriptorProvider}. + * @param {yfiles.graph.IGraph} graph The graph. + * @return {yfiles.graph.ILabelCandidateDescriptorProvider} The result of a {@link yfiles.support.ILookup#lookup} query on graph + * for the {@link yfiles.graph.ILabelCandidateDescriptorProvider} type. + */ + getLabelCandidateDescriptorProvider(graph:yfiles.graph.IGraph):yfiles.graph.ILabelCandidateDescriptorProvider; + /** + * Sets or yields the original {@link yfiles.graph.IGraph} instance that is + * adapted by this instance. + * Before performing a layout, this property must be set or the adapter must have been created with or . + * Note that this property cannot be assigned again if its value is already non null. + * @throws {yfiles.system.ArgumentException} if the value of this property is already non null + */ + adaptedGraph:yfiles.graph.IGraph; + /** + * Gets or sets the {@link yfiles.model.ISelectionModel} + * to use for the automatically registered {@link yfiles.algorithms.IDataProvider} + * instances for {@link yfiles.layout.LayouterKeys#SELECTED_NODES_DP_KEY} and {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY}. + */ + selectionModel:yfiles.model.ISelectionModel; + /** + * Factory method that creates a {@link yfiles.layout.INodeLayout} implementation that wraps the given + * {@link yfiles.graph.INode}. + * @param {yfiles.graph.INode} node The node to wrap. + * @return {yfiles.layout.INodeLayout} A wrapper instance. + */ + createNodeLayout(node:yfiles.graph.INode):yfiles.layout.INodeLayout; + /** + * Gets or sets the size of the nodes that are inserted for the ports that are created for + * {@link yfiles.graph.IEdge}s that are connected at other {@link yfiles.graph.IEdge}s. + * If this instance is configured to create dummy nodes for ports at edges, this will be the initial + * size of the dummy nodes with the center of the node always being the location of the port. + * The default is 3x3. + * @see {@link yfiles.graph.LayoutGraphAdapter#edgeToEdgeConnectionsIncluded} + */ + edgePortNodeSize:yfiles.geometry.SizeD; + /** + * Determines whether edges at other edges will be included in the layout graph or simply ignored. + * If this property is set to false, edges at other edges are simply ignored and not part + * of the layout graph. + * The default is true in which case dummy nodes are inserted into the layout graph for each source and target port + * of an {@link yfiles.graph.IEdge} that is {@link yfiles.graph.IPort#owner owned} by an {@link yfiles.graph.IEdge}. + * @see {@link yfiles.graph.LayoutGraphAdapter#edgePortNodeSize} + */ + edgeToEdgeConnectionsIncluded:boolean; + /** + * Callback factory method that creates the {@link yfiles.layout.INodeLayout} for the given {@link yfiles.graph.IPort} + * that is used as a dummy to represent the port at the {@link yfiles.graph.IEdge} that owns port. + * @param {yfiles.graph.IPort} port The port to create the layout for. + * @return {yfiles.layout.INodeLayout} A suitable implementation of {@link yfiles.layout.INodeLayout} that uses the {@link yfiles.graph.IPort#location} as the center of the node. + * @see {@link yfiles.graph.LayoutGraphAdapter#edgePortNodeSize} + * @see {@link yfiles.graph.LayoutGraphAdapter#edgeToEdgeConnectionsIncluded} + */ + createEdgePortLayout(port:yfiles.graph.IPort):yfiles.layout.INodeLayout; + /** + * Callback method that assigns a new location that matches newLocation to port. + * This method is called only for ports which are owned by edges. These are represented by dummy nodes during the layout, and newLocation is the + * position of the dummy node after the layout. + * @param {yfiles.graph.IPort} port The edge port that should be placed. + * @param {yfiles.geometry.PointD} newLocation The new location of the port as calculated by the layout algorithm. + */ + setEdgePortLocation(port:yfiles.graph.IPort,newLocation:yfiles.geometry.PointD):void; + /** + * Callback method that assigns a new relative location to port. + * The default implementation calls {@link yfiles.graph.GraphExtensions#setRelativeLocation} + * with newRelativeLocation. Depending on the port location model, the actual resulting port location may be different. + * @param {yfiles.graph.IPort} port The port that should be placed. + * @param {yfiles.geometry.PointD} newRelativeLocation The new coordinate offsets relative to the center of the node's {@link yfiles.graph.INode#layout}'s + * center. + */ + setRelativePortLocation(port:yfiles.graph.IPort,newRelativeLocation:yfiles.geometry.PointD):void; + /** + * Factory method that creates an {@link yfiles.layout.IEdgeLayout} implementation that wraps the given + * {@link yfiles.graph.IEdge}. + * @param {yfiles.graph.IEdge} edge The edge to wrap. + * @return {yfiles.layout.IEdgeLayout} A wrapper instance. + */ + createEdgeLayout(edge:yfiles.graph.IEdge):yfiles.layout.IEdgeLayout; + /** + * Returns the layout information for a given node. + * @see Specified by {@link yfiles.layout.IGraphLayout#getNodeLayout}. + */ + getNodeLayout(o:Object):yfiles.layout.INodeLayout; + /** + * Returns the layout information for a given edge. + * @see Specified by {@link yfiles.layout.IGraphLayout#getEdgeLayout}. + */ + getEdgeLayout(edge:Object):yfiles.layout.IEdgeLayout; + /** + * Returns an array of layout information for all node labels + * belonging to the given node. + * @see Specified by {@link yfiles.layout.IGraphLayout#getNodeLabelLayout}. + */ + getNodeLabelLayout(node:Object):yfiles.layout.INodeLabelLayout[]; + /** + * Returns an array of layout information for all edge labels + * belonging to the given edge. + * @see Specified by {@link yfiles.layout.IGraphLayout#getEdgeLabelLayout}. + */ + getEdgeLabelLayout(edge:Object):yfiles.layout.IEdgeLabelLayout[]; + /** + * Returns the bounding box of the graph layout. + * That is the smallest rectangular area that contains all + * defined layout elements. If there are no elements in this + * graph layout, the resulting rectangle will have negative + * width and height. + * @see Specified by {@link yfiles.layout.IGraphLayout#getBoundingBox}. + */ + getBoundingBox():yfiles.algorithms.Rectangle; + /** + * 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[]; + /** + * Creates a {@link yfiles.layout.NodeLabelCandidate} for a given label + * and {@link yfiles.graph.ILabelModelParameter} combination. + * @param {yfiles.graph.ILabel} originalLabel The original label. + * @param {yfiles.graph.ILabel} dummyLabel The dummy label that describes the current laid out label. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to create a candidate for. + * @param {yfiles.layout.INodeLabelLayout} ownerLayout The {@link yfiles.layout.INodeLabelLayout} of the label to pass to the candidate. + * @return {yfiles.layout.NodeLabelCandidate} A candidate to yield for the labeling algorithms or null. + */ + createNodeLabelCandidate(originalLabel:yfiles.graph.ILabel,dummyLabel:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter,ownerLayout:yfiles.layout.INodeLabelLayout):yfiles.layout.NodeLabelCandidate; + /** + * Callback that retrieves the label candidate descriptor for the given label and parameter. + * @param {yfiles.graph.ILabel} originalLabel The original label to which a parameter will be applied. + * @param {yfiles.graph.ILabel} dummyLabel The dummy label to which the parameter will be applied. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to apply. + * @return {yfiles.graph.ILabelCandidateDescriptor} A descriptor or null. + * @see {@link yfiles.graph.LayoutGraphAdapter#createNodeLabelCandidate} + * @see {@link yfiles.graph.LayoutGraphAdapter#createEdgeLabelCandidate} + * @see {@link yfiles.graph.LayoutGraphAdapter#getLabelCandidateDescriptorProvider} + */ + getLabelCandidateDescriptor(originalLabel:yfiles.graph.ILabel,dummyLabel:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; + /** + * Creates the {@link yfiles.layout.EdgeLabelCandidate} for a given label and + * {@link yfiles.graph.ILabelModelParameter} combination. + * @param {yfiles.graph.ILabel} originalLabel The original label. + * @param {yfiles.graph.ILabel} dummyLabel The dummy label that describes the current laid out label. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to create a candidate for. + * @param {yfiles.layout.IEdgeLabelLayout} labelLayout The {@link yfiles.layout.IEdgeLabelLayout} of the label to pass to the candidate. + * @return {yfiles.layout.EdgeLabelCandidate} A candidate to yield for the labeling algorithms or null. + */ + createEdgeLabelCandidate(originalLabel:yfiles.graph.ILabel,dummyLabel:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter,labelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.layout.EdgeLabelCandidate; + } + var LayoutGraphAdapter:{ + $class:yfiles.lang.Class; + /** + * An {@link yfiles.graph.IMapperRegistry} tag for an {@link yfiles.model.IMapper} + * that provides for the edge {@link yfiles.graph.ILabel}s in the {@link yfiles.graph.LayoutGraphAdapter#adaptedGraph} a + * {@link yfiles.layout.LabelPlacements} constant. + * This technique is obsolete and superseded by the more powerful {@link yfiles.layout.PreferredPlacementDescriptor} API, + * which is leveraged by the {@link yfiles.graph.LayoutGraphAdapter#EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY}. + * If there is a {@link yfiles.model.IMapper} in the {@link yfiles.graph.IGraph#mapperRegistry} + * it will be queried for each {@link yfiles.graph.IEdge edge} {@link yfiles.graph.ILabel label} + * to set the {@link yfiles.layout.IEdgeLabelLayout#preferredPlacementDescriptor} property of the adapted + * implementation. + * @see {@link yfiles.graph.LayoutGraphAdapter#EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY} + */ + EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DP_KEY:Object; + /** + * An {@link yfiles.graph.IMapperRegistry} tag for an {@link yfiles.model.IMapper} + * that provides for the edge {@link yfiles.graph.ILabel}s in the {@link yfiles.graph.LayoutGraphAdapter#adaptedGraph} a + * {@link yfiles.layout.PreferredPlacementDescriptor} instance. + * If there is a {@link yfiles.model.IMapper} in the {@link yfiles.graph.IGraph#mapperRegistry} + * it will be queried for each {@link yfiles.graph.IEdge edge} {@link yfiles.graph.ILabel label} + * to set the {@link yfiles.layout.IEdgeLabelLayout#preferredPlacementDescriptor} property of the adapted + * implementation. + */ + EDGE_LABEL_LAYOUT_PREFERRED_PLACEMENT_DESCRIPTOR_DP_KEY:Object; + /** + * A data provider key that can be used to look up the original {@link yfiles.graph.INode} of a {@link yfiles.algorithms.Node}. + * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy + * of an {@link yfiles.graph.IGraph} with the help of a {@link yfiles.graph.LayoutGraphAdapter}. Especially, it is available + * if the layout is run with a {@link yfiles.graph.LayoutExecutor} or the convenience methods + * {@link yfiles.graph.LayoutExtensions#morphLayout} and + * {@link yfiles.graph.LayoutExtensions#applyLayout}. + */ + ORIGINAL_NODE_DP_KEY:Object; + /** + * A data provider key that can be used to look up the original {@link yfiles.graph.IEdge} of an {@link yfiles.algorithms.Edge}. + * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy + * of an {@link yfiles.graph.IGraph} with the help of a {@link yfiles.graph.LayoutGraphAdapter}. Especially, it is available + * if the layout is run with a {@link yfiles.graph.LayoutExecutor} or the convenience methods + * {@link yfiles.graph.LayoutExtensions#morphLayout} and + * {@link yfiles.graph.LayoutExtensions#applyLayout}. + */ + ORIGINAL_EDGE_DP_KEY:Object; + /** + * A data provider key that can be used to look up the original {@link yfiles.graph.ILabel} of an + * {@link yfiles.layout.INodeLabelLayout}. + * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy + * of an {@link yfiles.graph.IGraph} with the help of a {@link yfiles.graph.LayoutGraphAdapter}. Especially, it is available + * if the layout is run with a {@link yfiles.graph.LayoutExecutor} or the convenience methods + * {@link yfiles.graph.LayoutExtensions#morphLayout} and + * {@link yfiles.graph.LayoutExtensions#applyLayout}. + */ + ORIGINAL_NODE_LABEL_DP_KEY:Object; + /** + * A data provider key that can be used to look up the original {@link yfiles.graph.ILabel} of an + * {@link yfiles.layout.IEdgeLabelLayout}. + * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy + * of an {@link yfiles.graph.IGraph} with the help of a {@link yfiles.graph.LayoutGraphAdapter}. Especially, it is available + * if the layout is run with a {@link yfiles.graph.LayoutExecutor} or the convenience methods + * {@link yfiles.graph.LayoutExtensions#morphLayout} and + * {@link yfiles.graph.LayoutExtensions#applyLayout}. + */ + ORIGINAL_EDGE_LABEL_DP_KEY:Object; + /** + * A data provider key that can be used to look up the {@link yfiles.graph.IPort source port} of the original + * {@link yfiles.graph.IEdge} of an {@link yfiles.algorithms.Edge}. + * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy + * of an {@link yfiles.graph.IGraph} with the help of a {@link yfiles.graph.LayoutGraphAdapter}. Especially, it is available + * if the layout is run with a {@link yfiles.graph.LayoutExecutor} or the convenience methods + * {@link yfiles.graph.LayoutExtensions#morphLayout} and + * {@link yfiles.graph.LayoutExtensions#applyLayout}. + */ + ORIGINAL_SOURCE_PORT_DP_KEY:Object; + /** + * A data provider key that can be used to look up the {@link yfiles.graph.IPort target port} of the original + * {@link yfiles.graph.IEdge} of an {@link yfiles.algorithms.Edge}. + * This data provider is created automatically for a {@link yfiles.layout.CopiedLayoutGraph} that is created as a copy + * of an {@link yfiles.graph.IGraph} with the help of a {@link yfiles.graph.LayoutGraphAdapter}. Especially, it is available + * if the layout is run with a {@link yfiles.graph.LayoutExecutor} or the convenience methods + * {@link yfiles.graph.LayoutExtensions#morphLayout} and + * {@link yfiles.graph.LayoutExtensions#applyLayout}. + */ + ORIGINAL_TARGET_PORT_DP_KEY:Object; + /** + * Creates the adapter with no initial {@link yfiles.graph.IGraph} + * and no {@link yfiles.model.ISelectionModel}. + * Before this instance can be used for automatic layouts, you mus assign a value to the {@link yfiles.graph.LayoutGraphAdapter#adaptedGraph} property. + */ + new ():yfiles.graph.LayoutGraphAdapter; + /** + * Creates the adapter using a given {@link yfiles.graph.IGraph} + * and no {@link yfiles.model.ISelectionModel}. + * @param {yfiles.graph.IGraph} graph The graph to build an adapter for. + */ + ForGraph:{ + new (graph:yfiles.graph.IGraph):yfiles.graph.LayoutGraphAdapter; + }; + /** + * This key is used to provide information about dummy nodes that have been inserted into the graph + * to model edges at edges. + * This key can be used to query an {@link yfiles.algorithms.IDataProvider} that yields true for {@link yfiles.algorithms.IDataProvider#getBool} + * for nodes that are actually representatives of {@link yfiles.graph.IPort}s at {@link yfiles.graph.IEdge}s. + * Also the {@link yfiles.algorithms.IDataProvider#get} method will yield the corresponding original {@link yfiles.graph.IEdge}. + */ + PORT_DUMMY_NODE_DP_KEY:Object; + /** + * Creates the adapter using a given {@link yfiles.graph.IGraph} + * and {@link yfiles.model.ISelectionModel}. + * @param {yfiles.graph.IGraph} graph The graph to build an adapter for. + * @param {yfiles.model.ISelectionModel.} selectionModel The selection model to use by the + * {@link yfiles.layout.LayouterKeys#SELECTED_NODES_DP_KEY} and {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY} + * {@link yfiles.algorithms.IDataProvider} instances that are automatically bound to this adapter. + * @throws {yfiles.system.ArgumentNullException} graph is null. + */ + ForGraphAndSelectionModel:{ + new (graph:yfiles.graph.IGraph,selectionModel:yfiles.model.ISelectionModel):yfiles.graph.LayoutGraphAdapter; + }; + }; + /** + * Support class that correctly configures {@link yfiles.layout.PartitionGrid} information from a given table configuration. + */ + export interface TableLayoutConfigurator extends Object{ + /** + * Gets or sets the minimal distance between two different table nodes. + */ + minimalTableDistance:number; + /** + * Specifies whether or not to enable size compaction for table nodes. + * If size compaction is enabled, the size of a column or row (or a table + * node for that matter) may be reduced due to layout calculation, but never + * below the column's or row's minimum size. + * If size compaction is disabled, columns and rows (and therefore table + * nodes) may only grow due to layout calculation. + *

+ * The default value for this property is true. + *

+ */ + compactionEnabled:boolean; + /** + * Gets or sets whether the configurator will prepare its associated + * graph for a vertical (that is top-to-bottom or bottom-to-top) layout + * calculation or a horizontal (that is left-to-right or right-to-left) + * one. + * The default value for this property is false. + */ + horizontalLayout:boolean; + /** + * Specifies whether or not from sketch mode should be enabled. + * If enabled, the positions of the table group nodes are considered, i.e., + * for horizontal layout configuration these nodes are sorted according to their y-coordinate + * and for vertical layout configuration according to their x-coordinate. + */ + fromSketch:boolean; + /** + * Setup partition grid information from a graph that contains table structures. + * @param {yfiles.graph.IGraph} graph + */ + prepareAll(graph:yfiles.graph.IGraph):void; + /** + * Write back all information from the partition grid. + * @param {yfiles.graph.IGraph} graph + */ + restoreAll(graph:yfiles.graph.IGraph):void; + /** + * Destroy all information that results from a previous {@link yfiles.graph.TableLayoutConfigurator#prepareAll} and a subsequent layout. + * @param {yfiles.graph.IGraph} graph + */ + cleanUp(graph:yfiles.graph.IGraph):void; + /** + * Return the sizes of all leaf rows. + * This method does not modify originalTable. You also need to call {@link yfiles.graph.TableLayoutConfigurator#cleanUp} explicitly if you don't + * need the {@link yfiles.graph.TableLayoutConfigurator} anymore. + * @param {yfiles.graph.ITable} originalTable The table + * @param {yfiles.geometry.RectD} nodeLayout The final layout of the node that owns the table + * @return {number[]} The sizes of all leaf rows in originalTable, in their natural order. + */ + getColumnLayout(originalTable:yfiles.graph.ITable,nodeLayout:yfiles.geometry.RectD):number[]; + /** + * Return the sizes of all leaf rows. + * This method does not modify originalTable. You also need to call {@link yfiles.graph.TableLayoutConfigurator#cleanUp} explicitly if you don't + * need the {@link yfiles.graph.TableLayoutConfigurator} anymore. + * @param {yfiles.graph.ITable} originalTable The table + * @param {yfiles.geometry.RectD} nodeLayout The final layout of the node that owns the table + * @return {number[]} The sizes of all leaf rows in originalTable, in their natural order. + */ + getRowLayout(originalTable:yfiles.graph.ITable,nodeLayout:yfiles.geometry.RectD):number[]; + } + var TableLayoutConfigurator:{ + $class:yfiles.lang.Class; + }; + /** + * Utility class that conveniently converts an {@link yfiles.graph.IGraph} + * instance to a {@link yfiles.algorithms.Graph} instance. + * This class creates a structural copy of a given {@link yfiles.graph.IGraph} + * and provides convenience methods to convert entities from one instance + * to their corresponding representatives in the other instance. + */ + export interface YGraphAdapter extends Object{ + /** + * Gets the graph instance that is created during the constructor call. + * Value: The graph instance that can be used for the algorithms. + */ + yGraph:yfiles.algorithms.Graph; + /** + * Gets the original graph instance. + * Value: The original graph. + */ + originalGraph:yfiles.graph.IGraph; + /** + * Yields the original node from the {@link yfiles.graph.YGraphAdapter#originalGraph original IGraph}. + * that the given node has been created for. + * @param {yfiles.algorithms.Node} n The node for which the original instance will be returned. + * @return {yfiles.graph.INode} The original instance. + */ + getOriginalNode(n:yfiles.algorithms.Node):yfiles.graph.INode; + /** + * Yields the original edge from the {@link yfiles.graph.YGraphAdapter#originalGraph original IGraph}. + * that the given edge has been created for. + * @param {yfiles.algorithms.Edge} e The edge for which the original instance will be returned. + * @return {yfiles.graph.IEdge} The original instance. + */ + getOriginalEdge(e:yfiles.algorithms.Edge):yfiles.graph.IEdge; + /** + * Yields the node that has been created as a copy in {@link yfiles.graph.YGraphAdapter#yGraph} to + * represent the given node. + * @param {yfiles.graph.INode} n The node for which the representation is returned. + * @return {yfiles.algorithms.Node} The node that represents n in {@link yfiles.graph.YGraphAdapter#yGraph}. + */ + getCopiedNode(n:yfiles.graph.INode):yfiles.algorithms.Node; + /** + * Yields the edge that has been created as a copy in {@link yfiles.graph.YGraphAdapter#yGraph} to + * represent the given edge. + * @param {yfiles.graph.IEdge} e The edge for which the representation is returned. + * @return {yfiles.algorithms.Edge} The edge that represents e in {@link yfiles.graph.YGraphAdapter#yGraph}. + */ + getCopiedEdge(e:yfiles.graph.IEdge):yfiles.algorithms.Edge; + /** + * Creates an {@link yfiles.collections.IEnumerable enumerable of edges} that + * maps the edges from the {@link yfiles.algorithms.EdgeList} to their {@link yfiles.graph.YGraphAdapter#getOriginalEdge + * original} ones. + * This method is useful where algorithms yield {@link yfiles.algorithms.EdgeList} instances + * as results and the result needs to be interpreted in terms of + * the {@link yfiles.graph.YGraphAdapter#originalGraph}. + * @param {yfiles.algorithms.EdgeList} el The edge list. + * @return {yfiles.model.IListEnumerable.} An enumerable that contains the {@link yfiles.graph.YGraphAdapter#getOriginalEdge original} edges + * for the ones in the list. + */ + createEdgeEnumerable(el:yfiles.algorithms.EdgeList):yfiles.model.IListEnumerable; + /** + * Creates an {@link yfiles.collections.IEnumerable enumerable of nodes} that + * maps the nodes from the {@link yfiles.algorithms.NodeList} to their {@link yfiles.graph.YGraphAdapter#getOriginalNode + * original} ones. + * This method is useful where algorithms yield {@link yfiles.algorithms.NodeList} instances + * as results and the result needs to be interpreted in terms of + * the {@link yfiles.graph.YGraphAdapter#originalGraph}. + * @param {yfiles.algorithms.NodeList} nl The node list. + * @return {yfiles.model.IListEnumerable.} An enumerable that contains the {@link yfiles.graph.YGraphAdapter#getOriginalNode original} nodes + * for the ones in the list. + */ + createNodeEnumerable(nl:yfiles.algorithms.NodeList):yfiles.model.IListEnumerable; + /** + * Creates an {@link yfiles.algorithms.EdgeList} that + * maps the edges from the {@link yfiles.collections.IEnumerable} to their {@link yfiles.graph.YGraphAdapter#getCopiedEdge + * copied} ones. + * This method is useful where algorithms require {@link yfiles.algorithms.EdgeList} instances + * as input and those edges are available as {@link yfiles.collections.IEnumerable}s in + * the {@link yfiles.graph.YGraphAdapter#originalGraph}. + * @param {yfiles.collections.IEnumerable.} el The edges from the {@link yfiles.graph.YGraphAdapter#originalGraph}. + * @return {yfiles.algorithms.EdgeList} An {@link yfiles.algorithms.EdgeList} that contains the {@link yfiles.graph.YGraphAdapter#getCopiedEdge copied} edges + * for the ones in the enumerable. + */ + createEdgeList(el:yfiles.collections.IEnumerable):yfiles.algorithms.EdgeList; + /** + * Creates a {@link yfiles.algorithms.NodeList} that + * maps the nodes from the {@link yfiles.collections.IEnumerable} to their {@link yfiles.graph.YGraphAdapter#getCopiedNode + * copied} ones. + * This method is useful where algorithms require {@link yfiles.algorithms.NodeList} instances + * as input and those nodes are available as {@link yfiles.collections.IEnumerable}s in + * the {@link yfiles.graph.YGraphAdapter#originalGraph}. + * @param {yfiles.collections.IEnumerable.} nl The nodes from the {@link yfiles.graph.YGraphAdapter#originalGraph}. + * @return {yfiles.algorithms.NodeList} A {@link yfiles.algorithms.NodeList} that contains the {@link yfiles.graph.YGraphAdapter#getCopiedNode copied} nodes + * for the ones in the enumerable. + */ + createNodeList(nl:yfiles.collections.IEnumerable):yfiles.algorithms.NodeList; + /** + * Creates an {@link yfiles.algorithms.IDataProvider} that delegates to the provided {@link yfiles.model.IMapper} + * when queried for items in the {@link yfiles.graph.YGraphAdapter#yGraph}. + * This method is useful where algorithms require {@link yfiles.algorithms.IDataProvider}s as input + * and that input can be obtained from {@link yfiles.model.IMapper} instances that + * provide the values for the {@link yfiles.graph.YGraphAdapter#getOriginalNode original nodes} and + * {@link yfiles.graph.YGraphAdapter#getOriginalEdge edges}. + * @param {yfiles.model.IMapper.} mapper The mapper to direct requests to. + * @return {yfiles.algorithms.IDataProvider} A DataProvider that will delegate requests to the mapper. + */ + createDataProviderForMapper(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,mapper:yfiles.model.IMapper):yfiles.algorithms.IDataProvider; + /** + * Creates an {@link yfiles.algorithms.IDataProvider} that delegates to the provided delegate + * when queried for items in the {@link yfiles.graph.YGraphAdapter#yGraph}. + * This method is useful where algorithms require {@link yfiles.algorithms.IDataProvider}s as input + * and that input can be through a dynamic callback that + * provides the values for the {@link yfiles.graph.YGraphAdapter#getOriginalNode original nodes} and + * {@link yfiles.graph.YGraphAdapter#getOriginalEdge edges}. + * @param {function(K):V} mapperDelegate The mapper delegate to direct requests to. + * @return {yfiles.algorithms.IDataProvider} A DataProvider that will delegate requests to the mapperDelegate. + */ + createDataProviderForDelegate(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,mapperDelegate:(key:K)=>V):yfiles.algorithms.IDataProvider; + /** + * Creates an {@link yfiles.model.IMapper} that delegates to the provided {@link yfiles.algorithms.INodeMap} + * when queried for items in the {@link yfiles.graph.IGraph}. + * This method is useful where algorithms yield {@link yfiles.algorithms.INodeMap}s + * and their values should be provided using {@link yfiles.model.IMapper} instances that + * use the {@link yfiles.graph.YGraphAdapter#getOriginalNode original nodes}. + * @param {yfiles.algorithms.INodeMap} nodeMap The map to direct requests to. + * @return {yfiles.model.IMapper.} A mapper that will delegate requests to the nodeMap. + */ + createMapperForNodeMap(nodeMap:yfiles.algorithms.INodeMap):yfiles.model.IMapper; + /** + * Creates an {@link yfiles.model.IMapper} that delegates to the provided {@link yfiles.algorithms.IEdgeMap} + * when queried for items in the {@link yfiles.graph.IGraph}. + * This method is useful where algorithms yield {@link yfiles.algorithms.IDataProvider}s + * and their values should be provided using {@link yfiles.model.IMapper} instances that + * use the {@link yfiles.graph.YGraphAdapter#getOriginalEdge original edges}. + * @param {yfiles.algorithms.IEdgeMap} edgeMap The map to direct requests to. + * @return {yfiles.model.IMapper.} A mapper that will delegate requests to the edgeMap. + */ + createMapperForEdgeMap(edgeMap:yfiles.algorithms.IEdgeMap):yfiles.model.IMapper; + /** + * Creates an {@link yfiles.model.IMapper} that delegates to the provided {@link yfiles.algorithms.IDataProvider} + * when queried for items in the {@link yfiles.graph.IGraph}. + * This method is useful where algorithms yield {@link yfiles.algorithms.IDataProvider}s + * and their values should be provided using {@link yfiles.model.IMapper} instances that + * use the {@link yfiles.graph.YGraphAdapter#getOriginalEdge original edges} and + * the {@link yfiles.graph.YGraphAdapter#getOriginalNode original nodes}. + * @param {yfiles.algorithms.IDataProvider} provider The provider to direct requests to. + * @return {yfiles.model.IMapper.} A mapper that will delegate requests to the provider. + */ + createMapper(provider:yfiles.algorithms.IDataProvider):yfiles.model.IMapper; + /** + * Creates an {@link yfiles.algorithms.IDataMap} that delegates to the provided {@link yfiles.model.IMapper} + * when queried for items in the {@link yfiles.graph.YGraphAdapter#yGraph}. + * This method is useful where algorithms require {@link yfiles.algorithms.IDataMap}s as input + * and that input can be obtained from {@link yfiles.model.IMapper} instances that + * provide and accept values for the {@link yfiles.graph.YGraphAdapter#getOriginalNode original nodes} and + * {@link yfiles.graph.YGraphAdapter#getOriginalEdge edges}. + * @param {yfiles.model.IMapper.} mapper The mapper to direct requests to. + * @return {yfiles.algorithms.IDataMap} An {@link yfiles.algorithms.IDataMap} that will delegate the functionality to the mapper. + * @see {@link yfiles.graph.YGraphAdapter#createDataProviderForMapper} + */ + createDataMap(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,mapper:yfiles.model.IMapper):yfiles.algorithms.IDataMap; + /** + * Creates an {@link yfiles.algorithms.INodeMap} that delegates to the provided {@link yfiles.model.IMapper} + * when queried for {@link yfiles.algorithms.Node}s in the {@link yfiles.graph.YGraphAdapter#yGraph}. + * This method is useful where algorithms require {@link yfiles.algorithms.INodeMap}s as input + * and this can be mapped to corresponding {@link yfiles.model.IMapper} instances that + * provide and accept the values for the {@link yfiles.graph.YGraphAdapter#getOriginalNode original nodes}. + * @param {yfiles.model.IMapper.} mapper The mapper to direct requests to. + * @return {yfiles.algorithms.INodeMap} An {@link yfiles.algorithms.INodeMap} that will delegate reads and writes to the mapper. + */ + createNodeMap(mapper:yfiles.model.IMapper):yfiles.algorithms.INodeMap; + /** + * Creates an {@link yfiles.algorithms.INodeMap} that delegates to the provided delegate + * when queried for {@link yfiles.algorithms.Node}s in the {@link yfiles.graph.YGraphAdapter#yGraph}. + * This method is useful where algorithms require {@link yfiles.algorithms.INodeMap}s as input + * and this can be mapped to a corresponding dynamic callback that + * provides the values for the {@link yfiles.graph.YGraphAdapter#getOriginalNode original nodes}. + * @param {function(yfiles.graph.INode):V} mapperDelegate The mapper delegate to direct read requests to. + * @return {yfiles.algorithms.INodeMap} An {@link yfiles.algorithms.INodeMap} that will delegate reads to the mapperDelegate. + */ + createNodeMapForDelegate(mapperDelegate:(key:yfiles.graph.INode)=>V):yfiles.algorithms.INodeMap; + /** + * Creates an {@link yfiles.algorithms.IEdgeMap} that delegates to the provided {@link yfiles.model.IMapper} + * when queried for {@link yfiles.algorithms.Edge}s in the {@link yfiles.graph.YGraphAdapter#yGraph}. + * This method is useful where algorithms require {@link yfiles.algorithms.IEdgeMap}s as input + * and this can be mapped to corresponding {@link yfiles.model.IMapper} instances that + * provide and accept the values for the {@link yfiles.graph.YGraphAdapter#getOriginalEdge original edges}. + * @param {yfiles.model.IMapper.} mapper The mapper to direct requests to. + * @return {yfiles.algorithms.IEdgeMap} An {@link yfiles.algorithms.IEdgeMap} that will delegate reads and writes to the mapper. + */ + createEdgeMapForMapper(mapper:yfiles.model.IMapper):yfiles.algorithms.IEdgeMap; + /** + * Creates an {@link yfiles.algorithms.IEdgeMap} that delegates to the provided delegate + * when queried for {@link yfiles.algorithms.Edge}s in the {@link yfiles.graph.YGraphAdapter#yGraph}. + * This method is useful where algorithms require {@link yfiles.algorithms.IEdgeMap}s as input + * and this can be mapped to a corresponding dynamic callback that + * provides the values for the {@link yfiles.graph.YGraphAdapter#getOriginalEdge original edges}. + * @param {function(yfiles.graph.IEdge):V} mapperDelegate The mapper delegate to direct read requests to. + * @return {yfiles.algorithms.IEdgeMap} An {@link yfiles.algorithms.INodeMap} that will delegate reads to the mapperDelegate. + */ + createEdgeMapForDelegate(mapperDelegate:(key:yfiles.graph.IEdge)=>V):yfiles.algorithms.IEdgeMap; + } + var YGraphAdapter:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.YGraphAdapter} class. + * This will create a copy of the originalGraph + * that has the same structure and makes it available via the {@link yfiles.graph.YGraphAdapter#yGraph} + * property. + * @param {yfiles.graph.IGraph} originalGraph The original graph whose structure will be copied. + */ + new (originalGraph:yfiles.graph.IGraph):yfiles.graph.YGraphAdapter; + }; + /** + * This class adds folding support to {@link yfiles.graph.IGraph} implementations on top of the {@link yfiles.graph.IGroupedGraph} + * interface. + * This implementation manages the varying states nodes and edges can have in different views and during different + * {@link yfiles.graph.IFoldedGraph#isExpanded collapsed/expanded} states of the nodes. + * Create an instance of this class for a given {@link yfiles.graph.IGraph} and use + * the {@link yfiles.graph.FoldingManager#createManagedViewWithRootAndExpandedPredicate} methods to create an {@link yfiles.graph.IGraph} implementation that + * provides a view of a subset of the graph, where {@link yfiles.graph.IGroupedGraph group nodes} can be + * {@link yfiles.graph.IFoldedGraph#collapse collapsed} and {@link yfiles.graph.IFoldedGraph#expand expanded}. + *

+    * var graphControl = new GraphControl();
+    * graphControl.graph = new FoldingManager().createManagedView().graph;
+    * graphControl.inputMode = new GraphEditorInputMode();
+    * 
+ * This class can be used to {@link yfiles.graph.FoldingManager#createManagedViewWithRootAndExpandedPredicate create managed views} + * of the {@link yfiles.graph.FoldingManager#masterGraph}, where group nodes can appear as {@link yfiles.graph.IFoldedGraph#collapse collapsed} + * group nodes with their contents hidden. Edges that connect to elements inside collapsed group nodes can be + * {@link yfiles.graph.FoldingManager#dummyEdgeConverter configured} to be represented by {@link yfiles.graph.DummyEdgeId dummy edges} in the + * views. The process of converting one or more true edges from the {@link yfiles.graph.FoldingManager#masterGraph} to zero or more dummy edges + * can be customized, as well as the process of {@link yfiles.graph.FoldingManager#dummyNodeConverter converting} an expanded group node + * to a collapsed group node. + *
+ * Related Information in the Developers Guide: + *

+ * Class FoldingManager's central role for folding support is discussed + * in the section Folding Characteristics. + * A brief description of the class's API, set-up, etc. is given in the section + * Class FoldingManager. + *

+ * @see {@link yfiles.graph.IFoldedGraph} + * @see {@link yfiles.graph.FoldingManager#createManagedViewWithRoot} + * @see {@link yfiles.graph.FoldingManager#createManagedViewWithRootAndExpandedPredicate} + */ + export interface FoldingManager extends Object,yfiles.graph.IFoldingManager{ + /** + * Gets or sets a property that determines whether the manager should synchronize + * the {@link yfiles.graph.IGroupedGraph#autoAdjustGroupNodeBounds} property of + * the {@link yfiles.graph.FoldingManager#masterGroupedGraph} with the client views. + * This property should be disabled to allow for modifying the contents of a collapsed + * group node without affecting the ancestor group nodes of nodes which would otherwise + * not be affected by that change. + * The default value is adopted from the + * initial setting of the {@link yfiles.graph.IGroupedGraph#autoAdjustGroupNodeBounds} + * property of the {@link yfiles.graph.FoldingManager#masterGroupedGraph}. If the graph is created using + * the constructor, the initial value will be false. + */ + autoAdjustMasterGroupNodeBounds:boolean; + /** + * Disposes of this instance. + * This will disconnect the {@link yfiles.graph.FoldingManager#masterGraph} from the previously created {@link yfiles.graph.FoldingManager#createManagedView managed views}. + * Also each view will be {@link yfiles.graph.IFoldedGraph#dispose disposed}. + */ + dispose():void; + /** + * Gets or sets the {@link yfiles.graph.IDummyEdgeConverter} implementation that is used + * to create/convert and modify the {@link yfiles.graph.DummyEdgeId dummy edges} + * inside the view instances. + * The converter instance will be used to + * {@link yfiles.graph.IDummyEdgeConverter#createDummyEdgeAppearance create the initial} + * and {@link yfiles.graph.IDummyEdgeConverter#changeDummyEdgeAppearance change} the + * appearance of the dummy edges as soon as they appear in a view. + * @see {@link yfiles.graph.DefaultDummyEdgeConverter} + * @throws {yfiles.system.ArgumentNullException} value is null. + * @see Specified by {@link yfiles.graph.IFoldingManager#dummyEdgeConverter}. + */ + dummyEdgeConverter:yfiles.graph.IDummyEdgeConverter; + /** + * Gets or sets the {@link yfiles.graph.IDummyNodeConverter} implementation that is used + * to create/convert and modify the {@link yfiles.graph.DummyNodeId collapsed group node dummies} + * inside the view instances. + * The converter instance will be used to + * {@link yfiles.graph.IDummyNodeConverter#createDummyNodeAppearance create the initial} + * and {@link yfiles.graph.IDummyNodeConverter#changeDummyNodeAppearance change} the + * appearance of the collapsed dummy group nodes as soon as they appear in a view. + * @see {@link yfiles.graph.DefaultDummyNodeConverter} + * @see Specified by {@link yfiles.graph.IFoldingManager#dummyNodeConverter}. + */ + dummyNodeConverter:yfiles.graph.IDummyNodeConverter; + /** + * Yields the master {@link yfiles.graph.IGraph} instance that holds the complete model in expanded group node state. + * This graph contains all non-dummy edges and expanded group nodes, no dummy edges and no collapsed group nodes. + * @see Specified by {@link yfiles.graph.IFoldingManager#masterGraph}. + */ + masterGraph:yfiles.graph.IGraph; + /** + * Yields the master {@link yfiles.graph.IHierarchy} instance that contains all nodes in the model, regardless of + * their (view-local) collapsed state. + * This is the hierarchy that is associated with the {@link yfiles.graph.IGroupedGraph} that belongs to the + * {@link yfiles.graph.FoldingManager#masterGraph}. + * @see Specified by {@link yfiles.graph.IFoldingManager#masterHierarchy}. + */ + masterHierarchy:yfiles.graph.IHierarchy; + /** + * Yields the master {@link yfiles.graph.IGroupedGraph} instance that models the fully expanded + * grouped graph. + * This is the instance that is associated with the {@link yfiles.graph.FoldingManager#masterGraph} and the {@link yfiles.graph.FoldingManager#masterHierarchy}. + * @see Specified by {@link yfiles.graph.IFoldingManager#masterGroupedGraph}. + */ + masterGroupedGraph:yfiles.graph.IGroupedGraph; + /** + * Callback that can be overridden by subclasses to prepare the {@link yfiles.graph.IFoldedGraph} instance + * right before it will be initialized with a copy of the elements in the initial graph. + * Subclasses could override this method to register additional {@link yfiles.model.IMapper} instances + * with the graph instance or add {@link yfiles.support.IContextLookupChainLink}s + * via the {@link yfiles.support.ILookupDecorator} of the {@link yfiles.graph.IFoldedGraph#graph} + * to the instance if they are essential for the initial creation of the elements in the view instance. + * Overriding methods should always consider to call the base class implementation, first. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The graph view that has just been created but is still empty. + */ + prepareFoldedGraph(foldedGraph:yfiles.graph.IFoldedGraph):void; + /** + * Creates a separate view instance of the {@link yfiles.graph.FoldingManager#masterGraph} which is a synchronized copy of a subset of the + * items from the master graph. + * This method will create a new instance of an {@link yfiles.graph.IGraph} that is constructed as a synchronized copy of the {@link yfiles.graph.FoldingManager#masterGraph}. + * That instance can be obtained from the {@link yfiles.graph.IFoldedGraph#graph} property of the returned {@link yfiles.graph.IFoldedGraph} implementation. + * The graph instance will provide the following instances in its {@link yfiles.support.ILookup#lookup} mechanism: + *
    + *
  • + * {@link yfiles.graph.IFoldedGraph}The instance of the {@link yfiles.graph.IFoldedGraph} interface that + * can be used to gain access to this {@link yfiles.graph.IFoldedGraph#manager manager instance} and the folding operations. + *
  • + *
  • + * {@link yfiles.graph.IGroupedGraph}An implementation of the {@link yfiles.graph.IGroupedGraph} interface that + * can be used to modify and inspect the local {@link yfiles.graph.IHierarchy hierarchy of the nodes} in this view. + *
  • + *
+ * Note that the entities that are contained in the returned graph instance are not the same instances as the original "master" entities in the + * {@link yfiles.graph.FoldingManager#masterGraph}. However they share the same properties ({@link yfiles.drawing.IVisualStyle style}, {@link yfiles.support.ITagOwner#tag tag}, + * {@link yfiles.graph.ILabelModelParameter parameters}, and {@link yfiles.graph.INode#layout geometry}). + * For collapsed group nodes and edge representatives, there is a separate set of properties available for each possible state combination. + * The {@link yfiles.graph.FoldingManager#getEdgeViewState} method for edges and the {@link yfiles.graph.FoldingManager#getNodeViewState} method for nodes provide + * access to that state while it is not being displayed in a view. + * @param {yfiles.graph.INode} root A group node or the root of the {@link yfiles.graph.FoldingManager#masterHierarchy} whose contents will be displayed in the view. + * @param {function(yfiles.graph.INode):boolean} expandedPredicate A predicate that can be provided to the view that will be used as a callback to determine the + * initial {@link yfiles.graph.IFoldedGraph#isExpanded expansion state} of group nodes in the view. + * @return {yfiles.graph.IFoldedGraph} A new graph instance that represents a synchronized view on the {@link yfiles.graph.FoldingManager#masterGraph}. + * @see {@link yfiles.graph.FoldingManager#prepareFoldedGraph} + */ + createManagedViewWithRootAndExpandedPredicate(root:yfiles.graph.INode,expandedPredicate:(obj:yfiles.graph.INode)=>boolean):yfiles.graph.IFoldedGraph; + /** + * Variant of the {@link yfiles.graph.FoldingManager#createManagedViewWithRootAndExpandedPredicate} method + * which lazily evaluates the value of the {@link yfiles.graph.FoldingManager#defaultExpandedPredicate} method to determine the initial + * expanded state of the nodes. + * This method will actually use the value of the {@link yfiles.graph.FoldingManager#defaultExpandedPredicate} {@link system.Predicate} + * function as the predicate that determines the initial expanded state at the time of the invocation. + * Therefore, changing the {@link yfiles.graph.FoldingManager#defaultExpandedPredicate} property after the creation of the view will + * still influence the view. + * @param {yfiles.graph.INode} root A group node or the root of the {@link yfiles.graph.FoldingManager#masterHierarchy} whose contents will be displayed in the view. + * @return {yfiles.graph.IFoldedGraph} A new graph instance that represents a synchronized view on the {@link yfiles.graph.FoldingManager#masterGraph}. + * @see {@link yfiles.graph.FoldingManager#createManagedViewWithRootAndExpandedPredicate} + * @see {@link yfiles.graph.FoldingManager#isInitiallyExpanded} + */ + createManagedViewWithRoot(root:yfiles.graph.INode):yfiles.graph.IFoldedGraph; + /** + * Variant of the {@link yfiles.graph.FoldingManager#createManagedViewWithRootAndExpandedPredicate} method + * where the root is set to the root in the {@link yfiles.graph.FoldingManager#masterHierarchy}. + * The view lazily evaluates the value of the {@link yfiles.graph.FoldingManager#defaultExpandedPredicate} method to determine the initial + * expanded state of the nodes. + * This method will actually use the value of the {@link yfiles.graph.FoldingManager#defaultExpandedPredicate} {@link system.Predicate} + * function as the predicate that determines the initial expanded state at the time of the invocation. + * Therefore, changing the {@link yfiles.graph.FoldingManager#defaultExpandedPredicate} property after the creation of the view will + * still influence the view. + * @return {yfiles.graph.IFoldedGraph} A new graph instance that represents a synchronized view on the {@link yfiles.graph.FoldingManager#masterGraph}. + * @see {@link yfiles.graph.FoldingManager#createManagedViewWithRoot} + * @see {@link yfiles.graph.FoldingManager#createManagedViewWithRootAndExpandedPredicate} + * @see {@link yfiles.graph.FoldingManager#isInitiallyExpanded} + * @see Specified by {@link yfiles.graph.IFoldingManager#createManagedView}. + */ + createManagedView():yfiles.graph.IFoldedGraph; + /** + * Yields all currently known {@link yfiles.graph.FoldingManager#createManagedView view instances} that + * are managed by this instance. + * @see {@link yfiles.graph.IFoldedGraph#graph} + * @see Specified by {@link yfiles.graph.IFoldingManager#views}. + */ + views:yfiles.collections.IEnumerable; + /** + * Determines whether for the given {@link yfiles.graph.DummyNodePortId} + * this manager has stored associated view local state. + * The manager does not necessarily have view local state for dummy elements if that + * specific state has never been requested by a {@link yfiles.graph.IFoldedGraph} view because it has never been visualized. + * This method indicates whether there is state information available for the given id. + * @param {yfiles.graph.DummyNodePortId} id The id for which state is requested. + * @return {boolean} Whether {@link yfiles.graph.FoldingManager#getPortViewState} would return existing state information. + * @see {@link yfiles.graph.FoldingManager#getPortViewState} + * @see Specified by {@link yfiles.graph.IFoldingManager#hasPortViewState}. + */ + hasPortViewState(id:yfiles.graph.DummyNodePortId):boolean; + /** + * Determines whether for the given {@link yfiles.graph.DummyNodeId} + * this manager has stored associated view local state. + * The manager does not necessarily have view local state for dummy elements if that + * specific state has never been requested by a {@link yfiles.graph.IFoldedGraph} view because it has never been visualized. + * This method indicates whether there is state information available for the given id. + * @param {yfiles.graph.DummyNodeId} id The id for which state is requested. + * @return {boolean} Whether {@link yfiles.graph.FoldingManager#getNodeViewState} would return existing state information. + * @see {@link yfiles.graph.FoldingManager#getNodeViewState} + * @see Specified by {@link yfiles.graph.IFoldingManager#hasNodeViewState}. + */ + hasNodeViewState(id:yfiles.graph.DummyNodeId):boolean; + /** + * Determines whether for the given {@link yfiles.graph.DummyEdgeId} + * this manager has stored associated view local state. + * The manager does not necessarily have view local state for dummy elements if that + * specific state has never been requested by a {@link yfiles.graph.IFoldedGraph} view because it has never been visualized. + * This method indicates whether there is state information available for the given id. + * @param {yfiles.graph.DummyEdgeId} id The id for which state is requested. + * @return {boolean} Whether {@link yfiles.graph.FoldingManager#getEdgeViewState} would return existing state information. + * @see {@link yfiles.graph.FoldingManager#getEdgeViewState} + * @see Specified by {@link yfiles.graph.IFoldingManager#hasEdgeViewState}. + */ + hasEdgeViewState(id:yfiles.graph.DummyEdgeId):boolean; + /** + * Provides access to the dummy state of a node for a specific view. + * This method can be used to query the collapsed state of a node in a specific view, even if there + * is no such view currently present or the node is in fact expanded currently in that view. + * Note that the instance returned is neither part of the {@link yfiles.graph.FoldingManager#masterGraph} nor part + * of any of the managed views. It serves as a data holder object only and the only way to modify it + * is using + * the {@link yfiles.graph.IChangeDummyNodeAppearanceCallback callback} provided by + * the {@link yfiles.graph.FoldingManager#getChangeDummyNodeAppearanceCallback} method or directly working + * on the dummy node in a {@link yfiles.graph.IFoldedGraph} view. + * @param {yfiles.graph.DummyNodeId} nodeId The id for which the state should be returned. + * @return {yfiles.graph.INode} A state holder implementation of a node, which is not part of any graph and can + * only be modified through the {@link yfiles.graph.FoldingManager#getChangeDummyNodeAppearanceCallback} method. + * @see {@link yfiles.graph.FoldingManager#getChangeDummyNodeAppearanceCallback} + * @throws {yfiles.system.ArgumentOutOfRangeException} nodeId is out of range. + * The master node does not belong to the managed graph. + * @see Specified by {@link yfiles.graph.IFoldingManager#getNodeViewState}. + */ + getNodeViewState(nodeId:yfiles.graph.DummyNodeId):yfiles.graph.INode; + /** + * Provides access to the dummy state of a port for a specific view. + * This method can be used to query the state of a port at a collapsed node in a specific view, even if there + * is no such view currently present or the port's node is in fact expanded currently in that view. + * Note that the instance returned is neither part of the {@link yfiles.graph.FoldingManager#masterGraph} nor part + * of any of the managed views. It serves as a data holder object only and the only way to modify it + * is using + * the {@link yfiles.graph.IChangeDummyNodeAppearanceCallback callback} provided by + * the {@link yfiles.graph.FoldingManager#getChangeDummyNodeAppearanceCallback} method or directly working + * on the dummy port in a {@link yfiles.graph.IFoldedGraph} view. + * @param {yfiles.graph.DummyNodePortId} nodePortId The id for which the state should be returned. + * @return {yfiles.graph.IPort} A state holder implementation of a port, which is not part of any graph and can + * only be modified through the {@link yfiles.graph.FoldingManager#getChangeDummyNodeAppearanceCallback} method. + * @see {@link yfiles.graph.FoldingManager#getChangeDummyNodeAppearanceCallback} + * @see {@link yfiles.graph.IChangeDummyNodeAppearanceCallback#setPortStyle} + * @see {@link yfiles.graph.IChangeDummyNodeAppearanceCallback#setPortLocationModelParameter} + * @see {@link yfiles.graph.DummyNodePortId} + * @see Specified by {@link yfiles.graph.IFoldingManager#getPortViewState}. + */ + getPortViewState(nodePortId:yfiles.graph.DummyNodePortId):yfiles.graph.IPort; + /** + * This method is meant for internal use only. + * This method is considered internal but public for technical reasons. + * @param {yfiles.graph.IEdge} masterEdge + * @return {yfiles.collections.IEnumerable.>} + * @see Specified by {@link yfiles.graph.IFoldingManager#getAllViewStates}. + */ + getAllViewStates(masterEdge:yfiles.graph.IEdge):yfiles.collections.IEnumerable>; + /** + * Return a data container implementation that is not part of any actual {@link yfiles.graph.IGraph} + * that describes the state of the edge for the given {@link yfiles.graph.DummyEdgeId}. + * This method can be used to query the state of an edge that is either not currently + * visible in any {@link yfiles.graph.FoldingManager#views view} or connects to different + * source and target nodes because of the {@link yfiles.graph.IFoldedGraph#collapse collapsed} + * states of the nodes and their parents in the view. + * The state can only be modified using the callback provided by + * {@link yfiles.graph.FoldingManager#getChangeDummyEdgeAppearanceCallback} or by modifying the corresponding + * item in a {@link yfiles.graph.IFoldedGraph} view. + * @param {yfiles.graph.DummyEdgeId} edgeId The id of the dummy edge for which the view state should be returned. + * @return {yfiles.graph.IEdge} An implementation of {@link yfiles.graph.IEdge} that can be used to query + * all properties of the edge. + * @see {@link yfiles.graph.FoldingManager#getNodeViewState} + * @see {@link yfiles.graph.DummyEdgeId} + * @see {@link yfiles.graph.FoldingManager#getChangeDummyEdgeAppearanceCallback} + * @see Specified by {@link yfiles.graph.IFoldingManager#getEdgeViewState}. + */ + getEdgeViewState(edgeId:yfiles.graph.DummyEdgeId):yfiles.graph.IEdge; + /** + * Triggers a call to {@link yfiles.graph.IDummyEdgeConverter#changeDummyEdgeAppearance} for all dummy edges + * that {@link yfiles.graph.IFoldedGraph#getRepresentative represent} the given masterEdge. + *

+ * In all {@link yfiles.graph.FoldingManager#views} that are currrently showing the dummy edge for the provided master edge, the + * {@link yfiles.graph.FoldingManager#getEdgeViewState view-local state} will be updated via a call to the {@link yfiles.graph.IDummyEdgeConverter}'s + * {@link yfiles.graph.IDummyEdgeConverter#changeDummyEdgeAppearance} method. + *

+ *

+ * This method is useful in situations where a change in the data on the master graph did not automatically trigger a call to the converter. + * Using this method, the state of the representing edges in the views can be synchronized according to the logic in the {@link yfiles.graph.IDummyEdgeConverter} implementation. + *

+ * @param {yfiles.graph.IEdge} masterEdge The master edge that belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. + * @throws {yfiles.system.ArgumentOutOfRangeException} If the provided master edge does not belong to the master graph. + * @see {@link yfiles.graph.FoldingManager#updateViewStatesForNode} + */ + updateViewStatesForEdge(masterEdge:yfiles.graph.IEdge):void; + /** + * Triggers a call to {@link yfiles.graph.IDummyNodeConverter#changeDummyNodeAppearance} for all dummy nodes + * that {@link yfiles.graph.IFoldedGraph#getRepresentative represent} the given masterNode + * in its collapsed state. + *

+ * In all {@link yfiles.graph.FoldingManager#views} that are currrently showing the node in collapsed state, the + * {@link yfiles.graph.FoldingManager#getNodeViewState view-local state} will be updated via a call to the {@link yfiles.graph.IDummyNodeConverter}'s + * {@link yfiles.graph.IDummyNodeConverter#changeDummyNodeAppearance} method. + *

+ *

+ * This method is useful in situations where a change in the data on the master graph did not automatically trigger a call to the converter. + * Using this method, the state of the collapsed nodes in the views can be synchronized according to the logic in the {@link yfiles.graph.IDummyNodeConverter} implementation. + *

+ * @param {yfiles.graph.INode} masterNode The master node that belongs to the {@link yfiles.graph.FoldingManager#masterGraph}. + * @throws {yfiles.system.ArgumentOutOfRangeException} If the provided master node does not belong to the master graph. + * @see {@link yfiles.graph.FoldingManager#updateViewStatesForEdge} + */ + updateViewStatesForNode(masterNode:yfiles.graph.INode):void; + /** + * Returns a callback object that can be used to modify the appearance of a given dummy + * edge without using a {@link yfiles.graph.IFoldedGraph} view. + * This method can be used to modify the {@link yfiles.graph.FoldingManager#getEdgeViewState view specific} + * state of a dummy edge, even if there is no view, that is currently displaying this edge. + * The methods provided by the callback implementation will work on the given {@link yfiles.graph.DummyEdgeId} + * and will affect all views that display that exact dummy edge. + * Using the callback is the only way of modifying a {@link yfiles.graph.FoldingManager#getEdgeViewState dummy edge view state}, + * since the {@link yfiles.graph.IEdge} instance returned by {@link yfiles.graph.FoldingManager#getEdgeViewState} does not + * belong to an accessible {@link yfiles.graph.IGraph} instance and thus cannot be modified otherwise. + * @param {yfiles.graph.DummyEdgeId} edgeId The id of the dummy edge to modify. + * @return {yfiles.graph.IChangeDummyEdgeAppearanceCallback} A callback implementation that can be used to modify the edge. + * @see {@link yfiles.graph.FoldingManager#getEdgeViewState} + * @see Specified by {@link yfiles.graph.IFoldingManager#getChangeDummyEdgeAppearanceCallback}. + */ + getChangeDummyEdgeAppearanceCallback(edgeId:yfiles.graph.DummyEdgeId):yfiles.graph.IChangeDummyEdgeAppearanceCallback; + /** + * Returns a callback object that can be used to modify the appearance of a given dummy + * node without using a {@link yfiles.graph.IFoldedGraph} view. + * This method can be used to modify the {@link yfiles.graph.FoldingManager#getNodeViewState view specific} + * state of a dummy node, even if there is no view, that is currently displaying this node. + * The methods provided by the callback implementation will work on the given {@link yfiles.graph.DummyNodeId} + * and will affect all views that display that exact dummy node. + * Using the callback is the only way of modifying a {@link yfiles.graph.FoldingManager#getNodeViewState dummy node view state}, + * since the {@link yfiles.graph.INode} instance returned by {@link yfiles.graph.FoldingManager#getNodeViewState} does not + * belong to an accessible {@link yfiles.graph.IGraph} instance and thus cannot be modified otherwise. + * @param {yfiles.graph.DummyNodeId} nodeId The id of the dummy node to modify. + * @return {yfiles.graph.IChangeDummyNodeAppearanceCallback} A callback implementation that can be used to modify the node. + * @see {@link yfiles.graph.FoldingManager#getNodeViewState} + * @see Specified by {@link yfiles.graph.IFoldingManager#getChangeDummyNodeAppearanceCallback}. + */ + getChangeDummyNodeAppearanceCallback(nodeId:yfiles.graph.DummyNodeId):yfiles.graph.IChangeDummyNodeAppearanceCallback; + /** + * Allows for setting the {@link yfiles.graph.IFoldedGraph#expand expanded state} + * of a group node from the master graph that will be applied to the group nodes + * in the default {@link yfiles.graph.FoldingManager#createManagedView managed views} the + * next time it will become visible in those views. + * The {@link yfiles.graph.FoldingManager#isInitiallyExpanded} {@link system.Predicate} function + * will be used as the predicate in the {@link yfiles.graph.FoldingManager#createManagedView} + * and {@link yfiles.graph.FoldingManager#createManagedViewWithRoot} factory methods. + * This method can be used to set the expanded state that is returned by + * that method for the given groupNode. + * @param {yfiles.graph.INode} groupNode The group node in the {@link yfiles.graph.FoldingManager#masterHierarchy}. + * @param {boolean} expanded true iff the node should be displayed in {@link yfiles.graph.IFoldedGraph#expand}ed state + * the next time it will become visible in the default views. + * @see {@link yfiles.graph.FoldingManager#isInitiallyExpanded} + * @see Specified by {@link yfiles.graph.IFoldingManager#setInitiallyExpanded}. + */ + setInitiallyExpanded(groupNode:yfiles.graph.INode,expanded:boolean):void; + /** + * Determines whether the given group node from the {@link yfiles.graph.FoldingManager#masterGraph} + * should be displayed in {@link yfiles.graph.IFoldedGraph#expand}ed state if it is included + * in a {@link yfiles.graph.FoldingManager#createManagedViewWithRoot managed view} for the first time. + * The {@link yfiles.graph.FoldingManager#createManagedView} and {@link yfiles.graph.FoldingManager#createManagedViewWithRoot} factory methods + * use the {@link yfiles.graph.FoldingManager#defaultExpandedPredicate} function to determine the initial + * expanded state of a group node. This method is the initial value of the predicate. + * This simple implementation will yield true, unless {@link yfiles.graph.FoldingManager#setInitiallyExpanded} + * has been called before for the provided group node, in which case that specific value will be returned. + * @param {yfiles.graph.INode} groupNode The group node in the {@link yfiles.graph.FoldingManager#masterHierarchy}. + * @return {boolean} true iff the node should be initially displayed in {@link yfiles.graph.IFoldedGraph#expand}ed state + * in the view that queries the initial state. + * @see {@link yfiles.graph.FoldingManager#setInitiallyExpanded} + * @see {@link yfiles.graph.IFoldedGraph#isInitiallyExpanded} + */ + isInitiallyExpanded(groupNode:yfiles.graph.INode):boolean; + /** + * Gets or sets the {@link system.Predicate} function to use + * by default to determine the {@link yfiles.graph.IFoldedGraph#isExpanded initial expanded state} + * for the views that have been {@link yfiles.graph.FoldingManager#createManagedViewWithRoot created} with the default expanded predicate + * function. + * The default value of this predicate is the {@link yfiles.graph.FoldingManager#isInitiallyExpanded} method + * of this class. + * @see {@link yfiles.graph.FoldingManager#createManagedViewWithRoot} + * @see {@link yfiles.graph.FoldingManager#createManagedView} + * @see {@link yfiles.graph.FoldingManager#isInitiallyExpanded} + * @see {@link yfiles.graph.FoldingManager#setInitiallyExpanded} + * @see Specified by {@link yfiles.graph.IFoldingManager#defaultExpandedPredicate}. + */ + defaultExpandedPredicate:(obj:yfiles.graph.INode)=>boolean; + } + var FoldingManager:{ + $class:yfiles.lang.Class; + /** + * Creates a new manager with a default backing graph implementation. + * Use {@link yfiles.graph.FoldingManager#createManagedView} to create a view that supports the + * {@link yfiles.graph.IFoldedGraph} interface for displaying and working with a collapsible graph structure. + * @see {@link yfiles.graph.FoldingManager#createManagedView} + * @see {@link yfiles.graph.FoldingManager#masterGraph} + */ + new ():yfiles.graph.FoldingManager; + /** + * Creates a manager instance for the given {@link yfiles.graph.FoldingManager#masterGraph} to create views on top of it + * that support folding operations. + * @param {yfiles.graph.IGraph} masterGraph The graph to use as the {@link yfiles.graph.FoldingManager#masterGraph}. This instance needs to support + * the {@link yfiles.graph.IGroupedGraph} interface. + * @see {@link yfiles.graph.DefaultGraph#groupingSupported} + * @throws {yfiles.system.ArgumentNullException} masterGraph is null. + * @throws {yfiles.system.ArgumentException} If the graph does not support {@link yfiles.graph.IHierarchy}. Turn on grouping support. + */ + WithMaster:{ + new (masterGraph:yfiles.graph.IGraph):yfiles.graph.FoldingManager; + }; + }; + /** + * Contains static extension methods for the {@link yfiles.graph.IGroupedGraph} interface. + */ + export interface GroupedGraphExtensions extends Object{ + } + var GroupedGraphExtensions:{ + $class:yfiles.lang.Class; + /** + * Creates a new group node using the {@link yfiles.graph.IGroupedGraph#groupNodeDefaults}. + * The group node will be a top-level group node in the node hierarchy. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.INode} The newly created group node. + * @see {@link yfiles.graph.IGroupedGraph#createGroupNodeWithParentBoundsStyleAndTag} + */ + createGroupNode(groupedGraph:yfiles.graph.IGroupedGraph):yfiles.graph.INode; + /** + * Method to adjust the size of a group node. + * This will resize the group node bounds such that the node requires the least amount of space. + * If the node does not have any {@link yfiles.graph.IHierarchy#getChildren children}, its bounds + * will be left unchanged. This will also respect any {@link yfiles.input.ISizeConstraintProvider}s for + * {@link yfiles.graph.INode}s, that are available in the lookup of the groupNode. + * @see {@link yfiles.drawing.IGroupBoundsCalculator} + * @see {@link yfiles.input.ISizeConstraintProvider} + * @see {@link yfiles.graph.GroupedGraphExtensions#calculateMinimumEnclosedArea} + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph to operate on. + * @param {yfiles.graph.INode} groupNode The group node to adjust the size of. + */ + adjustGroupNodeBounds(groupedGraph:yfiles.graph.IGroupedGraph,groupNode:yfiles.graph.INode):void; + /** + * Enlarges the given group node to ensure that the {@link yfiles.graph.GroupedGraphExtensions#calculateMinimumEnclosedArea minimum enclosed} + * area is inside of its bounds. + * This method can be used to resize a group node and all of its parent group nodes to fully contain its children, e.g. + * after a child node has changed its bounds. Note that this method will only enlarge the bounds of the group nodes, + * it will never reduce the size of a group node. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The grouped graph to work on. + * @param {yfiles.graph.INode} groupNode The group node to resize. + * @param {boolean} ancestors if set to true all ancestor group nodes will be resized, too, if necessary + * @see {@link yfiles.graph.GroupedGraphExtensions#enlargeGroupNodeWithContextNodeAndAncestors} + */ + enlargeGroupNode(groupedGraph:yfiles.graph.IGroupedGraph,groupNode:yfiles.graph.INode,ancestors:boolean):void; + /** + * Enlarges all group nodes in the given groupedGraph so that the + * {@link yfiles.graph.GroupedGraphExtensions#calculateMinimumEnclosedArea minimum enclosed area} is respected. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The grouped graph to resize the group nodes of. + * @see {@link yfiles.graph.GroupedGraphExtensions#enlargeGroupNode} + */ + enlargeAllGroupNodes(groupedGraph:yfiles.graph.IGroupedGraph):void; + /** + * Enlarges all group nodes in the given groupedGraph in an interactive scenario, so that the + * {@link yfiles.graph.GroupedGraphExtensions#calculateMinimumEnclosedArea minimum enclosed area} is respected. + * This method should be used in an interactive editing scenario. It records an {@link yfiles.support.ICompoundEdit} to support undoability + * and uses the {@link yfiles.input.IReshapeHandler} for the resizing of the nodes. That way, e.g. orthogonally edited edges will be properly + * reshaped. + * @param {yfiles.input.IInputModeContext} context The context to use for the {@link yfiles.input.IReshapeHandler}s. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The grouped graph to resize the group nodes of. + * @see {@link yfiles.graph.GroupedGraphExtensions#enlargeGroupNodeWithContextNodeAndAncestors} + */ + enlargeAllGroupNodesWithContext(groupedGraph:yfiles.graph.IGroupedGraph,context:yfiles.input.IInputModeContext):void; + /** + * Enlarges the group nodes in an interactive scenario, using {@link yfiles.input.IReshapeHandler} implementations of the group nodes + * to perform the actual resizing. + * This method should be used in an interactive editing scenario. It records an {@link yfiles.support.ICompoundEdit} to support undoability + * and uses the {@link yfiles.input.IReshapeHandler} for the resizing of the nodes. That way, e.g. orthogonally edited edges will be properly + * reshaped. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The grouped graph to operate on. + * @param {yfiles.input.IInputModeContext} context The context to use for the {@link yfiles.input.IReshapeHandler}s. + * @param {yfiles.graph.INode} node The node to enlarge appropriately. + * @param {boolean} ancestors if set to true ancestors the ancestor group nodes will be adjusted, too, if necessary. + * @see {@link yfiles.input.IReshapeHandler} + */ + enlargeGroupNodeWithContextNodeAndAncestors(groupedGraph:yfiles.graph.IGroupedGraph,context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,ancestors:boolean):void; + /** + * Calculates the minimum area to enclose by the given group node with respect to its {@link yfiles.drawing.IGroupBoundsCalculator}. + * @param {yfiles.graph.IHierarchy.} nodeHierarchy The hierarchy of the nodes. + * @param {yfiles.graph.INode} groupNode The group node to calculate the minimum enclosed area of. + * @return {yfiles.geometry.RectD} The area to enclose for the given group node. This is {@link yfiles.geometry.RectD#EMPTY} if the node is not a group node, or + * if it hasn't any children. + */ + calculateMinimumEnclosedArea(nodeHierarchy:yfiles.graph.IHierarchy,groupNode:yfiles.graph.INode):yfiles.geometry.RectD; + /** + * Creates a group node style using the {@link yfiles.graph.IGroupedGraph#groupNodeDefaults}. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The {@link yfiles.graph.IGroupedGraph} instance to use. This is a this parameter so that it can be used + * as an extension method. + * @return {yfiles.drawing.INodeStyle} A style instance to use for new group nodes. + */ + createGroupNodeStyle(groupedGraph:yfiles.graph.IGroupedGraph):yfiles.drawing.INodeStyle; + /** + * Groups the nodes in children into the provided group node. + * The parent needs to be a group node at the time of the invocation. + * This operation is basically the same as calling {@link yfiles.graph.IGroupedGraph#setParent} for each node in the + * children enumerable whose parent is not part of the set. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The {@link yfiles.graph.IGroupedGraph} instance to use. This is a this parameter so that it can be used + * as an extension method. + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + * @param {yfiles.collections.IEnumerable.} children The children to group into the group node. + * @see {@link yfiles.graph.GroupedGraphExtensions#groupNodes} + * @see {@link yfiles.graph.IGroupedGraph#setParent} + * @see {@link yfiles.graph.IGroupedGraph#createGroupNodeWithParentBoundsStyleAndTag} + */ + groupNodesWithParent(groupedGraph:yfiles.graph.IGroupedGraph,parent:yfiles.graph.INode,children:yfiles.collections.IEnumerable):void; + /** + * Groups the nodes into a newly created group node. + * The group node will be created at the common ancestor level of all nodes in children. + * @param {yfiles.graph.INode[]} children The children to group into the new group node. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The {@link yfiles.graph.IGroupedGraph} instance to use. This is a this parameter so that it can be used + * as an extension method. + * @return {yfiles.graph.INode} The newly created group node. + * @see {@link yfiles.graph.HierarchyExtensions#getNearestCommonAncestorOfArray} + * @see {@link yfiles.graph.GroupedGraphExtensions#groupNodes} + */ + groupNodesArray(groupedGraph:yfiles.graph.IGroupedGraph,children:yfiles.graph.INode[]):yfiles.graph.INode; + /** + * Groups the nodes in children into a newly created group node. + * The group node will be created at the common ancestor level of all nodes in children. + * @param {yfiles.collections.IEnumerable.} children The children to group into the new group node. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The {@link yfiles.graph.IGroupedGraph} instance to use. This is a this parameter so that it can be used + * as an extension method. + * @return {yfiles.graph.INode} The newly created group node. + * @see {@link yfiles.graph.HierarchyExtensions#getNearestCommonAncestorOfArray} + * @see {@link yfiles.graph.GroupedGraphExtensions#groupNodes} + */ + groupNodes(groupedGraph:yfiles.graph.IGroupedGraph,children:yfiles.collections.IEnumerable):yfiles.graph.INode; + /** + * Creates a new group node using the {@link yfiles.graph.IGroupedGraph#groupNodeDefaults} as a child of parent. + * The group node will be a direct descendant of parent. + * @return {yfiles.graph.INode} The newly created group node. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The {@link yfiles.graph.IGroupedGraph} instance to use. This is a this parameter so that it can be used + * as an extension method. + * @see {@link yfiles.graph.GroupedGraphExtensions#createGroupNode} + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + */ + createGroupNodeWithParent(groupedGraph:yfiles.graph.IGroupedGraph,parent:yfiles.graph.INode):yfiles.graph.INode; + /** + * Creates a new ordinary node as a direct descendant of parent. + * This method ultimately delegates to the {@link yfiles.graph.IGroupedGraph#graph}'s {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} set of methods. + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.INode} The newly created node. + * @see {@link yfiles.graph.IGroupedGraph#setParent} + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + */ + createNodeWithParent(groupedGraph:yfiles.graph.IGroupedGraph,parent:yfiles.graph.INode):yfiles.graph.INode; + /** + * Gets the bounds for a default group node using {@link yfiles.graph.IGroupedGraph#groupNodeDefaults}. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.geometry.RectD} The bounds for a newly created group node. + */ + getDefaultGroupNodeBounds(groupedGraph:yfiles.graph.IGroupedGraph):yfiles.geometry.RectD; + /** + * Creates a new ordinary node as a direct descendant of parent. + * This method ultimately delegates to the {@link yfiles.graph.IGroupedGraph#graph}'s {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} set of methods. + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + * @param {yfiles.geometry.RectD} bounds The new bounds of the node. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.INode} The newly created node. + * @see {@link yfiles.graph.IGroupedGraph#setParent} + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + */ + createNodeWithParentAndBounds(groupedGraph:yfiles.graph.IGroupedGraph,parent:yfiles.graph.INode,bounds:yfiles.geometry.RectD):yfiles.graph.INode; + /** + * Creates a new ordinary node as a direct descendant of parent. + * This method ultimately delegates to the {@link yfiles.graph.IGroupedGraph#graph}'s {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} set of methods. + * @param {yfiles.geometry.RectD} bounds The new bounds of the node. + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + * @param {yfiles.drawing.INodeStyle} nodeStyle The initial style to assign. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.INode} The newly created node. + * @see {@link yfiles.graph.IGroupedGraph#setParent} + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + */ + createNodeWithParentBoundsAndStyle(groupedGraph:yfiles.graph.IGroupedGraph,parent:yfiles.graph.INode,bounds:yfiles.geometry.RectD,nodeStyle:yfiles.drawing.INodeStyle):yfiles.graph.INode; + /** + * Creates a new ordinary node as a direct descendant of parent. + * This method ultimately delegates to the {@link yfiles.graph.IGroupedGraph#graph}'s {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} set of methods. + * @param {yfiles.geometry.RectD} bounds The new bounds of the node. + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + * @param {yfiles.drawing.INodeStyle} nodeStyle The initial style to assign. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.INode} The newly created node. + * @see {@link yfiles.graph.IGroupedGraph#setParent} + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + */ + createGroupNodeWithParentBoundsAndStyle(groupedGraph:yfiles.graph.IGroupedGraph,parent:yfiles.graph.INode,bounds:yfiles.geometry.RectD,nodeStyle:yfiles.drawing.INodeStyle):yfiles.graph.INode; + /** + * Tries to retrieve an {@link yfiles.graph.IGroupedGraph} instance from the {@link yfiles.input.IInputModeContext}. + * This will use the {@link yfiles.support.ILookup} of the context or if nothing is found the lookup + * of the {@link yfiles.graph.GraphExtensions#getGraph graph in the context}. + * @param {yfiles.input.IInputModeContext} context The context to retrieve the implementation from. + * @return {yfiles.graph.IGroupedGraph} The instance or null. + */ + getGroupedGraph(context:yfiles.input.IInputModeContext):yfiles.graph.IGroupedGraph; + }; + /** + * Contains static extension methods for the {@link yfiles.graph.IFoldedGraph} interface. + */ + export interface FoldedGraphExtensions extends Object{ + } + var FoldedGraphExtensions:{ + $class:yfiles.lang.Class; + /** + * Tries to retrieve an {@link yfiles.graph.IFoldedGraph} instance from the {@link yfiles.input.IInputModeContext}. + * This will use the {@link yfiles.support.ILookup} of the context or if nothing is found the lookup + * of the {@link yfiles.graph.GraphExtensions#getGraph graph in the context}. + * @param {yfiles.input.IInputModeContext} context The context to retrieve the implementation from. + * @return {yfiles.graph.IFoldedGraph} The instance or null. + */ + getFoldedGraph(context:yfiles.input.IInputModeContext):yfiles.graph.IFoldedGraph; + }; + /** + * An implementation of {@link yfiles.layout.IProfitModel} that returns the + * profit of a label candidate for instances of {@link yfiles.graph.ExtendedNodeLabelCandidate}. + */ + export interface ExtendedLabelCandidateProfitModel extends Object,yfiles.layout.IProfitModel{ + /** + * Returns the profit for placing a label-candidate. + * This implementation returns the profit for instances of + * {@link yfiles.graph.ExtendedNodeLabelCandidate} or 0.0 for other + * {@link yfiles.layout.LabelCandidate}s. + * @param {yfiles.layout.LabelCandidate} candidate a label candidate + * @return {number} a value between 0 and 1. + * @see Specified by {@link yfiles.layout.IProfitModel#getProfit}. + */ + getProfit(candidate:yfiles.layout.LabelCandidate):number; + } + var ExtendedLabelCandidateProfitModel:{ + $class:yfiles.lang.Class; + }; + /** + * A subclass of {@link yfiles.layout.EdgeLabelCandidate} that provides a + * {@link yfiles.graph.ILabelCandidateDescriptor candidate descriptor}. + */ + export interface ExtendedEdgeLabelCandidate extends yfiles.layout.EdgeLabelCandidate{ + /** + * Gets the label candidate descriptor. + */ + descriptor:yfiles.graph.ILabelCandidateDescriptor; + } + var ExtendedEdgeLabelCandidate:{ + $class:yfiles.lang.Class; + /** + * Returns a new instance of ExtendedEdgeLabelCandidate. + * @param {yfiles.algorithms.YPoint} pos + * the location of the upper + * left corner of the candidate. + * @param {yfiles.algorithms.YDimension} size the size of the candidate. + * @param {Object} param + * the parameters of the labeling model + * associated with this candidate. + * @param {yfiles.layout.IEdgeLabelLayout} owner the label associated to the candidate. + * @param {yfiles.graph.ILabelCandidateDescriptor} descriptor the label candidate descriptor. + */ + FromPointSizeParamOwnerAndDescriptor:{ + new (pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.IEdgeLabelLayout,descriptor:yfiles.graph.ILabelCandidateDescriptor):yfiles.graph.ExtendedEdgeLabelCandidate; + }; + /** + * Returns a new instance of ExtendedEdgeLabelCandidate. + * @param {yfiles.algorithms.YOrientedRectangle} orientedBox the label size and orientation + * @param {Object} param + * the parameters of the labeling model + * associated with this candidate. + * @param {yfiles.layout.IEdgeLabelLayout} owner the label associated to the candidate. + * @param {boolean} internal + * flag whether the candidate is + * allowed to overlap the layout of the edge. + * @param {yfiles.graph.ILabelCandidateDescriptor} descriptor the label candidate descriptor. + */ + FromRectParamAndOwner:{ + new (orientedBox:yfiles.algorithms.YOrientedRectangle,param:Object,owner:yfiles.layout.IEdgeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor):yfiles.graph.ExtendedEdgeLabelCandidate; + }; + /** + * Returns a new instance of ExtendedEdgeLabelCandidate. + * @param {yfiles.algorithms.YPoint} pos + * the location of the upper + * left corner of the candidate. + * @param {yfiles.algorithms.YDimension} size the size of the candidate. + * @param {Object} param + * the parameters of the labeling model + * associated with this candidate. + * @param {yfiles.layout.IEdgeLabelLayout} owner the label associated to the candidate. + * @param {boolean} internal + * flag whether the candidate is + * allowed to overlap the layout of the edge. + * @param {yfiles.graph.ILabelCandidateDescriptor} descriptor the label candidate descriptor. + */ + FromPointSizeParamOwnerInternalAndDescriptor:{ + new (pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.IEdgeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor):yfiles.graph.ExtendedEdgeLabelCandidate; + }; + }; + /** + * Extension method holder class that extends the + * {@link yfiles.graph.IGraph} type with utility methods. + * @see {@link yfiles.graph.IGraph} + */ + export interface GraphExtensions extends Object{ + } + var GraphExtensions:{ + $class:yfiles.lang.Class; + /** + * Clears the graph instance, removing all entities in proper order. + * @see {@link yfiles.graph.IGraph#removeEdge} + * @see {@link yfiles.graph.IGraph#removeNode} + */ + clear(graph:yfiles.graph.IGraph):void; + /** + * Determines whether the provided port recursively depends on the owner. + * If the port belongs is owned by an {@link yfiles.graph.IEdge}, the corresponding {@link yfiles.graph.IEdge#sourcePort} and {@link yfiles.graph.IEdge#targetPort} + * are recursively inspected to see whether they depend on owner. + * @param {yfiles.graph.IPort} port The port to check the dependencies of. + * @param {yfiles.graph.IPortOwner} owner The owner to look for in the dependency hierarchy. + * @return {boolean} + */ + portDependsOnOwner(port:yfiles.graph.IPort,owner:yfiles.graph.IPortOwner):boolean; + /** + * Tries to retrieve an {@link yfiles.graph.IGraph} instance from the {@link yfiles.input.IInputModeContext}. + * This will use the {@link yfiles.support.ILookup} and if this yields nothing, it will use the + * {@link yfiles.support.ILookup} of the {@link yfiles.input.IInputModeContext#canvasControl} + * or finally test if it is a {@link yfiles.canvas.GraphControl} to obtain the graph from. + * @param {yfiles.input.IInputModeContext} context The context to retrieve the graph from. + * @return {yfiles.graph.IGraph} Return the graph or null. + */ + getGraph(context:yfiles.input.IInputModeContext):yfiles.graph.IGraph; + /** + * Tries to call {@link yfiles.graph.IGraph#invalidateDisplays} on the {@link yfiles.graph.GraphExtensions#getGraph graph} from the {@link yfiles.input.IInputModeContext}. + * If the graph instance cannot be found, {@link yfiles.canvas.CanvasControl#invalidate} will be called instead. + * @param {yfiles.input.IInputModeContext} context The context to retrieve the graph from. + */ + invalidateDisplays(context:yfiles.input.IInputModeContext):void; + /** + * Tries to retrieve an {@link yfiles.graph.IGraphSelection} instance from the {@link yfiles.input.IInputModeContext}. + * This will use the {@link yfiles.support.ILookup} and if this yields nothing, it will use the + * {@link yfiles.support.ILookup} of the {@link yfiles.input.IInputModeContext#canvasControl} + * or finally test if it is a {@link yfiles.canvas.GraphControl} to obtain the selection from. + * @param {yfiles.input.IInputModeContext} context The context to retrieve the selection from. + * @return {yfiles.graph.IGraphSelection} Return the selection or null. + */ + getGraphSelection(context:yfiles.input.IInputModeContext):yfiles.graph.IGraphSelection; + /** + * Gets the source node for the given edge or null. + * @param {yfiles.graph.IEdge} edge The edge to get the {@link yfiles.graph.IEdge#sourcePort source port} {@link yfiles.graph.IPort#owner owner} + * as an {@link yfiles.graph.INode}. + * @return {yfiles.graph.INode} The source node or null. + */ + getSourceNode(edge:yfiles.graph.IEdge):yfiles.graph.INode; + /** + * Gets the target node for the given edge or null. + * @param {yfiles.graph.IEdge} edge The edge to get the {@link yfiles.graph.IEdge#targetPort target port} {@link yfiles.graph.IPort#owner owner} + * as an {@link yfiles.graph.INode}. + * @return {yfiles.graph.INode} The target node or null. + */ + getTargetNode(edge:yfiles.graph.IEdge):yfiles.graph.INode; + /** + * Returns whether an {@link yfiles.graph.IEdge edge} is a self loop. + * @param {yfiles.graph.IEdge} edge The edge to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {boolean} true, if the edge is a self loop + */ + isSelfloop(edge:yfiles.graph.IEdge):boolean; + /** + * Reverses an edge by {@link yfiles.graph.IGraph#setPorts setting source and target port} + * to {@link yfiles.graph.IEdge#targetPort} and {@link yfiles.graph.IEdge#sourcePort}. + * Also, this method will reverse the bends by clearing them and reinserting them in reverse order + * if there is more than one bend. + * @param {yfiles.graph.IEdge} edge The edge to reverse. + * @param {yfiles.graph.IGraph} graph The graph that contains the edge + * This is a this parameter, so that the method can be used + * as an extension method. + */ + reverse(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge):void; + /** + * Gets the default node bounds for newly created nodes in the graph. + * @param {yfiles.graph.IGraph} graph The graph to obtain the {@link yfiles.graph.INodeDefaults} from. + * @return {yfiles.geometry.RectD} The bounds anchored at (0,0) with {@link yfiles.graph.IGraph#nodeDefaults}' {@link yfiles.graph.INodeDefaults#size}. + */ + getDefaultNodeBounds(graph:yfiles.graph.IGraph):yfiles.geometry.RectD; + /** + * Gets the index of the bend at its {@link yfiles.graph.IBend#owner}. + * @param {yfiles.graph.IBend} bend The bend to get the index of. + * @return {number} The zero based index of the bend in the {@link yfiles.graph.IEdge#bends} list; -1 if the bend is not part of an edge. + */ + getBendIndex(bend:yfiles.graph.IBend):number; + /** + * Gets the index of the label at its {@link yfiles.graph.ILabel#owner}. + * @param {yfiles.graph.ILabel} label The label to get the index of. + * @return {number} The zero based index of the label in the {@link yfiles.graph.ILabeledItem#labels} list; -1 if the label is not part of a labeled item. + */ + getLabelIndex(label:yfiles.graph.ILabel):number; + /** + * Convenience method that removes a {@link yfiles.graph.IPortOwner} from the graph. + * @param {yfiles.graph.IGraph} graph The graph to remove the port owner from. This is a this argument so that this method can be used + * as an extension method. + * @param {yfiles.graph.IPortOwner} portOwner The port owner to remove. + * @throws {yfiles.system.ArgumentOutOfRangeException} If portOwner is neither {@link yfiles.graph.INode} nor {@link yfiles.graph.IEdge}. + */ + removePortOwner(graph:yfiles.graph.IGraph,portOwner:yfiles.graph.IPortOwner):void; + /** + * Convenience method that removes a {@link yfiles.graph.ILabeledItem} from the graph. + * @param {yfiles.graph.IGraph} graph The graph to remove the item from. This is a this argument so that this method can be used + * as an extension method. + * @param {yfiles.graph.ILabeledItem} labeledItem The item to remove. + * @throws {yfiles.system.ArgumentOutOfRangeException} If labeledItem is neither {@link yfiles.graph.INode} nor {@link yfiles.graph.IEdge}. + */ + removeLabeledItem(graph:yfiles.graph.IGraph,labeledItem:yfiles.graph.ILabeledItem):void; + /** + * Appends a new bend to the list of bends at the given edge. + * This is a convenience method that delegates to {@link yfiles.graph.IGraph#addBend}. + * @param {yfiles.graph.IGraph} graph The graph to add the bend to. This is a this argument so that this method can be used + * as an extension method. + * @param {yfiles.graph.IEdge} edge The edge to add the bend to. + * @param {yfiles.geometry.PointD} location The location of the bend. + * @return {yfiles.graph.IBend} The newly created bend. + */ + appendBend(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,location:yfiles.geometry.PointD):yfiles.graph.IBend; + /** + * Appends bends to the given edge using the provided locations. + * @param {yfiles.graph.IGraph} graph The graph to add the bends to. This is a this argument so that this method can be used + * as an extension method. + * @param {yfiles.graph.IEdge} edge The edge to add the bends to. + * @param {yfiles.collections.IEnumerable.} locations The locations of the bends. + */ + appendBends(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,locations:yfiles.collections.IEnumerable):void; + /** + * Convenience method that uses the {@link yfiles.support.IUndoSupport} from the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup} + * to {@link yfiles.support.IUndoSupport#beginEditForItems begin an edit}. + * @param {yfiles.graph.IGraph} graph The graph to edit. This is a this argument so that this method can be used + * as an extension method. + * @param {string} undoName The name of the undo operation. + * @param {string} redoName The name of the redo operation. + * @param {yfiles.collections.IEnumerable.} items The items to pass to {@link yfiles.support.IUndoSupport#beginEditForItems}. + * @return {yfiles.support.ICompoundEdit} An edit that can be used for editing. This will return a dummy implementation if no {@link yfiles.support.IUndoSupport} + * is available. + */ + beginNamedEditWithItems(graph:yfiles.graph.IGraph,undoName:string,redoName:string,items:yfiles.collections.IEnumerable):yfiles.support.ICompoundEdit; + /** + * Convenience method that uses the {@link yfiles.support.IUndoSupport} from the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup} + * to {@link yfiles.support.IUndoSupport#beginEdit begin an edit}. + * @param {yfiles.graph.IGraph} graph The graph to edit. This is a this argument so that this method can be used + * as an extension method. + * @param {string} undoName The name of the undo operation. + * @param {string} redoName The name of the redo operation. + * @return {yfiles.support.ICompoundEdit} An edit that can be used for editing. This will return a dummy implementation if no {@link yfiles.support.IUndoSupport} + * is available. + */ + beginEdit(graph:yfiles.graph.IGraph,undoName:string,redoName:string):yfiles.support.ICompoundEdit; + /** + * Convenience method that uses the {@link yfiles.support.IUndoSupport} from the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup} + * to {@link yfiles.support.IUndoSupport#addUnit add a unit}. + * @param {yfiles.graph.IGraph} graph The graph to add the unit to. This is a this argument so that this method can be used + * as an extension method. + * @param {string} undoName The name of the undo operation. + * @param {string} redoName The name of the redo operation. + * @param {function()} undoAction The undo action. + * @param {function()} redoAction The redo action. + */ + addUndoUnit(graph:yfiles.graph.IGraph,undoName:string,redoName:string,undoAction:()=> void,redoAction:()=> void):void; + /** + * Creates and returns a node using the specified initial style and geometry. + * The {@link yfiles.support.ITagOwner#tag} will be set to null. + * The node will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.IGraph} graph The graph to create the node in. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.geometry.RectD} bounds The bounds to use initially. + * The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} field + * @param {yfiles.drawing.INodeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + * @see {@link yfiles.drawing.common.VoidNodeStyle#INSTANCE} + */ + createNodeWithBoundsAndStyle(graph:yfiles.graph.IGraph,bounds:yfiles.geometry.RectD,style:yfiles.drawing.INodeStyle):yfiles.graph.INode; + /** + * Sets the center of a node to the given world coordinates. + * This implementation delegates to {@link yfiles.graph.IGraph#setBounds} + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.INode} node The node to recenter. + * @param {yfiles.geometry.PointD} center The new center coordinates of the node in the world coordinate system. + */ + setCenter(graph:yfiles.graph.IGraph,node:yfiles.graph.INode,center:yfiles.geometry.PointD):void; + /** + * Adjusts the {@link yfiles.graph.ILabel#preferredSize} property of a label to + * fit the suggested size of its {@link yfiles.drawing.ILabelStyleRenderer}. + * This implementation uses the {@link yfiles.graph.ILabel#style style's} + * renderer for the label to determine the preferred rendering size. + * This is useful after the label's content or style have been changed. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @see {@link yfiles.graph.ILabelDefaults#autoAdjustPreferredSize} + * @param {yfiles.graph.ILabel} label The label to adjust the size for. + */ + adjustPreferredSize(graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel):void; + /** + * Calculates the preferred size of a label with the given properties. + * @param {yfiles.graph.IGraph} graph The graph to which the label will be added. + * @param {yfiles.graph.ILabeledItem} item The item that will own the label. + * @param {yfiles.drawing.ILabelStyle} labelStyle The label style. + * @param {yfiles.graph.ILabelModelParameter} labelModelParameter The label model parameter. + * @param {string} text The text. + * @return {yfiles.geometry.SizeD} The size as calculated by the {@link yfiles.drawing.ILabelStyleRenderer}. + */ + calculatePreferredSizeWithStyleAndParameter(graph:yfiles.graph.IGraph,item:yfiles.graph.ILabeledItem,labelStyle:yfiles.drawing.ILabelStyle,labelModelParameter:yfiles.graph.ILabelModelParameter,text:string):yfiles.geometry.SizeD; + /** + * Calculates the preferred size of a label with the given properties. + * @param {yfiles.graph.IGraph} graph The graph to which the label will be added and that will yield the {@link yfiles.graph.ILabelDefaults label defaults}. + * @param {yfiles.graph.ILabeledItem} item The item that will own the label. + * @param {string} text The text. + * @return {yfiles.geometry.SizeD} The size as calculated by the {@link yfiles.drawing.ILabelStyleRenderer}. + * @see {@link yfiles.graph.GraphExtensions#getLabelDefaults} + * @see {@link yfiles.graph.GraphExtensions#calculatePreferredSizeWithStyleParameterAndTag} + */ + calculatePreferredSize(graph:yfiles.graph.IGraph,item:yfiles.graph.ILabeledItem,text:string):yfiles.geometry.SizeD; + /** + * Calculates the preferred size of a label with the given properties. + * @param {yfiles.graph.IGraph} graph The graph to which the label will be added. + * @param {yfiles.graph.ILabeledItem} item The item that will own the label. + * @param {yfiles.drawing.ILabelStyle} labelStyle The label style. + * @param {yfiles.graph.ILabelModelParameter} labelModelParameter The label model parameter. + * @param {string} text The text. + * @param {Object} tag The tag for the label. + * @return {yfiles.geometry.SizeD} The size as calculated by the {@link yfiles.drawing.ILabelStyleRenderer}. + */ + calculatePreferredSizeWithStyleParameterAndTag(graph:yfiles.graph.IGraph,item:yfiles.graph.ILabeledItem,labelStyle:yfiles.drawing.ILabelStyle,labelModelParameter:yfiles.graph.ILabelModelParameter,text:string,tag:Object):yfiles.geometry.SizeD; + /** + * Add a label to the given item using the text as the initial label text. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {string} text the initial text of the label + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + */ + addLabel(graph:yfiles.graph.IGraph,item:yfiles.graph.ILabeledItem,text:string):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text and a given tag. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {string} text the initial text of the label + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {Object} tag The tag to assign to the label. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + */ + addLabelWithTag(graph:yfiles.graph.IGraph,item:yfiles.graph.ILabeledItem,text:string,tag:Object):yfiles.graph.ILabel; + /** + * Yields the neighbors of a given portOwner. + * Neighbors are calculated by going through all {@link yfiles.graph.IPortOwner#ports} + * and inspecting the {@link yfiles.graph.IGraph#typedEdgesAtPort edges at these ports}, + * collecting the {@link yfiles.graph.GraphExtensions#opposite}s. + * @param {yfiles.graph.IGraph} graph The graph to use for obtaining the {@link yfiles.graph.IGraph#typedEdgesAtPort adjacent edges} + * This is a this argument so that this method can be used as an extension method. + * @param {T} portOwner The port owner. + * @return {yfiles.collections.IEnumerable.} An enumerable over all neighbors. + */ + neighbors(tType:yfiles.lang.Class,graph:yfiles.graph.IGraph,portOwner:T):yfiles.collections.IEnumerable; + /** + * Yields the successors of a given portOwner. + * Neighbors are calculated by going through all {@link yfiles.graph.IPortOwner#ports} + * and inspecting the {@link yfiles.graph.GraphExtensions#outEdgesAt outgoing edges at these ports}, + * collecting the {@link yfiles.graph.IEdge#targetPort} {@link yfiles.graph.IPort#owner}s. + * @param {yfiles.graph.IGraph} graph The graph to use for obtaining the {@link yfiles.graph.IGraph#typedEdgesAtPort adjacent edges} + * This is a this argument so that this method can be used as an extension method. + * @param {T} portOwner The port owner. + * @return {yfiles.collections.IEnumerable.} An enumerable over all successors. + */ + successors(tType:yfiles.lang.Class,graph:yfiles.graph.IGraph,portOwner:T):yfiles.collections.IEnumerable; + /** + * Yields the predecessors of a given portOwner. + * Neighbors are calculated by going through all {@link yfiles.graph.IPortOwner#ports} + * and inspecting the {@link yfiles.graph.GraphExtensions#inEdgesAt outgoing edges at these ports}, + * collecting the {@link yfiles.graph.IEdge#sourcePort} {@link yfiles.graph.IPort#owner}s. + * @param {yfiles.graph.IGraph} graph The graph to use for obtaining the {@link yfiles.graph.IGraph#typedEdgesAtPort adjacent edges} + * This is a this argument so that this method can be used as an extension method. + * @param {T} portOwner The port owner. + * @return {yfiles.collections.IEnumerable.} An enumerable over all predecessors. + */ + predecessors(tType:yfiles.lang.Class,graph:yfiles.graph.IGraph,portOwner:T):yfiles.collections.IEnumerable; + /** + * Yields the opposites port owner of an {@link yfiles.graph.IEdge}. + * @param {yfiles.graph.IEdge} edge The edge to get the opposite {@link yfiles.graph.IPortOwner} of owner from. + * @param {yfiles.graph.IPortOwner} owner The owner of the port that the {@link yfiles.graph.IEdge} is connected to. + * @return {yfiles.graph.IPortOwner} The owner of the opposite port. + * @throws {yfiles.system.ArgumentOutOfRangeException} If owner is neither the source or target of the edge. + */ + oppositePortOwner(edge:yfiles.graph.IEdge,owner:yfiles.graph.IPortOwner):yfiles.graph.IPortOwner; + /** + * Yields the opposites port of an {@link yfiles.graph.IEdge}. + * @param {yfiles.graph.IEdge} edge The edge to get the opposite {@link yfiles.graph.IPort} of port from. + * @param {yfiles.graph.IPort} port The port that the {@link yfiles.graph.IEdge} is connected to. + * @return {yfiles.graph.IPort} The opposite port. + * @throws {yfiles.system.ArgumentOutOfRangeException} If port is neither the source or target of the edge. + */ + opposite(edge:yfiles.graph.IEdge,port:yfiles.graph.IPort):yfiles.graph.IPort; + /** + * Calculates the number of edges at the given {@link yfiles.graph.IPortOwner} + * for this graph. + * Note that an edge that is both incoming and outgoing will be counted twice. + * @param {yfiles.graph.IGraph} graph The graph, which is a this-argument so that it can be used as an extension method. + * @param {yfiles.graph.IPortOwner} portOwner The port owner to count the degree of. + * @return {number} The number of edges that are incident to the port owner. + */ + portOwnerDegree(graph:yfiles.graph.IGraph,portOwner:yfiles.graph.IPortOwner):number; + /** + * Calculates the number of incoming edges at the given {@link yfiles.graph.IPortOwner} + * for this graph. + * @param {yfiles.graph.IGraph} graph The graph, which is a this-argument so that it can be used as an extension method. + * @param {yfiles.graph.IPortOwner} portOwner The port owner to count the incoming edges of. + * @return {number} The number of edges that have the port owner as their target port's owner. + */ + inDegree(graph:yfiles.graph.IGraph,portOwner:yfiles.graph.IPortOwner):number; + /** + * Calculates the number of outgoing edges at the given {@link yfiles.graph.IPortOwner} + * for this graph. + * @param {yfiles.graph.IGraph} graph The graph, which is a this-argument so that it can be used as an extension method. + * @param {yfiles.graph.IPortOwner} portOwner The port owner to count the outgoing edges of. + * @return {number} The number of edges that have the port owner as their source port's owner. + */ + outDegree(graph:yfiles.graph.IGraph,portOwner:yfiles.graph.IPortOwner):number; + /** + * Calculates the number of edges at the given {@link yfiles.graph.IPort} + * for this graph. + * Note that an edge that is both incoming and outgoing will be counted twice. + * @param {yfiles.graph.IGraph} graph The graph, which is a this-argument so that it can be used as an extension method. + * @param {yfiles.graph.IPort} port The port owner to count the degree of. + * @return {number} The number of edges that are incident to the port. + */ + portDegree(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort):number; + /** + * Calculates the number of incoming edges at the given {@link yfiles.graph.IPort} + * for this graph. + * @param {yfiles.graph.IGraph} graph The graph, which is a this-argument so that it can be used as an extension method. + * @param {yfiles.graph.IPort} port The port to count the incoming edges of. + * @return {number} The number of edges that have the port as their target port. + */ + portInDegree(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort):number; + /** + * Calculates the number of outgoing edges at the given {@link yfiles.graph.IPort} + * for this graph. + * @param {yfiles.graph.IGraph} graph The graph, which is a this-argument so that it can be used as an extension method. + * @param {yfiles.graph.IPort} port The port to count the outgoing edges of. + * @return {number} The number of edges that have the port as their source port. + */ + portOutDegree(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort):number; + /** + * Removes all bends from the given edge. + * The edge must be part of this graph + * at the time of the invocation. + * This will trigger the corresponding events. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IEdge} edge the edge whose bends will be removed + * @see {@link yfiles.graph.IGraph#removeBend} + * @see {@link yfiles.graph.IGraph#addBendRemovedListener BendRemoved} + */ + clearBends(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge):void; + /** + * Convenience method that tries to set the absolute coordinates of the given port to the given values. + * For full control over the placement of the ports, the {@link yfiles.graph.IGraph#setLocationModelParameter} + * method should be used instead. + * This implementation will use the port's {@link yfiles.graph.IPort#locationModelParameter}'s + * {@link yfiles.graph.IPortLocationModelParameter#model} to + * obtain a new {@link yfiles.graph.IPortLocationModelParameter} via the + * {@link yfiles.graph.IPortLocationModel#createParameter} method. This might result in the port using a different location, + * because the model might not support parameters that result in the given location. + * This will also trigger an {@link yfiles.graph.IGraph#invalidateDisplays} call. + * @see {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag} + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPort} port The port to modify + * @param {yfiles.geometry.PointD} location the new absolute coordinates of the port + */ + setPortLocation(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort,location:yfiles.geometry.PointD):void; + /** + * Add a port to the given port owner using the absolute coordinates as the new initial position of + * the port anchor. + * @param {yfiles.graph.IPortOwner} portOwner the owner to add the port instance to. + * @param {yfiles.geometry.PointD} location the location to use for the port to determine its location. + * This is passed to the {@link yfiles.graph.GraphExtensions#createLocationModelParameterForLocation} method + * to determine the initial {@link yfiles.graph.IPortLocationModelParameter} to use. + * @param {yfiles.drawing.IPortStyle} style the style to initially assign to the {@link yfiles.graph.IPort#style} property, e.g. + * {@link yfiles.drawing.common.VoidPortStyle#INSTANCE}. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.IPort} the newly created port + * @throws {yfiles.system.NotSupportedException} If this instance cannot add a port to portOwner. + */ + addPortAtLocationWithStyle(graph:yfiles.graph.IGraph,portOwner:yfiles.graph.IPortOwner,location:yfiles.geometry.PointD,style:yfiles.drawing.IPortStyle):yfiles.graph.IPort; + /** + * Finds an edge that connects from and to in the given graph. + * @param {yfiles.graph.IGraph} graph The graph to find the edge in. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPortOwner} from The {@link yfiles.graph.IEdge#sourcePort} owner of the edge to find. + * @param {yfiles.graph.IPortOwner} to The {@link yfiles.graph.IEdge#targetPort} owner of the edge to find. + * @return {yfiles.graph.IEdge} An edge that satisfies the constraints or null, if none was found. + */ + getEdgeAtOwners(graph:yfiles.graph.IGraph,from:yfiles.graph.IPortOwner,to:yfiles.graph.IPortOwner):yfiles.graph.IEdge; + /** + * Finds an edge that connects from and to in the given graph. + * @param {yfiles.graph.IGraph} graph The graph to find the edge in. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPort} from The {@link yfiles.graph.IEdge#sourcePort} of the edge to find. + * @param {yfiles.graph.IPort} to The {@link yfiles.graph.IEdge#targetPort} of the edge to find. + * @return {yfiles.graph.IEdge} An edge that satisfies the constraints or null, if none was found. + */ + getEdgeAtPorts(graph:yfiles.graph.IGraph,from:yfiles.graph.IPort,to:yfiles.graph.IPort):yfiles.graph.IEdge; + /** + * Tries to set the location of the port relative to its {@link yfiles.graph.IPort#owner owner} if + * the owner is a {@link yfiles.graph.INode node}. + * If the port is not owned by a node + * that is part of this graph, this method will throw an {@link yfiles.system.ArgumentOutOfRangeException}. + * This method will delegate to {@link yfiles.graph.GraphExtensions#setPortLocation}. + * @param {yfiles.graph.IPort} port the port + * @param {yfiles.geometry.PointD} relativeLocation the new coordinate offsets relative to the center of the node's {@link yfiles.graph.INode#layout}'s + * center. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @see {@link yfiles.graph.INode#layout The owner's layout} + * @throws {yfiles.system.ArgumentOutOfRangeException} If the port is not owned by a node + */ + setRelativeLocation(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort,relativeLocation:yfiles.geometry.PointD):void; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter and style. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {yfiles.drawing.ILabelStyle} style The style to assign to the new label. + * @param {string} text the initial text of the label + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + * @see {@link yfiles.graph.IGraph#setLabelStyle} + */ + addLabelWithParameterAndStyle(graph:yfiles.graph.IGraph,item:yfiles.graph.ILabeledItem,parameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter, preferred size, and style. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {yfiles.drawing.ILabelStyle} style The style to assign to the new label. + * @param {string} text the initial text of the label + * @param {yfiles.geometry.SizeD} preferredSize The initial preferred size to assign. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + * @see {@link yfiles.graph.IGraph#setLabelStyle} + */ + addLabelWithParameterStyleAndPreferredSize(graph:yfiles.graph.IGraph,item:yfiles.graph.ILabeledItem,parameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,preferredSize:yfiles.geometry.SizeD):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter and style. + * This method will {@link yfiles.graph.GraphExtensions#calculatePreferredSizeWithStyleParameterAndTag + * calculate the preferred size} of the new label before hand. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {yfiles.drawing.ILabelStyle} style The style to assign to the new label. + * @param {string} text the initial text of the label + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {Object} tag The {@link yfiles.support.ITagOwner#tag} to assign to the new label. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + * @see {@link yfiles.graph.IGraph#setLabelStyle} + */ + addLabelWithParameterStyleAndTag(graph:yfiles.graph.IGraph,item:yfiles.graph.ILabeledItem,parameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,tag:Object):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {string} text the initial text of the label + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + * @see {@link yfiles.graph.IGraph#setLabelStyle} + */ + addLabelWithParameter(graph:yfiles.graph.IGraph,item:yfiles.graph.ILabeledItem,parameter:yfiles.graph.ILabelModelParameter,text:string):yfiles.graph.ILabel; + /** + * Convenience method that yields the incoming edges at the given owner. + * This method delegates to {@link yfiles.graph.IGraph#typedEdgesAtOwner} + * using {@link yfiles.graph.AdjacencyTypes#INCOMING}. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPortOwner} owner The owner of the edges. + * @return {yfiles.model.IListEnumerable.} An enumerable for the edges. + */ + inEdgesAt(graph:yfiles.graph.IGraph,owner:yfiles.graph.IPortOwner):yfiles.model.IListEnumerable; + /** + * Convenience method that yields the outgoing edges at the given owner. + * This method delegates to {@link yfiles.graph.IGraph#typedEdgesAtOwner} + * using {@link yfiles.graph.AdjacencyTypes#OUTGOING}. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPortOwner} owner The owner of the edges. + * @return {yfiles.model.IListEnumerable.} An enumerable for the edges. + */ + outEdgesAt(graph:yfiles.graph.IGraph,owner:yfiles.graph.IPortOwner):yfiles.model.IListEnumerable; + /** + * Convenience method that yields all adjacent edges at the given owner. + * This method delegates to {@link yfiles.graph.IGraph#typedEdgesAtOwner} + * using {@link yfiles.graph.AdjacencyTypes#ALL}. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPortOwner} owner The owner of the edges. + * @return {yfiles.model.IListEnumerable.} An enumerable for the edges. + */ + edgesAtOwner(graph:yfiles.graph.IGraph,owner:yfiles.graph.IPortOwner):yfiles.model.IListEnumerable; + /** + * Convenience method that yields the incoming edges at the given owner. + * This method delegates to {@link yfiles.graph.IGraph#typedEdgesAtPort} + * using {@link yfiles.graph.AdjacencyTypes#INCOMING}. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPort} owner The owner of the edges. + * @return {yfiles.model.IListEnumerable.} An enumerable for the edges. + */ + portInEdgesAt(graph:yfiles.graph.IGraph,owner:yfiles.graph.IPort):yfiles.model.IListEnumerable; + /** + * Convenience method that yields the outgoing edges at the given owner. + * This method delegates to {@link yfiles.graph.IGraph#typedEdgesAtPort} + * using {@link yfiles.graph.AdjacencyTypes#OUTGOING}. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPort} owner The owner of the edges. + * @return {yfiles.model.IListEnumerable.} An enumerable for the edges. + */ + portOutEdgesAt(graph:yfiles.graph.IGraph,owner:yfiles.graph.IPort):yfiles.model.IListEnumerable; + /** + * Convenience method that yields all adjacent edges at the given owner. + * This method delegates to {@link yfiles.graph.IGraph#typedEdgesAtPort} + * using {@link yfiles.graph.AdjacencyTypes#ALL}. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPort} owner The owner of the edges. + * @return {yfiles.model.IListEnumerable.} An enumerable for the edges. + */ + edgesAtPort(graph:yfiles.graph.IGraph,owner:yfiles.graph.IPort):yfiles.model.IListEnumerable; + /** + * Adds a new port to the graph at the port using the given location. + * The implementation will use {@link yfiles.graph.GraphExtensions#createLocationModelParameterForLocation} + * to determine the parameter used for the newly created port. + * @param {yfiles.graph.IGraph} graph The graph to add the port to. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPortOwner} owner The owner of the port. + * @param {yfiles.geometry.PointD} location The absolute world coordinate location to add the port at. + * @return {yfiles.graph.IPort} The newly added port instance. + * @see {@link yfiles.graph.GraphExtensions#createPortStyle} + * @see {@link yfiles.graph.GraphExtensions#createLabelModelParameter} + */ + addPortAtLocation(graph:yfiles.graph.IGraph,owner:yfiles.graph.IPortOwner,location:yfiles.geometry.PointD):yfiles.graph.IPort; + /** + * Adds a new port to the graph at the port using the default location model parameter + * for the owner. + * The implementation will use {@link yfiles.graph.GraphExtensions#createLocationModelParameter} + * to determine the parameter used for the newly created port. + * @param {yfiles.graph.IGraph} graph The graph to add the port to. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPortOwner} owner The owner of the port. + * @return {yfiles.graph.IPort} The newly added port instance. + * @see {@link yfiles.graph.GraphExtensions#createPortStyle} + * @see {@link yfiles.graph.GraphExtensions#createLabelModelParameter} + */ + addPort(graph:yfiles.graph.IGraph,owner:yfiles.graph.IPortOwner):yfiles.graph.IPort; + /** + * Adds a new port to the graph at the port owner using the given location parameter. + * The implementation will use {@link yfiles.graph.GraphExtensions#createPortStyle} + * to determine the style used for the newly created port. + * @param {yfiles.graph.IGraph} graph The graph to add the port to. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPortOwner} owner The owner of the port. + * @param {yfiles.graph.IPortLocationModelParameter} locationModelParameter The location model parameter to use for the newly created port. + * @return {yfiles.graph.IPort} The newly added port instance. + * @see {@link yfiles.graph.GraphExtensions#createPortStyle} + */ + addPortWithParameter(graph:yfiles.graph.IGraph,owner:yfiles.graph.IPortOwner,locationModelParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.IPort; + /** + * Adds a new port to the graph using a null {@link yfiles.support.ITagOwner#tag}. + * The implementation simply delegates to {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag}. + * @param {yfiles.graph.IGraph} graph The graph to add the port to. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPortOwner} owner The owner of the port. + * @param {yfiles.graph.IPortLocationModelParameter} locationModelParameter The location model parameter to use for the newly created port. + * @param {yfiles.drawing.IPortStyle} portStyle The port style to assign to the port. + * @return {yfiles.graph.IPort} The newly added port instance. + */ + addPortWithParameterAndStyle(graph:yfiles.graph.IGraph,owner:yfiles.graph.IPortOwner,locationModelParameter:yfiles.graph.IPortLocationModelParameter,portStyle:yfiles.drawing.IPortStyle):yfiles.graph.IPort; + /** + * Creates and returns a node using default values for the geometry and style. + * The node will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + */ + createNode(graph:yfiles.graph.IGraph):yfiles.graph.INode; + /** + * Convenience method that creates and returns an edge that connects to the given node instances. + * The nodes must be part + * of this graph at the time of the invocation, and the implementation will choose the {@link yfiles.graph.IPort} instances to + * which the edge will be connected. + * The edge will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.INode} sourceNode The source node the created edge will connect to. It is up to the implementation + * to decide which port to use at the given node. The implementation may create a new port for the edge. + * @param {yfiles.graph.INode} targetNode The target node the created edge will connect to. It is up to the implementation + * to decide which port to use at the given node. The implementation may create a new port for the edge. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#createEdgeWithNodesStyleAndTag} + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + */ + createEdge(graph:yfiles.graph.IGraph,sourceNode:yfiles.graph.INode,targetNode:yfiles.graph.INode):yfiles.graph.IEdge; + /** + * Convenience method that creates and returns an edge that connects to the given node instances. + * The nodes must be part + * of this graph at the time of the invocation, and the implementation will choose the {@link yfiles.graph.IPort} instances to + * which the edge will be connected. + * The edge will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.INode} sourceNode The source node the created edge will connect to. It is up to the implementation + * to decide which port to use at the given node. The implementation may create a new port for the edge. + * @param {yfiles.graph.INode} targetNode The target node the created edge will connect to. It is up to the implementation + * to decide which port to use at the given node. The implementation may create a new port for the edge. + * @param {yfiles.drawing.IEdgeStyle} edgeStyle The initial style to use for the edge. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + * @see {@link yfiles.graph.IGraph#createEdgeWithNodesStyleAndTag} + */ + createEdgeWithNodesAndStyle(graph:yfiles.graph.IGraph,sourceNode:yfiles.graph.INode,targetNode:yfiles.graph.INode,edgeStyle:yfiles.drawing.IEdgeStyle):yfiles.graph.IEdge; + /** + * Creates and returns an edge that connects to the given port instances. + * The ports must be part + * of this graph at the time of the invocation. + * The edge will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.IPort} sourcePort The source port the created edge will connect to. + * @param {yfiles.graph.IPort} targetPort The target port the created edge will connect to. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + */ + createEdgeAtPorts(graph:yfiles.graph.IGraph,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):yfiles.graph.IEdge; + /** + * Creates and returns an edge that connects to the given port instances. + * The ports must be part + * of this graph at the time of the invocation. + * The edge will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.IPort} sourcePort The source port the created edge will connect to. + * @param {yfiles.graph.IPort} targetPort The target port the created edge will connect to. + * @param {yfiles.drawing.IEdgeStyle} edgeStyle The initial style to assign to the edge. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + */ + createEdgeWithPortsAndStyle(graph:yfiles.graph.IGraph,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,edgeStyle:yfiles.drawing.IEdgeStyle):yfiles.graph.IEdge; + /** + * Convenience method that delegates to the {@link yfiles.graph.IEdgeDefaults#getStyleInstance} + * method of the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.IGraph#edgeDefaults}. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.drawing.IEdgeStyle} The style instance to use for newly created edges. + */ + createEdgeStyle(graph:yfiles.graph.IGraph):yfiles.drawing.IEdgeStyle; + /** + * Adds a new port to the graph at the node using a location that is relative to the center of the node. + * The implementation will use {@link yfiles.graph.GraphExtensions#createPortStyle} + * to determine the style used for the newly created port and delegate to {@link yfiles.graph.GraphExtensions#addPortWithParameterAndStyle} + * to let it determine the location parameter. + * @param {yfiles.graph.IGraph} graph The graph to add the port to. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.INode} owner The owner of the port. + * @param {yfiles.geometry.PointD} relativeLocation The offset of the port relative to the center of the {@link yfiles.graph.INode#layout}. + * @return {yfiles.graph.IPort} The newly added port instance. + * @see {@link yfiles.graph.GraphExtensions#createPortStyle} + */ + addRelativePort(graph:yfiles.graph.IGraph,owner:yfiles.graph.INode,relativeLocation:yfiles.geometry.PointD):yfiles.graph.IPort; + /** + * Creates and returns a node using default values for the style and the specified initial center location. + * The node will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.geometry.PointD} location the initial coordinates of the center of + * the node's {@link yfiles.graph.INode#layout Layout} property + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + */ + createNodeWithCenter(graph:yfiles.graph.IGraph,location:yfiles.geometry.PointD):yfiles.graph.INode; + /** + * Creates and returns a node using default values for the style and the specified initial center location, as well as the tag. + * The node will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.geometry.PointD} location the initial coordinates of the center of + * the node's {@link yfiles.graph.INode#layout Layout} property + * @param {Object} tag The initial value of the {@link yfiles.support.ITagOwner#tag} that will be assigned to the new node. + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + */ + createNodeWithCenterAndTag(graph:yfiles.graph.IGraph,location:yfiles.geometry.PointD,tag:Object):yfiles.graph.INode; + /** + * Creates and returns a node using the specified initial center location and style. + * The node will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.geometry.PointD} location the initial coordinates of the center of + * the node's {@link yfiles.graph.INode#layout Layout} property + * @param {yfiles.drawing.INodeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + */ + createNodeWithCenterAndStyle(graph:yfiles.graph.IGraph,location:yfiles.geometry.PointD,style:yfiles.drawing.INodeStyle):yfiles.graph.INode; + /** + * Creates and returns a node using default values for the style and the specified initial geometry. + * The node will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.geometry.RectD} bounds The bounds to use initially. + * The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} property + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + */ + createNodeWithBounds(graph:yfiles.graph.IGraph,bounds:yfiles.geometry.RectD):yfiles.graph.INode; + /** + * Creates and returns a node using default values for the style and the specified initial geometry, as well as the provided + * tag. + * The node will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.geometry.RectD} bounds The bounds to use initially. + * The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} property + * @param {Object} tag The initial value of the {@link yfiles.support.ITagOwner#tag} that will be assigned to the new node. + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + */ + createNodeWithBoundsAndTag(graph:yfiles.graph.IGraph,bounds:yfiles.geometry.RectD,tag:Object):yfiles.graph.INode; + /** + * Convenience method that delegates to the {@link yfiles.graph.INodeDefaults#getStyleInstance} + * method of the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.IGraph#nodeDefaults}. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.drawing.INodeStyle} The style instance to use for newly created nodes. + */ + createNodeStyle(graph:yfiles.graph.IGraph):yfiles.drawing.INodeStyle; + /** + * Uses the {@link yfiles.graph.GraphExtensions#getPortDefaults port defaults} for the owner + * to obtain the {@link yfiles.graph.IPortDefaults#getLocationModelParameterInstance location model parameter}. + * @param {yfiles.graph.IGraph} graph The graph to obtain the {@link yfiles.graph.GraphExtensions#getPortDefaults port defaults} from. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPortOwner} owner The owner of the port to be created. + * @return {yfiles.graph.IPortLocationModelParameter} The default parameter to use for the {@link yfiles.graph.IPortOwner} as returned by {@link yfiles.graph.IPortDefaults#getLocationModelParameterInstance}. + * @see {@link yfiles.graph.GraphExtensions#getPortDefaults} + */ + createLocationModelParameter(graph:yfiles.graph.IGraph,owner:yfiles.graph.IPortOwner):yfiles.graph.IPortLocationModelParameter; + /** + * Creates a location model parameter for a newly created {@link yfiles.graph.IPort} at the owner that matches the + * location. + * @param {yfiles.graph.IGraph} graph The graph to add the port to. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPortOwner} owner The owner of the port. + * @param {yfiles.geometry.PointD} location The location in the world coordinate system where the port should be added. + * @return {yfiles.graph.IPortLocationModelParameter} A location model parameter that matches the location. + * @see {@link yfiles.graph.IPortLocationModel#createParameter} + * @see {@link yfiles.graph.GraphExtensions#getPortDefaults} + */ + createLocationModelParameterForLocation(graph:yfiles.graph.IGraph,owner:yfiles.graph.IPortOwner,location:yfiles.geometry.PointD):yfiles.graph.IPortLocationModelParameter; + /** + * Creates the label model parameter for a given {@link yfiles.graph.ILabeledItem}. + * This implementation uses the {@link yfiles.graph.GraphExtensions#getLabelDefaults label defaults} for the graph + * to {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance obtain the parameter instance}. + * @param {yfiles.graph.IGraph} graph The graph to retrieve the {@link yfiles.graph.ILabelDefaults} from. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.ILabeledItem} item The item that is the {@link yfiles.graph.ILabel#owner} of the label in question. + * @return {yfiles.graph.ILabelModelParameter} The default label model parameter to use for newly created labels at the item. + * @see {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance} + * @see {@link yfiles.graph.GraphExtensions#getLabelDefaults} + */ + createLabelModelParameter(graph:yfiles.graph.IGraph,item:yfiles.graph.ILabeledItem):yfiles.graph.ILabelModelParameter; + /** + * Gets the {@link yfiles.graph.ILabelDefaults label defaults} for a given {@link yfiles.graph.ILabeledItem} + * in the context of the graph. + * @param {yfiles.graph.IGraph} graph The graph that contains the item. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.ILabeledItem} item The item that the label defaults are returned for. If this is a {@link yfiles.graph.IGroupedGraph group node}, + * the {@link yfiles.graph.IGroupedGraph#groupNodeDefaults}'s {@link yfiles.graph.INodeDefaults#labels label defaults} will be returned, + * otherwise the {@link yfiles.graph.IGraph#nodeDefaults} or {@link yfiles.graph.IGraph#edgeDefaults} {@link yfiles.graph.INodeDefaults#labels labels} + * will be returned. + * @return {yfiles.graph.ILabelDefaults} Appropriate {@link yfiles.graph.ILabelDefaults} for the provided item. + */ + getLabelDefaults(graph:yfiles.graph.IGraph,item:yfiles.graph.ILabeledItem):yfiles.graph.ILabelDefaults; + /** + * Gets the {@link yfiles.graph.IPortDefaults port defaults} for a given {@link yfiles.graph.IPortOwner} + * in the context of the graph. + * @param {yfiles.graph.IGraph} graph The graph that contains the item. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPortOwner} item The item that the label defaults are returned for. If this is a {@link yfiles.graph.IGroupedGraph group node}, + * the {@link yfiles.graph.IGroupedGraph#groupNodeDefaults}'s {@link yfiles.graph.INodeDefaults#ports port defaults} will be returned, + * otherwise the {@link yfiles.graph.IGraph#nodeDefaults} or {@link yfiles.graph.IGraph#edgeDefaults} {@link yfiles.graph.INodeDefaults#ports ports} + * will be returned. + * @return {yfiles.graph.IPortDefaults} Appropriate {@link yfiles.graph.IPortDefaults} for the provided item. + */ + getPortDefaults(graph:yfiles.graph.IGraph,item:yfiles.graph.IPortOwner):yfiles.graph.IPortDefaults; + /** + * Convenience method that delegates to the {@link yfiles.graph.IPortDefaults#getStyleInstance} + * method of the {@link yfiles.graph.GraphExtensions#getPortDefaults} for the given owner. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IPortOwner} owner The owner that be used for the newly created port. + * @return {yfiles.drawing.IPortStyle} The style instance to use for newly created ports. + * @see {@link yfiles.graph.GraphExtensions#getPortDefaults} + */ + createPortStyle(graph:yfiles.graph.IGraph,owner:yfiles.graph.IPortOwner):yfiles.drawing.IPortStyle; + /** + * Convenience method that delegates to the {@link yfiles.graph.IEdgeDefaults#getStyleInstance} + * method of the {@link yfiles.graph.GraphExtensions#getLabelDefaults} for the given {@link yfiles.graph.ILabeledItem labeled item}. + * @param {yfiles.graph.IGraph} graph The graph to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.ILabeledItem} item The item the newly created label will belong to. + * @return {yfiles.drawing.ILabelStyle} The style instance to use for newly created edges. + */ + createLabelStyle(graph:yfiles.graph.IGraph,item:yfiles.graph.ILabeledItem):yfiles.drawing.ILabelStyle; + /** + * Gets the {@link yfiles.graph.IGroupedGraph grouped graph} instance associated with this + * {@link yfiles.graph.IGraph} or null if none is associated with it. + * This convenience method uses the {@link yfiles.support.ILookup#lookup} of the {@link yfiles.graph.IGraph} + * to obtain the {@link yfiles.graph.IGroupedGraph}. + * @param {yfiles.graph.IGraph} graph The graph to look up the {@link yfiles.graph.IGroupedGraph} instance. + * @return {yfiles.graph.IGroupedGraph} The implementation of the {@link yfiles.graph.IGroupedGraph} or null if + * {@link yfiles.graph.DefaultGraph#groupingSupported grouping is not supported}. + * @see {@link yfiles.graph.GroupedGraph} + * @see {@link yfiles.graph.DefaultGraph#groupingSupported} + */ + getGroupedGraph(graph:yfiles.graph.IGraph):yfiles.graph.IGroupedGraph; + /** + * Gets the {@link yfiles.graph.IFoldedGraph folded graph} instance associated with this + * {@link yfiles.graph.IGraph} or null if none is associated with it. + * This convenience method uses the {@link yfiles.support.ILookup#lookup} of the {@link yfiles.graph.IGraph} + * to obtain the {@link yfiles.graph.IFoldedGraph}. + * @param {yfiles.graph.IGraph} graph The graph to look up the {@link yfiles.graph.IGroupedGraph} instance. + * @return {yfiles.graph.IFoldedGraph} The implementation of the {@link yfiles.graph.IFoldedGraph} or null if + * the graph has not been created by a {@link yfiles.graph.FoldingManager}. + * @see {@link yfiles.graph.FoldingManager} + * @see {@link yfiles.graph.FoldingManager#createManagedView} + */ + getFoldedGraph(graph:yfiles.graph.IGraph):yfiles.graph.IFoldedGraph; + }; + /** + * A subclass of {@link yfiles.layout.NodeLabelCandidate} that provides a + * {@link yfiles.graph.ILabelCandidateDescriptor candidate descriptor}. + */ + export interface ExtendedNodeLabelCandidate extends yfiles.layout.NodeLabelCandidate{ + /** + * Gets the label candidate descriptor. + */ + descriptor:yfiles.graph.ILabelCandidateDescriptor; + } + var ExtendedNodeLabelCandidate:{ + $class:yfiles.lang.Class; + /** + * Returns a new instance of ExtendedNodeLabelCandidate. + * @param {yfiles.algorithms.YPoint} pos + * the location of the upper + * left corner of the candidate. + * @param {yfiles.algorithms.YDimension} size the size of the candidate. + * @param {Object} param + * the parameters of the labeling model + * associated with this candidate. + * @param {yfiles.layout.INodeLabelLayout} owner the label associated to the candidate. + * @param {yfiles.graph.ILabelCandidateDescriptor} descriptor the label candidate descriptor. + */ + FromPointSizeParamOwnerAndDescriptor:{ + new (pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.INodeLabelLayout,descriptor:yfiles.graph.ILabelCandidateDescriptor):yfiles.graph.ExtendedNodeLabelCandidate; + }; + /** + * Returns a new instance of NodeLabelCandidate. + * @param {yfiles.algorithms.YOrientedRectangle} orientedBox the label size and orientation + * @param {Object} param the parameters of the labeling model associated with this candidate. + * @param {yfiles.layout.INodeLabelLayout} owner the label associated to the candidate. + * @param {boolean} internal + * flag whether the candidate is inside the node, + * or outside. + * @param {yfiles.graph.ILabelCandidateDescriptor} descriptor the label candidate descriptor. + */ + FromRectParamAndOwner:{ + new (orientedBox:yfiles.algorithms.YOrientedRectangle,param:Object,owner:yfiles.layout.INodeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor):yfiles.graph.ExtendedNodeLabelCandidate; + }; + /** + * Returns a new instance of NodeLabelCandidate. + * @param {yfiles.algorithms.YPoint} pos + * the location of the upper + * left corner of the candidate. + * @param {yfiles.algorithms.YDimension} size the size of the candidate. + * @param {Object} param + * the parameters of the labeling model + * associated with this candidate. + * @param {yfiles.layout.INodeLabelLayout} owner the label associated to the candidate. + * @param {boolean} internal + * flag whether the candidate is inside the node, + * or outside. + * @param {yfiles.graph.ILabelCandidateDescriptor} descriptor the label candidate descriptor. + */ + FromPointSizeParamOwnerInternalAndDescriptor:{ + new (pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.INodeLabelLayout,internal:boolean,descriptor:yfiles.graph.ILabelCandidateDescriptor):yfiles.graph.ExtendedNodeLabelCandidate; + }; + }; + /** + * Extension method holder class with layout-related utility methods. + * @see {@link yfiles.graph.IGraph} + */ + export interface LayoutExtensions extends Object{ + } + var LayoutExtensions:{ + $class:yfiles.lang.Class; + /** + * Convenience method that runs a layouter on a graph using + * {@link yfiles.graph.CopiedLayoutIGraph#applyLayout}. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.layout.ILayouter} layouter The layouter. + */ + applyLayout(graph:yfiles.graph.IGraph,layouter:yfiles.layout.ILayouter):void; + /** + * Convenience method that runs a layouter on a graph and animates the transition + * to the new layout in a graph control that displays the graph. + * The implementation simply delegates to a properly configured instance of {@link yfiles.graph.LayoutExecutor}. + * For more fine-grained control over the execution of the layout, use the helper class directly, instead. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.layout.ILayouter} layouter The layouter to run. + * @param {yfiles.system.TimeSpan} morphDuration Duration of the animation of the layout. + * @param {yfiles.canvas.GraphControl} control The graph control displaying the graph. + * @see {@link yfiles.graph.LayoutExecutor} + * @see {@link yfiles.graph.LayoutExtensions#applyLayoutWithControlAndCallback} + */ + applyLayoutWithControl(graph:yfiles.graph.IGraph,layouter:yfiles.layout.ILayouter,morphDuration:yfiles.system.TimeSpan,control:yfiles.canvas.GraphControl):void; + /** + * Convenience method that runs a layouter on a graph and animates the transition + * to the new layout in a graph control that displays the graph. An event is called + * once the animation has finished. + * The implementation simply delegates to a properly configured instance of {@link yfiles.graph.LayoutExecutor}. + * For more fine-grained control over the execution of the layout, use the helper class directly, instead. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.layout.ILayouter} layouter The layouter to run. + * @param {yfiles.system.TimeSpan} morphDuration Duration of the animation of the layout. + * @param {yfiles.canvas.GraphControl} control The graph control displaying the graph. + * @param {function(Object, yfiles.system.EventArgs)} doneHandler The handler that is called after the animation has finished. See {@link yfiles.graph.LayoutExecutor#finishHandler}. + * @see {@link yfiles.graph.LayoutExecutor} + * @see {@link yfiles.graph.LayoutExtensions#doLayout} + */ + applyLayoutWithControlAndCallback(graph:yfiles.graph.IGraph,layouter:yfiles.layout.ILayouter,morphDuration:yfiles.system.TimeSpan,control:yfiles.canvas.GraphControl,doneHandler:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Convenience method that runs a layouter on the graph of a given graph control + * and animates the transition. An event is called once the animation has finished. + * The implementation simply delegates to a properly configured instance of {@link yfiles.graph.LayoutExecutor}. + * For more fine-grained control over the execution of the layout, use the helper class directly, instead. + * @param {yfiles.canvas.GraphControl} control The graph control. + * @param {yfiles.layout.ILayouter} layouter The layouter to run. + * @param {yfiles.system.TimeSpan} morphDuration Duration of the animation of the layout. + * @param {function(Object, yfiles.system.EventArgs)} doneHandler The handler that is called after the animation has finished. See {@link yfiles.graph.LayoutExecutor#finishHandler}. + * @see {@link yfiles.graph.LayoutExecutor} + * @see {@link yfiles.graph.LayoutExtensions#doLayout} + */ + morphLayout(control:yfiles.canvas.GraphControl,layouter:yfiles.layout.ILayouter,morphDuration:yfiles.system.TimeSpan,doneHandler:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Creates and registers an incremental layer constraint factory for an {@link yfiles.graph.IGraph}. + * This method can only be used for ihl instances of type {@link yfiles.hierarchic.IncrementalHierarchicLayouter}. + * @param {yfiles.layout.ILayouter} ihl The layouter instance where the factory is created. This must be an instance of {@link yfiles.hierarchic.IncrementalHierarchicLayouter}. + * @param {yfiles.graph.IGraph} graph The graph for which the factory is created + * @return {yfiles.hierarchic.incremental.ILayerConstraintFactory} the sequence constraint factory + */ + createIncrementalLayerConstraintFactory(ihl:yfiles.layout.ILayouter,graph:yfiles.graph.IGraph):yfiles.hierarchic.incremental.ILayerConstraintFactory; + /** + * Creates and registers a sequencer constraint factory for an {@link yfiles.graph.IGraph}. + * This method can only be used for ihl instances of type {@link yfiles.hierarchic.IncrementalHierarchicLayouter}. + * @param {yfiles.layout.ILayouter} ihl The layouter instance where the factory is created. This must be an instance of {@link yfiles.hierarchic.IncrementalHierarchicLayouter}. + * @param {yfiles.graph.IGraph} graph The graph. + * @return {yfiles.hierarchic.incremental.ISequenceConstraintFactory} the sequence constraint factory + */ + createSequenceConstraintFactory(ihl:yfiles.layout.ILayouter,graph:yfiles.graph.IGraph):yfiles.hierarchic.incremental.ISequenceConstraintFactory; + /** + * Convenience method that runs a layouter on a graph. + * @param {yfiles.layout.ILayouter} layouter The layouter. + * @param {yfiles.graph.IGraph} graph The graph. + * @see {@link yfiles.graph.LayoutExtensions#applyLayoutWithControl} + * @see {@link yfiles.graph.LayoutExtensions#morphLayout} + */ + doLayout(layouter:yfiles.layout.ILayouter,graph:yfiles.graph.IGraph):void; + }; + /** + * A helper class that can be used to execute a {@link yfiles.layout.ILayouter}, and possibly + * animate the result. + * This class supports several animation options. + */ + export interface LayoutExecutor extends Object{ + /** + * Gets or sets the {@link yfiles.graph.LayoutExecutor#abortHandler} that is used during the layout calculation. + * Value: The AbortHandler that is used during the layout calculation. + */ + abortHandler:yfiles.algorithms.AbortHandler; + /** + * The table layout configurator that is used if {@link yfiles.graph.LayoutExecutor#configureTableNodeLayout} is enabled. + */ + tableLayoutConfigurator:yfiles.graph.TableLayoutConfigurator; + /** + * Gets or sets a value indicating whether to automatically perform calls to {@link yfiles.graph.TableLayoutConfigurator#prepareAll} and {@link yfiles.graph.TableLayoutConfigurator#restoreAll} in order to + * layout table nodes. + * Value: true if table layout should be performed automatically; otherwise, false. Default value is true + */ + configureTableNodeLayout:boolean; + /** + * Gets or sets the duration of the animation. + * Value: The duration. A value smaller than {@link yfiles.system.TimeSpan#ZERO} will prevent the animation from happening. + */ + duration:yfiles.system.TimeSpan; + /** + * Gets or sets the handler that will be executed when this instance has finished its work. + * The handler that will be called upon completion or upon an exception (in which case the {@link yfiles.system.EventArgs} + * will be of type {@link yfiles.graph.LayoutExceptionEventArgs} and carries the exception. + */ + finishHandler:(sender:Object,e:yfiles.system.EventArgs)=> void; + /** + * Gets or sets a value indicating whether to animate the viewport. + * Value: true if the viewport should be animated; otherwise, false. + */ + animateViewport:boolean; + /** + * Whether to respect the {@link yfiles.canvas.CanvasControl#viewportLimiter} of the {@link yfiles.canvas.GraphControl} + * which is handled by this executor. + * Default is false. + * Value: true if the {@link yfiles.canvas.CanvasControl#viewportLimiter} should be considered, otherwise false. + */ + considerViewportLimiter:boolean; + /** + * Gets or sets a value indicating whether to use eased animation. + * Value: true if the animation should be done with eased; otherwise, false. + */ + easedAnimation:boolean; + /** + * Gets or sets the target bounds insets that will be used to calculate the target viewport. + * Value: The target bounds insets. + */ + targetBoundsInsets:yfiles.geometry.InsetsD; + /** + * Gets or sets a value indicating whether the content rectangle property of the {@link yfiles.canvas.CanvasControl} + * should be updated upon completion. + * Value: true if the content rectangle should be updated; otherwise, false. + */ + updateContentRect:boolean; + /** + * Actually starts the process. + * This method will ultimately call the {@link yfiles.graph.LayoutExecutor#execute} method. + * @see {@link yfiles.graph.LayoutExecutor#execute} + */ + start():void; + /** + * Gets or sets the {@link yfiles.model.ISelectionModel} + * to use for the automatically registered {@link yfiles.algorithms.IDataProvider} + * instances for {@link yfiles.layout.LayouterKeys#SELECTED_NODES_DP_KEY} and {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY}. + * If this value is null and {@link yfiles.graph.LayoutExecutor#graph} is the same instance as {@link yfiles.graph.LayoutExecutor#control}'s IGraph instance, + * the selection model from {@link yfiles.graph.LayoutExecutor#control} is used instead. + */ + selectionModel:yfiles.model.ISelectionModel; + /** + * Set up {@link yfiles.graph.LayoutExecutor#tableLayoutConfigurator} for an actual layout run. + * This implementation configures {@link yfiles.graph.TableLayoutConfigurator#horizontalLayout} according to the {@link yfiles.layout.CanonicMultiStageLayouter#layoutOrientation} and calls + * {@link yfiles.graph.TableLayoutConfigurator#prepareAll} + */ + prepareTableLayout():void; + /** + * Create a new instance of {@link yfiles.graph.LayoutExecutor#tableLayoutConfigurator} that is used if {@link yfiles.graph.LayoutExecutor#configureTableNodeLayout} is enabled. + * This method is called upon first access to {@link yfiles.graph.LayoutExecutor#tableLayoutConfigurator} + * @return {yfiles.graph.TableLayoutConfigurator} A new instance of {@link yfiles.graph.LayoutExecutor#tableLayoutConfigurator} + */ + createTableLayoutConfigurator():yfiles.graph.TableLayoutConfigurator; + /** + * Callback method that performs the actual layout. + */ + execute():void; + /** + * Writes the table layout information provided through {@link yfiles.graph.LayoutExecutor#tableLayoutConfigurator} back to all tables. + * This method is only called when the layout is not animated. + * @see {@link yfiles.graph.LayoutExecutor#prepareTableLayout} + */ + restoreTableLayout():void; + /** + * Factory method that creates the {@link yfiles.canvas.IAnimation} that will be used by this instance + * after the layout has been calculated. + * @return {yfiles.canvas.IAnimation} The animation to use after the layout. + * @see {@link yfiles.graph.LayoutExecutor#duration} + * @see {@link yfiles.graph.LayoutExecutor#animateViewport} + * @see {@link yfiles.graph.LayoutExecutor#createMorphAnimation} + * @see {@link yfiles.graph.LayoutExecutor#createViewportAnimation} + */ + createAnimation():yfiles.canvas.IAnimation; + /** + * Creates an animation that morphs the layout of all {@link yfiles.graph.ITable}s in the graph. + * @see {@link yfiles.canvas.TableAnimation} + * @see {@link yfiles.graph.LayoutExecutor#configureTableNodeLayout} + */ + createTableAnimations():yfiles.canvas.IAnimation; + /** + * Gets the layout graph that is used by this instance to calculate the layout. + * Value: The layout graph. + */ + layoutGraph:yfiles.graph.CopiedLayoutIGraph; + /** + * Gets the control this instance has been created for. + * Value: The control. + */ + control:yfiles.canvas.GraphControl; + /** + * Gets the {@link yfiles.layout.ILayouter} this instance is using. + * Value: The layouter. + */ + layouter:yfiles.layout.ILayouter; + /** + * Gets the graph this instance is working on. + * Value: The graph. + */ + graph:yfiles.graph.IGraph; + /** + * Factory method that creates the animation for the {@link yfiles.canvas.CanvasControl#viewport}. + * @param {yfiles.geometry.RectD} targetBounds The target bounds of the animation. + * @return {yfiles.canvas.IAnimation} The animation instance. + * @see {@link yfiles.graph.LayoutExecutor#createAnimation} + */ + createViewportAnimation(targetBounds:yfiles.geometry.RectD):yfiles.canvas.IAnimation; + /** + * Factory method that creates the animation for the {@link yfiles.graph.IGraph}. + * @return {yfiles.canvas.IAnimation} The animation instance. + * @see {@link yfiles.graph.LayoutExecutor#createAnimation} + * @see {@link yfiles.canvas.LayoutMorpherWrapper} + */ + createMorphAnimation():yfiles.canvas.IAnimation; + } + var LayoutExecutor:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.LayoutExecutor} class. + * Use the {@link yfiles.graph.LayoutExecutor#start} method to actually execute the task. + * This will disable animation and content rect updates. + * @param {yfiles.canvas.GraphControl} control The control which will be animated and provides the {@link yfiles.graph.IGraph} instance. + * @param {yfiles.layout.ILayouter} layouter The {@link yfiles.layout.ILayouter} to use. + */ + FromControlAndLayouter:{ + new (control:yfiles.canvas.GraphControl,layouter:yfiles.layout.ILayouter):yfiles.graph.LayoutExecutor; + }; + /** + * Initializes a new instance of the {@link yfiles.graph.LayoutExecutor} class. + * @param {yfiles.canvas.GraphControl} control The control which will be animated and provides the {@link yfiles.graph.IGraph} instance. + * @param {yfiles.graph.IGraph} graph The graph to layout. + * @param {yfiles.layout.ILayouter} layouter The {@link yfiles.layout.ILayouter} to use. + */ + FromControlGraphAndLayouter:{ + new (control:yfiles.canvas.GraphControl,graph:yfiles.graph.IGraph,layouter:yfiles.layout.ILayouter):yfiles.graph.LayoutExecutor; + }; + }; + /** + * This event argument is used by {@link yfiles.graph.LayoutExecutor#finishHandler} if an exception happened during the execution. + * For backwards compatibility this exception extends {@link yfiles.system.CancelEventArgs}. + */ + export interface LayoutExceptionEventArgs extends yfiles.system.CancelEventArgs{ + /** + * Gets the exception this event is signaling. + * Value: The exception. + */ + exception:yfiles.lang.Exception; + } + var LayoutExceptionEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.LayoutExceptionEventArgs} class. + * @param {yfiles.lang.Exception} exception The exception to pass to {@link yfiles.graph.LayoutExceptionEventArgs#exception}. + */ + new (exception:yfiles.lang.Exception):yfiles.graph.LayoutExceptionEventArgs; + }; + /** + * Interface used by {@link yfiles.graph.ITable} and the like to declare and obtain the defaults + * for stripes and their labels. + * @see {@link yfiles.graph.ITable#rowDefaults} + * @see {@link yfiles.graph.ITable#columnDefaults} + */ + export interface IStripeDefaults extends Object{ + /** + * Gets or sets the default insets for a stripe. + * Value: The default insets. + * @see Specified by {@link yfiles.graph.IStripeDefaults#insets}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Gets or sets the default stripe size. + * Value: The default size of newly created stripe. + * @see {@link yfiles.graph.IStripe#size} + * @see Specified by {@link yfiles.graph.IStripeDefaults#size}. + */ + size:number; + /** + * Gets or sets the default minimum stripe size. + * Value: The default minimum size of newly created stripes. + * @see {@link yfiles.graph.IStripe#minimumSize} + * @see Specified by {@link yfiles.graph.IStripeDefaults#minimumSize}. + */ + minimumSize:number; + /** + * Gets or sets the defaults for labels at stripes. + * Value: The label defaults. + * @see Specified by {@link yfiles.graph.IStripeDefaults#labels}. + */ + labels:yfiles.graph.ILabelDefaults; + /** + * Gets or sets the style to use for stripes. + * Depending on the setting of {@link yfiles.graph.IStripeDefaults#shareStyleInstance}, the {@link yfiles.graph.IStripeDefaults#getStyleInstance} + * method should return a {@link yfiles.system.ICloneable#clone clone} of this instance or the very same instance. + * Value: The style to use as a template. + * @see {@link yfiles.graph.IStripeDefaults#shareStyleInstance} + * @see Specified by {@link yfiles.graph.IStripeDefaults#style}. + */ + style:yfiles.drawing.INodeStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.IStripeDefaults#style} + * instance should be shared referentially or {@link yfiles.system.ICloneable#clone cloned} + * upon a call to {@link yfiles.graph.IStripeDefaults#getStyleInstance}. + * Value: + * true if the reference should be shared; otherwise, false. + * @see {@link yfiles.graph.IStripeDefaults#getStyleInstance} + * @see {@link yfiles.graph.IStripeDefaults#style} + * @see Specified by {@link yfiles.graph.IStripeDefaults#shareStyleInstance}. + */ + shareStyleInstance:boolean; + /** + * Factory method that returns a style instance for use with newly created stripes. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IStripeDefaults#style} property, if {@link yfiles.graph.IStripeDefaults#shareStyleInstance} + * is enabled, but they might use more complicated logic, too. + * @return {yfiles.drawing.INodeStyle} The style to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IStripeDefaults#style} property, if {@link yfiles.graph.IStripeDefaults#shareStyleInstance} + * is enabled. + * @see Specified by {@link yfiles.graph.IStripeDefaults#getStyleInstance}. + */ + getStyleInstance():yfiles.drawing.INodeStyle; + } + var IStripeDefaults:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A canonic implementation of the {@link yfiles.graph.ILabelDefaults} interface. + */ + export interface LabelDefaults extends Object,yfiles.graph.ILabelDefaults{ + /** + * Gets or sets a property that determines whether to automatically adjust + * the preferred size of a label. + * On a call to {@link yfiles.graph.IGraph#setLabelText} or + * {@link yfiles.graph.IGraph#setLabelStyle}, the + * preferred size of the label will automatically be adjusted to the preferred size that + * is suggested by the label's style renderer, if this property is set to true. + * @see {@link yfiles.drawing.ILabelStyleRenderer#getPreferredSize} + * @see Specified by {@link yfiles.graph.ILabelDefaults#autoAdjustPreferredSize}. + */ + autoAdjustPreferredSize:boolean; + /** + * Factory method that returns a style instance for use with newly created labels. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.ILabelDefaults#style} property, if {@link yfiles.graph.ILabelDefaults#shareStyleInstance} + * is enabled, but they might use more complicated logic, too. + * @param {yfiles.graph.ILabeledItem} owner The owner of the label that will be created. + * @return {yfiles.drawing.ILabelStyle} The style to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.ILabelDefaults#style} property, if {@link yfiles.graph.ILabelDefaults#shareStyleInstance} + * is enabled. + * @see Specified by {@link yfiles.graph.ILabelDefaults#getStyleInstance}. + */ + getStyleInstance(owner:yfiles.graph.ILabeledItem):yfiles.drawing.ILabelStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.ILabelDefaults#labelModelParameter} + * instance should be shared referentially or {@link yfiles.system.ICloneable#clone cloned} + * upon a call to {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance}. + * Value: + * true if the reference should be shared; otherwise, false. + * @see {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance} + * @see {@link yfiles.graph.ILabelDefaults#labelModelParameter} + * @see Specified by {@link yfiles.graph.ILabelDefaults#shareLabelModelParameterInstance}. + */ + shareLabelModelParameterInstance:boolean; + /** + * Gets or sets the label model parameter to use for labels. + * Depending on the setting of {@link yfiles.graph.ILabelDefaults#shareLabelModelParameterInstance}, the {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance} + * method should return a {@link yfiles.system.ICloneable#clone clone} of this instance or the very same instance. + * Value: The parameter to use as a template. + * @see {@link yfiles.graph.ILabelDefaults#shareLabelModelParameterInstance} + * @see {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance} + * @see Specified by {@link yfiles.graph.ILabelDefaults#labelModelParameter}. + */ + labelModelParameter:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets the style to use for labels. + * Depending on the setting of {@link yfiles.graph.ILabelDefaults#shareStyleInstance}, the {@link yfiles.graph.ILabelDefaults#getStyleInstance} + * method should return a {@link yfiles.system.ICloneable#clone clone} of this instance or the very same instance. + * Value: The style to use as a template. + * @see {@link yfiles.graph.ILabelDefaults#shareStyleInstance} + * @see Specified by {@link yfiles.graph.ILabelDefaults#style}. + */ + style:yfiles.drawing.ILabelStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.ILabelDefaults#style} + * instance should be shared referentially or {@link yfiles.system.ICloneable#clone cloned} + * upon a call to {@link yfiles.graph.ILabelDefaults#getStyleInstance}. + * Value: + * true if the reference should be shared; otherwise, false. + * @see {@link yfiles.graph.ILabelDefaults#getStyleInstance} + * @see {@link yfiles.graph.ILabelDefaults#style} + * @see Specified by {@link yfiles.graph.ILabelDefaults#shareStyleInstance}. + */ + shareStyleInstance:boolean; + /** + * Factory method that returns a label model parameter instance for use with newly created labels. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.ILabelDefaults#labelModelParameter} property, if {@link yfiles.graph.ILabelDefaults#shareLabelModelParameterInstance} + * is enabled, but they might use more complicated logic, too. + * @param {yfiles.graph.ILabeledItem} owner The owner of the label that will be created. + * @return {yfiles.graph.ILabelModelParameter} The parameter to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.ILabelDefaults#labelModelParameter} property, if {@link yfiles.graph.ILabelDefaults#shareLabelModelParameterInstance} + * is enabled. + * @see Specified by {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance}. + */ + getLabelModelParameterInstance(owner:yfiles.graph.ILabeledItem):yfiles.graph.ILabelModelParameter; + } + var LabelDefaults:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.LabelDefaults} class using a trivial parameter. + */ + new ():yfiles.graph.LabelDefaults; + /** + * Initializes a new instance of the {@link yfiles.graph.LabelDefaults} class using the provided parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter. + */ + WithParameter:{ + new (parameter:yfiles.graph.ILabelModelParameter):yfiles.graph.LabelDefaults; + }; + /** + * Initializes a new instance of the {@link yfiles.graph.LabelDefaults} class using the provided properties. + * @param {yfiles.drawing.ILabelStyle} style The label style. + * @param {yfiles.graph.ILabelModelParameter} labelModelParameter The label model parameter. + */ + FromStyleAndLabelModelParameter:{ + new (style:yfiles.drawing.ILabelStyle,labelModelParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.LabelDefaults; + }; + /** + * Initializes a new instance of the {@link yfiles.graph.LabelDefaults} class using the properties of the provided instance. + * @param {yfiles.graph.ILabelDefaults} labelDefaults The label defaults to obtain the settings from. + */ + FromDefaults:{ + new (labelDefaults:yfiles.graph.ILabelDefaults):yfiles.graph.LabelDefaults; + }; + }; + /** + * A canonic implementation of the {@link yfiles.graph.IEdgeDefaults} interface. + */ + export interface EdgeDefaults extends Object,yfiles.graph.IEdgeDefaults{ + /** + * Gets or sets the defaults for labels at edges. + * Value: The label defaults. + * @see Specified by {@link yfiles.graph.IEdgeDefaults#labels}. + */ + labels:yfiles.graph.ILabelDefaults; + /** + * Gets or sets the defaults for ports at edges. + * Note that these are not the {@link yfiles.graph.IEdge#sourcePort}s or {@link yfiles.graph.IEdge#targetPort}s, + * because conceptually they belong to the nodes (and their {@link yfiles.graph.INodeDefaults}), but rather for ports + * at edges to which other edges can connect. + * Value: The port defaults. + * @see Specified by {@link yfiles.graph.IEdgeDefaults#ports}. + */ + ports:yfiles.graph.IPortDefaults; + /** + * Gets or sets the style to use for edges. + * Depending on the setting of {@link yfiles.graph.IEdgeDefaults#shareStyleInstance}, the {@link yfiles.graph.IEdgeDefaults#getStyleInstance} + * method should return a {@link yfiles.system.ICloneable#clone clone} of this instance or the very same instance. + * Value: The style to use as a template. + * @see {@link yfiles.graph.IEdgeDefaults#shareStyleInstance} + * @see Specified by {@link yfiles.graph.IEdgeDefaults#style}. + */ + style:yfiles.drawing.IEdgeStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.IEdgeDefaults#style} + * instance should be shared referentially or {@link yfiles.system.ICloneable#clone cloned} + * upon a call to {@link yfiles.graph.IEdgeDefaults#getStyleInstance}. + * Value: + * true if the reference should be shared; otherwise, false. + * @see {@link yfiles.graph.IEdgeDefaults#getStyleInstance} + * @see {@link yfiles.graph.IEdgeDefaults#style} + * @see Specified by {@link yfiles.graph.IEdgeDefaults#shareStyleInstance}. + */ + shareStyleInstance:boolean; + /** + * Factory method that returns a style instance for use with newly created edges. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IEdgeDefaults#style} property, if {@link yfiles.graph.IEdgeDefaults#shareStyleInstance} + * is enabled, but they might use more complicated logic, too. + * @return {yfiles.drawing.IEdgeStyle} The style to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IEdgeDefaults#style} property, if {@link yfiles.graph.IEdgeDefaults#shareStyleInstance} + * is enabled. + * @see Specified by {@link yfiles.graph.IEdgeDefaults#getStyleInstance}. + */ + getStyleInstance():yfiles.drawing.IEdgeStyle; + } + var EdgeDefaults:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.EdgeDefaults} class + * with default edge style and label and port defaults. + */ + new ():yfiles.graph.EdgeDefaults; + /** + * Initializes a new instance of the {@link yfiles.graph.EdgeDefaults} class. + * @param {yfiles.drawing.IEdgeStyle} style The edge style. + * @param {yfiles.graph.ILabelDefaults} labelDefaults The label defaults. + * @param {yfiles.graph.IPortDefaults} portDefaults The port defaults. + */ + WithStyleAndDefaults:{ + new (style:yfiles.drawing.IEdgeStyle,labelDefaults:yfiles.graph.ILabelDefaults,portDefaults:yfiles.graph.IPortDefaults):yfiles.graph.EdgeDefaults; + }; + }; + /** + * A {@link yfiles.layout.CopiedLayoutGraph} variant that can be initialized using an {@link yfiles.graph.IGraph}. + * Using this class, the various layout algorithms can be used to calculate an automatic layout + * for an {@link yfiles.graph.IGraph}: + *

+    *     // graph is of type yfiles.graph.IGraph
+    *     // and layouter is of type yfiles.layout.ILayouter
+    *     graph.applyLayout(layouter);
+    * 
+ * which makes use of an extension method and is identical to this: + *

+    *     // graph is of type yfiles.graph.IGraph
+    *     // and layouter is of type yfiles.layout.ILayouter
+    *     yfiles.layout.CopiedLayoutIGraph.applyLayout(graph, layouter);
+    * 
+ * which is basically the same as writing: + *

+    *     // build the adapter copy, graph is of type yfiles.graph.IGraph
+    *     var copy = new yfiles.graph.CopiedLayoutIGraph.FromGraph(graph);
+    *     // perform the layout on the copy - layouter is of type yfiles.layout.ILayouter
+    *     layouter.doLayout(copy);
+    *     
+    *     // apply the results to the original IGraph
+    *     copy.commitLayoutToOriginalGraph();
+    * 
+ * For more control over the adapting process, see the {@link yfiles.graph.LayoutGraphAdapter} class. + * @see {@link yfiles.graph.CopiedLayoutIGraph#applyLayout} + * @see {@link yfiles.graph.LayoutGraphAdapter} + * @see {@link yfiles.graph.LayoutExtensions} + */ + export interface CopiedLayoutIGraph extends yfiles.layout.CopiedLayoutGraph{ + /** + * Overrides the base method to temporarily turn off {@link yfiles.graph.IGroupedGraph#autoAdjustGroupNodeBounds} + * so that the group node bounds don't get messed up. + * @see Overrides {@link yfiles.layout.CopiedLayoutGraph#commitLayoutToOriginalGraph} + */ + commitLayoutToOriginalGraph():void; + /** + * Get or set the selection model to use for the {@link yfiles.layout.LayouterKeys#SELECTED_NODES_DP_KEY} and + * {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY} data provider implementations that are automatically + * bound to this instance. + */ + selectionModel:yfiles.model.ISelectionModel; + } + var CopiedLayoutIGraph:{ + $class:yfiles.lang.Class; + /** + * Create a new instance using the given graph. + * @param {yfiles.graph.IGraph} graph The graph to initialize this instance from. + */ + FromGraph:{ + new (graph:yfiles.graph.IGraph):yfiles.graph.CopiedLayoutIGraph; + }; + /** + * Create a new instance of this graph using the provided adapter. + * This constructor is useful when customizations need to be made on {@link yfiles.graph.LayoutGraphAdapter}. + * @param {yfiles.graph.LayoutGraphAdapter} adapter The adapter that has been used to convert the {@link yfiles.graph.IGraph}. + */ + FromAdapter:{ + new (adapter:yfiles.graph.LayoutGraphAdapter):yfiles.graph.CopiedLayoutIGraph; + }; + /** + * Static convenience method that applies a {@link yfiles.layout.ILayouter layout algorithm} + * to an {@link yfiles.graph.IGraph}. + * @param {yfiles.layout.ILayouter} layouter The layout algorithm to apply. + * @param {yfiles.graph.IGraph} graph The graph to compute the layout on. + */ + applyLayout(graph:yfiles.graph.IGraph,layouter:yfiles.layout.ILayouter):void; + }; + /** + * A canonic implementation of the {@link yfiles.graph.IStripeDefaults} interface. + */ + export interface StripeDefaults extends Object,yfiles.graph.IStripeDefaults{ + /** + * Gets or sets the default insets for a stripe. + * Value: The default insets. + * @see Specified by {@link yfiles.graph.IStripeDefaults#insets}. + */ + insets:yfiles.geometry.InsetsD; + /** + * Gets or sets the default stripe size. + * Value: The default size of newly created stripe. Default value is 100 + * @see {@link yfiles.graph.IStripe#size} + * @see Specified by {@link yfiles.graph.IStripeDefaults#size}. + */ + size:number; + /** + * Gets or sets the default minimum stripe size. + * Value: The default minimum size of newly created stripes. Default value is 10 + * @see {@link yfiles.graph.IStripe#minimumSize} + * @see Specified by {@link yfiles.graph.IStripeDefaults#minimumSize}. + */ + minimumSize:number; + /** + * Gets or sets the defaults for labels at stripes. + * Value: The label defaults. + * @see Specified by {@link yfiles.graph.IStripeDefaults#labels}. + */ + labels:yfiles.graph.ILabelDefaults; + /** + * Gets or sets the style to use for stripes. + * Depending on the setting of {@link yfiles.graph.IStripeDefaults#shareStyleInstance}, the {@link yfiles.graph.IStripeDefaults#getStyleInstance} + * method should return a {@link yfiles.system.ICloneable#clone clone} of this instance or the very same instance. + * Value: The style to use as a template. + * @see {@link yfiles.graph.IStripeDefaults#shareStyleInstance} + * @see Specified by {@link yfiles.graph.IStripeDefaults#style}. + */ + style:yfiles.drawing.INodeStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.IStripeDefaults#style} + * instance should be shared referentially or {@link yfiles.system.ICloneable#clone cloned} + * upon a call to {@link yfiles.graph.IStripeDefaults#getStyleInstance}. + * Value: + * true if the reference should be shared; otherwise, false. + * @see {@link yfiles.graph.IStripeDefaults#getStyleInstance} + * @see {@link yfiles.graph.IStripeDefaults#style} + * @see Specified by {@link yfiles.graph.IStripeDefaults#shareStyleInstance}. + */ + shareStyleInstance:boolean; + /** + * Factory method that returns a style instance for use with newly created stripes. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IStripeDefaults#style} property, if {@link yfiles.graph.IStripeDefaults#shareStyleInstance} + * is enabled, but they might use more complicated logic, too. + * @return {yfiles.drawing.INodeStyle} The style to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IStripeDefaults#style} property, if {@link yfiles.graph.IStripeDefaults#shareStyleInstance} + * is enabled. + * @see Specified by {@link yfiles.graph.IStripeDefaults#getStyleInstance}. + */ + getStyleInstance():yfiles.drawing.INodeStyle; + } + var StripeDefaults:{ + $class:yfiles.lang.Class; + /** + * Default constructor. + * This constructor sets the style to {@link yfiles.drawing.common.VoidNodeStyle#INSTANCE} and the insets to {@link yfiles.geometry.InsetsD#EMPTY} + */ + new ():yfiles.graph.StripeDefaults; + /** + * Initializes a new instance of the {@link yfiles.graph.StripeDefaults} class using the given properties. + * @param {yfiles.drawing.INodeStyle} style The default stripe style. + * @param {yfiles.graph.ILabelDefaults} labelDefaults The label defaults. + * @param {yfiles.geometry.InsetsD} insets The default stripe insets + */ + WithStyleDefaultsAndInsets:{ + new (style:yfiles.drawing.INodeStyle,labelDefaults:yfiles.graph.ILabelDefaults,insets:yfiles.geometry.InsetsD):yfiles.graph.StripeDefaults; + }; + }; + /** + * A canonic implementation of the {@link yfiles.graph.INodeDefaults} interface. + */ + export interface NodeDefaults extends Object,yfiles.graph.INodeDefaults{ + /** + * Gets or sets the default node size. + * The values of this size will be used by the {@link yfiles.graph.GraphExtensions#createNode} + * and {@link yfiles.graph.GraphExtensions#createNodeWithCenter} methods. + * Value: The default size of newly created nodes. + * @see Specified by {@link yfiles.graph.INodeDefaults#size}. + */ + size:yfiles.geometry.SizeD; + /** + * Gets or sets the defaults for labels at nodes. + * Value: The label defaults. + * @see Specified by {@link yfiles.graph.INodeDefaults#labels}. + */ + labels:yfiles.graph.ILabelDefaults; + /** + * Gets or sets the defaults for ports at nodes. + * Value: The port defaults. + * @see Specified by {@link yfiles.graph.INodeDefaults#ports}. + */ + ports:yfiles.graph.IPortDefaults; + /** + * Gets or sets the style to use for nodes. + * Depending on the setting of {@link yfiles.graph.INodeDefaults#shareStyleInstance}, the {@link yfiles.graph.INodeDefaults#getStyleInstance} + * method should return a {@link yfiles.system.ICloneable#clone clone} of this instance or the very same instance. + * Value: The style to use as a template. + * @see {@link yfiles.graph.INodeDefaults#shareStyleInstance} + * @see Specified by {@link yfiles.graph.INodeDefaults#style}. + */ + style:yfiles.drawing.INodeStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.INodeDefaults#style} + * instance should be shared referentially or {@link yfiles.system.ICloneable#clone cloned} + * upon a call to {@link yfiles.graph.INodeDefaults#getStyleInstance}. + * Value: + * true if the reference should be shared; otherwise, false. + * @see {@link yfiles.graph.INodeDefaults#getStyleInstance} + * @see {@link yfiles.graph.INodeDefaults#style} + * @see Specified by {@link yfiles.graph.INodeDefaults#shareStyleInstance}. + */ + shareStyleInstance:boolean; + /** + * Factory method that returns a style instance for use with newly created nodes. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.INodeDefaults#style} property, if {@link yfiles.graph.INodeDefaults#shareStyleInstance} + * is enabled, but they might use more complicated logic, too. + * @return {yfiles.drawing.INodeStyle} The style to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.INodeDefaults#style} property, if {@link yfiles.graph.INodeDefaults#shareStyleInstance} + * is enabled. + * @see Specified by {@link yfiles.graph.INodeDefaults#getStyleInstance}. + */ + getStyleInstance():yfiles.drawing.INodeStyle; + } + var NodeDefaults:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.NodeDefaults} class using default properties. + */ + new ():yfiles.graph.NodeDefaults; + /** + * Initializes a new instance of the {@link yfiles.graph.NodeDefaults} class using the given properties. + * @param {yfiles.drawing.INodeStyle} style The node style. + * @param {yfiles.graph.ILabelDefaults} labelDefaults The label defaults. + * @param {yfiles.graph.IPortDefaults} portDefaults The port defaults. + */ + WithStyleAndDefaults:{ + new (style:yfiles.drawing.INodeStyle,labelDefaults:yfiles.graph.ILabelDefaults,portDefaults:yfiles.graph.IPortDefaults):yfiles.graph.NodeDefaults; + }; + }; + /** + * A canonic implementation of the {@link yfiles.graph.IPortDefaults} interface. + */ + export interface PortDefaults extends Object,yfiles.graph.IPortDefaults{ + /** + * Determines whether unused ports should automatically be removed from their owners + * as soon as no further edge is connected to them. + * @see {@link yfiles.graph.IGraph#removePort} + * @see {@link yfiles.graph.IGraph#removeEdge} + * @see Specified by {@link yfiles.graph.IPortDefaults#autoCleanup}. + */ + autoCleanup:boolean; + /** + * Factory method that returns a style instance for use with newly created ports. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IPortDefaults#style} property, if {@link yfiles.graph.IPortDefaults#shareStyleInstance} + * is enabled, but they might use more complicated logic, too. + * @param {yfiles.graph.IPortOwner} owner The owner of the port that will be created. + * @return {yfiles.drawing.IPortStyle} The style to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IPortDefaults#style} property, if {@link yfiles.graph.IPortDefaults#shareStyleInstance} + * is enabled. + * @see Specified by {@link yfiles.graph.IPortDefaults#getStyleInstance}. + */ + getStyleInstance(owner:yfiles.graph.IPortOwner):yfiles.drawing.IPortStyle; + /** + * Gets or sets the location model parameter to use for ports. + * Depending on the setting of {@link yfiles.graph.IPortDefaults#shareLocationModelParameterInstance}, the {@link yfiles.graph.IPortDefaults#getLocationModelParameterInstance} + * method should return a {@link yfiles.system.ICloneable#clone clone} of this instance or the very same instance. + * Value: The parameter to use as a template. + * @see {@link yfiles.graph.IPortDefaults#shareLocationModelParameterInstance} + * @see {@link yfiles.graph.IPortDefaults#getLocationModelParameterInstance} + * @see Specified by {@link yfiles.graph.IPortDefaults#locationModelParameter}. + */ + locationModelParameter:yfiles.graph.IPortLocationModelParameter; + /** + * Factory method that returns a location model parameter instance for use with newly created ports. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IPortDefaults#locationModelParameter} property, if {@link yfiles.graph.IPortDefaults#shareLocationModelParameterInstance} + * is enabled, but they might use more complicated logic, too. + * @param {yfiles.graph.IPortOwner} owner The owner of the port that will be created. + * @return {yfiles.graph.IPortLocationModelParameter} The parameter to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IPortDefaults#locationModelParameter} property, if {@link yfiles.graph.IPortDefaults#shareLocationModelParameterInstance} + * is enabled. + * @see Specified by {@link yfiles.graph.IPortDefaults#getLocationModelParameterInstance}. + */ + getLocationModelParameterInstance(owner:yfiles.graph.IPortOwner):yfiles.graph.IPortLocationModelParameter; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.IPortDefaults#locationModelParameter} + * instance should be shared referentially or {@link yfiles.system.ICloneable#clone cloned} + * upon a call to {@link yfiles.graph.IPortDefaults#getLocationModelParameterInstance}. + * Value: + * true if the reference should be shared; otherwise, false. + * @see {@link yfiles.graph.IPortDefaults#getLocationModelParameterInstance} + * @see {@link yfiles.graph.IPortDefaults#locationModelParameter} + * @see Specified by {@link yfiles.graph.IPortDefaults#shareLocationModelParameterInstance}. + */ + shareLocationModelParameterInstance:boolean; + /** + * Gets or sets the style to use for ports. + * Depending on the setting of {@link yfiles.graph.IPortDefaults#shareStyleInstance}, the {@link yfiles.graph.IPortDefaults#getStyleInstance} + * method should return a {@link yfiles.system.ICloneable#clone clone} of this instance or the very same instance. + * Value: The style to use as a template. + * @see {@link yfiles.graph.IPortDefaults#shareStyleInstance} + * @see Specified by {@link yfiles.graph.IPortDefaults#style}. + */ + style:yfiles.drawing.IPortStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.IPortDefaults#style} + * instance should be shared referentially or {@link yfiles.system.ICloneable#clone cloned} + * upon a call to {@link yfiles.graph.IPortDefaults#getStyleInstance}. + * Value: + * true if the reference should be shared; otherwise, false. + * @see {@link yfiles.graph.IPortDefaults#getStyleInstance} + * @see {@link yfiles.graph.IPortDefaults#style} + * @see Specified by {@link yfiles.graph.IPortDefaults#shareStyleInstance}. + */ + shareStyleInstance:boolean; + /** + * Factory method that returns a style instance for use with newly created ports. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.PortDefaults#style} property, if {@link yfiles.graph.PortDefaults#shareStyleInstance} + * is enabled, but they might use more complicated logic, too. + * @return {yfiles.drawing.IPortStyle} The style to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.PortDefaults#style} property, if {@link yfiles.graph.PortDefaults#shareStyleInstance} + * is enabled. + */ + getPortStyleInstance():yfiles.drawing.IPortStyle; + } + var PortDefaults:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.PortDefaults} class + * using a trivial location model parameter. + */ + new ():yfiles.graph.PortDefaults; + /** + * Initializes a new instance of the {@link yfiles.graph.PortDefaults} class using a given location model parameter. + * @param {yfiles.graph.IPortLocationModelParameter} locationModelParameter The location model parameter. + */ + WithParameter:{ + new (locationModelParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.PortDefaults; + }; + /** + * Initializes a new instance of the {@link yfiles.graph.PortDefaults} class using the given properties. + * @param {yfiles.drawing.IPortStyle} style The port style. + * @param {yfiles.graph.IPortLocationModelParameter} locationModelParameter The location model parameter. + */ + WithStyleAndParameter:{ + new (style:yfiles.drawing.IPortStyle,locationModelParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.PortDefaults; + }; + /** + * Initializes a new instance of the {@link yfiles.graph.PortDefaults} class using the values of the provided instance. + * @param {yfiles.graph.IPortDefaults} portDefaults The port defaults to retrieve the initial values from. + */ + FromDefaults:{ + new (portDefaults:yfiles.graph.IPortDefaults):yfiles.graph.PortDefaults; + }; + }; + /** + * Used by the {@link yfiles.graph.GraphClipboard} to assign IDs for elements in the clipboard. + * IDs are created when items are copied (or cut) into the clipboard and queried when the items are pasted from the clipboard. + * Providing a custom ID provider allows for identifying conceptually identical items + * across different graph instances. + * The default implementation uses the {@link yfiles.model.IModelItem} object reference as the ID. + */ + export interface IClipboardIdProvider extends Object{ + /** + * Gets the ID for the given originalItem. + * @param {yfiles.model.IModelItem} originalItem The original item which is copied. The item is part of the original graph from which the item is copied. + * @param {yfiles.graph.IGraphClipboardContext} context The clipboard context + * @return {Object} An ID for the given item. The object should be suitable for use in a {@link yfiles.collections.Dictionary}. + * @see Specified by {@link yfiles.graph.IClipboardIdProvider#getId}. + */ + getId(originalItem:yfiles.model.IModelItem,context:yfiles.graph.IGraphClipboardContext):Object; + /** + * Gets the item which is represented by the given id. + * @param {Object} id The ID to get the item for. + * @param {yfiles.graph.IGraphClipboardContext} context The clipboard context. + * @return {yfiles.model.IModelItem} The item which is represented by the given ID or null if the item cannot be located or is invalid. + * The item needs to be part of the target graph for paste operations. + * @see Specified by {@link yfiles.graph.IClipboardIdProvider#getItem}. + */ + getItem(id:Object,context:yfiles.graph.IGraphClipboardContext):yfiles.model.IModelItem; + } + var IClipboardIdProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Clipboard implementation for {@link yfiles.graph.IGraph} instances. + *

+ * This implementation copies a given graph to an internally held {@link yfiles.graph.GraphClipboard#clipboardGraph clipboard graph}. + * The clipboard graph can then be pasted to a target graph instance. + *

+ *

+ * The clipboard can be configured to copy and paste {@link yfiles.graph.GraphClipboard#independentCopyItems items that depend on other items} + * without copying the items it depends on, e.g. labels, ports, edges, and bends. + *

+ *

+ * Also depending on the selection in the target graph, items can be pasted at multiple locations at once, e.g. a single label can be copied to the + * clipboard independently and pasted onto several selected target items. + *

+ * @see {@link yfiles.graph.IClipboardHelper} + * @see {@link yfiles.graph.GraphClipboard#cut} + * @see {@link yfiles.graph.GraphClipboard#copyGraphToRoot} + * @see {@link yfiles.graph.GraphClipboard#paste} + * @see {@link yfiles.graph.GraphClipboard#clipboardGraph} + */ + export interface GraphClipboard extends Object{ + /** + * Gets or sets a vector that will be used to move nodes and bends by + * after they have been pasted to the target graph. + * {@link yfiles.graph.GraphClipboard#onElementPasted} will use this in {@link yfiles.graph.GraphClipboard#adjustItemPosition} + * to adjust the position of the nodes and bends. + */ + pasteDelta:yfiles.geometry.PointD; + /** + * Convenience method that creates a {@link system.Predicate} + * that is based upon the outcome of the {@link yfiles.graph.IClipboardHelper#shouldCut} + * method that can be found in the {@link yfiles.support.ILookup#lookup} + * of the provided {@link yfiles.model.IModelItem}. + * @return {function(yfiles.model.IModelItem):boolean} A predicate that uses {@link yfiles.graph.IClipboardHelper#shouldCut}. + * @see {@link yfiles.graph.GraphClipboard#cut} + */ + createClipBoardHelperCutFilter():(obj:yfiles.model.IModelItem)=>boolean; + /** + * Convenience method that creates a {@link system.Predicate} + * that is based upon the outcome of the {@link yfiles.graph.IClipboardHelper#shouldPaste} + * method that can be found in the {@link yfiles.support.ILookup#lookup} + * of the provided {@link yfiles.model.IModelItem}. + * @return {function(yfiles.model.IModelItem):boolean} A predicate that uses {@link yfiles.graph.IClipboardHelper#shouldPaste}. + * @see {@link yfiles.graph.GraphClipboard#cut} + */ + createClipBoardHelperPasteFilter():(obj:yfiles.model.IModelItem)=>boolean; + /** + * Creates a {@link system.Predicate} for use in the {@link yfiles.graph.GraphClipboard#cut} + * method. + * This filter uses two predicates to decide whether a graph item can be + * cut. The base set of items specified by this filter is induced by the + * {@link yfiles.graph.GraphClipboard#createSelectionFilter}. Optionally, this set can be + * restricted further by an + * {@link yfiles.graph.IClipboardHelper#shouldCut} predicate. If such a predicate + * returns false for the item itself or any item this + * item depends on, then the item will not be cut. Items without such a + * predicate are handled solely according to their selection state. + * @param {yfiles.graph.IGraphSelection} selection The selection model to base the filter on. + * @param {yfiles.graph.IGraph} graph The graph to use for determining adjacency. + * @return {function(yfiles.model.IModelItem):boolean} A predicate that filters subgraph induced by the selection of + * nodes and restricted by an optional + * {@link yfiles.graph.IClipboardHelper#shouldCut} predicate. + */ + createDefaultCutFilter(selection:yfiles.graph.IGraphSelection,graph:yfiles.graph.IGraph):(obj:yfiles.model.IModelItem)=>boolean; + /** + * Creates a {@link system.Predicate} for use in the + * {@link yfiles.graph.GraphClipboard#copyGraphToRoot} + * method. + * This filter uses two predicates to decide whether a graph item can be + * copied. The base set of items specified by this filter is induced by the + * {@link yfiles.graph.GraphClipboard#createSelectionFilter}. Optionally, this set can be + * restricted further by an + * {@link yfiles.graph.IClipboardHelper#shouldCopy} predicate. If such a predicate + * returns false for the item itself or any item this + * item depends on, then the item will not be copied. Items without such a + * predicate are handled solely according to their selection state. + * @param {yfiles.graph.IGraphSelection} selection The selection model to base the filter on. + * @param {yfiles.graph.IGraph} graph The graph to use for determining adjacency. + * @return {function(yfiles.model.IModelItem):boolean} A predicate that filters subgraph induced by the selection of + * nodes and restricted by an optional + * {@link yfiles.graph.IClipboardHelper#shouldCopy} predicate. + */ + createDefaultCopyFilter(selection:yfiles.graph.IGraphSelection,graph:yfiles.graph.IGraph):(obj:yfiles.model.IModelItem)=>boolean; + /** + * Creates a {@link system.Predicate} for use in the + * {@link yfiles.graph.GraphClipboard#duplicate} + * method. + * By default this method uses the same filter implementation as {@link yfiles.graph.GraphClipboard#createDefaultCopyFilter}: + * This filter uses two predicates to decide whether a graph item will be + * duplicated. The base set of items specified by this filter is induced by the + * {@link yfiles.graph.GraphClipboard#createSelectionFilter}. Optionally, this set can be + * restricted further by an + * {@link yfiles.graph.IClipboardHelper#shouldCopy} predicate. If such a predicate + * returns false for the item itself or any item this + * item depends on, then the item will not be copied. Items without such a + * predicate are handled solely according to their selection state. + * @param {yfiles.graph.IGraphSelection} selection The selection model to base the filter on. + * @param {yfiles.graph.IGraph} graph The graph to use for determining adjacency. + * @return {function(yfiles.model.IModelItem):boolean} A predicate that filters subgraph induced by the selection of + * nodes and restricted by an optional + * {@link yfiles.graph.IClipboardHelper#shouldCopy} predicate. + */ + createDefaultDuplicateFilter(selection:yfiles.graph.IGraphSelection,graph:yfiles.graph.IGraph):(obj:yfiles.model.IModelItem)=>boolean; + /** + * Gets or sets the clipboard context to use for the upcoming clipboard operations. + * Value: The clipboard context. + * @see {@link yfiles.graph.IClipboardHelper} + * @see {@link yfiles.graph.GraphClipboard#createContext} + */ + clipboardContext:yfiles.graph.IGraphClipboardContext; + /** + * Factory method that creates the context for the upcoming calls to the {@link yfiles.graph.IClipboardHelper} methods. + * @param {yfiles.graph.IGraph} sourceGraph The source graph of the operation. + * @param {yfiles.graph.IGraph} targetGraph The target graph of the operation. + * @return {yfiles.graph.IGraphClipboardContext} A context that has the properties configured according to the parameters. + */ + createContext(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph):yfiles.graph.IGraphClipboardContext; + /** + * Convenience method that creates a {@link system.Predicate} + * that is based upon the outcome of the {@link yfiles.graph.IClipboardHelper#shouldCopy} + * method that can be found in the {@link yfiles.support.ILookup#lookup} + * of the provided {@link yfiles.model.IModelItem}. + * @return {function(yfiles.model.IModelItem):boolean} A predicate that uses {@link yfiles.graph.IClipboardHelper#shouldCopy}. + * @see {@link yfiles.graph.GraphClipboard#copyGraphToRoot} + */ + createClipBoardHelperCopyFilter():(obj:yfiles.model.IModelItem)=>boolean; + /** + * Creates a {@link system.Predicate} for use in the {@link yfiles.graph.GraphClipboard#cut} + * and {@link yfiles.graph.GraphClipboard#copyGraphToRoot} methods. + * This predicate is based on the element induced by + * the set of selected nodes, e.g. each edge that has both of its adjacent port owners + * selected will be included as well as each label and port whose owner is included. + * Also ports where no adjacent edge is included (but edges exist), will not be included, + * unless the {@link yfiles.graph.IPortDefaults#autoCleanup} is set to false. + * @param {yfiles.graph.IGraphSelection} selection The selection model to base the filter on. + * @param {yfiles.graph.IGraph} graph The graph to use for determining adjacency. + * @return {function(yfiles.model.IModelItem):boolean} A predicate that filters subgraph induced by the selection of nodes. + */ + createSelectionFilter(selection:yfiles.graph.IGraphSelection,graph:yfiles.graph.IGraph):(obj:yfiles.model.IModelItem)=>boolean; + /** + * Creates the graph used for the clipboard. + * @return {yfiles.graph.IGraph} A new readily configured {@link yfiles.graph.DefaultGraph} instance. + */ + createClipboardGraph():yfiles.graph.IGraph; + /** + * Determines whether the clipboard graph is empty. + */ + empty:boolean; + /** + * Cuts the items indicated by filter to the clipboard and removes them + * from the graph. + * This method delegates the core work to {@link yfiles.graph.GraphClipboard#copyGraphToRoot} + * which will use the {@link yfiles.graph.GraphClipboard#toClipboardCopier} to copy the cut elements to the clipboard. + * @param {yfiles.graph.IGraph} sourceGraph The graph to cut the items from. + * @param {function(yfiles.model.IModelItem):boolean} filter The filter to use. + * @see {@link yfiles.graph.GraphClipboard#createSelectionFilter} + */ + cut(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.model.IModelItem)=>boolean):void; + /** + * Gets or sets the {@link yfiles.graph.GraphCopier} instance that will + * be used to copy the graph to the clipboard. + * This instance is lazily created using {@link yfiles.graph.GraphClipboard#createToClipboardCopier}. + */ + toClipboardCopier:yfiles.graph.GraphCopier; + /** + * Gets or sets the {@link yfiles.graph.GraphCopier} instance that will + * be used to copy the graph from the clipboard to the target graph. + * This instance is lazily created using {@link yfiles.graph.GraphClipboard#createFromClipboardCopier}. + */ + fromClipboardCopier:yfiles.graph.GraphCopier; + /** + * Gets or sets the {@link yfiles.graph.GraphCopier} instance that will + * be used to duplicate elements inside the graph. + * This instance is lazily created using {@link yfiles.graph.GraphClipboard#createDuplicateCopier}. + */ + duplicateCopier:yfiles.graph.GraphCopier; + /** + * Factory method that creates the {@link yfiles.graph.GraphClipboard#toClipboardCopier}. + * @return {yfiles.graph.GraphCopier} A new {@link yfiles.graph.GraphCopier} instance. + */ + createToClipboardCopier():yfiles.graph.GraphCopier; + /** + * Factory method that creates the {@link yfiles.graph.GraphClipboard#fromClipboardCopier}. + * @return {yfiles.graph.GraphCopier} A new {@link yfiles.graph.GraphCopier} instance. + */ + createFromClipboardCopier():yfiles.graph.GraphCopier; + /** + * Factory method that creates the {@link yfiles.graph.GraphClipboard#duplicateCopier}. + * @return {yfiles.graph.GraphCopier} A new {@link yfiles.graph.GraphCopier} instance. + */ + createDuplicateCopier():yfiles.graph.GraphCopier; + /** + * The {@link yfiles.graph.IClipboardIdProvider} used by this instance to provide IDs for copied items. + * The default implementation simply uses a reference to the original item as ID. + * Custom ID can be used to map between elements in different graphs. + */ + idProvider:yfiles.graph.IClipboardIdProvider; + /** + * Creates the default {@link yfiles.graph.IClipboardIdProvider} used by this instance to provide IDs for copied items. + *

+ * The default implementation simply uses a reference to the original item as ID. + *

+ *

+ * Custom ID can be used to map between elements in different graphs. + *

+ */ + createDefaultClipboardIdProvider():yfiles.graph.IClipboardIdProvider; + /** + * Calls {@link yfiles.graph.GraphCopier#copyGraphToRoot} on + * the current {@link yfiles.graph.GraphClipboard#toClipboardCopier} instance + * or {@link yfiles.graph.GraphClipboard#fromClipboardCopier} instance, depending on whether the targetGraph + * is the {@link yfiles.graph.GraphClipboard#clipboardGraph} instance. + * @param {yfiles.graph.IGraph} sourceGraph The source graph to pass to {@link yfiles.graph.GraphCopier#copyGraphToRoot} + * @param {function(yfiles.model.IModelItem):boolean} filter The predicate to pass on. + * @param {yfiles.graph.IGraph} targetGraph The target graph to pass on. + * @param {yfiles.graph.INode} targetRootNode The node to use as the root node in the target's {@link yfiles.graph.IHierarchy}. + * @param {function(yfiles.model.IModelItem, yfiles.model.IModelItem)} elementCopiedDelegate The delegate to pass on. For each element that is copied during the operation to the clipboard, + * this callback will be passed the original and the copy of the item. In case the sourceGraph is a + * folded graph view both elements are passed as master + * elements or {@link yfiles.graph.DummyNodeId view state elements} if a master element does not exist. + */ + copyGraphToRoot(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.model.IModelItem)=>boolean,targetGraph:yfiles.graph.IGraph,targetRootNode:yfiles.graph.INode,elementCopiedDelegate:(original:yfiles.model.IModelItem,copy:yfiles.model.IModelItem)=> void):void; + /** + * Calls {@link yfiles.graph.GraphCopier#copyGraphToRoot} on the current + * {@link yfiles.graph.GraphClipboard#fromClipboardCopier} instance, depending on whether the targetGraph + * is the {@link yfiles.graph.GraphClipboard#clipboardGraph} instance. + * @param {yfiles.graph.IGraph} sourceGraph The source graph to pass to {@link yfiles.graph.GraphCopier#copyGraphToRoot} + * @param {function(yfiles.model.IModelItem):boolean} filter The predicate to pass on. + * @param {yfiles.graph.IGraph} targetGraph The target graph to pass on. + * @param {yfiles.graph.INode} targetRootNode The node to use as the root node in the target's {@link yfiles.graph.IHierarchy}. + * @param {function(yfiles.model.IModelItem, yfiles.model.IModelItem)} elementCopiedDelegate The delegate to pass on. For each element that is copied during the operation to the clipboard, + * this callback will be passed the original and the copy of the item. In case the targetGraph is a + * {@link yfiles.graph.IFoldingManager#views folded graph view} the original element is passed as {@link yfiles.graph.IFoldingManager#masterGraph master} + * elements or {@link yfiles.graph.DummyNodeId view state elements} if a master element does not exist. + * The copied element is always part of the targetGraph. + * @param {function(yfiles.model.IModelItem):boolean} targetFilter This predicate is used to determine which {@link yfiles.graph.INode}s and {@link yfiles.graph.IEdge}s can be + * used as targets for paste operations, e.g. if a labels or ports are copied without their owners. + */ + pasteSubsetWithTargetAndCallback(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.model.IModelItem)=>boolean,targetGraph:yfiles.graph.IGraph,targetRootNode:yfiles.graph.INode,elementCopiedDelegate:(original:yfiles.model.IModelItem,copy:yfiles.model.IModelItem)=> void,targetFilter:(obj:yfiles.model.IModelItem)=>boolean):void; + /** + * Removes elements from the graph based on a {@link system.Predicate}. + * @param {yfiles.graph.IGraph} sourceGraph The graph to remove elements from. + * @param {function(yfiles.model.IModelItem):boolean} predicate The predicate that decides which elements to remove. + * @see {@link yfiles.graph.GraphClipboard#cut} + */ + removeElements(sourceGraph:yfiles.graph.IGraph,predicate:(obj:yfiles.model.IModelItem)=>boolean):void; + /** + * Copies the elements indicated by the filter to the clipboard graph. + * For each element copied to the clipboard graph the {@link yfiles.graph.GraphClipboard#onElementCopied} delegate will be called. + * The actual work of this method is delegated to the {@link yfiles.graph.GraphClipboard#toClipboardCopier}'s {@link yfiles.graph.GraphCopier#copyGraphToRoot} + * method. + * @param {yfiles.graph.IGraph} sourceGraph The graph to copy the contents from. + * @param {function(yfiles.model.IModelItem):boolean} filter The filter to apply to the source graph's elements. + */ + copy(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.model.IModelItem)=>boolean):void; + /** + * Clears the clipboard's contents. + */ + clear():void; + /** + * Pastes all of the contents of the {@link yfiles.graph.GraphClipboard#clipboardGraph} into the target graph. + * The actual work of this method is delegated to the {@link yfiles.graph.GraphClipboard#fromClipboardCopier}'s {@link yfiles.graph.GraphCopier#copyGraphToRoot} + * method. + * @param {yfiles.graph.IGraph} targetGraph + * @see {@link yfiles.graph.GraphClipboard#pasteSubsetWithCallback} + */ + paste(targetGraph:yfiles.graph.IGraph):void; + /** + * Pastes the contents from the {@link yfiles.graph.GraphClipboard#clipboardGraph} to the targetGraph + * after applying a filter. + * For each element pasted into the graph the {@link yfiles.graph.GraphClipboard#onElementPasted} method will be called. + * The actual work of this method is delegated to the {@link yfiles.graph.GraphClipboard#fromClipboardCopier}'s {@link yfiles.graph.GraphCopier#copyGraphToRoot} + * method. + * @param {yfiles.graph.IGraph} targetGraph The graph to paste the contents in. + * @param {function(yfiles.model.IModelItem):boolean} filter The filter to apply to the clipboard graph. + */ + pasteSubset(targetGraph:yfiles.graph.IGraph,filter:(obj:yfiles.model.IModelItem)=>boolean):void; + /** + * Pastes the {@link yfiles.graph.GraphClipboard#clipboardGraph}'s contents into the targetGraph, + * selecting all pasted elements. + * The actual work of this method is delegated to the {@link yfiles.graph.GraphClipboard#fromClipboardCopier}'s {@link yfiles.graph.GraphCopier#copyGraphToRoot} + * method. + * @param {yfiles.graph.IGraph} targetGraph The graph to paste into. + * @param {yfiles.graph.IGraphSelection} graphSelection The selection model to set the selection on. + */ + pasteWithSelection(targetGraph:yfiles.graph.IGraph,graphSelection:yfiles.graph.IGraphSelection):void; + /** + * Pastes the contents from the {@link yfiles.graph.GraphClipboard#clipboardGraph} to the targetGraph + * after applying a filter. + * For each element pasted into the graph the elementPasted delegate will be invoked + * and the {@link yfiles.graph.GraphClipboard#onElementPasted} method will be called. + * The actual work of this method is delegated to the {@link yfiles.graph.GraphClipboard#fromClipboardCopier}'s {@link yfiles.graph.GraphCopier#copyGraphToRoot} + * method. + * As a final step, this method will invoke the {@link yfiles.graph.GraphClipboard#adjustItemPosition} + * method for all items that have been pasted. + * @param {yfiles.graph.IGraph} targetGraph The graph to paste the contents in. + * @param {function(yfiles.model.IModelItem):boolean} filter The filter to apply to the clipboard graph. + * @param {function(yfiles.model.IModelItem, yfiles.model.IModelItem)} elementPasted The callback to use for each element that has been pasted. For each element that is copied during the operation to the clipboard, + * this callback will be passed the original and the copy of the item. In case the targetGraph is a + * {@link yfiles.graph.IFoldingManager#views folded graph view} the original element is passed as {@link yfiles.graph.IFoldingManager#masterGraph master} + * elements or {@link yfiles.graph.DummyNodeId view state elements} if a master element does not exist. + * The copied element is always part of the targetGraph. + */ + pasteSubsetWithCallback(targetGraph:yfiles.graph.IGraph,filter:(obj:yfiles.model.IModelItem)=>boolean,elementPasted:(original:yfiles.model.IModelItem,copy:yfiles.model.IModelItem)=> void):void; + /** + * Pastes the contents from the {@link yfiles.graph.GraphClipboard#clipboardGraph} to the targetGraph + * after applying a filter. + * For each element pasted into the graph the elementPasted delegate will be invoked + * and the {@link yfiles.graph.GraphClipboard#onElementPasted} method will be called. + * The actual work of this method is delegated to the {@link yfiles.graph.GraphClipboard#fromClipboardCopier}'s {@link yfiles.graph.GraphCopier#copyGraphToRoot} + * method. + * As a final step, this method will invoke the {@link yfiles.graph.GraphClipboard#adjustItemPosition} + * method for all items that have been pasted. + * Providing a valid targetFilter allows for pasting {@link yfiles.graph.ILabel}s, {@link yfiles.graph.IPort}s, and {@link yfiles.graph.IEdge}s without + * valid owners. + * @param {yfiles.graph.IGraph} targetGraph The graph to paste the contents in. + * @param {function(yfiles.model.IModelItem):boolean} filter The filter to apply to the clipboard graph. + * @param {function(yfiles.model.IModelItem, yfiles.model.IModelItem)} elementPasted The callback to use for each element that has been pasted. For each element that is copied during the operation to the clipboard, + * this callback will be passed the original and the copy of the item. In case the targetGraph is a + * {@link yfiles.graph.IFoldingManager#views folded graph view} the original element is passed as {@link yfiles.graph.IFoldingManager#masterGraph master} + * elements or {@link yfiles.graph.DummyNodeId view state elements} if a master element does not exist. + * The copied element is always part of the targetGraph. + * @param {yfiles.input.IInputModeContext} inputModeContext A valid input mode context. Passing a valid input mode context is required for keeping + * orthogonal edges at group nodes whose size might be adjusted after the paste operation. + * @param {function(yfiles.model.IModelItem):boolean} targetFilter A filter which returns true for model items which can be used as target for clipboard items which need an owner + * (e.g. {@link yfiles.graph.ILabel}s which were copied without their owner). + */ + pasteSubsetWithCallbackAndContext(targetGraph:yfiles.graph.IGraph,filter:(obj:yfiles.model.IModelItem)=>boolean,elementPasted:(original:yfiles.model.IModelItem,copy:yfiles.model.IModelItem)=> void,inputModeContext:yfiles.input.IInputModeContext,targetFilter:(obj:yfiles.model.IModelItem)=>boolean):void; + /** + * A callback function that will be invoked for each item that + * has been copied into the clipboard graph in response to a {@link yfiles.graph.GraphClipboard#cut} + * operation. + * This implementation will {@link yfiles.support.ILookup#lookup} a {@link yfiles.graph.IClipboardHelper} + * for each item in the original graph and remember the memento retrieved by + * the {@link yfiles.graph.IClipboardHelper#cut} method for later use during the + * {@link yfiles.graph.GraphClipboard#onElementPasted} operation. + * @param {yfiles.model.IModelItem} original The original element from the source graph instance. + * @param {yfiles.model.IModelItem} copy The copy from the clipboard graph. + */ + onElementCut(original:yfiles.model.IModelItem,copy:yfiles.model.IModelItem):void; + /** + * Retrieves the {@link yfiles.graph.IClipboardHelper} instance associated + * with the given item. + * This implementation uses the item's {@link yfiles.support.ILookup#lookup} + * method to retrieve the helper instance. + * @param {yfiles.model.IModelItem} item The item to find the clipboard helper for. + * @return {yfiles.graph.IClipboardHelper} An instance or null. + */ + getClipboardHelper(item:yfiles.model.IModelItem):yfiles.graph.IClipboardHelper; + /** + * A callback that will be invoked for each item that + * has been copied into the clipboard graph in response to a {@link yfiles.graph.GraphClipboard#copyGraphToRoot} + * operation. + * This implementation will {@link yfiles.support.ILookup#lookup} a {@link yfiles.graph.IClipboardHelper} + * for each item in the original graph and remember the memento retrieved by + * the {@link yfiles.graph.IClipboardHelper#copy} method for later use during the + * {@link yfiles.graph.GraphClipboard#onElementPasted} operation. + * @param {yfiles.model.IModelItem} original The original element from the source graph instance. + * @param {yfiles.model.IModelItem} copy The copy from the clipboard graph. + */ + onElementCopied(original:yfiles.model.IModelItem,copy:yfiles.model.IModelItem):void; + /** + * Retrieves the memento associated with an item in the clipboard graph + * that has been stored with the item during {@link yfiles.graph.GraphClipboard#onElementCopied} + * and {@link yfiles.graph.GraphClipboard#onElementCut}. + * @param {yfiles.model.IModelItem} clipboardModelItem The item in the clipboard graph. + * @return {Object} The object returned by the {@link yfiles.graph.IClipboardHelper} methods or null. + */ + getMemento(clipboardModelItem:yfiles.model.IModelItem):Object; + /** + * A callback function that will be invoked for each item that + * has been pasted into the target graph in response to a {@link yfiles.graph.GraphClipboard#paste} + * operation. + * This method will use a previously stored {@link yfiles.graph.IClipboardHelper} to + * let it {@link yfiles.graph.IClipboardHelper#paste finish} its work. + * @param {yfiles.model.IModelItem} original The original element from the clipboard graph instance. + * @param {yfiles.model.IModelItem} copy The copy from the target graph. + */ + onElementPasted(original:yfiles.model.IModelItem,copy:yfiles.model.IModelItem):void; + /** + * Moves the item after a paste operation according to {@link yfiles.graph.GraphClipboard#pasteDelta}. + * For each {@link yfiles.graph.INode} and {@link yfiles.graph.IBend} this method + * will {@link yfiles.support.ILookup#lookup} the {@link yfiles.geometry.IMovable} implementation + * and if successful will move that element by the amount specified by {@link yfiles.graph.GraphClipboard#pasteDelta}. + * @param {yfiles.model.IModelItem} copiedItem The item to adjust the position of after it has been pasted into the target graph. + */ + adjustItemPosition(copiedItem:yfiles.model.IModelItem):void; + /** + * Adjusts the state of the dummy edge after a paste operation according to {@link yfiles.graph.GraphClipboard#pasteDelta}. + * @param {yfiles.graph.IChangeDummyEdgeAppearanceCallback} callback The callback to use to adjust the position. + * @param {yfiles.graph.IEdge} edgeViewState The state of the edge to adjust the position of after it has been pasted into the target graph. + * @see {@link yfiles.graph.GraphClipboard#adjustItemPosition} + */ + adjustEdgePosition(callback:yfiles.graph.IChangeDummyEdgeAppearanceCallback,edgeViewState:yfiles.graph.IEdge):void; + /** + * Adjusts the state of the dummy node after a paste operation according to {@link yfiles.graph.GraphClipboard#pasteDelta}. + * @param {yfiles.graph.IChangeDummyNodeAppearanceCallback} callback The callback to use to adjust the position. + * @param {yfiles.graph.INode} nodeViewState The state of the node to adjust after it has been pasted into the target graph. + * @see {@link yfiles.graph.GraphClipboard#adjustItemPosition} + */ + adjustNodePosition(callback:yfiles.graph.IChangeDummyNodeAppearanceCallback,nodeViewState:yfiles.graph.INode):void; + /** + * Gets or sets the graph that contains the clipboard's contents. + * @throws {yfiles.system.ArgumentNullException} If value is null. + */ + clipboardGraph:yfiles.graph.IGraph; + /** + * Provides an {@link yfiles.graph.ILabeledItem} where the given originalLabel can be added to. + * Called for {@link yfiles.graph.ILabel}s whose owners are not copied to provide a new owner. + * Might return null if no target for the given originalLabel is found. + * In this case the label will not be copied. + * @param {yfiles.graph.ILabel} originalLabel The label to be copied. + * @return {yfiles.graph.ILabeledItem} An {@link yfiles.graph.ILabeledItem} for the label to be added to or null if the label should not be copied. + */ + getTargetLabel(originalLabel:yfiles.graph.ILabel):yfiles.graph.ILabeledItem; + /** + * Provides an {@link yfiles.graph.IPortOwner} where the given originalPort can be added to. + * Called for {@link yfiles.graph.IPort}s whose owners are not copied to provide a new owner. + * Might return null if no target for the given originalPort is found. + * In this case the port will not be copied. + * @param {yfiles.graph.IPort} originalPort The port to be copied. + * @return {yfiles.graph.IPortOwner} An {@link yfiles.graph.IPortOwner} for the port to be added to or null if the port should not be copied. + */ + getTargetPort(originalPort:yfiles.graph.IPort):yfiles.graph.IPortOwner; + /** + * Provides an {@link yfiles.graph.IPort} where the given originalEdge can be added to. + * Called for {@link yfiles.graph.IEdge}s whose source or target ports are not copied to provide a new port. + * Might return null if no target for the given originalEdge is found. + * In this case the edge will not be copied. + * @param {yfiles.graph.IEdge} originalEdge The edge to be copied. + * @param {boolean} atSource Whether to look for a source port. + * @return {yfiles.graph.IPort} An {@link yfiles.graph.IPort} for the edge to be added to or null if the edge should not be copied. + */ + getTargetEdge(originalEdge:yfiles.graph.IEdge,atSource:boolean):yfiles.graph.IPort; + /** + * Provides an {@link yfiles.graph.IEdge} where the given originalBend can be added to. + * Called for {@link yfiles.graph.IBend}s whose edge is not copied to provide a new owner. + * Might return null if no target for the given originalBend is found. + * In this case the bend will not be copied. + * @param {yfiles.graph.IBend} originalBend The bend to be copied. + * @return {yfiles.graph.IEdge} An {@link yfiles.graph.IEdge} for the bend to be added to or null if the bend should not be copied. + */ + getTargetBend(originalBend:yfiles.graph.IBend):yfiles.graph.IEdge; + /** + * Provides a parent group node for the given originalNode. + * Called for {@link yfiles.graph.INode}s to place them inside a group node. Might return null if the given node + * should be placed at the {@link yfiles.graph.IHierarchy#root} or if the graph is not grouped. + * @param {yfiles.graph.INode} originalNode The node to be copied. + * @return {yfiles.graph.INode} The new parent group of the node or null if the node should be placed at the + * {@link yfiles.graph.IHierarchy#root} of the hierarchy or if the graph is not grouped. + * @see {@link yfiles.graph.GraphClipboard#parentNodeDetection} + */ + getTargetNode(originalNode:yfiles.graph.INode):yfiles.graph.INode; + /** + * Determines whether nodes should be automatically put into a group node and if so how this group will be determined. + * This property is used by {@link yfiles.graph.GraphClipboard#getTargetNode} to decide what node to yield as the target group node for the newly pasted node. + *

+ * The default is {@link yfiles.graph.GraphClipboard.ParentNodeDetectionMode#SELECTION}|{@link yfiles.graph.GraphClipboard.ParentNodeDetectionMode#PREVIOUS_PARENT}. + *

+ */ + parentNodeDetection:yfiles.graph.GraphClipboard.ParentNodeDetectionMode_Interface; + /** + * This property gets or set the type of items that depend on other elements but should automatically be copied + * implicitly to the clipboard if all elements that it depends on are explicitly selected for copying. + *

+ * {@link yfiles.graph.ILabel Labels} depend on their {@link yfiles.graph.ILabeledItem owner}, like {@link yfiles.graph.IPort ports} depend on their + * {@link yfiles.graph.IPortOwner owner}. Also {@link yfiles.graph.IBend bends} of course depend on their {@link yfiles.graph.IEdge owning edge}. + *

+ *

+ * If the corresponding element type is set in this property, items that depend on other items are implicitly included in the copy operation, if all of + * the items that they depend on are included recursively, even if they are not included explicitly themselves. + *

+ *

+ * The default is {@link yfiles.graph.GraphItemTypes#ALL} minus {@link yfiles.graph.GraphItemTypes#NODE}, which means that selecting a number of nodes will automatically select all elements that directly and indirectly + * depend on the existence of this set of nodes will be copied to the clipboard, too. + *

+ *

+ * Technically nodes do not depend on anything. Setting this property to a value that includes {@link yfiles.graph.GraphItemTypes#NODE} + * will include all child nodes for every selected group node. + *

+ */ + dependentCopyItems:yfiles.graph.GraphItemTypes; + /** + * This property gets or set the type of items that can be copied and pasted independently of their owning element. + *

+ * {@link yfiles.graph.ILabel Labels} depend on their {@link yfiles.graph.ILabeledItem owner}, like {@link yfiles.graph.IPort ports} depend on their + * {@link yfiles.graph.IPortOwner owner}. Also {@link yfiles.graph.IBend bends} of course depend on their {@link yfiles.graph.IEdge owning edge}. + *

+ *

+ * If the corresponding element type is set in this property, items can be copied alone to the clipboard and be pasted onto different owning elements. + *

+ *

+ * This enables copying of a label to one or more owners, without having to copy the owner of the label. Also ports can be copied to other {@link yfiles.graph.IPortOwner}s and + * bends to other edges. + *

+ *

+ * The default is {@link yfiles.graph.GraphItemTypes#ALL} which means that all elements can + * be copied to the clipboard even if the items that they depend on are not copied to the clipboard. + *

+ *

+ * Technically owning elements are still part of the clipboard as {@link yfiles.graph.GraphClipboard#isDummy dummy elements}, but these elements will not be pasted + * to the target during paste or duplicate operations. + *

+ */ + independentCopyItems:yfiles.graph.GraphItemTypes; + /** + * This property gets or set the type of items that can be copied and pasted at all using the clipboard. + *

+ * If the corresponding element type is set in this property, items can be effectively copied. + *

+ *

+ * If the corresponding element type is not set in this property, items will not be pasted, even if they have been explicitly selected. + * They may copied to the clipboard and become part of the {@link yfiles.graph.GraphClipboard#clipboardGraph}, nevertheless though, if they are required + * as {@link yfiles.graph.GraphClipboard#isDummy dummy elements}. But these elements will not be pasted + * to the target during paste or duplicate operations. + *

+ *

+ * The default is {@link yfiles.graph.GraphItemTypes#ALL}. + *

+ */ + copyItems:yfiles.graph.GraphItemTypes; + /** + * Gets a {@link yfiles.graph.ILabelModelParameter} for the given label + * to be placed at the given newOwner. + * Implementations might delegate to {@link yfiles.graph.GraphCopier#copyLabelModelParameter} to copy the existing parameter or + * use the {@link yfiles.graph.IGraph#nodeDefaults} or {@link yfiles.graph.IGraph#edgeDefaults} to create a new one. Note that the type + * of the owner might have changed during the copy operation. + * @param {yfiles.graph.GraphCopier} copier The {@link yfiles.graph.GraphCopier} whose {@link yfiles.graph.GraphCopier#copyLabelModelParameter} method can be used to copy the existing parameter. + * @param {yfiles.graph.IGraph} graph The {@link yfiles.graph.IGraph} whose {@link yfiles.graph.IGraph#nodeDefaults} or {@link yfiles.graph.IGraph#edgeDefaults} can be used to create a new parameter. + * @param {yfiles.graph.ILabel} label The label to be copied. + * @param {yfiles.graph.ILabeledItem} newOwner The new owner for the label. + * @return {yfiles.graph.ILabelModelParameter} An {@link yfiles.graph.ILabelModelParameter} for the copied label. + */ + getLabelModelParameter(copier:yfiles.graph.GraphCopier,graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel,newOwner:yfiles.graph.ILabeledItem):yfiles.graph.ILabelModelParameter; + /** + * Gets a {@link yfiles.graph.IPortLocationModelParameter} for the given originalPort + * to be placed at the given newOwner. + * Implementations might delegate to {@link yfiles.graph.GraphCopier#copyPortLocationModelParameter} to copy the existing parameter or + * use the {@link yfiles.graph.IGraph#nodeDefaults} or {@link yfiles.graph.IGraph#edgeDefaults} to create a new one. Note that the type + * of the owner might have changed during the copy operation. + * @param {yfiles.graph.GraphCopier} copier The {@link yfiles.graph.GraphCopier} whose {@link yfiles.graph.GraphCopier#copyPortLocationModelParameter} method can be used to copy the existing parameter. + * @param {yfiles.graph.IGraph} graph The {@link yfiles.graph.IGraph} whose {@link yfiles.graph.IGraph#nodeDefaults} or {@link yfiles.graph.IGraph#edgeDefaults} can be used to create a new parameter. + * @param {yfiles.graph.IPort} originalPort The port to be copied. + * @param {yfiles.graph.IPortOwner} newOwner The new owner for the port. + * @return {yfiles.graph.IPortLocationModelParameter} An {@link yfiles.graph.IPortLocationModelParameter} for the copied port. + */ + getPortLocationModelParameter(copier:yfiles.graph.GraphCopier,graph:yfiles.graph.IGraph,originalPort:yfiles.graph.IPort,newOwner:yfiles.graph.IPortOwner):yfiles.graph.IPortLocationModelParameter; + /** + * Adjusts the bounds of group nodes which obtained new children during a {@link yfiles.graph.GraphClipboard#paste} or {@link yfiles.graph.GraphClipboard#duplicate} operation. + * @param {yfiles.graph.IGraphClipboardContext} context The context in which this method is called. + * @param {yfiles.collections.IEnumerable.} groupsToAdjust The group nodes that should be adjusted. + */ + adjustGroupNodeBounds(context:yfiles.graph.IGraphClipboardContext,groupsToAdjust:yfiles.collections.IEnumerable):void; + /** + * Gets a view state of an edge for a given {@link yfiles.graph.DummyEdgeId}. + * This method might be overridden to map view states for edges whose source or target + * node's hierarchy might have changed during a paste operation. + * @param {yfiles.graph.IEdge} edge The edge to get the viewstate for. + * @param {yfiles.graph.DummyEdgeId} dummyEdgeId The original {@link yfiles.graph.DummyEdgeId} to get the view state for. + * Passing null will return the view state which was visible when the edge + * was copied into the clipboard. + * @return {yfiles.graph.IEdge} The viewstate which is mapped to the given dummyEdgeId. May be null. + */ + getViewState(edge:yfiles.graph.IEdge,dummyEdgeId:yfiles.graph.DummyEdgeId):yfiles.graph.IEdge; + /** + * Whether the given item is a "dummy" item which should not be pasted. + * A dummy item is used to keep {@link yfiles.model.IModelItem}s which cannot exist without an owner + * in the {@link yfiles.graph.GraphClipboard#clipboardGraph} (e.g. {@link yfiles.graph.ILabel}s). + * @param {yfiles.model.IModelItem} item The item to test. + * @return {boolean} true if the item is a "dummy" item. + */ + isDummy(item:yfiles.model.IModelItem):boolean; + /** + * Whether to paste edges whose source or target node was selected when copying to the clipboard while the other + * node was not. + * The default is false. + */ + ignoreEdgesWithOneNode:boolean; + /** + * Duplicates the elements indicated by the filter. + * The {@link yfiles.graph.GraphClipboard#clipboardGraph} is not altered by this operation. + * @param {yfiles.graph.IGraph} sourceGraph The graph whose elements should be duplicated. + * @param {function(yfiles.model.IModelItem):boolean} filter A {@link system.Predicate} which returns true for elements which should be duplicated. + * @param {function(yfiles.model.IModelItem, yfiles.model.IModelItem)} elementDuplicated An {@link yfiles.graph.ElementCopiedDelegate} which gets invoked for each element which has been duplicated. + * The two parameters passed into the callback are guaranteed to be part of the sourceGraph. + * @param {yfiles.input.IInputModeContext} inputModeContext The current {@link yfiles.input.IInputModeContext}. + */ + duplicate(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.model.IModelItem)=>boolean,elementDuplicated:(original:yfiles.model.IModelItem,copy:yfiles.model.IModelItem)=> void,inputModeContext:yfiles.input.IInputModeContext):void; + } + export module GraphClipboard{ + export interface ParentNodeDetectionMode_Interface{} + } + var GraphClipboard:{ + $class:yfiles.lang.Class; + /** + * Creates a new initially empty clipboard. + */ + new ():yfiles.graph.GraphClipboard; + /** + * Creates an induced {@link system.Predicate} from + * coreFilter for use in the + * {@link yfiles.graph.GraphClipboard#cut} and + * {@link yfiles.graph.GraphClipboard#copyGraphToRoot} + * methods that takes dependent items into account. + * This method can create a predicate for only a core set of items + * which is then extended or restricted depending on the predicate values + * of graph item dependencies. + *

+ * The restrictive parameter determines whether the + * result restricts or extends the set of elements handled by + * coreFilter: + *

    + *
  • + * If restrictive is false, an item is + * allowed if either coreFilter returns + * true for itself or if all items it depends on (e.g. + * label/port owner, source/target port etc.) are allowed by + * coreFilter. + *
  • + *
  • + * If restrictive is true, an item is + * forbidden if either coreFilter returns + * false for itself or if any item it depends on (e.g. + * label/port owner, source/target port etc.) is forbidden by + * coreFilter. + *
  • + *
+ *

+ * @param {function(yfiles.model.IModelItem):boolean} coreFilter The core predicate for the base set of + * elements. + * @param {yfiles.graph.IGraph} graph The graph to use for determining adjacency. + * @param {boolean} restrictive Whether to create a restriction or extension + * for the coreFilter predicate + */ + createWrappedFilter(coreFilter:(obj:yfiles.model.IModelItem)=>boolean,graph:yfiles.graph.IGraph,restrictive:boolean):(obj:yfiles.model.IModelItem)=>boolean; + /** + * Whether the given item exists in a view state of its viewStateOwner. + * @param {yfiles.model.IModelItem} viewStateOwner The owner of the given item. + * @param {yfiles.model.IModelItem} item An {@link yfiles.graph.ILabel}, {@link yfiles.graph.IPort}, or {@link yfiles.graph.IBend}. + * @return {boolean} true if the given item exists in a view state. + */ + isViewStateElement(viewStateOwner:yfiles.model.IModelItem,item:yfiles.model.IModelItem):boolean; + ParentNodeDetectionMode:{ + ROOT:yfiles.graph.GraphClipboard.ParentNodeDetectionMode_Interface; + SELECTION:yfiles.graph.GraphClipboard.ParentNodeDetectionMode_Interface; + PREVIOUS_PARENT:yfiles.graph.GraphClipboard.ParentNodeDetectionMode_Interface; + AT_LOCATION:yfiles.graph.GraphClipboard.ParentNodeDetectionMode_Interface; + ALLOW_SELF:yfiles.graph.GraphClipboard.ParentNodeDetectionMode_Interface; + FORCE:yfiles.graph.GraphClipboard.ParentNodeDetectionMode_Interface; + MODE_MASK:yfiles.graph.GraphClipboard.ParentNodeDetectionMode_Interface; + MODIFIER_MASK:yfiles.graph.GraphClipboard.ParentNodeDetectionMode_Interface; + }; + }; + /** + * Interface that helps in clipboard actions that can be associated with each {@link yfiles.model.IModelItem} in + * the context where clipboards are needed. + */ + export interface IClipboardHelper extends Object{ + /** + * Determines whether the given item can or should be copied to the clipboard. + * @param {yfiles.graph.IGraphClipboardContext} context The context in which this interface is used, can be null + * @param {Object} item The item in question. + * @return {boolean} Whether this item should be copied. + * @see Specified by {@link yfiles.graph.IClipboardHelper#shouldCopy}. + */ + shouldCopy(context:yfiles.graph.IGraphClipboardContext,item:Object):boolean; + /** + * Determines whether the given item can or should be cut to the clipboard. + * @param {yfiles.graph.IGraphClipboardContext} context The context in which this interface is used, can be null + * @param {Object} item The item in question. + * @return {boolean} Whether this item should be cut. + * @see Specified by {@link yfiles.graph.IClipboardHelper#shouldCut}. + */ + shouldCut(context:yfiles.graph.IGraphClipboardContext,item:Object):boolean; + /** + * Determines whether the given item can or should be pasted from the clipboard to the target graph. + * @param {yfiles.graph.IGraphClipboardContext} context The context in which this interface is used, can be null + * @param {Object} item The item in the clipboard. + * @param {Object} userData The state memento that had been created during {@link yfiles.graph.IClipboardHelper#cut} or {@link yfiles.graph.IClipboardHelper#copy}. + * @return {boolean} Whether this item should be pasted. + * @see Specified by {@link yfiles.graph.IClipboardHelper#shouldPaste}. + */ + shouldPaste(context:yfiles.graph.IGraphClipboardContext,item:Object,userData:Object):boolean; + /** + * This method is called during the copy operation of the given item to retrieve additional state + * that can be later used during a {@link yfiles.graph.IClipboardHelper#paste} operation. + * @param {yfiles.graph.IGraphClipboardContext} context The context in which this interface is used, can be null + * @param {Object} item The item to copy to the clipboard. + * @return {Object} A custom user object that will later be provided to {@link yfiles.graph.IClipboardHelper#paste}. + * @see Specified by {@link yfiles.graph.IClipboardHelper#copy}. + */ + copy(context:yfiles.graph.IGraphClipboardContext,item:Object):Object; + /** + * This method is called during the cut operation of the given item to retrieve additional state + * that can be later used during a {@link yfiles.graph.IClipboardHelper#paste} operation. + * @param {yfiles.graph.IGraphClipboardContext} context The context in which this interface is used, can be null + * @param {Object} item The item to cut to the clipboard. + * @return {Object} A custom user object that will later be provided to {@link yfiles.graph.IClipboardHelper#paste}. + * @see Specified by {@link yfiles.graph.IClipboardHelper#cut}. + */ + cut(context:yfiles.graph.IGraphClipboardContext,item:Object):Object; + /** + * This method is called after the item has been pasted from the clipboard. + * @param {yfiles.graph.IGraphClipboardContext} context The context in which this interface is used, can be null + * @param {Object} item The item that has been created during the paste operation. + * @param {Object} userData The data that had been queried during {@link yfiles.graph.IClipboardHelper#cut} or {@link yfiles.graph.IClipboardHelper#copy} respectively. + * @see Specified by {@link yfiles.graph.IClipboardHelper#paste}. + */ + paste(context:yfiles.graph.IGraphClipboardContext,item:Object,userData:Object):void; + } + var IClipboardHelper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface for the context that is passed by the {@link yfiles.graph.GraphClipboard} implementation + * to the {@link yfiles.graph.IClipboardHelper} methods and {@link yfiles.graph.IClipboardIdProvider}. + */ + export interface IGraphClipboardContext extends Object,yfiles.support.ILookup{ + /** + * Yields the clipboard that created this context and is used during the current operation. + * @see Specified by {@link yfiles.graph.IGraphClipboardContext#clipboard}. + */ + clipboard:yfiles.graph.GraphClipboard; + /** + * Yields the source graph for the current operation. + * @see Specified by {@link yfiles.graph.IGraphClipboardContext#sourceGraph}. + */ + sourceGraph:yfiles.graph.IGraph; + /** + * Yields the target graph for the current operation. + * @see Specified by {@link yfiles.graph.IGraphClipboardContext#targetGraph}. + */ + targetGraph:yfiles.graph.IGraph; + } + var IGraphClipboardContext:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Event arguments for the events in {@link yfiles.graph.GraphCopier}. + * This event is used for the {@link yfiles.graph.GraphCopier#addNodeCopiedListener NodeCopied}, {@link yfiles.graph.GraphCopier#addEdgeCopiedListener EdgeCopied}, + * {@link yfiles.graph.GraphCopier#addPortCopiedListener PortCopied}, {@link yfiles.graph.GraphCopier#addGraphCopiedListener GraphCopied}, {@link yfiles.graph.GraphCopier#addLabelCopiedListener LabelCopied}, + * and {@link yfiles.graph.GraphCopier#addObjectCopiedListener ObjectCopied} events. + * This event holds references to the {@link yfiles.graph.ItemCopiedEventArgs#original original} of the copied item and the + * {@link yfiles.graph.ItemCopiedEventArgs#copy copied item} itself. + */ + export interface ItemCopiedEventArgs extends yfiles.system.EventArgs{ + /** + * The original of the {@link yfiles.graph.ItemCopiedEventArgs#copy copied item}. + */ + original:T; + /** + * The copied item. + */ + copy:T; + } + var ItemCopiedEventArgs:{ + $class:yfiles.lang.Class; + /** + * Creates a new argument for the given item and its original. + * @param {T} original The {@link yfiles.graph.ItemCopiedEventArgs#original original} of the copied item. + * @param {T} copy The {@link yfiles.graph.ItemCopiedEventArgs#copy copied item}. + */ + new (original:T,copy:T):yfiles.graph.ItemCopiedEventArgs; + }; + /** + * Utility class that copies parts of an {@link yfiles.graph.IGraph} to another + * instance. + * Instances of this class can be used in {@link yfiles.graph.GraphClipboard}, e.g. + */ + export interface GraphCopier extends Object{ + /** + * Gets or sets the types of items that should be {@link yfiles.system.ICloneable#clone cloned} + * for the copy operation. + * Value: A bitwise combination of the types to clone. + */ + clone:yfiles.graph.GraphCopier.CloneTypes_Interface; + /** + * Emits the {@link yfiles.graph.GraphCopier#addObjectCopiedListener ObjectCopied} event. + * @param {yfiles.graph.ItemCopiedEventArgs.} itemCopiedEventArgs The argument to use. + */ + onObjectCopied(itemCopiedEventArgs:yfiles.graph.ItemCopiedEventArgs):void; + /** + * Copies an {@link yfiles.drawing.IEdgeStyle} instance. + * This implementation uses the {@link yfiles.system.ICloneable#clone} + * method to create a copy. + * @param {yfiles.graph.IGraph} graph The graph that contains the edge. + * @param {yfiles.graph.IEdge} edge The edge to copy the style from. + * @return {yfiles.drawing.IEdgeStyle} The style to apply for the copy. + * @see {@link yfiles.graph.GraphCopier#copyGraphToRoot} + */ + copyEdgeStyle(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge):yfiles.drawing.IEdgeStyle; + /** + * Copies an {@link yfiles.drawing.IPortStyle} instance. + * This implementation uses the {@link yfiles.system.ICloneable#clone} + * method to create a copy. + * @param {yfiles.graph.IGraph} graph The graph that contains the port. + * @param {yfiles.graph.IPort} port The port to copy the style from. + * @return {yfiles.drawing.IPortStyle} The style to apply for the copy. + * @see {@link yfiles.graph.GraphCopier#copyGraphToRoot} + */ + copyPortStyle(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort):yfiles.drawing.IPortStyle; + /** + * Copies an {@link yfiles.drawing.INodeStyle} instance. + * This implementation uses the {@link yfiles.system.ICloneable#clone} + * method to create a copy. + * @param {yfiles.graph.IGraph} graph The graph that contains the node. + * @param {yfiles.graph.INode} node The node to copy the style from. + * @return {yfiles.drawing.INodeStyle} The style to apply for the copy. + * @see {@link yfiles.graph.GraphCopier#copyGraphToRoot} + */ + copyNodeStyle(graph:yfiles.graph.IGraph,node:yfiles.graph.INode):yfiles.drawing.INodeStyle; + /** + * Copies an {@link yfiles.drawing.ILabelStyle} instance. + * This implementation uses the {@link yfiles.system.ICloneable#clone} + * method to create a copy. + * @param {yfiles.graph.IGraph} graph The graph that contains the label. + * @param {yfiles.graph.ILabel} label The label to copy the style from. + * @return {yfiles.drawing.ILabelStyle} The style to apply for the copy. + * @see {@link yfiles.graph.GraphCopier#copyGraphToRoot} + */ + copyLabelStyle(graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel):yfiles.drawing.ILabelStyle; + /** + * Copies a {@link yfiles.graph.ILabelModelParameter} for a given label. + * This implementation uses the {@link yfiles.system.ICloneable#clone} + * method to create a copy. + * @param {yfiles.graph.IGraph} graph The graph that contains the label. + * @param {yfiles.graph.ILabel} label The label to copy the label model parameter from. + * @return {yfiles.graph.ILabelModelParameter} The copy of the parameter to apply for the copy. + * @see {@link yfiles.graph.GraphCopier#copyGraphToRoot} + */ + copyLabelModelParameter(graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel):yfiles.graph.ILabelModelParameter; + /** + * Copies a {@link yfiles.graph.IPortLocationModelParameter} for a given port. + * This implementation uses the {@link yfiles.system.ICloneable#clone} + * method to create a copy. + * @param {yfiles.graph.IGraph} graph The graph that contains the port. + * @param {yfiles.graph.IPort} port The port to copy the model parameter from. + * @return {yfiles.graph.IPortLocationModelParameter} The copy of the parameter to apply for the copy. + * @see {@link yfiles.graph.GraphCopier#copyGraphToRoot} + */ + copyPortLocationModelParameter(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort):yfiles.graph.IPortLocationModelParameter; + /** + * Gets or sets the types of objects where the referential identity should be kept across + * clipboard operations. + * For each of the types that are set via this property, this implementation will use a caching copy mechanism as follows: + * If there has already been an instance copied via this clipboard ({@link yfiles.graph.GraphCopier#getCopy}), that instance will instead be returned, + * otherwise, this implementation will clone the original instance (depending on the setting of {@link yfiles.graph.GraphCopier#clone}) and + * {@link yfiles.graph.GraphCopier#cacheCopy cache the copy} until after the operation the {@link yfiles.graph.GraphCopier#clearCopyCache cache is cleared}. + * This feature is implemented directly by the various {@link yfiles.graph.GraphCopier#copyNodeStyle CopyXXX} methods. + * Value: The referential identity types. + * @see {@link yfiles.graph.GraphCopier#getOrCreateCopy} + */ + referentialIdentityTypes:yfiles.graph.GraphCopier.CloneTypes_Interface; + /** + * Tries to obtain a previously {@link yfiles.graph.GraphCopier#cacheCopy cached} copy for the given original. + * Values will be stored in the cache until the next call to {@link yfiles.graph.GraphCopier#clearCopyCache}. + * @param {T} original The original item. + * @param {T} copy The copy will be returned via this parameter if this method yields true. + * @return {boolean} Whether a valid copy has been found in the cache. + * @see {@link yfiles.graph.GraphCopier#cacheCopy} + * @see {@link yfiles.graph.GraphCopier#getOrCreateCopy} + */ + getCopy(itemType:yfiles.lang.Class,original:T,copy:{value:T;}):boolean; + /** + * This method places the given copy into an internal cache. + * The cache can be queried using {@link yfiles.graph.GraphCopier#getCopy}. The cache is held until {@link yfiles.graph.GraphCopier#clearCopyCache} is called. + * @param {T} original The original item. + * @param {T} copy The copy of the item. + * @see {@link yfiles.graph.GraphCopier#getOrCreateCopy} + */ + cacheCopy(original:T,copy:T):void; + /** + * Gets or sets a property that determines whether {@link yfiles.graph.IHierarchy grouping information}. + * Should be copied to {@link yfiles.graph.IGroupedGraph} target graphs. + * The default is true. + */ + copyGrouping:boolean; + /** + * Gets or sets a property that determines whether {@link yfiles.graph.FoldingManager additional view states}. + * Should be copied to target graphs. + * If the source and target graphs have an instance of {@link yfiles.graph.FoldingManager} in their + * lookup, the additional {@link yfiles.graph.FoldingManager#getNodeViewState view state} of + * the nodes and edges will be copied. + * The default is true. + */ + copyViewStates:boolean; + /** + * Copies a subgraph described by a {@link system.Predicate} from the sourceGraph + * to the targetGraph. + * For each element that has been copied, the elementCopiedDelegate will be invoked. + * This method actually delegates to {@link yfiles.graph.GraphCopier#copyGraphToRoot} + * and provides the {@link yfiles.graph.IHierarchy#root} as the "targetGraph" parameter if there is a hierarchy associated + * with targetGraph. + * @param {yfiles.graph.IGraph} sourceGraph The graph to copy the elements from. + * @param {function(yfiles.model.IModelItem):boolean} filter The filter that decides which elements to copy. + * @param {yfiles.graph.IGraph} targetGraph The graph to copy the elements to. + * @param {function(yfiles.model.IModelItem, yfiles.model.IModelItem)} elementCopiedDelegate A delegate to invoke for each element being copied. + */ + copyGraph(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.model.IModelItem)=>boolean,targetGraph:yfiles.graph.IGraph,elementCopiedDelegate:(original:yfiles.model.IModelItem,copy:yfiles.model.IModelItem)=> void):void; + /** + * Copies a subgraph induced by a {@link system.Predicate} from the sourceGraph + * to the targetGraph. + * For each element that has been copied, the elementCopiedDelegate will be invoked. + * @param {yfiles.graph.IGraph} sourceGraph The graph to copy the elements from. + * @param {function(yfiles.model.IModelItem):boolean} filter The filter that decides which elements to copy. + * @param {yfiles.graph.IGraph} targetGraph The graph to copy the elements to. + * @param {yfiles.graph.INode} targetRoot The group node that should act as the root node for the pasted elements. May be null if there is no + * such node. + * @param {function(yfiles.model.IModelItem, yfiles.model.IModelItem)} elementCopiedDelegate A delegate to invoke for each element being copied. + */ + copyGraphToRoot(sourceGraph:yfiles.graph.IGraph,filter:(obj:yfiles.model.IModelItem)=>boolean,targetGraph:yfiles.graph.IGraph,targetRoot:yfiles.graph.INode,elementCopiedDelegate:(original:yfiles.model.IModelItem,copy:yfiles.model.IModelItem)=> void):void; + /** + * Callback method that retrieves the {@link yfiles.graph.FoldingManager} from the given target graph. + * @param {yfiles.graph.IGraph} targetGraph The target graph. + * @return {yfiles.graph.IFoldingManager} The folding manager as obtained from the lookup of the graph. + */ + getTargetFoldingManager(targetGraph:yfiles.graph.IGraph):yfiles.graph.IFoldingManager; + /** + * Callback method that retrieves the {@link yfiles.graph.FoldingManager} from the given source graph. + * @param {yfiles.graph.IGraph} sourceGraph The source graph. + * @return {yfiles.graph.IFoldingManager} The folding manager as obtained from the lookup of the graph. + */ + getSourceFoldingManager(sourceGraph:yfiles.graph.IGraph):yfiles.graph.IFoldingManager; + /** + * Callback method that retrieves the {@link yfiles.graph.IGroupedGraph} from the given target graph. + * @param {yfiles.graph.IGraph} targetGraph The target graph. + * @return {yfiles.graph.IGroupedGraph} The grouped graph instance as obtained from the lookup of the graph. + */ + getTargetGroupedGraph(targetGraph:yfiles.graph.IGraph):yfiles.graph.IGroupedGraph; + /** + * Callback method that retrieves the {@link yfiles.graph.IGroupedGraph} from the given source graph. + * @param {yfiles.graph.IGraph} sourceGraph The source graph. + * @return {yfiles.graph.IHierarchy.} The grouped graph instance as obtained from the lookup of the graph. + */ + getSourceHierarchy(sourceGraph:yfiles.graph.IGraph):yfiles.graph.IHierarchy; + /** + * Clears the cache for the {@link yfiles.graph.GraphCopier#cacheCopy cached copies} of the instance copied using this class. + * This method is called before and after a copy operation. + */ + clearCopyCache():void; + /** + * Callback method that adds a bend to the targetEdge in the targetGraph as a copy of the source bend. + * @param {yfiles.graph.IGraph} sourceGraph The source graph. + * @param {yfiles.graph.IGraph} targetGraph The target graph. + * @param {yfiles.graph.IEdge} targetEdge The target edge to add the bend to. + * @param {yfiles.graph.IBend} sourceBend The source bend to copy the values from. + * @param {number} index The index to add the bend at. + * @return {yfiles.graph.IBend} The newly created bend. + */ + addBend(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,targetEdge:yfiles.graph.IEdge,sourceBend:yfiles.graph.IBend,index:number):yfiles.graph.IBend; + /** + * Callback method that adds an edge to the targetGraph as a copy of the source edge. + * This implementation does not need to copy the {@link yfiles.graph.IBend}s of the sourceEdge, + * nor should it copy {@link yfiles.graph.IPort}s or {@link yfiles.graph.ILabel}s. + * This implementation uses {@link yfiles.graph.GraphCopier#copyEdgeStyle} and {@link yfiles.graph.GraphCopier#copyEdgeTag} as callbacks. + * @param {yfiles.graph.IGraph} sourceGraph The source graph. + * @param {yfiles.graph.IGraph} targetGraph The target graph. + * @param {yfiles.graph.IEdge} sourceEdge The edge in the source graph. + * @param {yfiles.graph.IPort} targetSourcePort The new source port in the target graph. + * @param {yfiles.graph.IPort} targetTargetPort The new target port in the target graph. + * @return {yfiles.graph.IEdge} The newly created edge. + */ + copyEdge(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,sourceEdge:yfiles.graph.IEdge,targetSourcePort:yfiles.graph.IPort,targetTargetPort:yfiles.graph.IPort):yfiles.graph.IEdge; + /** + * Callback method that adds a port to the targetPortOwner in the targetGraph as a copy of the source port. + * This implementation does not need to copy the adjacent {@link yfiles.graph.IEdge}s of the sourcePort. + * This implementation uses {@link yfiles.graph.GraphCopier#copyPortLocationModelParameter}, {@link yfiles.graph.GraphCopier#copyPortStyle}, and {@link yfiles.graph.GraphCopier#copyPortTag} as callbacks. + * @param {yfiles.graph.IGraph} sourceGraph The source graph. + * @param {yfiles.graph.IGraph} targetGraph The target graph. + * @param {yfiles.graph.IPortOwner} targetPortOwner The port owner in the target graph to add the port to. + * @param {yfiles.graph.IPort} sourcePort The source port in the source graph. + * @return {yfiles.graph.IPort} The newly created port. + */ + addPort(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,targetPortOwner:yfiles.graph.IPortOwner,sourcePort:yfiles.graph.IPort):yfiles.graph.IPort; + /** + * Callback method that adds a label to the target item in the targetGraph as a copy of the source label. + * This implementation uses {@link yfiles.graph.GraphCopier#copyLabelModelParameter}, {@link yfiles.graph.GraphCopier#copyLabelStyle}, and {@link yfiles.graph.GraphCopier#copyLabelTag} as callbacks. + * @param {yfiles.graph.IGraph} sourceGraph The source graph. + * @param {yfiles.graph.IGraph} targetGraph The target graph. + * @param {yfiles.graph.ILabeledItem} targetItem The item owner in the target graph to add the label to. + * @param {yfiles.graph.ILabel} sourceLabel The source label in the source graph. + * @return {yfiles.graph.ILabel} The newly created label. + */ + addLabel(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,targetItem:yfiles.graph.ILabeledItem,sourceLabel:yfiles.graph.ILabel):yfiles.graph.ILabel; + /** + * Callback method that creates a copy of the sourceNode in the targetGraph. + * This implementation does not need to copy {@link yfiles.graph.IPort}s or {@link yfiles.graph.ILabel}s. + * This implementation uses {@link yfiles.graph.GraphCopier#copyNodeStyle} and {@link yfiles.graph.GraphCopier#copyNodeTag} as callbacks. + * @param {yfiles.graph.IGraph} sourceGraph The source graph. + * @param {yfiles.graph.IGraph} targetGraph The target graph. + * @param {yfiles.graph.INode} sourceNode The source node to create a copy of in the targetGraph. + * @return {yfiles.graph.INode} The newly created node. + * @see {@link yfiles.graph.GraphCopier#copyNodeWithParent} + */ + copyNode(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph,sourceNode:yfiles.graph.INode):yfiles.graph.INode; + /** + * Callback method that creates a copy of the sourceGroupNode in the targetGraph. + * This implementation does not need to copy {@link yfiles.graph.IPort}s or {@link yfiles.graph.ILabel}s. + * This implementation uses {@link yfiles.graph.GraphCopier#copyNodeStyle} and {@link yfiles.graph.GraphCopier#copyNodeTag} as callbacks. + * @param {yfiles.graph.IGraph} sourceGraph The source graph. + * @param {yfiles.graph.IGroupedGraph} targetGraph The target graph. + * @param {yfiles.graph.INode} sourceGroupNode The source node to create a copy of in the targetGraph. + * @param {yfiles.graph.INode} targetParent The parent of the group node in the target graph. + * @return {yfiles.graph.INode} The newly created node. + */ + copyGroupNode(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGroupedGraph,sourceGroupNode:yfiles.graph.INode,targetParent:yfiles.graph.INode):yfiles.graph.INode; + /** + * Callback method that creates a copy of the sourceNode in the targetGroupedGraph. + * This implementation does not need to copy {@link yfiles.graph.IPort}s or {@link yfiles.graph.ILabel}s. + * This implementation uses {@link yfiles.graph.GraphCopier#copyNodeStyle} and {@link yfiles.graph.GraphCopier#copyNodeTag} as callbacks. + * @param {yfiles.graph.IGraph} sourceGraph The source graph. + * @param {yfiles.graph.IGroupedGraph} targetGroupedGraph The target grouped graph instance. + * @param {yfiles.graph.INode} targetParent The parent of the group node in the target graph. + * @param {yfiles.graph.INode} sourceNode The source node to create a copy of in the targetGroupedGraph. + * @return {yfiles.graph.INode} The newly created node. + */ + copyNodeWithParent(sourceGraph:yfiles.graph.IGraph,targetGroupedGraph:yfiles.graph.IGroupedGraph,sourceNode:yfiles.graph.INode,targetParent:yfiles.graph.INode):yfiles.graph.INode; + /** + * Callback that copies the {@link yfiles.support.ITagOwner#tag} of a {@link yfiles.graph.ILabel}. + * This implementation simply delegates to {@link yfiles.graph.GraphCopier#copyTag} + * @param {yfiles.graph.ILabel} oldLabel The old label. + * @param {Object} tag The tag to copy. + * @return {Object} The copy of the tag. + */ + copyLabelTag(oldLabel:yfiles.graph.ILabel,tag:Object):Object; + /** + * Callback that copies the {@link yfiles.support.ITagOwner#tag} of an {@link yfiles.graph.IEdge}. + * This implementation simply delegates to {@link yfiles.graph.GraphCopier#copyTag} + * @param {yfiles.graph.IEdge} oldEdge The old edge. + * @param {Object} tag The tag to copy. + * @return {Object} The copy of the tag. + */ + copyEdgeTag(oldEdge:yfiles.graph.IEdge,tag:Object):Object; + /** + * Callback that copies the {@link yfiles.support.ITagOwner#tag} of a {@link yfiles.graph.IPort}. + * This implementation simply delegates to {@link yfiles.graph.GraphCopier#copyTag} + * @param {yfiles.graph.IPort} oldPort The old port. + * @param {Object} tag The tag to copy. + * @return {Object} The copy of the tag. + */ + copyPortTag(oldPort:yfiles.graph.IPort,tag:Object):Object; + /** + * Callback that copies the {@link yfiles.support.ITagOwner#tag} of a {@link yfiles.graph.INode}. + * This implementation simply delegates to {@link yfiles.graph.GraphCopier#copyTag} + * @param {yfiles.graph.INode} oldNode The old node. + * @param {Object} tag The tag to copy. + * @return {Object} The copy of the tag. + */ + copyNodeTag(oldNode:yfiles.graph.INode,tag:Object):Object; + /** + * Callback that will copy a {@link yfiles.support.ITagOwner#tag} for the target graph. + * This implementation will try to {@link yfiles.system.ICloneable#clone} the tag + * if the {@link yfiles.graph.GraphCopier#clone} property has the {@link yfiles.graph.GraphCopier.CloneTypes#TAGS} flag set. + * If this is not the case or the tag is not {@link yfiles.system.ICloneable}, the instance will be returned. + * @param {yfiles.model.IModelItem} oldOwner The old owner of the tag. + * @param {Object} tag The tag to copy. + * @return {Object} A copy of the tag. + */ + copyTag(oldOwner:yfiles.model.IModelItem,tag:Object):Object; + /** + * Convenience method that either yields a previously {@link yfiles.graph.GraphCopier#cacheCopy cached} copy for the given original + * or uses the copyDelegate to create the copy of the original. + * If there is a cache miss, the delegate will be used to create the copy and the copy will be placed into the + * {@link yfiles.graph.GraphCopier#cacheCopy cache}. + * @param {T} original The original item. + * @param {function(T):T} copyDelegate The copy delegate to create the copy. + * @return {T} A copy of the original, either cached, or newly created and then cached. + */ + getOrCreateCopy(tType:yfiles.lang.Class,original:T,copyDelegate:(context:T)=>T):T; + /** + * Event which is dispatched after a node has been copied. + *

+ * This event is dispatched after the {@link yfiles.graph.ElementCopiedDelegate} has been executed. + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#original original} item is a master item, i.e. it belongs to the . + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#copy copied} item is a master item, i.e. it belongs to the . + *

+ */ + addNodeCopiedListener(value:(sender:Object,e:yfiles.graph.ItemCopiedEventArgs)=> void):void; + /** + * Event which is dispatched after a node has been copied. + *

+ * This event is dispatched after the {@link yfiles.graph.ElementCopiedDelegate} has been executed. + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#original original} item is a master item, i.e. it belongs to the . + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#copy copied} item is a master item, i.e. it belongs to the . + *

+ */ + removeNodeCopiedListener(value:(sender:Object,e:yfiles.graph.ItemCopiedEventArgs)=> void):void; + /** + * Event which is dispatched after a bend has been copied. + *

+ * This event is dispatched after the {@link yfiles.graph.ElementCopiedDelegate} has been executed. + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#original original} item is a master item, i.e. it belongs to the . + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#copy copied} item is a master item, i.e. it belongs to the . + *

+ *

+ * For {@link yfiles.graph.DummyEdgeId dummy edge} bends, their view state representation is passed. These elements + * are neither part of the nor the view graph. + *

+ */ + addBendCopiedListener(value:(sender:Object,e:yfiles.graph.ItemCopiedEventArgs)=> void):void; + /** + * Event which is dispatched after a bend has been copied. + *

+ * This event is dispatched after the {@link yfiles.graph.ElementCopiedDelegate} has been executed. + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#original original} item is a master item, i.e. it belongs to the . + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#copy copied} item is a master item, i.e. it belongs to the . + *

+ *

+ * For {@link yfiles.graph.DummyEdgeId dummy edge} bends, their view state representation is passed. These elements + * are neither part of the nor the view graph. + *

+ */ + removeBendCopiedListener(value:(sender:Object,e:yfiles.graph.ItemCopiedEventArgs)=> void):void; + /** + * Event which is dispatched after a style has been copied. + *

+ * This event is triggered for all minor objects the graph items are made up of, e.g. the {@link yfiles.graph.GraphCopier#copyNodeStyle styles}, {@link yfiles.graph.GraphCopier#copyTag tags}, + * {@link yfiles.graph.GraphCopier#copyLabelModelParameter labels}, and {@link yfiles.graph.GraphCopier#copyPortLocationModelParameter port} parameters. + *

+ *

+ * This event will not be triggered for the graph items themselves and will not be triggered if the object reference is reused, i.e. it will only be triggered + * if the old and new references actually differ. + *

+ */ + addObjectCopiedListener(value:(sender:Object,e:yfiles.graph.ItemCopiedEventArgs)=> void):void; + /** + * Event which is dispatched after a style has been copied. + *

+ * This event is triggered for all minor objects the graph items are made up of, e.g. the {@link yfiles.graph.GraphCopier#copyNodeStyle styles}, {@link yfiles.graph.GraphCopier#copyTag tags}, + * {@link yfiles.graph.GraphCopier#copyLabelModelParameter labels}, and {@link yfiles.graph.GraphCopier#copyPortLocationModelParameter port} parameters. + *

+ *

+ * This event will not be triggered for the graph items themselves and will not be triggered if the object reference is reused, i.e. it will only be triggered + * if the old and new references actually differ. + *

+ */ + removeObjectCopiedListener(value:(sender:Object,e:yfiles.graph.ItemCopiedEventArgs)=> void):void; + /** + * Event which is dispatched after an edge has been copied. + *

+ * This event is dispatched after the {@link yfiles.graph.ElementCopiedDelegate} has been executed. + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#original original} item is a master item, i.e. it belongs to the . + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#copy copied} item is a master item, i.e. it belongs to the . + *

+ */ + addEdgeCopiedListener(value:(sender:Object,e:yfiles.graph.ItemCopiedEventArgs)=> void):void; + /** + * Event which is dispatched after an edge has been copied. + *

+ * This event is dispatched after the {@link yfiles.graph.ElementCopiedDelegate} has been executed. + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#original original} item is a master item, i.e. it belongs to the . + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#copy copied} item is a master item, i.e. it belongs to the . + *

+ */ + removeEdgeCopiedListener(value:(sender:Object,e:yfiles.graph.ItemCopiedEventArgs)=> void):void; + /** + * Event which is dispatched after a port has been copied. + *

+ * This event is dispatched after the {@link yfiles.graph.ElementCopiedDelegate} has been executed. + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#original original} item is a master item, i.e. it belongs to the . + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#copy copied} item is a master item, i.e. it belongs to the . + *

+ */ + addPortCopiedListener(value:(sender:Object,e:yfiles.graph.ItemCopiedEventArgs)=> void):void; + /** + * Event which is dispatched after a port has been copied. + *

+ * This event is dispatched after the {@link yfiles.graph.ElementCopiedDelegate} has been executed. + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#original original} item is a master item, i.e. it belongs to the . + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#copy copied} item is a master item, i.e. it belongs to the . + *

+ */ + removePortCopiedListener(value:(sender:Object,e:yfiles.graph.ItemCopiedEventArgs)=> void):void; + /** + * Event which is dispatched after a label has been copied. + *

+ * This event is dispatched after the {@link yfiles.graph.ElementCopiedDelegate} has been executed. + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#original original} item is a master item, i.e. it belongs to the . + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#copy copied} item is a master item, i.e. it belongs to the . + *

+ *

+ * For {@link yfiles.graph.DummyEdgeId dummy edge} or dummy node labels, their view state representation is passed. These elements + * are neither part of the nor the view graph. + *

+ */ + addLabelCopiedListener(value:(sender:Object,e:yfiles.graph.ItemCopiedEventArgs)=> void):void; + /** + * Event which is dispatched after a label has been copied. + *

+ * This event is dispatched after the {@link yfiles.graph.ElementCopiedDelegate} has been executed. + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#original original} item is a master item, i.e. it belongs to the . + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#copy copied} item is a master item, i.e. it belongs to the . + *

+ *

+ * For {@link yfiles.graph.DummyEdgeId dummy edge} or dummy node labels, their view state representation is passed. These elements + * are neither part of the nor the view graph. + *

+ */ + removeLabelCopiedListener(value:(sender:Object,e:yfiles.graph.ItemCopiedEventArgs)=> void):void; + /** + * Event which is dispatched after the entire graph has been copied. + *

+ * This event is dispatched at the end of the + * {@link yfiles.graph.GraphCopier#copyGraphToRoot} method. + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#original source graph} item is the master graph + * of the folded graph. + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#copy target graph} is the master graph + * of the folded graph. + *

+ */ + addGraphCopiedListener(value:(sender:Object,e:yfiles.graph.ItemCopiedEventArgs)=> void):void; + /** + * Event which is dispatched after the entire graph has been copied. + *

+ * This event is dispatched at the end of the + * {@link yfiles.graph.GraphCopier#copyGraphToRoot} method. + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#toClipboardCopier} (Cut/Copy) and the source graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#original source graph} item is the master graph + * of the folded graph. + *

+ *

+ * If this GraphCopier instance is used as {@link yfiles.graph.GraphClipboard}'s {@link yfiles.graph.GraphClipboard#fromClipboardCopier} (Paste) and the target graph + * is a folded graph the {@link yfiles.graph.ItemCopiedEventArgs#copy target graph} is the master graph + * of the folded graph. + *

+ */ + removeGraphCopiedListener(value:(sender:Object,e:yfiles.graph.ItemCopiedEventArgs)=> void):void; + /** + * Called after a node has been copied. + * Raises the {@link yfiles.graph.GraphCopier#addNodeCopiedListener NodeCopied} event. + * @param {yfiles.graph.INode} original The original of the copied node. + * @param {yfiles.graph.INode} copy The copied node. + */ + onNodeCopied(original:yfiles.graph.INode,copy:yfiles.graph.INode):void; + /** + * Called after a bend has been copied. + * Raises the {@link yfiles.graph.GraphCopier#addBendCopiedListener BendCopied} event. + * @param {yfiles.graph.IBend} original The original of the copied bend. + * @param {yfiles.graph.IBend} copy The copied bend. + */ + onBendCopied(original:yfiles.graph.IBend,copy:yfiles.graph.IBend):void; + /** + * Called after an edge has been copied. + * Raises the {@link yfiles.graph.GraphCopier#addEdgeCopiedListener EdgeCopied} event. + * @param {yfiles.graph.IEdge} original The original of the copied edge. + * @param {yfiles.graph.IEdge} copy The copied edge. + */ + onEdgeCopied(original:yfiles.graph.IEdge,copy:yfiles.graph.IEdge):void; + /** + * Called after a label has been copied. + * Raises the {@link yfiles.graph.GraphCopier#addLabelCopiedListener LabelCopied} event. + * @param {yfiles.graph.ILabel} original The original of the copied label. + * @param {yfiles.graph.ILabel} copy The copied label. + */ + onLabelCopied(original:yfiles.graph.ILabel,copy:yfiles.graph.ILabel):void; + /** + * Called after a port has been copied. + * Raises the {@link yfiles.graph.GraphCopier#addPortCopiedListener PortCopied} event. + * @param {yfiles.graph.IPort} original The original of the copied port. + * @param {yfiles.graph.IPort} copy The copied port. + */ + onPortCopied(original:yfiles.graph.IPort,copy:yfiles.graph.IPort):void; + /** + * Called after the entire graph has been copied. + * Raises the {@link yfiles.graph.GraphCopier#addGraphCopiedListener GraphCopied} event. + * @param {yfiles.graph.IGraph} sourceGraph The source graph from which the elements have been copied. + * @param {yfiles.graph.IGraph} targetGraph The graph to which the elements have been copied. + */ + onGraphCopied(sourceGraph:yfiles.graph.IGraph,targetGraph:yfiles.graph.IGraph):void; + } + export module GraphCopier{ + export interface CloneTypes_Interface{} + } + var GraphCopier:{ + $class:yfiles.lang.Class; + new ():yfiles.graph.GraphCopier; + CloneTypes:{ + NODE_STYLE:yfiles.graph.GraphCopier.CloneTypes_Interface; + EDGE_STYLE:yfiles.graph.GraphCopier.CloneTypes_Interface; + PORT_STYLE:yfiles.graph.GraphCopier.CloneTypes_Interface; + LABEL_STYLE:yfiles.graph.GraphCopier.CloneTypes_Interface; + LABEL_MODEL_PARAMETER:yfiles.graph.GraphCopier.CloneTypes_Interface; + PORT_LOCATION_MODEL_PARAMETER:yfiles.graph.GraphCopier.CloneTypes_Interface; + TAGS:yfiles.graph.GraphCopier.CloneTypes_Interface; + ALL:yfiles.graph.GraphCopier.CloneTypes_Interface; + }; + }; + /** + * A graph wrapper implementation that takes two {@link yfiles.graph.IGraph} instances + * and merges them into one. + * Note that this instance will register listeners with the wrapped graph, so + * {@link yfiles.graph.CompositeGraph#dispose} should be called if this instance is not used any more. + */ + export interface CompositeGraph extends yfiles.graph.AbstractGraphWrapper{ + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Creates and returns an edge that connects to the given port instances. + * The ports must be part + * of this graph at the time of the invocation. + * The edge will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.IPort} sourcePort The source port the created edge will connect to. + * @param {yfiles.graph.IPort} targetPort The target port the created edge will connect to. + * @param {yfiles.drawing.IEdgeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @param {Object} tag The initial value of the {@link yfiles.support.ITagOwner#tag} that will be assigned to the new edge. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + * @see {@link yfiles.drawing.common.VoidEdgeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#createEdgeWithPortsStyleAndTag}. + */ + createEdgeWithPortsStyleAndTag(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style:yfiles.drawing.IEdgeStyle,tag:Object):yfiles.graph.IEdge; + /** + * Convenience method that creates and returns an edge that connects to the given node instances using the + * given style instance. + * The nodes must be part + * of this graph at the time of the invocation, and the implementation will choose the {@link yfiles.graph.IPort} instances to + * which the edge will be connected. + * The edge will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.INode} source The source node the created edge will connect to. It is up to the implementation + * to decide which port to use at the given node. The implementation may create a new port of the edge. + * @param {yfiles.graph.INode} target The target node the created edge will connect to. It is up to the implementation + * to decide which port to use at the given node. The implementation may create a new port of the edge. + * @param {yfiles.drawing.IEdgeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @param {Object} tag The initial value of the {@link yfiles.support.ITagOwner#tag} that will be assigned to the new edge. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + * @see {@link yfiles.drawing.common.VoidEdgeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#createEdgeWithNodesStyleAndTag}. + */ + createEdgeWithNodesStyleAndTag(source:yfiles.graph.INode,target:yfiles.graph.INode,style:yfiles.drawing.IEdgeStyle,tag:Object):yfiles.graph.IEdge; + /** + * Sets the ports of the given edge to the new values. + * This will trigger an {@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} event if source or target ports differ + * from the current ones. Both ports and the edge must belong to the current graph instance. + * @param {yfiles.graph.IEdge} edge The edge to change the ports. + * @param {yfiles.graph.IPort} sourcePort The new source port instance. + * @param {yfiles.graph.IPort} targetPort The new target port instance. + * @see Specified by {@link yfiles.graph.IGraph#setPorts}. + */ + setPorts(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + /** + * Returns an {@link yfiles.collections.IEnumerable} for all edges that are adjacent to the given + * port as a {@link yfiles.graph.IEdge#sourcePort} or {@link yfiles.graph.IEdge#targetPort}. + * @param {yfiles.graph.IPort} port the port to check + * @param {yfiles.graph.AdjacencyTypes} adjacencyType The type of adjacency to consider. + * @return {yfiles.model.IListEnumerable.} An enumeration of all adjacent edges of the given type. + * @see {@link yfiles.graph.GraphExtensions#edgesAtPort} + * @see {@link yfiles.graph.GraphExtensions#portInEdgesAt} + * @see {@link yfiles.graph.GraphExtensions#portOutEdgesAt} + * @see {@link yfiles.graph.AdjacencyTypes} + * @see Specified by {@link yfiles.graph.IGraph#typedEdgesAtPort}. + */ + typedEdgesAtPort(port:yfiles.graph.IPort,adjacencyType:yfiles.graph.AdjacencyTypes):yfiles.model.IListEnumerable; + /** + * Returns an {@link yfiles.model.IListEnumerable} for all edges that have the given port owner as their + * {@link yfiles.graph.IEdge#targetPort target port's} or {@link yfiles.graph.IEdge#sourcePort source port's} {@link yfiles.graph.IPort#owner} + * depending on the {@link yfiles.graph.AdjacencyTypes}. + * @param {yfiles.graph.AdjacencyTypes} adjacencyType The type of adjacency to consider. + * @param {yfiles.graph.IPortOwner} portOwner the port owner to check + * @return {yfiles.model.IListEnumerable.} An enumeration of all adjacent edges of the given type. + * @see {@link yfiles.graph.GraphExtensions#edgesAtOwner} + * @see {@link yfiles.graph.GraphExtensions#inEdgesAt} + * @see {@link yfiles.graph.GraphExtensions#outEdgesAt} + * @see {@link yfiles.graph.AdjacencyTypes} + * @see Specified by {@link yfiles.graph.IGraph#typedEdgesAtOwner}. + */ + typedEdgesAtOwner(portOwner:yfiles.graph.IPortOwner,adjacencyType:yfiles.graph.AdjacencyTypes):yfiles.model.IListEnumerable; + /** + * Assigns the given style instance by reference to the node. + * Style instances can be shared. + * @param {yfiles.graph.INode} node The node that will be assigned the new style + * @param {yfiles.drawing.INodeStyle} style The style instance that will be assigned to the node. + * @see {@link yfiles.graph.INode#style} + * @see {@link yfiles.graph.IGraph#addNodeChangedListener NodeChanged} + * @see {@link yfiles.drawing.common.VoidNodeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#setNodeStyle}. + */ + setNodeStyle(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):void; + /** + * Assigns the given style instance by reference to the label. + * Style instances can be shared. + * @param {yfiles.graph.ILabel} label The label that will be assigned the new style + * @param {yfiles.drawing.ILabelStyle} style The style instance that will be assigned to the label. + * @see {@link yfiles.graph.ILabel#style} + * @see {@link yfiles.graph.IGraph#addLabelChangedListener LabelChanged} + * @see {@link yfiles.drawing.common.VoidLabelStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#setLabelStyle}. + */ + setLabelStyle(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle):void; + /** + * Assigns the given style instance by reference to the edge. + * Style instances can be shared. + * @param {yfiles.graph.IEdge} edge The edge that will be assigned the new style + * @param {yfiles.drawing.IEdgeStyle} style The style instance that will be assigned to the edge. + * @see {@link yfiles.graph.IEdge#style} + * @see {@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} + * @see {@link yfiles.drawing.common.VoidEdgeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#setEdgeStyle}. + */ + setEdgeStyle(edge:yfiles.graph.IEdge,style:yfiles.drawing.IEdgeStyle):void; + /** + * Assigns the given style instance by reference to the port. + * Style instances can be shared. + * @param {yfiles.graph.IPort} port The port that will be assigned the new style + * @param {yfiles.drawing.IPortStyle} style The style instance that will be assigned to the port. + * @see {@link yfiles.graph.IPort#style} + * @see {@link yfiles.graph.IGraph#addPortChangedListener PortChanged} + * @see {@link yfiles.drawing.common.VoidPortStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#setPortStyle}. + */ + setPortStyle(port:yfiles.graph.IPort,style:yfiles.drawing.IPortStyle):void; + /** + * Adds a bend at the given index to the given edge using the coordinates provided. + * The added instance will be returned. + * @param {yfiles.graph.IEdge} edge The edge to which the bend will be added. + * @param {number} index The index for the newly added bend + * @param {yfiles.geometry.PointD} location the coordinates to use for the newly created bend + * @return {yfiles.graph.IBend} a newly created live bend + * @see {@link yfiles.graph.IGraph#removeBend} + * @see {@link yfiles.graph.IGraph#setBendLocation} + * @see Specified by {@link yfiles.graph.IGraph#addBend}. + */ + addBend(edge:yfiles.graph.IEdge,index:number,location:yfiles.geometry.PointD):yfiles.graph.IBend; + /** + * Add a label to the given item using the text as the initial label text and label model parameter, style and tag. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} labelModelParameter The label model parameter instance to use. + * @param {string} text the initial text of the label + * @param {yfiles.drawing.ILabelStyle} style The style to use for the label + * @param {yfiles.geometry.SizeD} preferredSize The initial values to use for the {@link yfiles.graph.ILabel#preferredSize}. + * @param {Object} tag the initial {@link yfiles.support.ITagOwner#tag} to assign. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + * @see {@link yfiles.graph.IGraph#setLabelStyle} + * @see {@link yfiles.drawing.common.VoidLabelStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#addLabelWithParameterStylePreferredSizeAndTag}. + */ + addLabelWithParameterStylePreferredSizeAndTag(item:yfiles.graph.ILabeledItem,labelModelParameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,preferredSize:yfiles.geometry.SizeD,tag:Object):yfiles.graph.ILabel; + /** + * Sets the label text of the given label. + * @param {yfiles.graph.ILabel} label the label to modify + * @param {string} text the new text of the label + * @see {@link yfiles.graph.ILabel#text} + * @see Specified by {@link yfiles.graph.IGraph#setLabelText}. + */ + setLabelText(label:yfiles.graph.ILabel,text:string):void; + /** + * Modifies the location of the given bend. + * @param {yfiles.graph.IBend} bend the bend whose location is to be modified + * @param {yfiles.geometry.PointD} location the new location of the bend + * @see {@link yfiles.graph.IGraph#addBend} + * @see Specified by {@link yfiles.graph.IGraph#setBendLocation}. + */ + setBendLocation(bend:yfiles.graph.IBend,location:yfiles.geometry.PointD):void; + /** + * Sets the preferred size of the label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.geometry.SizeD} preferredSize The new preferred size. + * @see {@link yfiles.graph.ILabel#preferredSize} + * @see Specified by {@link yfiles.graph.IGraph#setPreferredSize}. + */ + setPreferredSize(label:yfiles.graph.ILabel,preferredSize:yfiles.geometry.SizeD):void; + /** + * Sets the label model parameter for the given label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.graph.ILabelModelParameter} parameter The new parameter. + * @throws {yfiles.system.ArgumentException} If the parameter cannot be used for this label. + * @see Specified by {@link yfiles.graph.IGraph#setLabelModelParameter}. + */ + setLabelModelParameter(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):void; + /** + * Sets a new {@link yfiles.graph.IPortLocationModelParameter} for the given port. + * @param {yfiles.graph.IPort} port The port to modify + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter the new parameter that determines the coordinates of the port + * @see Specified by {@link yfiles.graph.IGraph#setLocationModelParameter}. + */ + setLocationModelParameter(port:yfiles.graph.IPort,location:yfiles.graph.IPortLocationModelParameter):void; + /** + * Sets the bounds of the given node to the new values. + * @param {yfiles.graph.INode} node a live node that belongs to this graph + * @param {yfiles.geometry.RectD} bounds The new bounds of the node to assign to its {@link yfiles.graph.INode#layout}. + * @see {@link yfiles.graph.INode#layout} + * @see Specified by {@link yfiles.graph.IGraph#setBounds}. + */ + setBounds(node:yfiles.graph.INode,bounds:yfiles.geometry.RectD):void; + /** + * Removes the given node instance from this graph. + * The node must be a part of this graph. + * This will trigger the corresponding event. This method will remove all adjacent edges and their + * corresponding ports in proper order before the node will be removed. Also this will trigger + * the removal of all labels owned by this instance. + * @param {yfiles.graph.INode} node the live node to be removed from this graph instance + * @see {@link yfiles.graph.IGraph#addNodeRemovedListener NodeRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeNode}. + */ + removeNode(node:yfiles.graph.INode):void; + /** + * Removes the given edge instance from this graph. + * The edge must be a part of this graph. + * This will trigger the corresponding event. The implementation may decide to remove the + * corresponding ports from the node if no other edge connects to them after the given + * edge has been removed. Also this will trigger the removal of all labels and bends owned by this instance. + * @param {yfiles.graph.IEdge} edge the live edge to be removed from this graph instance + * @see {@link yfiles.graph.IGraph#addEdgeRemovedListener EdgeRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeEdge}. + */ + removeEdge(edge:yfiles.graph.IEdge):void; + /** + * Removes the given label from its owner. + * This will trigger the corresponding event. + * The label must be part of this graph + * at the time of the invocation. + * This will trigger the corresponding events. + * @param {yfiles.graph.ILabel} label the label to remove + * @see {@link yfiles.graph.IGraph#addLabelRemovedListener LabelRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeLabel}. + */ + removeLabel(label:yfiles.graph.ILabel):void; + /** + * Removes a port from its owner. + * The port must be part of this graph + * at the time of the invocation. This will also remove all edges that are currently connected to the port. + * This will trigger the {@link yfiles.graph.IGraph#addNodeChangedListener NodeChanged} or {@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} event respectively. + * @param {yfiles.graph.IPort} port the port that will be removed + * @see {@link yfiles.graph.IGraph#addPortRemovedListener PortRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removePort}. + */ + removePort(port:yfiles.graph.IPort):void; + /** + * Removes the given bend instance from its edge. + * The bend must be part of this graph + * at the time of the invocation. + * This will trigger the corresponding events. + * @param {yfiles.graph.IBend} bend the bend to remove + * @see {@link yfiles.graph.IGraph#addBendRemovedListener BendRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeBend}. + */ + removeBend(bend:yfiles.graph.IBend):void; + /** + * A collection view of the nodes contained in this graph. + * This is a live view of the nodes that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Nodes can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#nodes}. + */ + nodes:yfiles.model.ICollectionModel; + /** + * A collection view that combines all nodes, edges, labels, ports, and bends of this graph. + * This is a read-only live view of all model items of this graph that always represents the current + * state. The same reference will be returned for each invocation. + * @see Specified by {@link yfiles.graph.IGraph#collectionModel}. + */ + collectionModel:yfiles.model.ICollectionModel; + /** + * A collection view of the edges contained in this graph. + * This is a live view of the edges that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Edges can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#edges}. + */ + edges:yfiles.model.ICollectionModel; + /** + * A collection view of the edge labels contained in this graph. + * This is a live view of the edge labels that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Edge labels can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#edgeLabels}. + */ + edgeLabels:yfiles.model.ICollectionModel; + /** + * A collection view of the node labels contained in this graph. + * This is a live view of the node labels that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Node labels can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#nodeLabels}. + */ + nodeLabels:yfiles.model.ICollectionModel; + /** + * A collection view of the ports contained in this graph. + * This is a live view of the ports that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Ports can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#ports}. + */ + ports:yfiles.model.ICollectionModel; + /** + * A collection view of the bends contained in this graph. + * This is a live view of the bends that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Bends can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#bends}. + */ + bends:yfiles.model.ICollectionModel; + /** + * Determines whether this graph contains the specified item. + * @param {yfiles.model.IModelItem} item The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraph#contains}. + */ + contains(item:yfiles.model.IModelItem):boolean; + } + var CompositeGraph:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance which is a composite of the two given graphs. + * Note that this instance will register listeners with the graph and + * graph2 instances, so + * {@link yfiles.graph.CompositeGraph#dispose} should be called if this instance is not used any more. + * @param {yfiles.graph.IGraph} graph The first graph. + * @param {yfiles.graph.IGraph} graph2 The second graph. + */ + new (graph:yfiles.graph.IGraph,graph2:yfiles.graph.IGraph):yfiles.graph.CompositeGraph; + }; + /** + * A struct that can be used to describe a collapsed node in an {@link yfiles.graph.IFoldedGraph} view. + * Instances of this type are passed to the various methods in {@link yfiles.graph.FoldingManager} + * to identify collapsed group nodes inside {@link yfiles.graph.IFoldedGraph} views. + * @see {@link yfiles.graph.FoldingManager#hasNodeViewState} + * @see {@link yfiles.graph.FoldingManager#getNodeViewState} + * @see {@link yfiles.graph.FoldingManager#getChangeDummyNodeAppearanceCallback} + * @see {@link yfiles.graph.IFoldedGraph#isDummy} + * @see {@link yfiles.graph.DummyEdgeId} + */ + export interface DummyNodeId extends yfiles.lang.Struct{ + /** + * The node instance in the {@link yfiles.graph.FoldingManager#masterGraph} that is represented by dummies in + * a {@link yfiles.graph.IFoldedGraph} view. + */ + masterNode:yfiles.graph.INode; + } + var DummyNodeId:{ + $class:yfiles.lang.Class; + /** + * Initializes a dummy node id for a collapsed dummy node in a {@link yfiles.graph.IFoldedGraph} view + * using the {@link yfiles.graph.IFoldedGraph#getMaster master} node. + * @param {yfiles.graph.INode} masterNode The node in the master graph this dummy node will represent + */ + new (masterNode:yfiles.graph.INode):yfiles.graph.DummyNodeId; + /** + * Initializes a dummy node id from an actual node in a {@link yfiles.graph.IFoldedGraph}. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The graph that contains the localNode. + * @param {yfiles.graph.INode} localNode The node for which there should be an id created. + */ + FromGraphAndNode:{ + new (foldedGraph:yfiles.graph.IFoldedGraph,localNode:yfiles.graph.INode):yfiles.graph.DummyNodeId; + }; + }; + /** + * A type that can be used to describe a master port at + * a {@link yfiles.graph.DummyNodeId dummy node} in a {@link yfiles.graph.IFoldedGraph} view. + * Instances of this type are passed to the various methods in {@link yfiles.graph.FoldingManager} + * to identify ports at dummy nodes inside {@link yfiles.graph.IFoldedGraph} views. + * @see {@link yfiles.graph.FoldingManager#getNodeViewState} + * @see {@link yfiles.graph.FoldingManager#getChangeDummyNodeAppearanceCallback} + * @see {@link yfiles.graph.IFoldedGraph#isDummy} + * @see {@link yfiles.graph.DummyNodeId} + * @see {@link yfiles.graph.DummyEdgeId} + */ + export interface DummyNodePortId extends yfiles.lang.Struct{ + /** + * The port instance in the {@link yfiles.graph.FoldingManager#masterGraph} that is represented by dummies in + * a {@link yfiles.graph.IFoldedGraph} view. + */ + masterPort:yfiles.graph.IPort; + /** + * Whether the port is at a dummy node. + * Typically this will yield true because only ports at + * {@link yfiles.graph.IFoldedGraph#collapse collapsed} nodes are Dummy Node Ports. + */ + atDummy:boolean; + } + var DummyNodePortId:{ + $class:yfiles.lang.Class; + /** + * Initializes a dummy port id for a port at a dummy node in a {@link yfiles.graph.IFoldedGraph} view + * using the {@link yfiles.graph.IFoldedGraph#getMaster master} port. + * @param {yfiles.graph.IPort} masterPort The port in the master graph this dummy port will represent + */ + new (masterPort:yfiles.graph.IPort):yfiles.graph.DummyNodePortId; + /** + * Initializes a dummy node id from an actual node in a {@link yfiles.graph.IFoldedGraph}. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The graph that contains the localPort. + * @param {yfiles.graph.IPort} localPort The node for which there should be an id created. + */ + FromGraphAndPort:{ + new (foldedGraph:yfiles.graph.IFoldedGraph,localPort:yfiles.graph.IPort):yfiles.graph.DummyNodePortId; + }; + }; + /** + * A decorator implementation of an {@link yfiles.graph.IGraph} + * that contains a subset of the wrapped graph instance. + * Note that this instance will register listeners with the wrapped graph, so + * {@link yfiles.graph.FilteredGraphWrapper#dispose} should be called if this instance is not used any more. + * This implementation does not fully support {@link yfiles.graph.IPortOwner#ports} + * at {@link yfiles.graph.IEdge}s. This implementation supports the filtering of + * {@link yfiles.graph.IGroupedGraph grouped} graphs. + */ + export interface FilteredGraphWrapper extends yfiles.graph.AbstractGraphWrapper{ + /** + * Gets the full graph that has been wrapped by this instance. + * Value: The full graph this instance is decorating. + */ + fullGraph:yfiles.graph.IGraph; + /** + * Gets the predicate function for the nodes. + */ + nodePredicate:(obj:yfiles.graph.INode)=>boolean; + /** + * Gets the predicate function for the edges. + */ + edgePredicate:(obj:yfiles.graph.IEdge)=>boolean; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Returns an {@link yfiles.collections.IEnumerable} for all edges that are adjacent to the given + * port as a {@link yfiles.graph.IEdge#sourcePort} or {@link yfiles.graph.IEdge#targetPort}. + * @param {yfiles.graph.IPort} port the port to check + * @param {yfiles.graph.AdjacencyTypes} adjacencyType The type of adjacency to consider. + * @return {yfiles.model.IListEnumerable.} An enumeration of all adjacent edges of the given type. + * @see {@link yfiles.graph.GraphExtensions#edgesAtPort} + * @see {@link yfiles.graph.GraphExtensions#portInEdgesAt} + * @see {@link yfiles.graph.GraphExtensions#portOutEdgesAt} + * @see {@link yfiles.graph.AdjacencyTypes} + * @see Specified by {@link yfiles.graph.IGraph#typedEdgesAtPort}. + */ + typedEdgesAtPort(port:yfiles.graph.IPort,adjacencyType:yfiles.graph.AdjacencyTypes):yfiles.model.IListEnumerable; + /** + * Returns an {@link yfiles.model.IListEnumerable} for all edges that have the given port owner as their + * {@link yfiles.graph.IEdge#targetPort target port's} or {@link yfiles.graph.IEdge#sourcePort source port's} {@link yfiles.graph.IPort#owner} + * depending on the {@link yfiles.graph.AdjacencyTypes}. + * @param {yfiles.graph.AdjacencyTypes} adjacencyType The type of adjacency to consider. + * @param {yfiles.graph.IPortOwner} portOwner the port owner to check + * @return {yfiles.model.IListEnumerable.} An enumeration of all adjacent edges of the given type. + * @see {@link yfiles.graph.GraphExtensions#edgesAtOwner} + * @see {@link yfiles.graph.GraphExtensions#inEdgesAt} + * @see {@link yfiles.graph.GraphExtensions#outEdgesAt} + * @see {@link yfiles.graph.AdjacencyTypes} + * @see Specified by {@link yfiles.graph.IGraph#typedEdgesAtOwner}. + */ + typedEdgesAtOwner(portOwner:yfiles.graph.IPortOwner,adjacencyType:yfiles.graph.AdjacencyTypes):yfiles.model.IListEnumerable; + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Should be called by clients if the {@link yfiles.graph.FilteredGraphWrapper#nodePredicate} + * changed for the given node. + * @param {yfiles.graph.INode} node The node. + */ + nodePredicateChangedForNode(node:yfiles.graph.INode):void; + /** + * Should be called by the client if the {@link yfiles.graph.FilteredGraphWrapper#nodePredicate} + * changed for the nodes in the graph. + */ + nodePredicateChanged():void; + /** + * Should be called by the client if the {@link yfiles.graph.FilteredGraphWrapper#edgePredicate} + * changed for the given edge in the graph. + */ + edgePredicateChangedForEdge(edge:yfiles.graph.IEdge):void; + /** + * Should be called by the client if the {@link yfiles.graph.FilteredGraphWrapper#edgePredicate} + * changed for the edge in the graph. + */ + edgePredicateChanged():void; + /** + * A collection view that combines all nodes, edges, labels, ports, and bends of this graph. + * This is a read-only live view of all model items of this graph that always represents the current + * state. The same reference will be returned for each invocation. + * @see Specified by {@link yfiles.graph.IGraph#collectionModel}. + */ + collectionModel:yfiles.model.ICollectionModel; + /** + * A collection view of the nodes contained in this graph. + * This is a live view of the nodes that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Nodes can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#nodes}. + */ + nodes:yfiles.model.ICollectionModel; + /** + * A collection view of the edges contained in this graph. + * This is a live view of the edges that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Edges can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#edges}. + */ + edges:yfiles.model.ICollectionModel; + /** + * A collection view of the edge labels contained in this graph. + * This is a live view of the edge labels that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Edge labels can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#edgeLabels}. + */ + edgeLabels:yfiles.model.ICollectionModel; + /** + * A collection view of the node labels contained in this graph. + * This is a live view of the node labels that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Node labels can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#nodeLabels}. + */ + nodeLabels:yfiles.model.ICollectionModel; + /** + * A collection view of the ports contained in this graph. + * This is a live view of the ports that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Ports can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#ports}. + */ + ports:yfiles.model.ICollectionModel; + /** + * A collection view of the bends contained in this graph. + * This is a live view of the bends that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Bends can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#bends}. + */ + bends:yfiles.model.ICollectionModel; + /** + * Determines whether this graph contains the specified item. + * @param {yfiles.model.IModelItem} item The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraph#contains}. + */ + contains(item:yfiles.model.IModelItem):boolean; + } + var FilteredGraphWrapper:{ + $class:yfiles.lang.Class; + /** + * Creates a new graph instance that wraps the original graph + * and uses the {@link system.Predicate}s to determine which nodes and edges + * should be contained in the graph. + * Note that this instance will register listeners with the graph, so + * {@link yfiles.graph.FilteredGraphWrapper#dispose} should be called if this instance is not used any more. + * @param {yfiles.graph.IGraph} graph The graph to wrap + * @param {function(yfiles.graph.INode):boolean} nodePredicate The predicate that determines which nodes to keep. + * @param {function(yfiles.graph.IEdge):boolean} edgePredicate The predicate that determines which edges to keep. + */ + new (graph:yfiles.graph.IGraph,nodePredicate:(obj:yfiles.graph.INode)=>boolean,edgePredicate:(obj:yfiles.graph.IEdge)=>boolean):yfiles.graph.FilteredGraphWrapper; + }; + /** + * A type that can be used to describe a {@link yfiles.graph.IFoldedGraph#isDummy dummy} edge that connects to nodes inside + * a collapsed group or other {@link yfiles.graph.DummyNodeId dummy nodes} in a {@link yfiles.graph.IFoldedGraph}. + * Instances of this type are passed to the various methods in {@link yfiles.graph.FoldingManager} + * to identify different possible states of an edge inside {@link yfiles.graph.IFoldedGraph} views. + * A dummy edge is identified through the master edge, which is an edge in the {@link yfiles.graph.FoldingManager#masterGraph} + * and a source and target node from the {@link yfiles.graph.FoldingManager#masterHierarchy}. Also whether + * those source and target nodes are currently {@link yfiles.graph.IFoldedGraph#isDummy dummy} nodes needs + * to be taken into account. + * The source and target nodes need to be either the true {@link yfiles.graph.IPort#owner owners} of + * the adjacent edge's {@link yfiles.graph.IEdge#sourcePort} and {@link yfiles.graph.IEdge#targetPort} respectively, + * or {@link yfiles.graph.IHierarchy#getParent ancestor} group nodes in the {@link yfiles.graph.FoldingManager#masterHierarchy}. + * In the latter case these dummy edges are used to describe the state of the dummy edges that are present in the + * views of the corresponding group nodes are in {@link yfiles.graph.IFoldedGraph#collapse collapsed} state, so that + * the true source and target nodes are not currently visible in the view. As such the {@link yfiles.graph.DummyEdgeId#currentMasterSource} + * and {@link yfiles.graph.DummyEdgeId#currentMasterTarget} nodes represent the {@link yfiles.graph.IFoldedGraph#getMaster masters} + * of the nearest ancestors in the {@link yfiles.graph.FoldingManager#masterHierarchy} that are visible in the + * {@link yfiles.graph.IFoldedGraph folded graph view}. + * @see {@link yfiles.graph.FoldingManager#hasEdgeViewState} + * @see {@link yfiles.graph.FoldingManager#getEdgeViewState} + * @see {@link yfiles.graph.FoldingManager#getChangeDummyEdgeAppearanceCallback} + * @see {@link yfiles.graph.IFoldedGraph#isDummy} + * @see {@link yfiles.graph.DummyNodeId} + */ + export interface DummyEdgeId extends yfiles.lang.Struct{ + /** + * The edge instance in the {@link yfiles.graph.FoldingManager#masterGraph} that is represented by the dummy in + * a view. + */ + masterEdge:yfiles.graph.IEdge; + /** + * The source node of the edge or an ancestor (both in the {@link yfiles.graph.FoldingManager#masterHierarchy}). + * This may be an ancestor of the true source node. The views will contain this dummy if the {@link yfiles.graph.IFoldedGraph#getRepresentative} + * of the source node is currently {@link yfiles.graph.IFoldedGraph#collapse collapsed} by one of its ancestors. + */ + currentMasterSource:yfiles.graph.INode; + /** + * The target node of the edge or an ancestor (both in the {@link yfiles.graph.FoldingManager#masterHierarchy}). + * This may be an ancestor of the true target node. The views will contain this dummy if the {@link yfiles.graph.IFoldedGraph#getRepresentative} + * of the target node is currently {@link yfiles.graph.IFoldedGraph#collapse collapsed} by one of its ancestors. + */ + currentMasterTarget:yfiles.graph.INode; + /** + * Specifies whether the {@link yfiles.graph.DummyEdgeId#currentMasterSource} node is in {@link yfiles.graph.IFoldedGraph#isExpanded collapsed/dummy} state. + * Since an edge will be converted to a dummy edge if the adjacent node itself will be converted to a dummy (collapsed group) node, + * this property determines which state the source node is in for this dummy edge. + */ + sourceIsCollapsed:boolean; + /** + * Specifies whether the {@link yfiles.graph.DummyEdgeId#currentMasterTarget} node is in {@link yfiles.graph.IFoldedGraph#isExpanded collapsed/dummy} state. + * Since an edge will be converted to a dummy edge if the adjacent node itself will be converted to a dummy (collapsed group) node, + * this property determines which state the target node is in for this dummy edge. + */ + targetIsCollapsed:boolean; + } + var DummyEdgeId:{ + $class:yfiles.lang.Class; + /** + * Initializes an id for a dummy edge in a {@link yfiles.graph.IFoldedGraph} view that represent a master edge and + * connects a specific pair of nodes. + * All of the arguments need to be entities of the {@link yfiles.graph.FoldingManager#masterGraph master graph}. + * @param {yfiles.graph.IEdge} masterEdge An edge in the {@link yfiles.graph.FoldingManager#masterGraph} that is represented + * by the dummy edge. + * @param {yfiles.graph.INode} currentMasterSource The source node of the edge or one of its ancestors to which the dummy edge + * connects in the view, if the actual parent is currently {@link yfiles.graph.IFoldedGraph#collapse collapsed in an ancestor node}. + * @param {boolean} sourceCollapsed true if the currentMasterSource is the true source + * of the masterEdge, but is in its {@link yfiles.graph.IFoldedGraph#collapse collapsed/dummy} state. + * @param {boolean} targetCollapsed true if the currentMasterTarget is the true target + * of the masterEdge, but is in its {@link yfiles.graph.IFoldedGraph#collapse collapsed/dummy} state. + * @param {yfiles.graph.INode} currentMasterTarget The target node of the edge or one of its ancestors to which the dummy edge + * connects in the view, if the actual parent is currently {@link yfiles.graph.IFoldedGraph#collapse collapsed in an ancestor node}. + */ + new (masterEdge:yfiles.graph.IEdge,currentMasterSource:yfiles.graph.INode,sourceCollapsed:boolean,currentMasterTarget:yfiles.graph.INode,targetCollapsed:boolean):yfiles.graph.DummyEdgeId; + /** + * Initializes an id for a dummy edge that is currently part of the given view. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The view the dummy edge is part of. + * @param {yfiles.graph.IEdge} dummyEdge The instance that is part of the {@link yfiles.graph.IFoldedGraph#graph folded graph view}. + */ + FromGraphAndEdge:{ + new (foldedGraph:yfiles.graph.IFoldedGraph,dummyEdge:yfiles.graph.IEdge):yfiles.graph.DummyEdgeId; + }; + }; + /** + * Simple implementation of the {@link yfiles.graph.IGraphSelection} interface. + */ + export interface GraphSelection extends Object,yfiles.graph.IGraphSelection{ + /** + * Raises the {@link yfiles.graph.GraphSelection#addItemSelectedListener ItemSelected} event. + * @param {yfiles.model.ItemEventArgs.} itemEventArgs The parameters for the event + */ + onItemSelected(itemEventArgs:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.GraphSelection#addItemDeselectedListener ItemDeselected} event. + * @param {yfiles.model.ItemEventArgs.} itemEventArgs The parameters for the event + */ + onItemDeselected(itemEventArgs:yfiles.model.ItemEventArgs):void; + /** + * Factory method that creates the {@link yfiles.model.DefaultSelectionModel} to use for the ports. + */ + createPortSelectionModel():yfiles.model.DefaultSelectionModel; + /** + * Factory method that creates the {@link yfiles.model.DefaultSelectionModel} to use for the bends. + */ + createBendSelectionModel():yfiles.model.DefaultSelectionModel; + /** + * Factory method that creates the {@link yfiles.model.DefaultSelectionModel} to use for the labels. + */ + createLabelSelectionModel():yfiles.model.DefaultSelectionModel; + /** + * Factory method that creates the {@link yfiles.model.DefaultSelectionModel} to use for the nodes. + */ + createNodeSelectionModel():yfiles.model.DefaultSelectionModel; + /** + * Factory method that creates the {@link yfiles.model.DefaultSelectionModel} to use for the edges. + */ + createEdgeSelectionModel():yfiles.model.DefaultSelectionModel; + /** + * Sets the selected state for the given node. + * This will trigger the corresponding event if the state changes. + * @param {yfiles.graph.INode} node the node to set the selection state for + * @param {boolean} selected the new selection state + */ + setNodeSelected(node:yfiles.graph.INode,selected:boolean):void; + /** + * Queries the selection state for the given node. + * @param {yfiles.graph.INode} node the node to query the state for + * @return {boolean} whether the node is currently selected + */ + isNodeSelected(node:yfiles.graph.INode):boolean; + /** + * Sets the selected state for the given edge. + * This will trigger the corresponding event if the state changes. + * @param {yfiles.graph.IEdge} edge the edge to set the selection state for + * @param {boolean} selected the new selection state + */ + setEdgeSelected(edge:yfiles.graph.IEdge,selected:boolean):void; + /** + * Queries the selection state for the given edge. + * @param {yfiles.graph.IEdge} edge the edge to query the state for + * @return {boolean} whether the edge is currently selected + */ + isEdgeSelected(edge:yfiles.graph.IEdge):boolean; + /** + * Sets the selected state for the given bend. + * This will trigger the corresponding event if the state changes. + * @param {yfiles.graph.IBend} bend the bend to set the selection state for + * @param {boolean} selected the new selection state + */ + setBendSelected(bend:yfiles.graph.IBend,selected:boolean):void; + /** + * Queries the selection state for the given bend. + * @param {yfiles.graph.IBend} bend the bend to query the state for + * @return {boolean} whether the bend is currently selected + */ + isBendSelected(bend:yfiles.graph.IBend):boolean; + /** + * Sets the selected state for the given label. + * This will trigger the corresponding event if the state changes. + * @param {yfiles.graph.ILabel} label the label to set the selection state for + * @param {boolean} selected the new selection state + */ + setLabelSelected(label:yfiles.graph.ILabel,selected:boolean):void; + /** + * Queries the selection state for the given label. + * @param {yfiles.graph.ILabel} label the label to query the state for + * @return {boolean} whether the label is currently selected + */ + isLabelSelected(label:yfiles.graph.ILabel):boolean; + /** + * Sets the selected state for the given port. + * This will trigger the corresponding event if the state changes. + * @param {yfiles.graph.IPort} port the port to set the selection state for + * @param {boolean} selected the new selection state + */ + setPortSelected(port:yfiles.graph.IPort,selected:boolean):void; + /** + * Queries the selection state for the given port. + * @param {yfiles.graph.IPort} port the port to query the state for + * @return {boolean} whether the port is currently selected + */ + isPortSelected(port:yfiles.graph.IPort):boolean; + /** + * An {@link yfiles.model.ISelectionModel} of the selected nodes. + * This is the node part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedNodes}. + */ + selectedNodes:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of the selected edges. + * This is the edge part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedEdges}. + */ + selectedEdges:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of the selected labels. + * This is the label part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedLabels}. + */ + selectedLabels:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of the selected ports. + * This is the ports part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedPorts}. + */ + selectedPorts:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of the selected bends. + * This is the bend part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedBends}. + */ + selectedBends:yfiles.model.ISelectionModel; + /** + * Determines whether an item is currently selected. + * @param {T} o The item to check. + * @return {boolean} Whether it is currently selected. + * @see Specified by {@link yfiles.model.ISelectionModel#isSelected}. + */ + isSelected(o:yfiles.model.IModelItem):boolean; + /** + * Sets the selection state of an item. + * If the state changes, this will trigger the {@link yfiles.model.ISelectionModel#addItemSelectedListener ItemSelected} or + * {@link yfiles.model.ISelectionModel#addItemDeselectedListener ItemDeselected} events respectively. + * @param {T} o The object to set the selection state for. + * @param {boolean} selected Whether to select the object. + * @see Specified by {@link yfiles.model.ISelectionModel#setSelected}. + */ + setSelected(o:yfiles.model.IModelItem,selected:boolean):void; + /** + * Returns the number of selected items. + * @see Specified by {@link yfiles.model.ISelectionModel#count}. + */ + count:number; + /** + * Gets or sets the {@link yfiles.graph.IGraph} this instance + * is using as the domain for the selection. + */ + graph:yfiles.graph.IGraph; + /** + * Returns an enumerator that iterates through the collection of all selected elements. + * @return {yfiles.objectcollections.IEnumerator} + * An {@link yfiles.objectcollections.IEnumerator} object that can be used to iterate through all selected elements. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Returns an enumerator that iterates through the collection of all selected elements. + * @return {yfiles.collections.IEnumerator.} + * An {@link yfiles.collections.IEnumerator} object that can be used to iterate through all selected elements. + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * An event that will be triggered if an item changed its selection state from + * unselected to selected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + addItemSelectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * unselected to selected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + removeItemSelectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * selected to unselected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + addItemDeselectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * selected to unselected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + removeItemDeselectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Clears the selection. + * This is a convenience method that will set the selection state of all elements to + * unselected. + * @see {@link yfiles.model.ISelectionModel#addItemDeselectedListener ItemDeselected} + * @see Specified by {@link yfiles.model.ISelectionModel#clear}. + */ + clear():void; + } + var GraphSelection:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with no initial {@link yfiles.graph.GraphSelection#graph} + * assigned. + * In order to be always in sync with the structural changes in a graph, + * an instance should be associated with an {@link yfiles.graph.IGraph} using + * the {@link yfiles.graph.GraphSelection#graph} property. + */ + new ():yfiles.graph.GraphSelection; + /** + * Instantiates an instance using the the graph as the model. + * @param {yfiles.graph.IGraph} graph + */ + ForGraph:{ + new (graph:yfiles.graph.IGraph):yfiles.graph.GraphSelection; + }; + }; + /** + * Default implementation of the {@link yfiles.graph.IGroupedGraph} interface that can be used + * to decorate {@link yfiles.graph.IGraph} instances. + * {@link yfiles.graph.DefaultGraph} uses this class to provide an implementation of the {@link yfiles.graph.IGroupedGraph} + * interface in its {@link yfiles.support.ILookup#lookup} method, if {@link yfiles.graph.DefaultGraph#groupingSupported} + * is set to true. + * This implementation will {@link yfiles.support.ILookupDecorator decorate} the {@link yfiles.support.ILookup look-ups} + * of the {@link yfiles.graph.IGraph} and its {@link yfiles.graph.INode nodes} to support the following features: + *
    + *
  • + * Add a view of the {@link yfiles.graph.IHierarchy IHierarchy<INode>} to the lookup of the {@link yfiles.graph.IGraph} + * as well as registers this instance under {@link yfiles.graph.IGroupedGraph} and {@link yfiles.graph.GroupedGraph} with the graph's lookup + * mechanism. + *
  • + *
  • + * Automatically resize group nodes once their contents' bounds changes. This + * can optionally be disabled using {@link yfiles.graph.GroupedGraph#autoAdjustGroupNodeBounds}. + *
  • + *
  • + * Automatically forward positional changes of group nodes to their contents. + *
  • + *
  • + * Provide {@link yfiles.input.ISizeConstraintProvider size constraints} for group nodes, + * so that it will not be possible to resize group nodes in such a way that they do not encompass their + * contents' bounds any more. + *
  • + *
  • + * Add {@link yfiles.support.IUndoUnit}s for hierarchy changes to the {@link yfiles.support.IUndoSupport} of + * the graph instance if the underlying graph supports it. + *
  • + *
+ *
+ * Related Information in the Developers Guide: + *

+ * Graph hierarchies, and in particular class GroupedGraph, are described in the section + * Managing Graph Hierarchies. + *

+ */ + export interface GroupedGraph extends Object,yfiles.graph.IGroupedGraph{ + /** + * Callback that will be called once the original {@link yfiles.graph.IGraph} + * triggers the {@link yfiles.graph.IGraph#addNodeChangedListener NodeChanged} event. + * This will fire a {@link yfiles.graph.IHierarchy#publishItemChanged} + * event. + * @param {yfiles.graph.INode} node The node that has changed. + */ + onNodeChanged(node:yfiles.graph.INode):void; + /** + * Called whenever a new node has been created in the graph. + * @param {yfiles.graph.INode} parent The new parent node of the node or {@link yfiles.graph.IHierarchy#root}. + * @param {yfiles.graph.INode} node The newly created node. + */ + onNodeCreated(parent:yfiles.graph.INode,node:yfiles.graph.INode):void; + /** + * Called whenever a new group node has been created in the graph. + * @param {yfiles.graph.INode} parent The new parent node of the node or {@link yfiles.graph.IHierarchy#root}. + * @param {yfiles.graph.INode} node The newly created node. + */ + onGroupNodeCreated(parent:yfiles.graph.INode,node:yfiles.graph.INode):void; + /** + * Yields the graph instance that this instance is working on. + * @see Specified by {@link yfiles.graph.IGroupedGraph#graph}. + */ + graph:yfiles.graph.IGraph; + /** + * Gets or sets the defaults for group nodes. + * Value: The default for group nodes + * @see {@link yfiles.graph.GroupedGraph#createGroupNodeDefaults} + * @see Specified by {@link yfiles.graph.IGroupedGraph#groupNodeDefaults}. + */ + groupNodeDefaults:yfiles.graph.INodeDefaults; + /** + * Factory method that creates the {@link yfiles.graph.INodeDefaults} for group nodes. + * Delegates to {@link yfiles.graph.GroupedGraph#createDefaultGroupNodeStyle}, {@link yfiles.graph.GroupedGraph#createGroupNodeLabelDefaults}, + * and {@link yfiles.graph.GroupedGraph#createGroupNodePortDefaults}. + * @return {yfiles.graph.INodeDefaults} The defaults for group nodes. + */ + createGroupNodeDefaults():yfiles.graph.INodeDefaults; + /** + * Factory method that creates the {@link yfiles.graph.IPortDefaults} for group nodes. + * @return {yfiles.graph.IPortDefaults} The defaults for group nodes. + */ + createGroupNodePortDefaults():yfiles.graph.IPortDefaults; + /** + * Factory method that creates the {@link yfiles.graph.ILabelDefaults} for group nodes. + * @return {yfiles.graph.ILabelDefaults} The defaults for group nodes. + */ + createGroupNodeLabelDefaults():yfiles.graph.ILabelDefaults; + /** + * Called whenever a node has been removed in the graph. + * @param {yfiles.graph.INode} node The removed node. + */ + onNodeRemoved(node:yfiles.graph.INode):void; + /** + * Gets or sets a property that determines whether the bounds of group nodes should automatically + * be adjusted whenever the nodes that belong to the group node change their bounds. + * This behavior is turned on by default and should only be turned off temporarily to + * allow for programmatic batch updates to the bounds of nodes. + * The default is true + * @see Specified by {@link yfiles.graph.IGroupedGraph#autoAdjustGroupNodeBounds}. + */ + autoAdjustGroupNodeBounds:boolean; + /** + * Yields the hierarchy of the nodes in this grouped graph. + * @see Specified by {@link yfiles.graph.IGroupedGraph#hierarchy}. + */ + hierarchy:yfiles.graph.IHierarchy; + /** + * Factory method for the DefaultGroupNodeStyle property. This method will be called + * upon first access to the {@link yfiles.graph.GroupedGraph#groupNodeDefaults} property. + * @return {yfiles.drawing.INodeStyle} A new instance of {@link yfiles.drawing.ShapeNodeStyle}. + */ + createDefaultGroupNodeStyle():yfiles.drawing.INodeStyle; + /** + * Sets the parent node for a given node. + * Use {@link yfiles.graph.IGroupedGraph#hierarchy}'s {@link yfiles.graph.IHierarchy#root} field + * to make node a top-level node for this graph. + * @param {yfiles.graph.INode} node The node to assign a new parent. + * @param {yfiles.graph.INode} parent The parent group node to assign to node. + * @see {@link yfiles.graph.IHierarchy#getParent} + * @see {@link yfiles.graph.IGroupedGraph#hierarchy} + * @see Specified by {@link yfiles.graph.IGroupedGraph#setParent}. + */ + setParent(node:yfiles.graph.INode,parent:yfiles.graph.INode):void; + /** + * Creates a new group node using the provided style and bounds as a child of parent. + * The group node will be a direct descendant of parent. + * @return {yfiles.graph.INode} The newly created group node. + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + * @param {yfiles.geometry.RectD} bounds The initial bounds to use for the new node. + * @param {yfiles.drawing.INodeStyle} style The style to use for the new node. + * @param {Object} tag The {@link yfiles.support.ITagOwner#tag} to assign to the {@link yfiles.graph.INode}. + * @see Specified by {@link yfiles.graph.IGroupedGraph#createGroupNodeWithParentBoundsStyleAndTag}. + */ + createGroupNodeWithParentBoundsStyleAndTag(parent:yfiles.graph.INode,bounds:yfiles.geometry.RectD,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.INode; + /** + * Convenience method that yields the {@link yfiles.graph.IHierarchy#getParent parent} of a node. + * This method yields the parent node of the current node or {@link yfiles.graph.IHierarchy#root} + * if the node is a top level node in the hierarchy. + * @param {yfiles.graph.INode} node The node to yield the parent node. + * @return {yfiles.graph.INode} The parent of the node or {@link yfiles.graph.IHierarchy#root} if the node is a top level node. + * @see {@link yfiles.graph.GroupedGraph#hierarchy} + * @see {@link yfiles.graph.GroupedGraph#setParent} + * @see {@link yfiles.graph.IHierarchy#root} + * @see {@link yfiles.graph.IHierarchy#getParent} + */ + getParent(node:yfiles.graph.INode):yfiles.graph.INode; + /** + * Creates a new ordinary node as a direct descendant of parent using the given bounds + * and style. + * This method ultimately delegates to the {@link yfiles.graph.IGroupedGraph#graph}'s {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} method. + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + * @return {yfiles.graph.INode} The newly created node. + * @param {yfiles.geometry.RectD} bounds The bounds to use initially. + * The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} field. + * @param {yfiles.drawing.INodeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @param {Object} tag The {@link yfiles.support.ITagOwner#tag} to assign to the {@link yfiles.graph.INode}. + * @see {@link yfiles.graph.IGroupedGraph#setParent} + * @see {@link yfiles.graph.IGroupedGraph#createNodeWithParentBoundsStyleAndTag} + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + * @see Specified by {@link yfiles.graph.IGroupedGraph#createNodeWithParentBoundsStyleAndTag}. + */ + createNodeWithParentBoundsStyleAndTag(parent:yfiles.graph.INode,bounds:yfiles.geometry.RectD,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.INode; + /** + * Disposes of this instance. This removes all artifacts from the {@link yfiles.graph.IGraph} instance that + * have been added during the registration. + */ + dispose():void; + } + var GroupedGraph:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using a newly created empty {@link yfiles.graph.DefaultGraph} instance + * and {@link yfiles.graph.DefaultHierarchy}. + */ + new ():yfiles.graph.GroupedGraph; + /** + * Creates a new instance using a newly created empty {@link yfiles.graph.DefaultGraph} instance + * and the provided hierarchy. + * The hierarchy may not contain any nodes initially. + * @param {yfiles.graph.IHierarchy.} hierarchy The hierarchy implementation to use for managing the node hierarchy. + */ + FromHierarchy:{ + new (hierarchy:yfiles.graph.IHierarchy):yfiles.graph.GroupedGraph; + }; + /** + * Creates a new instance using a newly created {@link yfiles.graph.DefaultHierarchy} instance + * and the provided graph. + * The hierarchy will be initialized so that all nodes in the provided graph are initially top-level + * non-group nodes. + * @param {yfiles.graph.IGraph} graph The graph implementation to use for managing the node hierarchy. + */ + ForGraph:{ + new (graph:yfiles.graph.IGraph):yfiles.graph.GroupedGraph; + }; + /** + * Creates a new instance using the provided graph and hierarchy instance. + * It is the responsibility of the caller to assure that the hierarchy and graph instances are in sync, initially. + * @param {yfiles.graph.IGraph} graph The graph implementation to use for managing the node hierarchy. + * @param {yfiles.graph.IHierarchy.} hierarchy The hierarchy to use. The hierarchy needs to be initialized already, i.e. all of the nodes of the + * graph need to be part of the hierarchy. + */ + ForGraphWithHierarchy:{ + new (graph:yfiles.graph.IGraph,hierarchy:yfiles.graph.IHierarchy):yfiles.graph.GroupedGraph; + }; + }; + /** + * A convenience composite implementation of the {@link yfiles.model.IObstacleProvider} + * that will use the {@link yfiles.graph.IGraph#edges} and {@link yfiles.graph.IGraph#nodes} + * of an {@link yfiles.graph.IGraph} from the {@link yfiles.drawing.IRenderContext}. + * This class can be used to add bridge support via the {@link yfiles.model.BridgeManager} + * to a rendered {@link yfiles.graph.IGraph}. + * @see {@link yfiles.model.BridgeManager#addObstacleProvider} + * @see {@link yfiles.model.BridgeManager} + * @see {@link yfiles.model.IObstacleProvider} + */ + export interface GraphObstacleProvider extends Object,yfiles.model.IObstacleProvider{ + /** + * Gets or sets a value indicating whether to query the {@link yfiles.graph.IGraph#edges} + * for an {@link yfiles.model.IObstacleProvider} implementation. + * Value: true if edges should be queried at all; otherwise, false. The default is true. + */ + queryEdges:boolean; + /** + * Gets or sets a value indicating whether to query the {@link yfiles.graph.IGraph#nodes} + * for an {@link yfiles.model.IObstacleProvider} implementation. + * Value: true if nodes should be queried at all; otherwise, false. The default is false. + */ + queryNodes:boolean; + /** + * Iterates over all {@link yfiles.graph.IGraph#edges} and + * {@link yfiles.graph.IGraph#nodes} to query + * an {@link yfiles.model.IObstacleProvider} from + * the {@link yfiles.model.IModelItem}'s {@link yfiles.support.ILookup#lookup}. + * This method will depending on the {@link yfiles.graph.GraphObstacleProvider#queryEdges} + * and {@link yfiles.graph.GraphObstacleProvider#queryNodes} property query the items for + * an implementation of {@link yfiles.model.IObstacleProvider} + * and concatenate all resulting {@link yfiles.drawing.GeneralPath} + * obstacles into one path that will then be returned. + * @param {yfiles.drawing.IRenderContext} canvasContext The context where the obstacles are queried for. + * @return {yfiles.drawing.GeneralPath} A path that is the concatenated path of all obstacles for the given context. + * @see Specified by {@link yfiles.model.IObstacleProvider#getObstacles}. + */ + getObstacles(canvasContext:yfiles.drawing.IRenderContext):yfiles.drawing.GeneralPath; + /** + * Helper method that retrieves the {@link yfiles.graph.IGraph} to use + * from the canvasContext. + * This implementation uses the {@link yfiles.support.ILookup#lookup} of the + * {@link yfiles.drawing.IRenderContext#canvas} to query the {@link yfiles.graph.IGraph} implementation. + * @param {yfiles.drawing.IRenderContext} canvasContext The context to retrieve the implementation from. + * @return {yfiles.graph.IGraph} The {@link yfiles.graph.IGraph} instance to query or null. + */ + getGraph(canvasContext:yfiles.drawing.IRenderContext):yfiles.graph.IGraph; + } + var GraphObstacleProvider:{ + $class:yfiles.lang.Class; + }; + /** + * A utility class that helps in {@link yfiles.support.ILookupDecorator#addLookup decorating} the {@link yfiles.support.ILookup#lookup} + * method of {@link yfiles.model.IModelItem} instances that are contained + * in an {@link yfiles.graph.IGraph} which are managed by an {@link yfiles.support.ILookupDecorator}. + * This implementation serves as a factory for predefined {@link yfiles.graph.LookupDecorator} + * instances that are often useful for the {@link yfiles.model.IModelItem} type in an {@link yfiles.graph.IGraph} instance + * that is being edited in a {@link yfiles.canvas.GraphControl}. + * Note that the list of possible decorations that are available using this class + * is not exhaustive in any way. This is merely a way to provide access to those + * interfaces that are more commonly being decorated by the developer. + * @see {@link yfiles.graph.GraphDecorator} + * @see {@link yfiles.graph.GraphDecoratorExtensions} + * @see {@link yfiles.graph.LookupDecorator} + */ + export interface ItemDecorator extends Object{ + /** + * The {@link yfiles.support.ILookupDecorator} instance to pass to the various + * {@link yfiles.graph.LookupDecorator} helper instances. + * This field can be null in which case decorating will not be supported. + */ + decorator:yfiles.support.ILookupDecorator; + /** + * Creates a {@link yfiles.graph.LookupDecorator} for the TModelItem + * that can be used to decorate TInterface types of the model items. + * @return {yfiles.graph.LookupDecorator.} A new {@link yfiles.graph.LookupDecorator} for the specified interface. + */ + getDecoratorFor(InterfaceType:yfiles.lang.Class):yfiles.graph.LookupDecorator; + /** + * Creates a {@link yfiles.graph.LookupDecorator} for the TModelItem + * that can be used to decorate TInterface types of the model items. + * @param {boolean} decorateNulls if set to true null values will be decorated, otherwise not. + * @param {boolean} nullIsFallback if set to true null values will be treated as fallback values, otherwise they will + * be used as the final result. + * @return {yfiles.graph.LookupDecorator.} + * A new {@link yfiles.graph.LookupDecorator} for the specified interface. + */ + getDecoratorWithOptions(InterfaceType:yfiles.lang.Class,decorateNulls:boolean,nullIsFallback:boolean):yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IPositionHandler} + * type for the type of items this instance has been created for. + * Custom {@link yfiles.input.IPositionHandler} implementations can be used to restrict or enhance the + * way the user moves elements interactively in the editor. + * This interface is mainly used by the {@link yfiles.input.MoveInputMode}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IPositionHandler} + * instances on items that implement the TModelItem interface this instance uses + * as the generic type parameter. + */ + positionHandlerDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.graph.IClipboardHelper} + * type for the type of items this instance has been created for. + * Custom {@link yfiles.graph.IClipboardHelper} implementations can be used to customize the + * way the clipboard operations are performed by {@link yfiles.graph.GraphClipboard}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.graph.IClipboardHelper} + * instances on items that implement the TModelItem interface this instance uses + * as the generic type parameter. + */ + clipboardHelperDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.drawing.IMarqueeTestable} + * type for the type of items this instance has been created for. + * Custom {@link yfiles.drawing.IMarqueeTestable} implementations can be used to change the + * way tests for marquee inclusions are performed on the items in the editor. + * This interface is mainly used by the {@link yfiles.input.GraphEditorInputMode}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.drawing.IMarqueeTestable} + * instances on items that implement the TModelItem interface this instance uses + * as the generic type parameter. + */ + marqueeTestableDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.support.IMementoSupport} + * type for the type of items this instance has been created for. + * Custom {@link yfiles.support.IMementoSupport} implementations can be used to + * make the {@link yfiles.support.IUndoSupport} aware of changes to data that is associated with the model items. + * This interface is mainly used by the {@link yfiles.support.MementoUndoUnit}, which is used + * by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.IUndoSupport} implementation. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.support.IMementoSupport} + * instances on items that implement the TModelItem interface this instance uses + * as the generic type parameter. + */ + mementoSupportDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.model.ISelectionInstaller} + * type for the type of items this instance has been created for. + * Custom {@link yfiles.model.ISelectionInstaller} implementations can be used change the way + * the selection of an item is represented in a {@link yfiles.canvas.CanvasControl}. + * This interface is mainly used by the {@link yfiles.model.SelectionPaintManager} + * in the {@link yfiles.canvas.GraphControl}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.model.ISelectionInstaller} + * instances on items that implement the TModelItem interface this instance uses + * as the generic type parameter. + */ + selectionDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IHighlightInstaller} + * type for the type of items this instance has been created for. + * Custom {@link yfiles.input.IHighlightInstaller} implementations can be used change the way + * the highlighting of an item is represented in a {@link yfiles.canvas.CanvasControl}. + * This interface is mainly used by the {@link yfiles.model.HighlightPaintManager} + * in the {@link yfiles.canvas.GraphControl}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IHighlightInstaller} + * instances on items that implement the TModelItem interface this instance uses + * as the generic type parameter. + */ + highlightDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IFocusIndicatorInstaller} + * type for the type of items this instance has been created for. + * Custom {@link yfiles.input.IFocusIndicatorInstaller} implementations can be used change the way + * the focus of an item is represented in a {@link yfiles.canvas.GraphControl}. + * This interface is mainly used by the {@link yfiles.model.FocusPaintManager} + * in the {@link yfiles.canvas.GraphControl}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IFocusIndicatorInstaller} + * instances on items that implement the TModelItem interface this instance uses + * as the generic type parameter. + */ + focusIndicatorDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IHandleProvider} + * type for the type of items this instance has been created for. + * Custom {@link yfiles.input.IHandleProvider} implementations + * provide interactive draggable handles for the user to change the geometry or + * other aspects of items in the {@link yfiles.canvas.GraphControl}. + * This interface is mainly used by the {@link yfiles.input.HandleInputMode} + * in the {@link yfiles.input.GraphEditorInputMode}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IHandleProvider} + * instances on items that implement the TModelItem interface this instance uses + * as the generic type parameter. + */ + handleProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.model.IObstacleProvider} + * type for the type of items this instance has been created for. + * Custom {@link yfiles.model.IObstacleProvider} implementations provide + * information about obstacles that will be considered by {@link yfiles.graph.GraphObstacleProvider} + * which itself serves as a provider for geometric obstacles to + * {@link yfiles.model.BridgeManager} that manages the rendering of bridges in edge paths. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.model.IObstacleProvider} + * instances on items that implement the TModelItem interface this instance uses + * as the generic type parameter. + * @see {@link yfiles.graph.GraphObstacleProvider} + * @see {@link yfiles.model.BridgeManager} + */ + obstacleProviderDecorator:yfiles.graph.LookupDecorator; + } + var ItemDecorator:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.ItemDecorator} class. + * @param {yfiles.support.ILookupDecorator} decorator The decorator to use, which can be null. + */ + new (modelItemType:yfiles.lang.Class,decorator:yfiles.support.ILookupDecorator):yfiles.graph.ItemDecorator; + }; + /** + * A subclass of the {@link yfiles.graph.ItemDecorator} + * class that is specifically tailored for {@link yfiles.graph.ILabel}s. + * This {@link yfiles.graph.ItemDecorator} can be used + * as a convenience to {@link yfiles.support.ILookupDecorator decorate the lookup} + * of {@link yfiles.graph.ILabel}s in an {@link yfiles.graph.IGraph}. + * It serves as a factory for predefined {@link yfiles.graph.LookupDecorator} + * instances that are specifically useful for the {@link yfiles.graph.ILabel} type. + * Note that the list of possible decorations that are available using this class + * is not exhaustive in any way. This is merely a way to provide access to those + * interfaces that are more commonly being decorated by the developer. + * @see {@link yfiles.graph.GraphDecorator} + * @see {@link yfiles.graph.GraphDecoratorExtensions} + * @see {@link yfiles.graph.LookupDecorator} + */ + export interface LabelDecorator extends yfiles.graph.ItemDecorator{ + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.graph.ILabelModelParameterFinder} + * type for the {@link yfiles.graph.ILabel}s of the graph this instance has been created for. + * Custom {@link yfiles.graph.ILabelModelParameterFinder} implementations can be used change the way + * {@link yfiles.graph.ILabel}s can be dragged interactively by the user. It helps in determining the + * right {@link yfiles.graph.ILabelModelParameter} for a given location that has been chosen by the user. + * This interface is mainly used by the {@link yfiles.input.LabelPositionHandler} + * in the {@link yfiles.canvas.GraphControl}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.graph.ILabelModelParameterFinder} + * instances on {@link yfiles.graph.ILabel}s. + */ + labelModelParameterFinderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IEditLabelHelper} + * type for the {@link yfiles.graph.ILabel}s this instance has been created for. + * Custom {@link yfiles.input.IEditLabelHelper} implementations can be used to change or + * customize interactive label editing. + * This interface is mainly used by the + * which uses the callbacks from the implementation to determine whether the label can + * be edited, as well as to customize the {@link yfiles.input.TextEditorInputMode} + * appearance for the upcoming edit. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IEditLabelHelper} + * instances on {@link yfiles.graph.ILabel}s. + */ + editLabelHelperDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.graph.ILabelModelParameterProvider} + * type for the {@link yfiles.graph.ILabel}s of the graph this instance has been created for. + * Custom {@link yfiles.graph.ILabelModelParameterProvider} implementations can be used to change the set + * of possible {@link yfiles.graph.ILabelModelParameter}s that the user can assign to a label interactively by + * dragging it in a {@link yfiles.canvas.GraphControl}. + * This interface is mainly used by the {@link yfiles.input.LabelPositionHandler} and {@link yfiles.input.MoveLabelInputMode} + * in the {@link yfiles.canvas.GraphControl}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.graph.ILabelModelParameterProvider} + * instances on {@link yfiles.graph.ILabel}s. + */ + labelModelParameterProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.ILabelSnapContextHelper} for the {@link yfiles.graph.ILabel}s this instance has been created for. + * Custom {@link yfiles.input.ILabelSnapContextHelper} implementations can be used to provide custom + * {@link yfiles.input.SnapLine snap lines} and + * {@link yfiles.input.SnapResult snap results} based on the {@link yfiles.graph.ILabel}s this instance has been created for. + * This interface is mainly used by the label's {@link yfiles.input.IPositionHandler} to collect snap results + * during a drag gesture for the label. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify queries for {@link yfiles.input.ILabelSnapContextHelper} + * instances on an {@link yfiles.graph.ILabel}. + */ + labelSnapContextHelperDecorator:yfiles.graph.LookupDecorator; + } + var LabelDecorator:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.LabelDecorator} class. + * @param {yfiles.support.ILookupDecorator} decorator The decorator to use, which can be null. + */ + new (decorator:yfiles.support.ILookupDecorator):yfiles.graph.LabelDecorator; + }; + /** + * Static class that contains extension methods for {@link yfiles.graph.IGraph} + * to aid in conveniently using {@link yfiles.support.ILookupDecorator}. + */ + export interface GraphDecoratorExtensions extends Object{ + } + var GraphDecoratorExtensions:{ + $class:yfiles.lang.Class; + /** + * Gets a {@link yfiles.graph.GraphDecorator} instance for use with the given graph. + * @param {yfiles.graph.IGraph} graph The graph to get a {@link yfiles.graph.GraphDecorator} instance for. + * @return {yfiles.graph.GraphDecorator} A new {@link yfiles.graph.GraphDecorator} + */ + getDecorator(graph:yfiles.graph.IGraph):yfiles.graph.GraphDecorator; + }; + /** + * Helper class that can be used to aid in + * decorating {@link yfiles.model.IModelItem}s from an {@link yfiles.graph.IGraph} + * instance. + * This class servers as a factory for {@link yfiles.graph.ItemDecorator}s + * for the various items that make up an {@link yfiles.graph.IGraph}. + * This is a convenience class that obtains the {@link yfiles.support.ILookupDecorator} + * from the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup} + * and passes that to the various specialized {@link yfiles.graph.ItemDecorator} + * subclasses. + * @see {@link yfiles.graph.GraphDecorator#nodeDecorator} + * @see {@link yfiles.graph.GraphDecorator#edgeDecorator} + * @see {@link yfiles.graph.GraphDecorator#labelDecorator} + * @see {@link yfiles.graph.GraphDecorator#portDecorator} + * @see {@link yfiles.graph.GraphDecorator#bendDecorator} + */ + export interface GraphDecorator extends Object{ + /** + * Returns a {@link yfiles.graph.GraphDecorator#nodeDecorator} instance that can be + * used to decorate the {@link yfiles.graph.INode} instances in the graph + * that this decorator has been created for. + * This will obtain the {@link yfiles.support.ILookupDecorator} instance + * from the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup} + * method and use it to initialize the {@link yfiles.graph.ItemDecorator} + * Value: The decorator for {@link yfiles.graph.INode}s. + */ + nodeDecorator:yfiles.graph.NodeDecorator; + /** + * Returns an {@link yfiles.graph.GraphDecorator#edgeDecorator} instance that can be + * used to decorate the {@link yfiles.graph.IEdge} instances in the graph + * that this decorator has been created for. + * This will obtain the {@link yfiles.support.ILookupDecorator} instance + * from the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup} + * method and use it to initialize the {@link yfiles.graph.ItemDecorator} + * Value: The decorator for {@link yfiles.graph.IEdge}s. + */ + edgeDecorator:yfiles.graph.EdgeDecorator; + /** + * Returns a {@link yfiles.graph.GraphDecorator#labelDecorator} instance that can be + * used to decorate the {@link yfiles.graph.ILabel} instances in the graph + * that this decorator has been created for. + * This will obtain the {@link yfiles.support.ILookupDecorator} instance + * from the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup} + * method and use it to initialize the {@link yfiles.graph.ItemDecorator} + * Value: The decorator for {@link yfiles.graph.ILabel}s. + */ + labelDecorator:yfiles.graph.LabelDecorator; + /** + * Returns a {@link yfiles.graph.GraphDecorator#portDecorator} instance that can be + * used to decorate the {@link yfiles.graph.IPort} instances in the graph + * that this decorator has been created for. + * This will obtain the {@link yfiles.support.ILookupDecorator} instance + * from the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup} + * method and use it to initialize the {@link yfiles.graph.ItemDecorator} + * Value: The decorator for {@link yfiles.graph.IPort}s. + */ + portDecorator:yfiles.graph.PortDecorator; + /** + * Returns a {@link yfiles.graph.GraphDecorator#bendDecorator} instance that can be + * used to decorate the {@link yfiles.graph.IBend} instances in the graph + * that this decorator has been created for. + * This will obtain the {@link yfiles.support.ILookupDecorator} instance + * from the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup} + * method and use it to initialize the {@link yfiles.graph.ItemDecorator} + * Value: The decorator for {@link yfiles.graph.IBend}s. + */ + bendDecorator:yfiles.graph.BendDecorator; + } + var GraphDecorator:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.GraphDecorator} class. + * @param {yfiles.graph.IGraph} graph The graph. + */ + new (graph:yfiles.graph.IGraph):yfiles.graph.GraphDecorator; + }; + /** + * A subclass of the {@link yfiles.graph.ItemDecorator} + * class that is specifically tailored for {@link yfiles.graph.IEdge}s. + * This {@link yfiles.graph.ItemDecorator} can be used + * as a convenience to {@link yfiles.support.ILookupDecorator decorate the lookup} + * of {@link yfiles.graph.IEdge}s in an {@link yfiles.graph.IGraph}. + * It serves as a factory for predefined {@link yfiles.graph.LookupDecorator} + * instances that are specifically useful for the {@link yfiles.graph.IEdge} type. + * Note that the list of possible decorations that are available using this class + * is not exhaustive in any way. This is merely a way to provide access to those + * interfaces that are more commonly being decorated by the developer. + * @see {@link yfiles.graph.GraphDecorator} + * @see {@link yfiles.graph.GraphDecoratorExtensions} + * @see {@link yfiles.graph.LookupDecorator} + */ + export interface EdgeDecorator extends yfiles.graph.ItemDecorator{ + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IEdgePortCandidateProvider} + * type for the {@link yfiles.graph.IEdge}s of the graph this instance has been created for. + * Custom {@link yfiles.input.IEdgePortCandidateProvider} implementations can be used to change the set + * of possible {@link yfiles.input.IPortCandidate}s that are available for an existing edge in the + * {@link yfiles.graph.IGraph} if the user interactively tries to {@link yfiles.graph.IGraph#setPorts change the ports} + * of an {@link yfiles.graph.IEdge} in a {@link yfiles.canvas.GraphControl}. + * This interface is mainly used by the {@link yfiles.input.PortRelocationHandle}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IEdgePortCandidateProvider} + * instances on {@link yfiles.graph.IEdge}s. + */ + edgePortCandidateProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IPortCandidateProvider} + * for the {@link yfiles.graph.IEdge}s this instance has been created for. + * Custom {@link yfiles.input.IPortCandidateProvider} implementations can be used to + * present the user with a set of {@link yfiles.input.IPortCandidate}s + * that newly created edges can use as their {@link yfiles.graph.IEdge#sourcePort source} + * and {@link yfiles.graph.IEdge#targetPort target} {@link yfiles.graph.IPort}s. + * This interface is mainly used by the {@link yfiles.input.CreateEdgeInputMode} + * mode of {@link yfiles.input.GraphEditorInputMode} if {@link yfiles.input.CreateEdgeInputMode.edgeToEdgeConnectionsAllowed} is enabled. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IPortCandidateProvider} + * instances on {@link yfiles.graph.IEdge}s. + */ + portCandidateProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IEdgePortHandleProvider} + * type for the type of items this instance has been created for. + * Custom {@link yfiles.input.IEdgePortHandleProvider} implementations can be used + * provide interactive draggable handles for the source and target end points of an edge. + * This interface is mainly used by the {@link yfiles.input.HandleInputMode} + * in the {@link yfiles.input.GraphEditorInputMode} and by the implementations that work with {@link yfiles.input.OrthogonalEdgeEditingContext}. + * Implementations may decide, e.g. whether to yield {@link yfiles.input.IHandle} implementations that + * either move the edge to another port(-{@link yfiles.input.IPortCandidate candidate}) using {@link yfiles.graph.IGraph#setPorts} + * or whether to move the port the edge is currently connected to itself, instead. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IEdgePortHandleProvider} + * instances on edges. + * @see {@link yfiles.input.PortRelocationHandle} + * @see {@link yfiles.input.IHandle} + * @see {@link yfiles.input.IHandleProvider} + * @see {@link yfiles.input.OrthogonalEdgeEditingContext} + */ + edgePortHandleProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IOrthogonalEdgeHelper} + * type for the {@link yfiles.graph.IEdge}s of the graph this instance has been created for. + * Custom {@link yfiles.input.IOrthogonalEdgeHelper} implementations can be used to change the orthogonal + * edge editing behavior in the context of {@link yfiles.input.OrthogonalEdgeEditingContext}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IOrthogonalEdgeHelper} + * instances on {@link yfiles.graph.IEdge}s. + */ + orthogonalEdgeHelperDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IEdgeSnapResultProvider} + * type for the {@link yfiles.graph.IEdge}s of the graph this instance has been created for. + * Custom {@link yfiles.input.IEdgeSnapResultProvider} implementations can be used to change the snapping behavior + * of edges while they are being moved in the context of a {@link yfiles.input.GraphSnapContext}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IEdgeSnapResultProvider} + * instances on {@link yfiles.graph.IEdge}s. + */ + edgeSnapResultProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IEditLabelHelper} + * type for the {@link yfiles.graph.IEdge}s this instance has been created for. + * Custom {@link yfiles.input.IEditLabelHelper} implementations can be used to change or + * customize interactive label editing and label creation. + * This interface is mainly used by the {@link yfiles.input.GraphEditorInputMode} + * which uses the callbacks from the implementation to determine the label to + * add or edit, as well as to customize the {@link yfiles.input.TextEditorInputMode} + * appearance for the upcoming edit. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IEditLabelHelper} + * instances on {@link yfiles.graph.IEdge}s. + */ + editLabelHelperDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IBendCreator} + * type for the {@link yfiles.graph.IEdge}s of the graph this instance has been created for. + * Custom {@link yfiles.input.IBendCreator} implementations can be used to influence the interactive + * creation of new {@link yfiles.graph.IBend}s. + * This interface is mainly used by the {@link yfiles.input.CreateBendInputMode} in {@link yfiles.input.GraphEditorInputMode}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IBendCreator} + * instances on {@link yfiles.graph.IEdge}s. + */ + bendCreatorDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IBendSelectionTester} + * type for the {@link yfiles.graph.IEdge}s of the graph this instance has been created for. + * Custom {@link yfiles.input.IBendSelectionTester} implementations can be used to influence hit test behavior + * for bends on edges. + * This interface is mainly used by the {@link yfiles.input.GraphEditorInputMode} and {@link yfiles.input.CreateBendInputMode} + * to determine whether an existing bend has been hit. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IBendSelectionTester} + * instances on {@link yfiles.graph.IEdge}s. + */ + bendSelectionTesterDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.ISnapLineProvider} for the {@link yfiles.graph.IEdge}s this instance has been created for. + * Custom {@link yfiles.input.ISnapLineProvider} implementations can be used to provide custom + * {@link yfiles.input.OrthogonalSnapLine}s based on the {@link yfiles.graph.IEdge}s this instance has been created for. + * This could e.g. be a horizontal {@link yfiles.input.OrthogonalSnapLine} vertically centered between two horizontal + * segments of one of these edges. + * This interface is mainly used by the {@link yfiles.input.GraphSnapContext} to collect all available + * {@link yfiles.input.OrthogonalSnapLine}s of orthogonal edge segments. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify queries for {@link yfiles.input.ISnapLineProvider} + * instances on {@link yfiles.graph.IEdge}s. + */ + snapLineProviderDecorator:yfiles.graph.LookupDecorator; + } + var EdgeDecorator:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.EdgeDecorator} class. + * @param {yfiles.support.ILookupDecorator} decorator The decorator to use, which can be null. + */ + new (decorator:yfiles.support.ILookupDecorator):yfiles.graph.EdgeDecorator; + }; + /** + * A subclass of the {@link yfiles.graph.ItemDecorator} + * class that is specifically tailored for {@link yfiles.graph.INode}s. + * This {@link yfiles.graph.ItemDecorator} can be used + * as a convenience to {@link yfiles.support.ILookupDecorator decorate the lookup} + * of {@link yfiles.graph.INode}s in an {@link yfiles.graph.IGraph}. + * It serves as a factory for predefined {@link yfiles.graph.LookupDecorator} + * instances that are specifically useful for the {@link yfiles.graph.INode} type. + * Note that the list of possible decorations that are available using this class + * is not exhaustive in any way. This is merely a way to provide access to those + * interfaces that are more commonly being decorated by the developer. + * @see {@link yfiles.graph.GraphDecorator} + * @see {@link yfiles.graph.GraphDecoratorExtensions} + * @see {@link yfiles.graph.LookupDecorator} + */ + export interface NodeDecorator extends yfiles.graph.ItemDecorator{ + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IReshapeHandleProvider} + * type for the {@link yfiles.graph.INode}s this instance has been created for. + * Custom {@link yfiles.input.IReshapeHandleProvider} implementations can be used to change the + * number and type of {@link yfiles.input.IHandle}s that can be used by the user + * to reshape the {@link yfiles.graph.INode}s in interactively in the editor. + * This interface is mainly used by the {@link yfiles.input.GraphEditorInputMode} + * which passes the {@link yfiles.input.IHandle}s to the {@link yfiles.input.HandleInputMode}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IReshapeHandleProvider} + * instances on {@link yfiles.graph.INode}s. + */ + reshapeHandleProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IEditLabelHelper} + * type for the {@link yfiles.graph.INode}s this instance has been created for. + * Custom {@link yfiles.input.IEditLabelHelper} implementations can be used to change or + * customize interactive label editing and label creation. + * This interface is mainly used by the {@link yfiles.input.GraphEditorInputMode} + * which uses the callbacks from the implementation to determine the label to + * add or edit, as well as to customize the {@link yfiles.input.TextEditorInputMode} + * appearance for the upcoming edit. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IEditLabelHelper} + * instances on {@link yfiles.graph.INode}s. + */ + editLabelHelperDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.drawing.IShapeGeometry} + * type for the type {@link yfiles.graph.INode}s this instance has been created for. + * Custom {@link yfiles.drawing.IShapeGeometry} implementations can be used to change the + * way different code parts interpret the {@link yfiles.graph.INode#layout} of an {@link yfiles.graph.INode}. + * This interface is mainly used by the {@link yfiles.graph.DefaultEdgeIntersectionCalculator}, + * and {@link yfiles.input.ShapeGeometryPortCandidateProvider}. + * Note that decorating the {@link yfiles.drawing.IShapeGeometry} for an {@link yfiles.graph.INode} + * will not change the result of a call to {@link yfiles.drawing.INodeStyleRenderer#getShapeGeometry} + * of the {@link yfiles.graph.INode#style}. So standard hit tests will not be influenced by such a change. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.drawing.IShapeGeometry} + * instances on {@link yfiles.graph.INode}s. + */ + shapeGeometryDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.ISizeConstraintProvider} + * type for the type {@link yfiles.graph.INode}s this instance has been created for. + * Custom {@link yfiles.input.ISizeConstraintProvider} implementations can be used to add constraints + * to the size of a node. These constraints are used by the default {@link yfiles.input.IReshapeHandleProvider} + * implementation for nodes to enforce size constraints for interactive resize gestures. + * Also {@link yfiles.input.GraphEditorInputMode} uses this interface to constrain the size of a node + * whenever its labels are being edited interactively. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.ISizeConstraintProvider} + * instances on {@link yfiles.graph.INode}s. + */ + sizeConstraintProviderDecorator:yfiles.graph.LookupDecorator>; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.drawing.IGroupBoundsCalculator} + * type for the {@link yfiles.graph.INode}s this instance has been created for. + * Custom {@link yfiles.drawing.IGroupBoundsCalculator} implementations can be used to change the + * way the bounds of {@link yfiles.graph.IGroupedGraph#createGroupNodeWithParentBoundsStyleAndTag group nodes} + * are being calculated in the context of {@link yfiles.graph.IGroupedGraph} if the geometry + * of child nodes is changed by the user and {@link yfiles.graph.IGroupedGraph#autoAdjustGroupNodeBounds} + * is turned on. + * This interface is mainly used by the the implementation of {@link yfiles.graph.IGroupedGraph} + * which uses the callback to determine the bounds of a group node whenever appropriate. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.drawing.IGroupBoundsCalculator} + * instances on {@link yfiles.graph.INode}s. + */ + groupBoundsCalculatorDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.drawing.IInsetsProvider} (tied to the {@link yfiles.graph.INode} type parameter) + * for the {@link yfiles.graph.INode}s this instance has been created for. + * Custom {@link yfiles.drawing.IInsetsProvider} implementations can be used to change the + * way the bounds of {@link yfiles.graph.IGroupedGraph#createGroupNodeWithParentBoundsStyleAndTag group nodes} + * are being calculated in the context of {@link yfiles.graph.IGroupedGraph} if the geometry + * of child nodes is changed by the user and {@link yfiles.graph.IGroupedGraph#autoAdjustGroupNodeBounds} + * is turned on. This interface will be used if there is no custom {@link yfiles.drawing.IGroupBoundsCalculator} + * associated with the nodes (see {@link yfiles.graph.NodeDecorator#groupBoundsCalculatorDecorator}). + * This interface is mainly used by the the implementation of {@link yfiles.graph.IGroupedGraph} + * which uses the callback to determine the bounds of a group node whenever appropriate. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Note that many {@link yfiles.drawing.INodeStyle} implementations provide an Insets + * property whose value will be reported by a {@link yfiles.drawing.IInsetsProvider} implementation + * that is provided by the corresponding {@link yfiles.drawing.INodeStyleRenderer}. Using this property + * instead of decorating the lookup of the {@link yfiles.graph.INode} is thus often simpler. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.drawing.IInsetsProvider} + * instances on {@link yfiles.graph.INode}s. + */ + insetsProviderDecorator:yfiles.graph.LookupDecorator>; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IPortCandidateProvider} + * for the {@link yfiles.graph.INode}s this instance has been created for. + * Custom {@link yfiles.input.IPortCandidateProvider} implementations can be used to + * present the user with a set of {@link yfiles.input.IPortCandidate}s + * that newly created edges can use as their {@link yfiles.graph.IEdge#sourcePort source} + * and {@link yfiles.graph.IEdge#targetPort target} {@link yfiles.graph.IPort}s. + * This interface is mainly used by the {@link yfiles.input.CreateEdgeInputMode} + * mode of {@link yfiles.input.GraphEditorInputMode}. Also {@link yfiles.input.DefaultEdgePortsCandidateProvider} + * will use this interface to determine the candidates that are available if the user + * interactively moves the ports using {@link yfiles.input.PortRelocationHandle} (see {@link yfiles.graph.PortDecorator#handleDecorator}). + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IPortCandidateProvider} + * instances on {@link yfiles.graph.INode}s. + */ + portCandidateProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.ISnapLineProvider} for the {@link yfiles.graph.INode}s this instance has been created for. + * Custom {@link yfiles.input.ISnapLineProvider} implementations can be used to provide custom + * {@link yfiles.input.OrthogonalSnapLine}s based on the {@link yfiles.graph.INode}s this instance has been created for. + * This could e.g. be a horizontal {@link yfiles.input.OrthogonalSnapLine} at the vertical center of the node to which + * other nodes should snap with their top border. + * This interface is mainly used by the {@link yfiles.input.GraphSnapContext} to collect all available + * {@link yfiles.input.OrthogonalSnapLine}s. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify queries for {@link yfiles.input.ISnapLineProvider} + * instances on {@link yfiles.graph.INode}s. + */ + snapLineProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.INodeSnapResultProvider} for the {@link yfiles.graph.INode}s this instance has been created for. + * Custom {@link yfiles.input.INodeSnapResultProvider} implementations can be used to provide custom + * {@link yfiles.input.SnapResult}s based on the {@link yfiles.graph.INode}s this instance has been created for. + * This could e.g. be a {@link yfiles.input.SnapResult} describing that the top left corner of the node + * wants to snap to a grid point. + * This interface is mainly used by the default {@link yfiles.input.IPositionHandler} for {@link yfiles.graph.INode}s to collect {@link yfiles.input.SnapResult}s + * during a drag gesture for the node. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify queries for {@link yfiles.input.INodeSnapResultProvider} + * instances on {@link yfiles.graph.INode}s. + */ + nodeSnapResultProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.ISnapLineProvider} for the {@link yfiles.graph.INode}s this instance has been created for. + * Custom {@link yfiles.input.INodeReshapeSnapResultProvider} implementations can be used to provide custom + * {@link yfiles.input.SnapResult}s based on the {@link yfiles.graph.INode}s this instance has been created for. + * This could e.g. be a {@link yfiles.input.SnapResult} describing that the top left corner of the node + * wants to snap to a grid point. + * This interface is mainly used by the default {@link yfiles.input.IReshapeHandler} for {@link yfiles.graph.INode}s to collect {@link yfiles.input.SnapResult}s + * during a resize gesture for the node. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify queries for {@link yfiles.input.ISnapLineProvider} + * instances on {@link yfiles.graph.INode}s. + */ + nodeReshapeSnapResultProviderDecorator:yfiles.graph.LookupDecorator; + } + var NodeDecorator:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.NodeDecorator} class. + * @param {yfiles.support.ILookupDecorator} decorator The decorator to use, which can be null. + */ + new (decorator:yfiles.support.ILookupDecorator):yfiles.graph.NodeDecorator; + }; + /** + * A convenience class that facilitates the process of using {@link yfiles.support.ILookupDecorator}. + * This class provides convenience methods that help in performing common tasks related + * to decorating the {@link yfiles.support.ILookup#lookup} method for a certain TDecoratedType. + * @see {@link yfiles.support.ILookup} + * @see {@link yfiles.graph.GraphDecorator} + * @see {@link yfiles.support.LookupExtensions} + */ + export interface LookupDecorator extends Object{ + /** + * Gets the decorator instance that is used by this instance. + * Value: The decorator, which can be null in which case all method of this class + * perform nothing. + */ + decorator:yfiles.support.ILookupDecorator; + /** + * Gets or sets a value indicating whether calls that make it possible to wrap existing implementations + * ({@link yfiles.graph.LookupDecorator#setImplementationWrapperWithPredicate} and + * {@link yfiles.graph.LookupDecorator#setImplementationWrapper}) that yield null. + * Value: true if null implementation should be wrapped; otherwise, false, in which case the null + * will be the result. + * @see {@link yfiles.graph.LookupDecorator#setImplementationWrapperWithPredicate} + * @see {@link yfiles.graph.LookupDecorator#setImplementationWrapper} + */ + decorateNulls:boolean; + /** + * Gets or sets a value indicating how a null result value of the {@link yfiles.graph.LookupDecorator#setImplementationWithPredicate} + * and {@link yfiles.graph.LookupDecorator#setFactory} methods should be interpreted. + * Value: true if null return values should tell the mechanism to use the fallback value, which is the result of the remainder + * of the {@link yfiles.support.LookupChain}; otherwise, false, which will make null the result of this lookup call. + * @see {@link yfiles.graph.LookupDecorator#setImplementationWithPredicate} + * @see {@link yfiles.graph.LookupDecorator#setFactory} + */ + nullIsFallback:boolean; + /** + * Adds a {@link yfiles.support.IContextLookupChainLink link to the chain}, that will yield implementation + * if TInterface is queried on the forItem's {@link yfiles.support.ILookup#lookup}. + * This is the same as adding a {@link yfiles.support.IContextLookupChainLink} to the {@link yfiles.graph.LookupDecorator#decorator} that + * will check whether the context that is passed to {@link yfiles.support.IContextLookup#lookupForItem} is the same as forItem + * and an implementation of TInterface is requested and will then return implementation. + * @param {TDecoratedType} forItem The item for which the implementation shall be returned. + * @param {TInterface} implementation The implementation to return if forItem + * is queried for TInterface. + * @return {yfiles.support.IContextLookupChainLink} + * The {@link yfiles.support.IContextLookupChainLink} implementation that has been {@link yfiles.support.ILookupDecorator#addLookup added} + * to the {@link yfiles.graph.LookupDecorator#decorator} as a result of this call, or null if the decoration was unsuccessful. + * Using {@link yfiles.support.ILookupDecorator#removeLookup}, the effect of this call can be undone. + * @see {@link yfiles.support.ILookupDecorator#addLookup} + * @see {@link yfiles.support.LookupExtensions} + */ + setImplementationForItem(forItem:TDecoratedType,implementation:TInterface):yfiles.support.IContextLookupChainLink; + /** + * Adds a {@link yfiles.support.IContextLookupChainLink link to the chain}, that will yield implementation + * if TInterface is queried during the {@link yfiles.support.ILookup#lookup} + * on all items that match the predicate. + * This is the same as adding a {@link yfiles.support.IContextLookupChainLink} to the {@link yfiles.graph.LookupDecorator#decorator} that + * will check whether the context that is passed to {@link yfiles.support.IContextLookup#lookupForItem} matches the predicate + * and an implementation of TInterface is requested and will then return implementation. + * @param {function(TDecoratedType):boolean} predicate The predicate that determines for which items the implementation shall be returned. + * @param {TInterface} implementation The implementation to return if the predicate matches. + * @return {yfiles.support.IContextLookupChainLink} + * The {@link yfiles.support.IContextLookupChainLink} implementation that has been {@link yfiles.support.ILookupDecorator#addLookup added} + * to the {@link yfiles.graph.LookupDecorator#decorator} as a result of this call, or null if the decoration was unsuccessful. + * Using {@link yfiles.support.ILookupDecorator#removeLookup}, the effect of this call can be undone. + * @see {@link yfiles.support.ILookupDecorator#addLookup} + * @see {@link yfiles.support.LookupExtensions} + */ + setImplementationWithPredicate(predicate:(obj:TDecoratedType)=>boolean,implementation:TInterface):yfiles.support.IContextLookupChainLink; + /** + * Adds a {@link yfiles.support.IContextLookupChainLink link to the chain}, that will always yield singletonImplementation + * if TInterface is queried during the {@link yfiles.support.ILookup#lookup}. + * This is the same as adding a {@link yfiles.support.IContextLookupChainLink} to the {@link yfiles.graph.LookupDecorator#decorator} that + * will check whether an implementation of TInterface is requested and will then return singletonImplementation. + * @param {TInterface} singletonImplementation The implementation to return unconditionally. + * @return {yfiles.support.IContextLookupChainLink} + * The {@link yfiles.support.IContextLookupChainLink} implementation that has been {@link yfiles.support.ILookupDecorator#addLookup added} + * to the {@link yfiles.graph.LookupDecorator#decorator} as a result of this call, or null if the decoration was unsuccessful. + * Using {@link yfiles.support.ILookupDecorator#removeLookup}, the effect of this call can be undone. + * @see {@link yfiles.support.ILookupDecorator#addLookup} + * @see {@link yfiles.support.LookupExtensions} + */ + setImplementation(singletonImplementation:TInterface):yfiles.support.IContextLookupChainLink; + /** + * Adds a {@link yfiles.support.IContextLookupChainLink link to the chain}, that will use a factory + * if TInterface is queried during the {@link yfiles.support.ILookup#lookup} + * on all items that match the predicate. + * This is the same as adding a {@link yfiles.support.IContextLookupChainLink} to the {@link yfiles.graph.LookupDecorator#decorator} that + * will check whether the context that is passed to {@link yfiles.support.IContextLookup#lookupForItem} matches the predicate + * and an implementation of TInterface is requested and will then use the factory + * to create the result. + * @param {function(TDecoratedType):boolean} predicate The predicate that determines for which items the factory shall be called. + * @param {function(TDecoratedType):TInterface} factory The factory that is queried to create the result. + * @return {yfiles.support.IContextLookupChainLink} + * The {@link yfiles.support.IContextLookupChainLink} implementation that has been {@link yfiles.support.ILookupDecorator#addLookup added} + * to the {@link yfiles.graph.LookupDecorator#decorator} as a result of this call, or null if the decoration was unsuccessful. + * Using {@link yfiles.support.ILookupDecorator#removeLookup}, the effect of this call can be undone. + * @see {@link yfiles.support.ILookupDecorator#addLookup} + * @see {@link yfiles.support.LookupExtensions} + */ + setFactoryWithPredicate(predicate:(obj:TDecoratedType)=>boolean,factory:(context:TDecoratedType)=>TInterface):yfiles.support.IContextLookupChainLink; + /** + * Adds a {@link yfiles.support.IContextLookupChainLink link to the chain}, that will use a factory + * callback that wraps the underlying implementation + * if TInterface is queried during the {@link yfiles.support.ILookup#lookup} + * on all items that match the predicate. + * This is the same as adding a {@link yfiles.support.IContextLookupChainLink} to the {@link yfiles.graph.LookupDecorator#decorator} that + * will check whether the context that is passed to {@link yfiles.support.IContextLookup#lookupForItem} matches the predicate + * and an implementation of TInterface is requested and will then use the factory + * to wrap the underlying implementation. + * Note that depending on {@link yfiles.graph.LookupDecorator#decorateNulls}, the factory will not not be called to decorate null + * results. + * @param {function(TDecoratedType):boolean} predicate The predicate that determines for which items the wrapping shall be performed. + * @param {function(TDecoratedType, TInterface):TInterface} factory The factory that will be passed the underlying implementation and that is queried to create the result. + * @return {yfiles.support.IContextLookupChainLink} + * The {@link yfiles.support.IContextLookupChainLink} implementation that has been {@link yfiles.support.ILookupDecorator#addLookup added} + * to the {@link yfiles.graph.LookupDecorator#decorator} as a result of this call, or null if the decoration was unsuccessful. + * Using {@link yfiles.support.ILookupDecorator#removeLookup}, the effect of this call can be undone. + * @see {@link yfiles.support.ILookupDecorator#addLookup} + * @see {@link yfiles.support.LookupExtensions} + */ + setImplementationWrapperWithPredicate(predicate:(obj:TDecoratedType)=>boolean,factory:(item:TDecoratedType,baseImplementation:TInterface)=>TInterface):yfiles.support.IContextLookupChainLink; + /** + * Adds a {@link yfiles.support.IContextLookupChainLink link to the chain}, that will use a factory + * if TInterface is queried during the {@link yfiles.support.ILookup#lookup} + * on all items that of type TDecoratedType. + * This is the same as adding a {@link yfiles.support.IContextLookupChainLink} to the {@link yfiles.graph.LookupDecorator#decorator} that + * will check whether + * an implementation of TInterface is requested and will then use the factory + * to create the result. + * Note that depending on {@link yfiles.graph.LookupDecorator#nullIsFallback} the implementation will either yield null + * factory results as the final result or interpret it as the fallback value in which case the remainder of the lookup + * chain is queried for the result. + * @param {function(TDecoratedType):TInterface} factory The factory that is queried to create the result. + * @return {yfiles.support.IContextLookupChainLink} + * The {@link yfiles.support.IContextLookupChainLink} implementation that has been {@link yfiles.support.ILookupDecorator#addLookup added} + * to the {@link yfiles.graph.LookupDecorator#decorator} as a result of this call, or null if the decoration was unsuccessful. + * Using {@link yfiles.support.ILookupDecorator#removeLookup}, the effect of this call can be undone. + * @see {@link yfiles.support.ILookupDecorator#addLookup} + * @see {@link yfiles.support.LookupExtensions} + */ + setFactory(factory:(context:TDecoratedType)=>TInterface):yfiles.support.IContextLookupChainLink; + /** + * Adds a {@link yfiles.support.IContextLookupChainLink link to the chain}, that will use a factory + * callback that wraps the underlying implementation + * if TInterface is queried during the {@link yfiles.support.ILookup#lookup} + * on all TDecoratedType items. + * This is the same as adding a {@link yfiles.support.IContextLookupChainLink} to the {@link yfiles.graph.LookupDecorator#decorator} that + * will check whether an implementation of TInterface is requested and will then use the factory + * to wrap the underlying implementation. + * Note that depending on {@link yfiles.graph.LookupDecorator#decorateNulls}, the factory will not not be called to decorate null + * results. + * @param {function(TDecoratedType, TInterface):TInterface} factory The factory that will be passed the underlying implementation and that is queried to create the result. + * @return {yfiles.support.IContextLookupChainLink} + * The {@link yfiles.support.IContextLookupChainLink} implementation that has been {@link yfiles.support.ILookupDecorator#addLookup added} + * to the {@link yfiles.graph.LookupDecorator#decorator} as a result of this call, or null if the decoration was unsuccessful. + * Using {@link yfiles.support.ILookupDecorator#removeLookup}, the effect of this call can be undone. + * @see {@link yfiles.support.ILookupDecorator#addLookup} + * @see {@link yfiles.support.LookupExtensions} + */ + setImplementationWrapper(factory:(item:TDecoratedType,baseImplementation:TInterface)=>TInterface):yfiles.support.IContextLookupChainLink; + /** + * Adds a {@link yfiles.support.IContextLookupChainLink link to the chain}, that will yield null + * if TInterface is queried during the {@link yfiles.support.ILookup#lookup} + * on all TDecoratedType items. + * This is the same as adding a {@link yfiles.support.IContextLookupChainLink} to the {@link yfiles.graph.LookupDecorator#decorator} that + * will unconditionally yield null if TInterface is queried on + * TDecoratedType items. + * @return {yfiles.support.IContextLookupChainLink} + * The {@link yfiles.support.IContextLookupChainLink} implementation that has been {@link yfiles.support.ILookupDecorator#addLookup added} + * to the {@link yfiles.graph.LookupDecorator#decorator} as a result of this call, or null if the decoration was unsuccessful. + * Using {@link yfiles.support.ILookupDecorator#removeLookup}, the effect of this call can be undone. + * @see {@link yfiles.support.ILookupDecorator#addLookup} + * @see {@link yfiles.support.LookupExtensions} + */ + hideImplementation():yfiles.support.IContextLookupChainLink; + /** + * Adds a {@link yfiles.support.IContextLookupChainLink link to the chain}, that will yield null + * if TInterface is queried during the {@link yfiles.support.ILookup#lookup} + * on all TDecoratedType items that match the predicate. + * This is the same as adding a {@link yfiles.support.IContextLookupChainLink} to the {@link yfiles.graph.LookupDecorator#decorator} that + * will yield null if TInterface is queried on + * TDecoratedType items that match the predicate. + * @return {yfiles.support.IContextLookupChainLink} + * The {@link yfiles.support.IContextLookupChainLink} implementation that has been {@link yfiles.support.ILookupDecorator#addLookup added} + * to the {@link yfiles.graph.LookupDecorator#decorator} as a result of this call, or null if the decoration was unsuccessful. + * Using {@link yfiles.support.ILookupDecorator#removeLookup}, the effect of this call can be undone. + * @see {@link yfiles.support.ILookupDecorator#addLookup} + * @see {@link yfiles.support.LookupExtensions} + */ + hideImplementationWithPredicate(predicate:(obj:TDecoratedType)=>boolean):yfiles.support.IContextLookupChainLink; + /** + * Simple helper method that tries to add the provided chain link to the {@link yfiles.graph.LookupDecorator#decorator}. + * @param {yfiles.support.IContextLookupChainLink} link The link to add. + * @return {yfiles.support.IContextLookupChainLink} + * The link that has been {@link yfiles.support.ILookupDecorator#addLookup added} + * to the {@link yfiles.graph.LookupDecorator#decorator} as a result of this call, or null if the decoration was unsuccessful. + * @see {@link yfiles.support.ILookupDecorator#addLookup} + * @see {@link yfiles.support.LookupExtensions} + */ + addChainLink(link:yfiles.support.IContextLookupChainLink):yfiles.support.IContextLookupChainLink; + } + var LookupDecorator:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.LookupDecorator} class. + * @param {yfiles.support.ILookupDecorator} decorator The decorator instance that will be used to {@link yfiles.support.ILookupDecorator#addLookup} + * add lookup . + * @param {boolean} decorateNulls The initial value of the {@link yfiles.graph.LookupDecorator#decorateNulls} property. + * @param {boolean} nullIsFallback The initial value of the {@link yfiles.graph.LookupDecorator#nullIsFallback} property. + */ + new (decoratedType:yfiles.lang.Class,interfaceType:yfiles.lang.Class,decorator:yfiles.support.ILookupDecorator,decorateNulls:boolean,nullIsFallback:boolean):yfiles.graph.LookupDecorator; + }; + /** + * A subclass of the {@link yfiles.graph.ItemDecorator} + * class that is specifically tailored for {@link yfiles.graph.IBend}s. + * This {@link yfiles.graph.ItemDecorator} can be used + * as a convenience to {@link yfiles.support.ILookupDecorator decorate the lookup} + * of {@link yfiles.graph.IBend}s in an {@link yfiles.graph.IGraph}. + * It serves as a factory for predefined {@link yfiles.graph.LookupDecorator} + * instances that are specifically useful for the {@link yfiles.graph.IBend} type. + * Note that the list of possible decorations that are available using this class + * is not exhaustive in any way. This is merely a way to provide access to those + * interfaces that are more commonly being decorated by the developer. + * @see {@link yfiles.graph.GraphDecorator} + * @see {@link yfiles.graph.GraphDecoratorExtensions} + * @see {@link yfiles.graph.LookupDecorator} + */ + export interface BendDecorator extends yfiles.graph.ItemDecorator{ + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IHandle} + * type for the {@link yfiles.graph.IBend}s of the graph this instance has been created for. + * Custom {@link yfiles.input.IHandle} implementations can be used to change the way + * the user can drag a bend interactively to change its position + * in a {@link yfiles.canvas.GraphControl}. + * This interface is mainly used by the {@link yfiles.input.HandleInputMode} in {@link yfiles.input.GraphEditorInputMode}. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IHandle} + * instances on {@link yfiles.graph.IEdge}s. + */ + handleDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IBendSnapResultProvider} for the {@link yfiles.graph.IBend}s this instance has been created for. + * Custom {@link yfiles.input.IBendSnapResultProvider} implementations can be used to provide custom + * {@link yfiles.input.SnapResult}s based on the {@link yfiles.graph.IBend}s this instance has been created for. + * This could e.g. be a {@link yfiles.input.SnapResult} describing that the bend wants to snap vertically to the + * top border of a node. + * This interface is mainly used by the default {@link yfiles.input.IHandle} for {@link yfiles.graph.IBend}s to collect {@link yfiles.input.SnapResult}s + * during a drag gesture for the bend. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify queries for {@link yfiles.input.IBendSnapResultProvider} + * instances on {@link yfiles.graph.IBend}s. + */ + bendSnapResultProviderDecorator:yfiles.graph.LookupDecorator; + } + var BendDecorator:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.BendDecorator} class. + * @param {yfiles.support.ILookupDecorator} decorator The decorator to use, which can be null. + */ + new (decorator:yfiles.support.ILookupDecorator):yfiles.graph.BendDecorator; + }; + /** + * A subclass of the {@link yfiles.graph.ItemDecorator} + * class that is specifically tailored for {@link yfiles.graph.IPort}s. + * This {@link yfiles.graph.ItemDecorator} can be used + * as a convenience to {@link yfiles.support.ILookupDecorator decorate the lookup} + * of {@link yfiles.graph.IPort}s in an {@link yfiles.graph.IGraph}. + * It serves as a factory for predefined {@link yfiles.graph.LookupDecorator} + * instances that are specifically useful for the {@link yfiles.graph.IPort} type. + * @see {@link yfiles.graph.GraphDecorator} + * @see {@link yfiles.graph.GraphDecoratorExtensions} + * @see {@link yfiles.graph.LookupDecorator} + */ + export interface PortDecorator extends yfiles.graph.ItemDecorator{ + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IHandle} + * type for the {@link yfiles.graph.IPort}s of the graph this instance has been created for. + * Custom {@link yfiles.input.IHandle} implementations can be used to change the way + * the user can drag a port interactively to change its position + * in a {@link yfiles.canvas.GraphControl}. + * This interface is mainly used by the {@link yfiles.input.HandleInputMode} in {@link yfiles.input.GraphEditorInputMode} + * which obtains the {@link yfiles.input.IHandle} from the {@link yfiles.graph.IPort} by querying the + * {@link yfiles.input.IHandleProvider} from it, which in turn will query the {@link yfiles.input.IHandle} + * from itself. Alternatively, selected nodes can put the {@link yfiles.input.IHandle} of their ports + * into their {@link yfiles.input.IHandleProvider} implementation. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.input.IHandle} + * instances on {@link yfiles.graph.IPort}s. + */ + handleDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.drawing.IEdgeIntersectionCalculator} + * type for the {@link yfiles.graph.IPort}s of the graph this instance has been created for. + * Custom {@link yfiles.drawing.IEdgeIntersectionCalculator} implementations can be used to change the way + * the path of {@link yfiles.drawing.PathBasedEdgeStyleRenderer`1} implementations + * calculate the {@link yfiles.drawing.GeneralPath} of the visual representation of an {@link yfiles.graph.IEdge} + * in a {@link yfiles.canvas.GraphControl}. + * This interface is mainly used by the {@link yfiles.drawing.PathBasedEdgeStyleRenderer`1} to + * find the intersection of an edge with the bounds of the adjacent node to properly crop + * the edge path. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify the queries for + * {@link yfiles.drawing.IEdgeIntersectionCalculator} + * instances on {@link yfiles.graph.IPort}s. + */ + edgeIntersectionDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.ISnapLineProvider} for the {@link yfiles.graph.IPort}s this instance has been created for. + * Custom {@link yfiles.input.ISnapLineProvider} implementations can be used to provide custom + * {@link yfiles.input.OrthogonalSnapLine}s based on the {@link yfiles.graph.IPort}s this instance has been created for. + * This could e.g. be a {@link yfiles.input.OrthogonalSnapLine} with a horizontal or vertical offset to the port's location. + * This interface is mainly used by the {@link yfiles.input.GraphSnapContext} to collect all available + * {@link yfiles.input.OrthogonalSnapLine}s. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify queries for {@link yfiles.input.ISnapLineProvider} + * instances on {@link yfiles.graph.IPort}s. + */ + snapLineProviderDecorator:yfiles.graph.LookupDecorator; + /** + * Gets a {@link yfiles.graph.LookupDecorator} that decorates the + * {@link yfiles.input.IPortSnapResultProvider} for the {@link yfiles.graph.IPort}s this instance has been created for. + * Custom {@link yfiles.input.IPortSnapResultProvider} implementations can be used to provide custom + * {@link yfiles.input.SnapResult}s based on the {@link yfiles.graph.IPort}s this instance has been created for. + * This could e.g. be a {@link yfiles.input.SnapResult} describing that the port wants to snap to a grid point. + * This interface is mainly used by the {@link yfiles.input.PortLocationModelParameterHandle} to collect {@link yfiles.input.SnapResult}s + * during a drag gesture for the port. + * This is a convenient alternative to the direct usage of the {@link yfiles.support.ILookupDecorator} + * that is provided by the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup#lookup}. + * Value: A decorator that can be used to modify queries for {@link yfiles.input.IPortSnapResultProvider} + * instances on {@link yfiles.graph.IPort}s. + */ + portSnapResultProviderDecorator:yfiles.graph.LookupDecorator; + } + var PortDecorator:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.PortDecorator} class. + * @param {yfiles.support.ILookupDecorator} decorator The decorator to use, which can be null. + */ + new (decorator:yfiles.support.ILookupDecorator):yfiles.graph.PortDecorator; + }; + /** + * A simple implementation of the {@link yfiles.graph.IDummyEdgeConverter} interface + * for use in the {@link yfiles.graph.FoldingManager#dummyEdgeConverter} property, that will + * prevent dummy edges from appearing in the {@link yfiles.graph.IFoldedGraph} view. + */ + export interface ExcludingDummyEdgeConverter extends Object,yfiles.graph.IDummyEdgeConverter{ + /** + * Always calls {@link yfiles.graph.IAddDummyEdgeCallback#excludeDummyEdge}. + * @see Specified by {@link yfiles.graph.IDummyEdgeConverter#addDummyEdge}. + */ + addDummyEdge(callback:yfiles.graph.IAddDummyEdgeCallback,foldedGraph:yfiles.graph.IFoldedGraph,masterEdge:yfiles.graph.IEdge,localSourceNode:yfiles.graph.INode,sourceDummy:boolean,localTargetNode:yfiles.graph.INode,targetDummy:boolean):yfiles.graph.IEdge; + /** + * Does nothing and should not normally be called by the view since all dummy edges are excluded from it. + * @see Specified by {@link yfiles.graph.IDummyEdgeConverter#changeDummyEdgeAppearance}. + */ + changeDummyEdgeAppearance(callback:yfiles.graph.IChangeDummyEdgeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,dummyEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Does nothing and should not normally be called by the view since all dummy edges are excluded from it. + * @see Specified by {@link yfiles.graph.IDummyEdgeConverter#createDummyEdgeAppearance}. + */ + createDummyEdgeAppearance(callback:yfiles.graph.IChangeDummyEdgeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,dummyEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + } + var ExcludingDummyEdgeConverter:{ + $class:yfiles.lang.Class; + }; + /** + * A simple implementation of the {@link yfiles.graph.IDummyEdgeConverter} interface + * that will make the {@link yfiles.graph.IFoldedGraph} view contain at most one + * dummy edge between each pair of nodes by letting a single dummy edge + * represent all master edges. + * This implementation by default, will have the {@link yfiles.graph.AbstractDummyEdgeConverter#resetDummyPorts} + * property and the {@link yfiles.graph.AbstractDummyEdgeConverter#resetBends} property set to true. + */ + export interface MergingDummyEdgeConverter extends yfiles.graph.AbstractDummyEdgeConverter{ + /** + * Gets or sets a value indicating whether edge direction should be ignored for the determination of + * the {@link yfiles.graph.IAddDummyEdgeCallback#getExistingDummyEdges existing dummy edges}. + * Value: true if edge direction should be ignored; otherwise, false. + */ + ignoreEdgeDirection:boolean; + /** + * Tries to add the dummy edge to an {@link yfiles.graph.IAddDummyEdgeCallback#getExistingDummyEdges existing} + * dummy edge, considering the {@link yfiles.graph.MergingDummyEdgeConverter#ignoreEdgeDirection} property. + * If this is the first dummy edge that connects the source and target node, this method will + * use the {@link yfiles.graph.MergingDummyEdgeConverter#addFirstSeparateEdge} callback to create the initial representative. + * @see Overrides {@link yfiles.graph.AbstractDummyEdgeConverter#addDummyEdge} + * @see Specified by {@link yfiles.graph.IDummyEdgeConverter#addDummyEdge}. + */ + addDummyEdge(callback:yfiles.graph.IAddDummyEdgeCallback,foldedGraph:yfiles.graph.IFoldedGraph,masterEdge:yfiles.graph.IEdge,localSourceNode:yfiles.graph.INode,sourceDummy:boolean,localTargetNode:yfiles.graph.INode,targetDummy:boolean):yfiles.graph.IEdge; + /** + * Adds the first separate edge to the source and target node pair using the {@link yfiles.graph.IAddDummyEdgeCallback#addAsSeparateEdge} method. + */ + addFirstSeparateEdge(callback:yfiles.graph.IAddDummyEdgeCallback,foldedGraph:yfiles.graph.IFoldedGraph,masterEdge:yfiles.graph.IEdge,localSourceNode:yfiles.graph.INode,sourceDummy:boolean,localTargetNode:yfiles.graph.INode,targetDummy:boolean):yfiles.graph.IEdge; + } + var MergingDummyEdgeConverter:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.MergingDummyEdgeConverter} class. + */ + new ():yfiles.graph.MergingDummyEdgeConverter; + }; + /** + * The default implementation of the {@link yfiles.graph.IDummyEdgeConverter} that + * is used by the {@link yfiles.graph.FoldingManager} initially and can be customized to suit the application's needs. + * @see {@link yfiles.graph.AbstractDummyEdgeConverter} + * @see {@link yfiles.graph.DefaultDummyEdgeConverter#reuseMasterPorts} + */ + export interface DefaultDummyEdgeConverter extends yfiles.graph.AbstractDummyEdgeConverter{ + /** + * Gets or sets a property that determines whether this implementation should + * reuse the ports + * of the {@link yfiles.graph.FoldingManager#masterGraph} + * at non-{@link yfiles.graph.IFoldedGraph#isDummy dummy} nodes for the dummy edges. + * The {@link yfiles.graph.IFoldedGraph} view can be configured to use separate port instances for + * dummy edges. This makes it possible to assign different styles and locations to + * source and target ports of dummy edges, which may be desirable if the style and geometry of dummy edges + * differs a lot from the style of the master edges. + * Dummy edges may of course still connect to non-dummy nodes at one of their ports. Setting this + * property to true will make the dummy edge connect to the + * {@link yfiles.graph.IFoldedGraph#getRepresentative representing} port instance. + * This property can be set to true, iff the graph model used is port-centric, i.e. each edge + * connects to specific ports and even dummy edges should still connect to those specific port representatives. + * The default value is false + * @see {@link yfiles.graph.DefaultDummyEdgeConverter#reuseDummyNodePorts} + */ + reuseMasterPorts:boolean; + /** + * Gets or sets a property that determines whether this implementation should + * reuse the ports of {@link yfiles.graph.IFoldedGraph#isDummy dummy} nodes for the dummy edges. + * The {@link yfiles.graph.IFoldedGraph} view can be configured to use separate port instances for + * dummy edges. This makes it possible to assign different styles and locations to + * source and target ports of dummy edges, which may be desirable if the style and geometry of dummy edges + * differs a lot from the style of the master edges. + * Dummy nodes ({@link yfiles.graph.IFoldedGraph#collapse collapsed} group nodes), will have all of + * their master's ports {@link yfiles.graph.IFoldedGraph#getRepresentative represented} + * in the view. This property can be used to make dummy edges that connect to the master ports + * connect to these dummy port instances instead of creating extra dummy ports for the edges. + * Note that ports can only be automatically reused by dummy edges if they still connect to the same nodes. Otherwise + * the view will have to create new dummy ports to let the edges connect to the representing adjacent nodes. + * This property can be set to true, iff the graph model used is port-centric, i.e. each edge + * connects to specific ports and even dummy edges should still connect to those specific port instances, if + * possible. + * The default value is false. + * @see {@link yfiles.graph.DefaultDummyEdgeConverter#reuseMasterPorts} + */ + reuseDummyNodePorts:boolean; + /** + * Actually adds the dummy edge as a {@link yfiles.graph.IAddDummyEdgeCallback#addAsSeparateEdge separate edge} + * to the view, reusing existing port {@link yfiles.graph.IFoldedGraph#getRepresentative representatives} + * of the original source and target port, if {@link yfiles.graph.DefaultDummyEdgeConverter#reuseMasterPorts} is enabled and that is possible for the given edge. + * @param {yfiles.graph.IAddDummyEdgeCallback} callback The {@link yfiles.graph.IAddDummyEdgeCallback} implementation. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The instance into which the dummy edge is going to be inserted. + * @param {yfiles.graph.IEdge} masterEdge The edge from the {@link yfiles.graph.FoldingManager#masterGraph} that needs to be represented by a dummy + * edge. + * @param {yfiles.graph.INode} localSourceNode The source node that belongs to the {@link yfiles.graph.IFoldedGraph} view that will act as the local + * representative of the actual source node. + * @param {boolean} sourceDummy Determines whether the localSourceNode is currently a dummy node. + * @param {yfiles.graph.INode} localTargetNode The target node that belongs to the {@link yfiles.graph.IFoldedGraph} view that will act as the local + * representative of the actual target node. + * @param {boolean} targetDummy Determines whether the localTargetNode is currently a dummy node. + * @return {yfiles.graph.IEdge} The edge as returned by the call to {@link yfiles.graph.IAddDummyEdgeCallback#addAsSeparateEdge}. + * @see Overrides {@link yfiles.graph.AbstractDummyEdgeConverter#addDummyEdge} + * @see Specified by {@link yfiles.graph.IDummyEdgeConverter#addDummyEdge}. + */ + addDummyEdge(callback:yfiles.graph.IAddDummyEdgeCallback,foldedGraph:yfiles.graph.IFoldedGraph,masterEdge:yfiles.graph.IEdge,localSourceNode:yfiles.graph.INode,sourceDummy:boolean,localTargetNode:yfiles.graph.INode,targetDummy:boolean):yfiles.graph.IEdge; + } + var DefaultDummyEdgeConverter:{ + $class:yfiles.lang.Class; + new ():yfiles.graph.DefaultDummyEdgeConverter; + }; + /** + * Simple default implementation of the {@link yfiles.graph.IDummyNodeConverter} interface that + * is used by the {@link yfiles.graph.FoldingManager}'s {@link yfiles.graph.FoldingManager#dummyNodeConverter} + * property. + * This class has a couple of properties that can be adjusted to customize the behavior. Also, it contains + * a number of callback methods for conveniently overriding the implementation in custom sub classes. + * @see {@link yfiles.graph.FoldingManager} + * @see {@link yfiles.graph.IDummyNodeConverter} + * @see {@link yfiles.graph.DefaultDummyEdgeConverter} + */ + export interface DefaultDummyNodeConverter extends Object,yfiles.graph.IDummyNodeConverter{ + /** + * Gets or sets the {@link yfiles.drawing.INodeStyle} to use for the {@link yfiles.graph.IFoldedGraph#collapse collapsed} group nodes. + * Depending on the {@link yfiles.graph.DefaultDummyNodeConverter#cloneNodeStyle} property this implementation will + * assign a {@link yfiles.system.ICloneable#clone} to the property or this instance. + *

+ * A value of null will leave the style property unmodified. + *

+ */ + collapsedNodeStyle:yfiles.drawing.INodeStyle; + /** + * Gets or sets a value indicating whether the first label of the {@link yfiles.graph.IFoldedGraph#getMaster master group node} + * should be recreated for the collapsed group node instance. + * This setting can be used to initially create a copy of the first label of the master group node (if any) and + * subsequently synchronize the {@link yfiles.graph.ILabel#text} property with the master's node label text. + * Set it to true if the first label should be copied; otherwise, false. + * The default is false. + * @see {@link yfiles.graph.DefaultDummyNodeConverter#firstLabelStyle} + * @see {@link yfiles.graph.DefaultDummyNodeConverter#firstLabelModelParameter} + */ + copyFirstLabel:boolean; + /** + * Gets or sets the {@link yfiles.drawing.ILabelStyle} to use for the first label of the collapsed group nodes. + * This will only affect the collapsed group node if the {@link yfiles.graph.DefaultDummyNodeConverter#copyFirstLabel} + * property is set to true. + * The default is null + *

+ * A value of null will leave the style property unmodified. + *

+ * @see {@link yfiles.graph.DefaultDummyNodeConverter#copyFirstLabel} + */ + firstLabelStyle:yfiles.drawing.ILabelStyle; + /** + * Gets or sets the {@link yfiles.graph.ILabelModelParameter} to use for the first label of the collapsed group node. + * This will only affect the dummy node if the {@link yfiles.graph.DefaultDummyNodeConverter#copyFirstLabel} + * property is set to true. + * The default is null + *

+ * A value of null will leave the label model parameter property unmodified. + *

+ * @see {@link yfiles.graph.DefaultDummyNodeConverter#copyFirstLabel} + * @see {@link yfiles.graph.DefaultDummyNodeConverter#createInitialLabels} + */ + firstLabelModelParameter:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets the {@link yfiles.drawing.IPortStyle} to use for the ports at the collapsed group node that + * {@link yfiles.graph.IFoldedGraph#getRepresentative represent} the ports of the + * {@link yfiles.graph.IFoldedGraph#getMaster master group node} in the collapsed state. + * Since the appearance of the collapsed group node may totally differ from the appearance of the + * expanded group node, the appearance of the ports may also be different. This property can be used + * to assign a different specific style to the ports if the node is in collapsed state. + * A value of null will leave the style property unmodified. + * The default is null + * @see {@link yfiles.graph.DefaultDummyNodeConverter#createPortStyle} + */ + portStyle:yfiles.drawing.IPortStyle; + /** + * Sets the initial size of the {@link yfiles.graph.INode#layout} of the collapsed group node that + * will be assigned during the {@link yfiles.graph.IDummyNodeConverter#createDummyNodeAppearance creation} + * of the appearance of the collapsed group node. + * Since the {@link yfiles.graph.INode#layout} of an {@link yfiles.graph.IFoldedGraph#expand expanded} group node + * normally encompasses the child nodes, it will have quite a large size. Since the contents of a + * collapsed group node are not visible, there is no need for the collapsed group node to encompass the area + * of its children. Thus the size can be different and most of the time should be smaller. + * Setting this property to non-null values will make the initial layout of the collapsed + * node become the given size assigned. + * The default is null + * @see {@link yfiles.graph.DefaultDummyNodeConverter#createInitialLayout} + */ + initialSize:yfiles.geometry.SizeD; + /** + * Gets or sets a value indicating whether to reset the location of dummy ports to the + * center of the node. + * The default is false + * true if the location should initially be reset to the center of the node; otherwise, false. + * @see {@link yfiles.graph.DefaultDummyNodeConverter#portStyle} + */ + resetPortLocation:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.DefaultDummyNodeConverter#collapsedNodeStyle} instance should + * be assigned as a {@link yfiles.system.ICloneable#clone}clone or not. + * Value: true if the dummy node style should be cloned; otherwise, false. The default is false + */ + cloneNodeStyle:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.DefaultDummyNodeConverter#portStyle} instance should + * be assigned as a {@link yfiles.system.ICloneable#clone}clone or not. + * Value: true if the port style should be cloned; otherwise, false. The default is false + */ + clonePortStyle:boolean; + /** + * Callback that is used by {@link yfiles.graph.IFoldedGraph} view implementations to change the appearance + * of a {@link yfiles.graph.IFoldedGraph#isDummy dummy} node. + * This method is called by the view to allow for adjusting the appearance of a local dummy node in + * the view when the {@link yfiles.graph.IFoldedGraph#getMaster master} node for it has + * changed properties. + * This can be used, e.g. to synchronize the label or style properties with the corresponding properties + * of the masterNode. + * Note that changing the appearance has to be done using the callback that + * implements the {@link yfiles.graph.IChangeDummyNodeAppearanceCallback} interface. Direct changes to the dummyNode + * would otherwise be enqueued into the undo queue and could thus break the undo stack. + * @param {yfiles.graph.IChangeDummyNodeAppearanceCallback} callback The callback to use for changing the appearance. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The graph instance for which the dummy node can be changed. + * @param {yfiles.graph.INode} dummyNode The dummy node instance in the view + * @param {yfiles.graph.INode} masterNode The node that represents the {@link yfiles.graph.IFoldedGraph#getMaster} item that + * is represented in the local view by the dummyNode. + * @see {@link yfiles.graph.IDummyNodeConverter#createDummyNodeAppearance} + * @see Specified by {@link yfiles.graph.IDummyNodeConverter#changeDummyNodeAppearance}. + */ + changeDummyNodeAppearance(callback:yfiles.graph.IChangeDummyNodeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,localCollapsedNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + /** + * Called by {@link yfiles.graph.DefaultDummyNodeConverter#changeDummyNodeAppearance} to synchronize the first label if {@link yfiles.graph.DefaultDummyNodeConverter#copyFirstLabel} + * is enabled. + * This will adjust the label text property or remove the label if there is no more master label. + * @param {yfiles.graph.IChangeDummyNodeAppearanceCallback} callback The callback. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The folded graph. + * @param {yfiles.graph.INode} localCollapsedNode The local node instance. + * @param {yfiles.graph.INode} masterNode The master node. + */ + synchronizeLabels(callback:yfiles.graph.IChangeDummyNodeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,localCollapsedNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + /** + * Callback that is used by {@link yfiles.graph.IFoldedGraph} view implementations to initially create the appearance + * of a {@link yfiles.graph.IFoldedGraph#isDummy dummy} node. + * This method is called by the view to allow for initially creating the appearance of a local dummy node in + * the view when it is included in the view for the first time. + * This can be used, e.g. to initialize the labels or style properties with the corresponding properties + * of the masterNode. + * Note that changing the appearance has to be done using the callback that + * implements the {@link yfiles.graph.IChangeDummyNodeAppearanceCallback} interface. Direct changes to the dummyNode + * would otherwise be enqueued into the undo queue and could thus break the undo stack. + * @param {yfiles.graph.IChangeDummyNodeAppearanceCallback} callback The callback to use for determining the appearance. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The graph instance for which the dummy node has been created. + * @param {yfiles.graph.INode} dummyNode The dummy node instance in the view + * @param {yfiles.graph.INode} masterNode The node that represents the {@link yfiles.graph.IFoldedGraph#getMaster} item that + * is represented in the local view by the dummyNode. + * @see {@link yfiles.graph.IDummyNodeConverter#changeDummyNodeAppearance} + * @see Specified by {@link yfiles.graph.IDummyNodeConverter#createDummyNodeAppearance}. + */ + createDummyNodeAppearance(callback:yfiles.graph.IChangeDummyNodeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,localCollapsedNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + /** + * Called by {@link yfiles.graph.DefaultDummyNodeConverter#createDummyNodeAppearance} to initialize the appearance of the + * {@link yfiles.graph.IFoldedGraph#getRepresentative representatives} of the master ports at the collapsed group node. + * This method will call {@link yfiles.graph.DefaultDummyNodeConverter#createPortStyle} for each port at the group node and assign the returned + * style if it is non-null. If {@link yfiles.graph.DefaultDummyNodeConverter#resetPortLocation} is enabled, + * the ports' {@link yfiles.graph.IPort#location} will be reset to the center of the node's {@link yfiles.graph.INode#layout}. + * @param {yfiles.graph.IChangeDummyNodeAppearanceCallback} callback The callback to use for {@link yfiles.graph.IChangeDummyNodeAppearanceCallback#setPortStyle setting the port style} + * and {@link yfiles.graph.IChangeDummyNodeAppearanceCallback#setPortLocationModelParameter location}. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The folded graph instance. + * @param {yfiles.graph.INode} localCollapsedNode The local group node. + * @param {yfiles.graph.INode} masterNode The master group node. + */ + createInitialPorts(callback:yfiles.graph.IChangeDummyNodeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,localCollapsedNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + /** + * Callback method that initializes the {@link yfiles.graph.IChangeDummyNodeAppearanceCallback#setNodeStyle style property} + * of the collapsed group node. + * This implementation calls {@link yfiles.graph.DefaultDummyNodeConverter#createNodeStyle} and + * {@link yfiles.graph.IChangeDummyNodeAppearanceCallback#setNodeStyle assigns} + * the style to the group node if a non-null value has been returned. + * @param {yfiles.graph.IChangeDummyNodeAppearanceCallback} callback The callback. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The folded graph instance that has triggered the {@link yfiles.graph.DefaultDummyNodeConverter#createDummyNodeAppearance} call. + * @param {yfiles.graph.INode} localCollapsedNode The local node in the view that may be changed using the callback. + * @param {yfiles.graph.INode} masterNode The master node that the local dummy node represents. + */ + createInitialStyle(callback:yfiles.graph.IChangeDummyNodeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,localCollapsedNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + /** + * Callback factory method that creates the {@link yfiles.drawing.INodeStyle} for use + * in {@link yfiles.graph.DefaultDummyNodeConverter#createInitialStyle}. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The folded graph instance. + * @param {yfiles.graph.INode} localCollapsedNode The local dummy node in the view whose {@link yfiles.graph.INode#style} should be initialized. + * @param {yfiles.graph.INode} masterNode The node that is being represented by the dummy node. + * @return {yfiles.drawing.INodeStyle} The {@link yfiles.graph.DefaultDummyNodeConverter#collapsedNodeStyle} or a {@link yfiles.system.ICloneable#clone} of it + * depending on the {@link yfiles.graph.DefaultDummyNodeConverter#cloneNodeStyle} property. This method may return null + * to indicate that the default style should not be changed. + */ + createNodeStyle(foldedGraph:yfiles.graph.IFoldedGraph,localCollapsedNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):yfiles.drawing.INodeStyle; + /** + * Callback factory method that creates the {@link yfiles.drawing.IPortStyle} for use + * in {@link yfiles.graph.DefaultDummyNodeConverter#createInitialPorts}. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The folded graph instance. + * @param {yfiles.graph.IPort} localPort The local port in the view whose {@link yfiles.graph.IPort#style} should be initialed. + * @param {yfiles.graph.IPort} masterPort The port that is being represented by the dummy port. + * @return {yfiles.drawing.IPortStyle} The {@link yfiles.graph.DefaultDummyNodeConverter#portStyle} or a {@link yfiles.system.ICloneable#clone} of it + * depending on the {@link yfiles.graph.DefaultDummyNodeConverter#clonePortStyle} property. This method may return null + * to indicate that the default style should not be changed. + */ + createPortStyle(foldedGraph:yfiles.graph.IFoldedGraph,localPort:yfiles.graph.IPort,masterPort:yfiles.graph.IPort):yfiles.drawing.IPortStyle; + /** + * Callback method that initializes the initial labels + * of the collapsed group node. + * This will try to copy the first label of the master node if {@link yfiles.graph.DefaultDummyNodeConverter#copyFirstLabel} is enabled. + * @param {yfiles.graph.IChangeDummyNodeAppearanceCallback} callback The callback. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The folded graph instance that has triggered the {@link yfiles.graph.DefaultDummyNodeConverter#createDummyNodeAppearance} call. + * @param {yfiles.graph.INode} localCollapsedNode The collapsed group node in the view that may be changed using the callback. + * @param {yfiles.graph.INode} masterNode The master node that the dummy node represents. + * @see {@link yfiles.graph.DefaultDummyNodeConverter#firstLabelStyle} + * @see {@link yfiles.graph.DefaultDummyNodeConverter#firstLabelModelParameter} + */ + createInitialLabels(callback:yfiles.graph.IChangeDummyNodeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,localCollapsedNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + /** + * Callback method that initializes the {@link yfiles.graph.INode#layout} of the collapsed group node. + * This implementation will {@link yfiles.graph.IChangeDummyNodeAppearanceCallback#setBounds set the bounds} + * of the nodes in such a way that the size will be that of the {@link yfiles.graph.DefaultDummyNodeConverter#initialSize} + * property (if non-null) but not smaller than the {@link yfiles.input.ISizeConstraintProvider#getMinimumSize minimum} + * size that is reported by a potential {@link yfiles.input.ISizeConstraintProvider} for {@link yfiles.graph.INode}s that has been + * found in the {@link yfiles.support.ILookup} of the localCollapsedNode. + * @param {yfiles.graph.IChangeDummyNodeAppearanceCallback} callback The callback to use for {@link yfiles.graph.IChangeDummyNodeAppearanceCallback#setBounds} + * @param {yfiles.graph.IFoldedGraph} foldedGraph The folded graph instance. + * @param {yfiles.graph.INode} localCollapsedNode The local collapsed group node to change. + * @param {yfiles.graph.INode} masterNode The master node that is represented by the local group node. + */ + createInitialLayout(callback:yfiles.graph.IChangeDummyNodeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,localCollapsedNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + } + var DefaultDummyNodeConverter:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of this class with default values. + */ + new ():yfiles.graph.DefaultDummyNodeConverter; + /** + * Initializes a new instance of this class using the values + * provided by the collapsedNodeDefaults parameter. + */ + WithNodeDefaults:{ + new (collapsedNodeDefaults:yfiles.graph.INodeDefaults):yfiles.graph.DefaultDummyNodeConverter; + }; + }; + /** + * A simple mutable implementation of the {@link yfiles.graph.IEdge} + * interface that can be used stand-alone. + * Note that this class is not the one used as the default implementation + * of a {@link yfiles.graph.DefaultGraph}'s {@link yfiles.graph.IEdge}s and casting an IEdge + * to this class will most likely fail. + * Instances of this class can be used without an accompanying graph instance. All of the + * properties are mutable. An example of a possible use case would be the rendering of an edge + * into a graphics context: Simply instantiate a SimpleEdge, associate a style with it + * and use the style's renderer instance to obtain a paintable for the edge. + */ + export interface SimpleEdge extends yfiles.graph.AbstractLabeledItem,yfiles.graph.IEdge{ + /** + * Returns the style that is responsible for the visual representation + * of this edge in a {@link yfiles.canvas.CanvasControl}. + * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setEdgeStyle} + * method. + * Note that the style instance associated with an edge instance may be shared + * between multiple edge instances and that the modification of this style will + * result in a change of the appearance of all edges that are associated with the same style instance. + * @see Specified by {@link yfiles.graph.IEdge#style}. + */ + style:yfiles.drawing.IEdgeStyle; + /** + * Provides access to a collection of {@link yfiles.graph.IBend bends} that + * describe the geometry of this edge. + * This gives access to a read-only live view of the bends, i.e. the collection + * can change over time, as well as the bends contained in it. If a snapshot of the + * current state is needed, one needs to copy the collection. + * In order to modify the bend collection of an edge, use the {@link yfiles.graph.IGraph#addBend various methods} + * in {@link yfiles.graph.IGraph}. + * @see Specified by {@link yfiles.graph.IEdge#bends}. + */ + bends:yfiles.model.IListEnumerable; + /** + * Gets the source port instance this edge is connected to. + * Although the notion of source and target port is used for directed + * edges, it is still up to the client to decide whether the edge should + * be treated as such. + * @see Specified by {@link yfiles.graph.IEdge#sourcePort}. + */ + sourcePort:yfiles.graph.IPort; + /** + * Gets the target port instance this edge is connected to. + * Although the notion of source and target port is used for directed + * edges, it is still up to the client to decide whether the edge should + * be treated as such. + * @see Specified by {@link yfiles.graph.IEdge#targetPort}. + */ + targetPort:yfiles.graph.IPort; + /** + * Provides access to a collection of {@link yfiles.graph.IPort ports} that + * are owned by this instance. + * This gives access to a read-only live view of the ports, i.e. the collection + * can change over time, as well as the ports contained in it. If a snapshot of the + * current state is needed, one needs to copy the collection. + * @see Specified by {@link yfiles.graph.IPortOwner#ports}. + */ + ports:yfiles.model.IListEnumerable; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + } + var SimpleEdge:{ + $class:yfiles.lang.Class; + /** + * Creates an edge with a {@link yfiles.graph.DefaultEdgeLookup default lookup} + * using the given source and target ports. + */ + WithPorts:{ + new (sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):yfiles.graph.SimpleEdge; + }; + /** + * Creates an edge with a {@link yfiles.graph.DefaultEdgeLookup default lookup} + * using the given source and target ports and bend and label collections. + */ + FromLabelsPortsAndBends:{ + new (labelCollection:yfiles.model.IListEnumerable,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,bends:yfiles.model.IListEnumerable):yfiles.graph.SimpleEdge; + }; + /** + * Creates an edge with the given lookup, + * using the given source and target ports and bend and label collections. + */ + FromLookupLabelsPortsAndBends:{ + new (lookup:yfiles.support.ILookup,labelCollection:yfiles.model.IListEnumerable,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,bends:yfiles.model.IListEnumerable):yfiles.graph.SimpleEdge; + }; + }; + /** + * The default {@link yfiles.support.ILookup} implementation as it is used by the + * framework's implementations of {@link yfiles.graph.IEdge}. + */ + export interface DefaultEdgeLookup extends yfiles.graph.DefaultItemLookup{ + /** + * Sets or gets edge. + * Value: The edge. + */ + edge:yfiles.graph.IEdge; + /** + * Subclasses need to override this method. + * @param {T} item The context item to lookup an implementation for. + * @param {yfiles.lang.Class} type The type of the implementation to find. + * @param {yfiles.support.ILookup} nextLookup The lookup to use for another type. + * @param {yfiles.support.ILookup} lastLookup The lookup to use as a fallback for the type. + * @return {Object} + */ + chainedLookup(edge:yfiles.graph.IEdge,type:yfiles.lang.Class,nextLookup:yfiles.support.ILookup,lastLookup:yfiles.support.ILookup):Object; + } + var DefaultEdgeLookup:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.DefaultEdgeLookup} class. + */ + new ():yfiles.graph.DefaultEdgeLookup; + /** + * Initializes a new instance of the {@link yfiles.graph.DefaultEdgeLookup} class that uses + * the provided edge as the {@link yfiles.graph.DefaultItemLookup#item}. + * @param {yfiles.graph.IEdge} edge The edge. + */ + ForEdge:{ + new (edge:yfiles.graph.IEdge):yfiles.graph.DefaultEdgeLookup; + }; + }; + /** + * An abstract basic implementation of the {@link yfiles.graph.IDummyEdgeConverter} + * interface that may be derived from to create a customized {@link yfiles.graph.FoldingManager#dummyEdgeConverter}. + * This class provides default mechanisms and callbacks that can be used + * to set another style for dummy edges, for the ports of dummy edges, + * synchronizing the first label of a dummy edge with the master edge, etc. + * Subclasses need to implement the {@link yfiles.graph.AbstractDummyEdgeConverter#addDummyEdge} method, only. + * @see {@link yfiles.graph.DefaultDummyEdgeConverter} + * @see {@link yfiles.graph.IFoldingManager} + */ + export interface AbstractDummyEdgeConverter extends Object,yfiles.graph.IDummyEdgeConverter{ + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.AbstractDummyEdgeConverter#dummyEdgeStyle} instance should + * be assigned as a {@link yfiles.system.ICloneable#clone}clone or not. + * Value: true if the dummy edge style should be cloned; otherwise, false. + */ + cloneEdgeStyle:boolean; + /** + * Gets or sets the {@link yfiles.drawing.IPortStyle} to use for the dummy source port. + * A value of null will leave the style property unmodified. + */ + dummySourcePortStyle:yfiles.drawing.IPortStyle; + /** + * Gets or sets the {@link yfiles.drawing.IPortStyle} to use for the dummy target port. + * A value of null will leave the style property unmodified. + */ + dummyTargetPortStyle:yfiles.drawing.IPortStyle; + /** + * Gets or sets the {@link yfiles.drawing.ILabelStyle} to use for the first label of the dummy edge. + * This will only affect the dummy edge if the {@link yfiles.graph.AbstractDummyEdgeConverter#copyFirstLabel} + * property is set to true. + *

+ * A value of null will leave the style property unmodified. + *

+ */ + firstLabelStyle:yfiles.drawing.ILabelStyle; + /** + * Gets or sets the {@link yfiles.graph.ILabelModelParameter} to use for the first label of the dummy edge. + * This will only affect the dummy edge if the {@link yfiles.graph.AbstractDummyEdgeConverter#copyFirstLabel} + * property is set to true. + *

+ * A value of null will leave the label model parameter property unmodified. + *

+ */ + firstLabelModelParameter:yfiles.graph.ILabelModelParameter; + /** + * Gets or sets a value indicating whether to reset the location of dummy ports to the + * center of the node. + * Value: true if the location should initially be reset to the center of the node; otherwise, false. + */ + resetDummyPorts:boolean; + /** + * Gets or sets the {@link yfiles.drawing.IEdgeStyle} to use for the dummy edge. + *

+ * Depending on the {@link yfiles.graph.AbstractDummyEdgeConverter#cloneEdgeStyle} property this implementation will + * assign a {@link yfiles.system.ICloneable#clone} to the property or this instance. + *

+ *

+ * A value of null (the default) will leave the style property unmodified. + *

+ */ + dummyEdgeStyle:yfiles.drawing.IEdgeStyle; + /** + * Gets or sets a value indicating whether to reset and clear the bends of a dummy edge initially. + * Value: true if the dummy edge should initially not contain any bends; otherwise, false, which is the default. + */ + resetBends:boolean; + /** + * Gets or sets a value indicating whether the first label of the {@link yfiles.graph.IFoldedGraph#getMaster master edge} + * should be recreated for the dummy edge. + * This setting can be used to initially create a copy of the first label of the master edge (if any) and + * subsequently synchronize the {@link yfiles.graph.ILabel#text} property with the master's edge label text. + * Value: true if the first label should be copied; otherwise, false. + * @see {@link yfiles.graph.AbstractDummyEdgeConverter#firstLabelStyle} + * @see {@link yfiles.graph.AbstractDummyEdgeConverter#firstLabelModelParameter} + */ + copyFirstLabel:boolean; + /** + * This method gets called by the {@link yfiles.graph.IFoldedGraph} implementation to determine + * whether a given edge in the {@link yfiles.graph.FoldingManager#masterGraph} should be represented by a dummy edge + * in the given view. + * The implementation will be passed in a callback object that implements the {@link yfiles.graph.IAddDummyEdgeCallback} + * interface, which needs to be used by the implementation to communicate the result of the query. + * The implementation needs to either call {@link yfiles.graph.IAddDummyEdgeCallback#addAsSeparateEdge}, + * {@link yfiles.graph.IAddDummyEdgeCallback#addToExistingDummy}, or {@link yfiles.graph.IAddDummyEdgeCallback#excludeDummyEdge} and return + * the values that these implementation yields to the caller. + * The implementation can optionally query the {@link yfiles.graph.IAddDummyEdgeCallback#getExistingDummyEdges existing dummy edges} + * between the source and target node and decide whether to add the edge {@link yfiles.graph.IAddDummyEdgeCallback#addToExistingDummy to the existing dummy}. + * @param {yfiles.graph.IAddDummyEdgeCallback} callback The {@link yfiles.graph.IAddDummyEdgeCallback} implementation that needs to be called in order to + * communicate the results of this query. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The instance into which the dummy edge is going to be inserted. + * @param {yfiles.graph.IEdge} masterEdge The edge from the {@link yfiles.graph.FoldingManager#masterGraph} that needs to be represented by a dummy + * edge. Note that you may not return this instance. + * @param {yfiles.graph.INode} localSourceNode The source node that belongs to the {@link yfiles.graph.IFoldedGraph} view that will act as the local + * representative of the actual source node. + * @param {boolean} sourceDummy Determines whether the localSourceNode is currently a dummy node. + * @param {yfiles.graph.INode} localTargetNode The target node that belongs to the {@link yfiles.graph.IFoldedGraph} view that will act as the local + * representative of the actual target node. + * @param {boolean} targetDummy Determines whether the localTargetNode is currently a dummy node. + * @return {yfiles.graph.IEdge} The edge as returned by {@link yfiles.graph.IAddDummyEdgeCallback#addAsSeparateEdge}, or {@link yfiles.graph.IAddDummyEdgeCallback#addToExistingDummy}, + * or null if the edge will be {@link yfiles.graph.IAddDummyEdgeCallback#excludeDummyEdge excluded} from the view. + * @see Specified by {@link yfiles.graph.IDummyEdgeConverter#addDummyEdge}. + */ + addDummyEdge(callback:yfiles.graph.IAddDummyEdgeCallback,foldedGraph:yfiles.graph.IFoldedGraph,masterEdge:yfiles.graph.IEdge,localSourceNode:yfiles.graph.INode,sourceDummy:boolean,localTargetNode:yfiles.graph.INode,targetDummy:boolean):yfiles.graph.IEdge; + /** + * Callback that is triggered by the {@link yfiles.graph.IFoldedGraph} view to adjust the appearance of a dummy edge, e.g. to + * reflect a state change in the {@link yfiles.graph.IFoldedGraph#getMasterEdges master edges} that make up + * that dummy edge. + * Implementations may not use the {@link yfiles.graph.IFoldedGraph}'s {@link yfiles.graph.IFoldedGraph#graph} instance to modify + * the localDummyEdge, because this would create and enqueue undo events. Rather + * the callbacks provided by the callback's {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback} + * implementation must be used. + * @param {yfiles.graph.IChangeDummyEdgeAppearanceCallback} callback The callback to use for changing the appearance. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The graph to which the dummy edge belongs. + * @param {yfiles.graph.IEdge} localDummyEdge The dummy edge for which the appearance might need an update. + * @param {yfiles.collections.IList.} masterEdges The list of {@link yfiles.graph.IFoldedGraph#getMasterEdges master edges}, that + * the dummy edge currently represents. + * @see {@link yfiles.graph.IDummyEdgeConverter#createDummyEdgeAppearance} + * @see Specified by {@link yfiles.graph.IDummyEdgeConverter#changeDummyEdgeAppearance}. + */ + changeDummyEdgeAppearance(callback:yfiles.graph.IChangeDummyEdgeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,dummyEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Called by {@link yfiles.graph.AbstractDummyEdgeConverter#changeDummyEdgeAppearance} to synchronize the first label if {@link yfiles.graph.AbstractDummyEdgeConverter#copyFirstLabel} + * is enabled. + * This will adjust the label text property or remove the label if there is no more master label or + * there is more than one master edge. + * @param {yfiles.graph.IChangeDummyEdgeAppearanceCallback} callback The callback. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The folded graph. + * @param {yfiles.graph.IEdge} dummyEdge The dummy edge. + * @param {yfiles.collections.IList.} masterEdges The master edges. + */ + synchronizeLabels(callback:yfiles.graph.IChangeDummyEdgeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,dummyEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Callback that is triggered by the {@link yfiles.graph.IFoldedGraph} view to initially create the appearance of a dummy edge. + * Implementations may not use the {@link yfiles.graph.IFoldedGraph}'s {@link yfiles.graph.IFoldedGraph#graph} instance to modify + * the localDummyEdge, because this would create and enqueue undo events. Rather + * the callbacks provided by the callback's {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback} + * implementation must be used. + * @param {yfiles.graph.IChangeDummyEdgeAppearanceCallback} callback The callback to use for changing the appearance. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The graph to which the dummy edge belongs. + * @param {yfiles.graph.IEdge} localDummyEdge The dummy edge for which the appearance shall be determined. + * @param {yfiles.collections.IList.} masterEdges The list of {@link yfiles.graph.IFoldedGraph#getMasterEdges master edges}, that + * the dummy edge initially represents. + * @see {@link yfiles.graph.IDummyEdgeConverter#changeDummyEdgeAppearance} + * @see Specified by {@link yfiles.graph.IDummyEdgeConverter#createDummyEdgeAppearance}. + */ + createDummyEdgeAppearance(callback:yfiles.graph.IChangeDummyEdgeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,dummyEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Callback method that initializes the {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#setStyle style property} + * of the dummy edge. + * This implementation calls {@link yfiles.graph.AbstractDummyEdgeConverter#createEdgeStyle} and + * {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#setStyle assigns} + * the style to the dummy edge if a non-null value has been returned. + * @param {yfiles.graph.IChangeDummyEdgeAppearanceCallback} callback The callback. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The folded graph instance that has triggered the {@link yfiles.graph.AbstractDummyEdgeConverter#createDummyEdgeAppearance} call. + * @param {yfiles.graph.IEdge} dummyEdge The dummy edge in the view that may be changed using the callback. + * @param {yfiles.collections.IList.} masterEdges The master edges that the dummy edge represents. + */ + createInitialStyle(callback:yfiles.graph.IChangeDummyEdgeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,dummyEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Callback factory method that creates the {@link yfiles.drawing.IEdgeStyle} for use + * in {@link yfiles.graph.AbstractDummyEdgeConverter#createInitialStyle}. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The folded graph instance. + * @param {yfiles.graph.IEdge} dummyEdge The dummy edge in the view whose {@link yfiles.graph.IEdge#style} should be initialed. + * @param {yfiles.collections.IList.} masterEdges The edges that are being represented by the dummy edge. + * @return {yfiles.drawing.IEdgeStyle} The {@link yfiles.graph.AbstractDummyEdgeConverter#dummyEdgeStyle} or a {@link yfiles.system.ICloneable#clone} of it + * depending on the {@link yfiles.graph.AbstractDummyEdgeConverter#cloneEdgeStyle} property. This method may return null + * to indicate that the default style should not be changed. + */ + createEdgeStyle(foldedGraph:yfiles.graph.IFoldedGraph,dummyEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):yfiles.drawing.IEdgeStyle; + /** + * Callback method that initializes the ports + * of the dummy edge. + * @param {yfiles.graph.IChangeDummyEdgeAppearanceCallback} callback The callback. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The folded graph instance that has triggered the {@link yfiles.graph.AbstractDummyEdgeConverter#createDummyEdgeAppearance} call. + * @param {yfiles.graph.IEdge} dummyEdge The dummy edge in the view that may be changed using the callback. + * @param {yfiles.collections.IList.} masterEdges The master edges that the dummy edge represents. + * @see {@link yfiles.graph.AbstractDummyEdgeConverter#dummySourcePortStyle} + * @see {@link yfiles.graph.AbstractDummyEdgeConverter#dummyTargetPortStyle} + * @see {@link yfiles.graph.AbstractDummyEdgeConverter#resetDummyPorts} + */ + createInitialPorts(callback:yfiles.graph.IChangeDummyEdgeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,dummyEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Callback method that creates the source port location parameter. + * @param {yfiles.graph.IFoldedGraph} graph The graph. + * @param {yfiles.graph.IEdge} edge The edge to create the parameter for. + * @param {yfiles.collections.IList.} masterEdges The master edges. + * @return {yfiles.graph.IPortLocationModelParameter} The parameter to use. + */ + createSourcePortLocationParameter(graph:yfiles.graph.IFoldedGraph,edge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):yfiles.graph.IPortLocationModelParameter; + /** + * Callback method that creates the target port location parameter. + * @param {yfiles.graph.IFoldedGraph} graph The graph. + * @param {yfiles.graph.IEdge} edge The edge to create the parameter for. + * @param {yfiles.collections.IList.} masterEdges The master edges. + * @return {yfiles.graph.IPortLocationModelParameter} The parameter to use. + */ + createTargetPortLocationParameter(graph:yfiles.graph.IFoldedGraph,edge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):yfiles.graph.IPortLocationModelParameter; + /** + * Callback method that initializes the bends + * of the dummy edge. + * This will call the + * {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#clearBends} + * callback if {@link yfiles.graph.AbstractDummyEdgeConverter#resetBends} is enabled. + * @param {yfiles.graph.IChangeDummyEdgeAppearanceCallback} callback The callback. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The folded graph instance that has triggered the {@link yfiles.graph.AbstractDummyEdgeConverter#createDummyEdgeAppearance} call. + * @param {yfiles.graph.IEdge} dummyEdge The dummy edge in the view that may be changed using the callback. + * @param {yfiles.collections.IList.} masterEdges The master edges that the dummy edge represents. + */ + createInitialBends(callback:yfiles.graph.IChangeDummyEdgeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,dummyEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Callback method that initializes the initial labels + * of the dummy edge. + * This will first {@link yfiles.graph.IChangeLabeledItemAppearanceCallback#clearLabels clear all the labels} and then + * try to copy the first label of the single master edge if {@link yfiles.graph.AbstractDummyEdgeConverter#copyFirstLabel} is enabled. + * @param {yfiles.graph.IChangeDummyEdgeAppearanceCallback} callback The callback. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The folded graph instance that has triggered the {@link yfiles.graph.AbstractDummyEdgeConverter#createDummyEdgeAppearance} call. + * @param {yfiles.graph.IEdge} dummyEdge The dummy edge in the view that may be changed using the callback. + * @param {yfiles.collections.IList.} masterEdges The master edges that the dummy edge represents. + * @see {@link yfiles.graph.AbstractDummyEdgeConverter#firstLabelStyle} + * @see {@link yfiles.graph.AbstractDummyEdgeConverter#firstLabelModelParameter} + */ + createInitialLabels(callback:yfiles.graph.IChangeDummyEdgeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,dummyEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + } + var AbstractDummyEdgeConverter:{ + $class:yfiles.lang.Class; + }; + /** + * A basic implementation of a {@link yfiles.model.IModelItem} + * with support for pluggable {@link yfiles.support.ILookup} implementations. + */ + export interface AbstractModelItem extends Object,yfiles.model.IModelItem{ + /** + * Gets or sets the tag associated with this instance. + * Value: The user object associated with this instance. + * The implementation + * itself does not normally depend on the tag associated with it. It serves as storage for + * the object only. + * @see Specified by {@link yfiles.support.ITagOwner#tag}. + */ + tag:Object; + /** + * Sets the {@link yfiles.support.ILookup} implementation used for + * {@link yfiles.graph.AbstractModelItem#lookup} calls on this instance. + * @param {yfiles.support.ILookup} newLookup the new implementation to use + */ + setLookupImplementation(newLookup:yfiles.support.ILookup):void; + /** + * Returns the currently set {@link yfiles.support.ILookup} delegate. + * @return {yfiles.support.ILookup} the current lookup delegate + * @see {@link yfiles.graph.AbstractModelItem#lookup} + */ + getLookup():yfiles.support.ILookup; + /** + * Simple lookup implementation that delegates to the + * current {@link yfiles.graph.AbstractModelItem#getLookup lookup delegate} if it is available. + * Otherwise returns this if this is assignable to the provided type. + * If no lookup delegate is registered this implementation will return this + * for each type that is implemented by the current instance. + * @param {yfiles.lang.Class} type the query type + * @return {Object} an implementation of type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + } + var AbstractModelItem:{ + $class:yfiles.lang.Class; + /** + * Creates a new item with no initial lookup implementation. + * @see {@link yfiles.graph.AbstractModelItem#lookup} + */ + new ():yfiles.graph.AbstractModelItem; + /** + * Creates a new item using the given initial lookup implementation. + * @see {@link yfiles.graph.AbstractModelItem#lookup} + */ + WithLookup:{ + new (lookup:yfiles.support.ILookup):yfiles.graph.AbstractModelItem; + }; + }; + /** + * An abstract {@link yfiles.graph.IGraph} implementation that delegates all of its work + * to an existing implementation. + * Subclasses can override all of the methods to customize the behavior of this instance. + * Note that this instance will register listeners with the wrapped graph instance, so + * {@link yfiles.graph.AbstractGraphWrapper#dispose} should be called if this instance is not used any more. + */ + export interface AbstractGraphWrapper extends Object,yfiles.graph.IGraph,yfiles.system.IDisposable{ + /** + * The lookup instance. + */ + lookupInstance:yfiles.support.ILookup; + /** + * The wrapped graph instance. + */ + graph:yfiles.graph.IGraph; + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Adds event handlers that propagate graph events from graph + * to listeners on this instance. + * @param {yfiles.graph.IGraph} graph The graph for which event propagators should be created + */ + addEventHandlers(graph:yfiles.graph.IGraph):void; + /** + * Removes event handlers for graph + * that have been added with {@link yfiles.graph.AbstractGraphWrapper#addEventHandlers}. + * @param {yfiles.graph.IGraph} graph The graph for which event propagators should be removed + */ + removeEventHandlers(graph:yfiles.graph.IGraph):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addBendChangedListener BendChanged} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onBendChanged} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_BendChanged(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addDisplaysInvalidatedListener DisplaysInvalidated} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onInvalidateDisplays} + * @param {Object} source the source of the event + * @param {yfiles.system.EventArgs} eventArgs the parameters of this event + */ + graph_DisplaysInvalidated(source:Object,eventArgs:yfiles.system.EventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addBendRemovedListener BendRemoved} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onBendRemoved} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_BendRemoved(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addBendAddedListener BendAdded} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onBendAdded} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_BendAdded(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addNodeChangedListener NodeChanged} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onNodeChanged} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_NodeChanged(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addNodeRemovedListener NodeRemoved} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onNodeRemoved} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_NodeRemoved(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onNodeCreated} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_NodeCreated(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addPortChangedListener PortChanged} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onPortChanged} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_PortChanged(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addPortRemovedListener PortRemoved} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onPortRemoved} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_PortRemoved(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addPortAddedListener PortAdded} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onPortAdded} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_PortAdded(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addLabelChangedListener LabelChanged} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onLabelChanged} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_LabelChanged(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addLabelRemovedListener LabelRemoved} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onLabelRemoved} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_LabelRemoved(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onLabelAdded} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_LabelAdded(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onEdgeChanged} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_EdgeChanged(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addEdgeRemovedListener EdgeRemoved} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onEdgeRemoved} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_EdgeRemoved(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Event propagator for {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} events from the wrapped graph. + * Just calls {@link yfiles.graph.AbstractGraphWrapper#onEdgeCreated} + * @param {Object} source the source of the event + * @param {yfiles.model.ItemEventArgs.} eventArgs the parameters of this event + */ + graph_EdgeCreated(source:Object,eventArgs:yfiles.model.ItemEventArgs):void; + /** + * Causes the {@link yfiles.graph.IGraph#addDisplaysInvalidatedListener DisplaysInvalidated} event to be triggered. + * This method may be called by client code to invalidate all views of the graph + * that have registered with the {@link yfiles.graph.IGraph#addDisplaysInvalidatedListener DisplaysInvalidated} event. + * Views that need to be informed if non-structural changes have been made + * to the graph should register with the corresponding event. + * @see Specified by {@link yfiles.graph.IGraph#invalidateDisplays}. + */ + invalidateDisplays():void; + /** + * A collection view that combines all nodes, edges, labels, ports, and bends of this graph. + * This is a read-only live view of all model items of this graph that always represents the current + * state. The same reference will be returned for each invocation. + * @see Specified by {@link yfiles.graph.IGraph#collectionModel}. + */ + collectionModel:yfiles.model.ICollectionModel; + /** + * A collection view of the nodes contained in this graph. + * This is a live view of the nodes that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Nodes can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#nodes}. + */ + nodes:yfiles.model.ICollectionModel; + /** + * A collection view of the edges contained in this graph. + * This is a live view of the edges that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Edges can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#edges}. + */ + edges:yfiles.model.ICollectionModel; + /** + * A collection view of the edge labels contained in this graph. + * This is a live view of the edge labels that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Edge labels can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#edgeLabels}. + */ + edgeLabels:yfiles.model.ICollectionModel; + /** + * A collection view of the node labels contained in this graph. + * This is a live view of the node labels that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Node labels can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#nodeLabels}. + */ + nodeLabels:yfiles.model.ICollectionModel; + /** + * A collection view of the ports contained in this graph. + * This is a live view of the ports that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Ports can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#ports}. + */ + ports:yfiles.model.ICollectionModel; + /** + * A collection view of the bends contained in this graph. + * This is a live view of the bends that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Bends can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#bends}. + */ + bends:yfiles.model.ICollectionModel; + /** + * Gets or sets the defaults for normal edges. + * The settings that are obtained from the instance influence newly + * created elements only. Setting different defaults afterwards + * does not influence existing elements. + * @see Specified by {@link yfiles.graph.IGraph#edgeDefaults}. + */ + edgeDefaults:yfiles.graph.IEdgeDefaults; + /** + * Gets or sets the defaults for normal nodes. + * The settings that are obtained from the instance influence newly + * created elements only. Setting different defaults afterwards + * does not influence existing elements. + * @see Specified by {@link yfiles.graph.IGraph#nodeDefaults}. + */ + nodeDefaults:yfiles.graph.INodeDefaults; + /** + * Creates and returns an edge that connects to the given port instances. + * The ports must be part + * of this graph at the time of the invocation. + * The edge will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.IPort} sourcePort The source port the created edge will connect to. + * @param {yfiles.graph.IPort} targetPort The target port the created edge will connect to. + * @param {yfiles.drawing.IEdgeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @param {Object} tag The initial value of the {@link yfiles.support.ITagOwner#tag} that will be assigned to the new edge. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + * @see {@link yfiles.drawing.common.VoidEdgeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#createEdgeWithPortsStyleAndTag}. + */ + createEdgeWithPortsStyleAndTag(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style:yfiles.drawing.IEdgeStyle,tag:Object):yfiles.graph.IEdge; + /** + * Convenience method that creates and returns an edge that connects to the given node instances using the + * given style instance. + * The nodes must be part + * of this graph at the time of the invocation, and the implementation will choose the {@link yfiles.graph.IPort} instances to + * which the edge will be connected. + * The edge will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.INode} source The source node the created edge will connect to. It is up to the implementation + * to decide which port to use at the given node. The implementation may create a new port of the edge. + * @param {yfiles.graph.INode} target The target node the created edge will connect to. It is up to the implementation + * to decide which port to use at the given node. The implementation may create a new port of the edge. + * @param {yfiles.drawing.IEdgeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @param {Object} tag The initial value of the {@link yfiles.support.ITagOwner#tag} that will be assigned to the new edge. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + * @see {@link yfiles.drawing.common.VoidEdgeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#createEdgeWithNodesStyleAndTag}. + */ + createEdgeWithNodesStyleAndTag(source:yfiles.graph.INode,target:yfiles.graph.INode,style:yfiles.drawing.IEdgeStyle,tag:Object):yfiles.graph.IEdge; + /** + * Sets the ports of the given edge to the new values. + * This will trigger an {@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} event if source or target ports differ + * from the current ones. Both ports and the edge must belong to the current graph instance. + * @param {yfiles.graph.IEdge} edge The edge to change the ports. + * @param {yfiles.graph.IPort} sourcePort The new source port instance. + * @param {yfiles.graph.IPort} targetPort The new target port instance. + * @see Specified by {@link yfiles.graph.IGraph#setPorts}. + */ + setPorts(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + /** + * Returns an {@link yfiles.collections.IEnumerable} for all edges that are adjacent to the given + * port as a {@link yfiles.graph.IEdge#sourcePort} or {@link yfiles.graph.IEdge#targetPort}. + * @param {yfiles.graph.IPort} port the port to check + * @param {yfiles.graph.AdjacencyTypes} adjacencyType The type of adjacency to consider. + * @return {yfiles.model.IListEnumerable.} An enumeration of all adjacent edges of the given type. + * @see {@link yfiles.graph.GraphExtensions#edgesAtPort} + * @see {@link yfiles.graph.GraphExtensions#portInEdgesAt} + * @see {@link yfiles.graph.GraphExtensions#portOutEdgesAt} + * @see {@link yfiles.graph.AdjacencyTypes} + * @see Specified by {@link yfiles.graph.IGraph#typedEdgesAtPort}. + */ + typedEdgesAtPort(port:yfiles.graph.IPort,adjacencyType:yfiles.graph.AdjacencyTypes):yfiles.model.IListEnumerable; + /** + * Returns an {@link yfiles.model.IListEnumerable} for all edges that have the given port owner as their + * {@link yfiles.graph.IEdge#targetPort target port's} or {@link yfiles.graph.IEdge#sourcePort source port's} {@link yfiles.graph.IPort#owner} + * depending on the {@link yfiles.graph.AdjacencyTypes}. + * @param {yfiles.graph.AdjacencyTypes} adjacencyType The type of adjacency to consider. + * @param {yfiles.graph.IPortOwner} portOwner the port owner to check + * @return {yfiles.model.IListEnumerable.} An enumeration of all adjacent edges of the given type. + * @see {@link yfiles.graph.GraphExtensions#edgesAtOwner} + * @see {@link yfiles.graph.GraphExtensions#inEdgesAt} + * @see {@link yfiles.graph.GraphExtensions#outEdgesAt} + * @see {@link yfiles.graph.AdjacencyTypes} + * @see Specified by {@link yfiles.graph.IGraph#typedEdgesAtOwner}. + */ + typedEdgesAtOwner(portOwner:yfiles.graph.IPortOwner,adjacencyType:yfiles.graph.AdjacencyTypes):yfiles.model.IListEnumerable; + /** + * Assigns the given style instance by reference to the node. + * Style instances can be shared. + * @param {yfiles.graph.INode} node The node that will be assigned the new style + * @param {yfiles.drawing.INodeStyle} style The style instance that will be assigned to the node. + * @see {@link yfiles.graph.INode#style} + * @see {@link yfiles.graph.IGraph#addNodeChangedListener NodeChanged} + * @see {@link yfiles.drawing.common.VoidNodeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#setNodeStyle}. + */ + setNodeStyle(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):void; + /** + * Assigns the given style instance by reference to the label. + * Style instances can be shared. + * @param {yfiles.graph.ILabel} label The label that will be assigned the new style + * @param {yfiles.drawing.ILabelStyle} style The style instance that will be assigned to the label. + * @see {@link yfiles.graph.ILabel#style} + * @see {@link yfiles.graph.IGraph#addLabelChangedListener LabelChanged} + * @see {@link yfiles.drawing.common.VoidLabelStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#setLabelStyle}. + */ + setLabelStyle(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle):void; + /** + * Assigns the given style instance by reference to the edge. + * Style instances can be shared. + * @param {yfiles.graph.IEdge} edge The edge that will be assigned the new style + * @param {yfiles.drawing.IEdgeStyle} style The style instance that will be assigned to the edge. + * @see {@link yfiles.graph.IEdge#style} + * @see {@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} + * @see {@link yfiles.drawing.common.VoidEdgeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#setEdgeStyle}. + */ + setEdgeStyle(edge:yfiles.graph.IEdge,style:yfiles.drawing.IEdgeStyle):void; + /** + * Assigns the given style instance by reference to the port. + * Style instances can be shared. + * @param {yfiles.graph.IPort} port The port that will be assigned the new style + * @param {yfiles.drawing.IPortStyle} style The style instance that will be assigned to the port. + * @see {@link yfiles.graph.IPort#style} + * @see {@link yfiles.graph.IGraph#addPortChangedListener PortChanged} + * @see {@link yfiles.drawing.common.VoidPortStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#setPortStyle}. + */ + setPortStyle(port:yfiles.graph.IPort,style:yfiles.drawing.IPortStyle):void; + /** + * Determines whether this graph contains the specified item. + * @param {yfiles.model.IModelItem} item The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraph#contains}. + */ + contains(item:yfiles.model.IModelItem):boolean; + /** + * Adds a bend at the given index to the given edge using the coordinates provided. + * The added instance will be returned. + * @param {yfiles.graph.IEdge} edge The edge to which the bend will be added. + * @param {number} index The index for the newly added bend + * @param {yfiles.geometry.PointD} location the coordinates to use for the newly created bend + * @return {yfiles.graph.IBend} a newly created live bend + * @see {@link yfiles.graph.IGraph#removeBend} + * @see {@link yfiles.graph.IGraph#setBendLocation} + * @see Specified by {@link yfiles.graph.IGraph#addBend}. + */ + addBend(edge:yfiles.graph.IEdge,index:number,location:yfiles.geometry.PointD):yfiles.graph.IBend; + /** + * Add a port to the given port owner using the location model parameter, style and tag. + * The locationModelParameter determines the location of the port. + * Depending on the implementation this method may throw an {@link yfiles.system.NotSupportedException} + * if the type of the portOwner instance does not support adding of ports. + * This will trigger the {@link yfiles.graph.IGraph#addNodeChangedListener NodeChanged} or {@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} + * event correspondingly. + * @param {yfiles.graph.IPortOwner} portOwner the owner to add the port instance to. + * @param {yfiles.graph.IPortLocationModelParameter} locationModelParameter the parameter to use for the port to determine its location. + * @param {yfiles.drawing.IPortStyle} style the style to initially assign to the {@link yfiles.graph.IPort#style} property, e.g. + * {@link yfiles.drawing.common.VoidPortStyle#INSTANCE}. + * @param {Object} tag the initial {@link yfiles.support.ITagOwner#tag} to assign. + * @return {yfiles.graph.IPort} the newly created port + * @see {@link yfiles.graph.IGraph#addPortAddedListener PortAdded} + * @see {@link yfiles.drawing.common.VoidPortStyle#INSTANCE} + * @throws {yfiles.system.NotSupportedException} If this instance cannot add a port to portOwner. + * @see Specified by {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag}. + */ + addPortWithParameterStyleAndTag(portOwner:yfiles.graph.IPortOwner,locationModelParameter:yfiles.graph.IPortLocationModelParameter,style:yfiles.drawing.IPortStyle,tag:Object):yfiles.graph.IPort; + /** + * Add a label to the given item using the text as the initial label text and label model parameter, style and tag. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} labelModelParameter The label model parameter instance to use. + * @param {string} text the initial text of the label + * @param {yfiles.drawing.ILabelStyle} style The style to use for the label + * @param {yfiles.geometry.SizeD} preferredSize The initial values to use for the {@link yfiles.graph.ILabel#preferredSize}. + * @param {Object} tag the initial {@link yfiles.support.ITagOwner#tag} to assign. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + * @see {@link yfiles.graph.IGraph#setLabelStyle} + * @see {@link yfiles.drawing.common.VoidLabelStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#addLabelWithParameterStylePreferredSizeAndTag}. + */ + addLabelWithParameterStylePreferredSizeAndTag(item:yfiles.graph.ILabeledItem,labelModelParameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,preferredSize:yfiles.geometry.SizeD,tag:Object):yfiles.graph.ILabel; + /** + * Sets the label text of the given label. + * @param {yfiles.graph.ILabel} label the label to modify + * @param {string} text the new text of the label + * @see {@link yfiles.graph.ILabel#text} + * @see Specified by {@link yfiles.graph.IGraph#setLabelText}. + */ + setLabelText(label:yfiles.graph.ILabel,text:string):void; + /** + * Modifies the location of the given bend. + * @param {yfiles.graph.IBend} bend the bend whose location is to be modified + * @param {yfiles.geometry.PointD} location the new location of the bend + * @see {@link yfiles.graph.IGraph#addBend} + * @see Specified by {@link yfiles.graph.IGraph#setBendLocation}. + */ + setBendLocation(bend:yfiles.graph.IBend,location:yfiles.geometry.PointD):void; + /** + * Sets the preferred size of the label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.geometry.SizeD} preferredSize The new preferred size. + * @see {@link yfiles.graph.ILabel#preferredSize} + * @see Specified by {@link yfiles.graph.IGraph#setPreferredSize}. + */ + setPreferredSize(label:yfiles.graph.ILabel,preferredSize:yfiles.geometry.SizeD):void; + /** + * Sets the label model parameter for the given label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.graph.ILabelModelParameter} parameter The new parameter. + * @throws {yfiles.system.ArgumentException} If the parameter cannot be used for this label. + * @see Specified by {@link yfiles.graph.IGraph#setLabelModelParameter}. + */ + setLabelModelParameter(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):void; + /** + * Sets a new {@link yfiles.graph.IPortLocationModelParameter} for the given port. + * @param {yfiles.graph.IPort} port The port to modify + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter the new parameter that determines the coordinates of the port + * @see Specified by {@link yfiles.graph.IGraph#setLocationModelParameter}. + */ + setLocationModelParameter(port:yfiles.graph.IPort,location:yfiles.graph.IPortLocationModelParameter):void; + /** + * Sets the bounds of the given node to the new values. + * @param {yfiles.graph.INode} node a live node that belongs to this graph + * @param {yfiles.geometry.RectD} bounds The new bounds of the node to assign to its {@link yfiles.graph.INode#layout}. + * @see {@link yfiles.graph.INode#layout} + * @see Specified by {@link yfiles.graph.IGraph#setBounds}. + */ + setBounds(node:yfiles.graph.INode,bounds:yfiles.geometry.RectD):void; + /** + * Removes the given node instance from this graph. + * The node must be a part of this graph. + * This will trigger the corresponding event. This method will remove all adjacent edges and their + * corresponding ports in proper order before the node will be removed. Also this will trigger + * the removal of all labels owned by this instance. + * @param {yfiles.graph.INode} node the live node to be removed from this graph instance + * @see {@link yfiles.graph.IGraph#addNodeRemovedListener NodeRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeNode}. + */ + removeNode(node:yfiles.graph.INode):void; + /** + * Removes the given edge instance from this graph. + * The edge must be a part of this graph. + * This will trigger the corresponding event. The implementation may decide to remove the + * corresponding ports from the node if no other edge connects to them after the given + * edge has been removed. Also this will trigger the removal of all labels and bends owned by this instance. + * @param {yfiles.graph.IEdge} edge the live edge to be removed from this graph instance + * @see {@link yfiles.graph.IGraph#addEdgeRemovedListener EdgeRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeEdge}. + */ + removeEdge(edge:yfiles.graph.IEdge):void; + /** + * Removes the given label from its owner. + * This will trigger the corresponding event. + * The label must be part of this graph + * at the time of the invocation. + * This will trigger the corresponding events. + * @param {yfiles.graph.ILabel} label the label to remove + * @see {@link yfiles.graph.IGraph#addLabelRemovedListener LabelRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeLabel}. + */ + removeLabel(label:yfiles.graph.ILabel):void; + /** + * Removes a port from its owner. + * The port must be part of this graph + * at the time of the invocation. This will also remove all edges that are currently connected to the port. + * This will trigger the {@link yfiles.graph.IGraph#addNodeChangedListener NodeChanged} or {@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} event respectively. + * @param {yfiles.graph.IPort} port the port that will be removed + * @see {@link yfiles.graph.IGraph#addPortRemovedListener PortRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removePort}. + */ + removePort(port:yfiles.graph.IPort):void; + /** + * Removes the given bend instance from its edge. + * The bend must be part of this graph + * at the time of the invocation. + * This will trigger the corresponding events. + * @param {yfiles.graph.IBend} bend the bend to remove + * @see {@link yfiles.graph.IGraph#addBendRemovedListener BendRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeBend}. + */ + removeBend(bend:yfiles.graph.IBend):void; + /** + * Sets the lookup instance to use in {@link yfiles.graph.AbstractGraphWrapper#lookup}. + */ + setLookup(newLookup:yfiles.support.ILookup):void; + /** + * Gets the lookup instance to use in {@link yfiles.graph.AbstractGraphWrapper#lookup}. + */ + getLookup():yfiles.support.ILookup; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Event that is triggered if a node has been created. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in node creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the node creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + */ + addNodeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a node has been created. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in node creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the node creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + */ + removeNodeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a node has been removed. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in node removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the node removal that has triggered this event. + * @see {@link yfiles.graph.IGraph#removeNode} + */ + addNodeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a node has been removed. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in node removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the node removal that has triggered this event. + * @see {@link yfiles.graph.IGraph#removeNode} + */ + removeNodeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a node has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setNodeStyle} + */ + addNodeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a node has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setNodeStyle} + */ + removeNodeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been created. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in edge creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the edge creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#createEdgeWithPortsStyleAndTag} + */ + addEdgeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been created. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in edge creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the edge creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#createEdgeWithPortsStyleAndTag} + */ + removeEdgeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been removed. + * This event will be triggered, too, prior to a node removal. + *

+ * Implementations may choose to use the {@link yfiles.graph.EdgeEventArgs} to carry + * additional port information. The {@link yfiles.graph.EdgeEventArgs#sourcePort} + * and {@link yfiles.graph.EdgeEventArgs#targetPort} properties will be set to the the instances + * the edge was connected to before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in edge removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the edge removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removeNode} + * @see {@link yfiles.graph.IGraph#removeEdge} + */ + addEdgeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been removed. + * This event will be triggered, too, prior to a node removal. + *

+ * Implementations may choose to use the {@link yfiles.graph.EdgeEventArgs} to carry + * additional port information. The {@link yfiles.graph.EdgeEventArgs#sourcePort} + * and {@link yfiles.graph.EdgeEventArgs#targetPort} properties will be set to the the instances + * the edge was connected to before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in edge removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the edge removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removeNode} + * @see {@link yfiles.graph.IGraph#removeEdge} + */ + removeEdgeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been changed, e.g. if its style + * has been replaced. + *

+ * Also this event will be triggered if the {@link yfiles.graph.IEdge#sourcePort} + * or {@link yfiles.graph.IEdge#targetPort} have been changed by a call to {@link yfiles.graph.IGraph#setPorts}. + * Implementations may choose to use the {@link yfiles.graph.EdgeEventArgs} to carry + * additional port information. In the case of {@link yfiles.graph.IGraph#setPorts}, the {@link yfiles.graph.EdgeEventArgs#sourcePort} + * and {@link yfiles.graph.EdgeEventArgs#targetPort} properties will be set to the the old instances + * that the edge was connected to previously. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + *

+ * @see {@link yfiles.graph.IGraph#setEdgeStyle} + */ + addEdgeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been changed, e.g. if its style + * has been replaced. + *

+ * Also this event will be triggered if the {@link yfiles.graph.IEdge#sourcePort} + * or {@link yfiles.graph.IEdge#targetPort} have been changed by a call to {@link yfiles.graph.IGraph#setPorts}. + * Implementations may choose to use the {@link yfiles.graph.EdgeEventArgs} to carry + * additional port information. In the case of {@link yfiles.graph.IGraph#setPorts}, the {@link yfiles.graph.EdgeEventArgs#sourcePort} + * and {@link yfiles.graph.EdgeEventArgs#targetPort} properties will be set to the the old instances + * that the edge was connected to previously. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + *

+ * @see {@link yfiles.graph.IGraph#setEdgeStyle} + */ + removeEdgeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been added to an edge in this graph. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in bend creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the bend creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addBend} + */ + addBendAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been added to an edge in this graph. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in bend creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the bend creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addBend} + */ + removeBendAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been removed from an edge in this graph. + * This event will be triggered, too, if an edge has been removed from the graph, for each + * of the bends that belonged to the edge. + *

+ * Implementations may choose to use the {@link yfiles.graph.BendEventArgs} to carry + * additional bend owner and index information. The {@link yfiles.graph.BendEventArgs#owner} + * and {@link yfiles.graph.BendEventArgs#index} properties will be set to the the edge and + * index that the bend belonged to before the removal. + *

+ *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in bend removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the bend removal that has triggered this event. + *

+ *

+ * @see {@link yfiles.graph.IGraph#removeBend} + * @see {@link yfiles.graph.IGraph#removeEdge} + * @see {@link yfiles.graph.IGraph#removePort} + * @see {@link yfiles.graph.IGraph#removeNode} + */ + addBendRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been removed from an edge in this graph. + * This event will be triggered, too, if an edge has been removed from the graph, for each + * of the bends that belonged to the edge. + *

+ * Implementations may choose to use the {@link yfiles.graph.BendEventArgs} to carry + * additional bend owner and index information. The {@link yfiles.graph.BendEventArgs#owner} + * and {@link yfiles.graph.BendEventArgs#index} properties will be set to the the edge and + * index that the bend belonged to before the removal. + *

+ *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in bend removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the bend removal that has triggered this event. + *

+ *

+ * @see {@link yfiles.graph.IGraph#removeBend} + * @see {@link yfiles.graph.IGraph#removeEdge} + * @see {@link yfiles.graph.IGraph#removePort} + * @see {@link yfiles.graph.IGraph#removeNode} + */ + removeBendRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been changed. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + */ + addBendChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been changed. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + */ + removeBendChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been added to this graph instance. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in label creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the label creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addLabelWithParameterStylePreferredSizeAndTag} + */ + addLabelAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been added to this graph instance. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in label creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the label creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addLabelWithParameterStylePreferredSizeAndTag} + */ + removeLabelAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been removed from this graph instance. + * This event will also be triggered, prior to the removal of the {@link yfiles.graph.ILabel#owner owner} + * of the label. + *

+ * Implementations may choose to use the {@link yfiles.graph.LabelEventArgs} to carry + * additional label owner information. The {@link yfiles.graph.LabelEventArgs#owner} + * property will be set to the the owner of the label + * that owned it before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in label removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the label removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removeLabel} + * @see {@link yfiles.graph.IGraph#removeNode} + * @see {@link yfiles.graph.IGraph#removeEdge} + */ + addLabelRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been removed from this graph instance. + * This event will also be triggered, prior to the removal of the {@link yfiles.graph.ILabel#owner owner} + * of the label. + *

+ * Implementations may choose to use the {@link yfiles.graph.LabelEventArgs} to carry + * additional label owner information. The {@link yfiles.graph.LabelEventArgs#owner} + * property will be set to the the owner of the label + * that owned it before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in label removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the label removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removeLabel} + * @see {@link yfiles.graph.IGraph#removeNode} + * @see {@link yfiles.graph.IGraph#removeEdge} + */ + removeLabelRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setLabelStyle} + */ + addLabelChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setLabelStyle} + */ + removeLabelChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been added to this graph instance. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the port creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag} + * @see {@link yfiles.graph.IGraph#createEdgeWithNodesStyleAndTag} + */ + addPortAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been added to this graph instance. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the port creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag} + * @see {@link yfiles.graph.IGraph#createEdgeWithNodesStyleAndTag} + */ + removePortAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been removed from its {@link yfiles.graph.IPort#owner owner}. + * This event will also be triggered prior to the removal of the corresponding owner + * of the port. + *

+ * Implementations may choose to use the {@link yfiles.graph.PortEventArgs} to carry + * additional port owner information. The {@link yfiles.graph.PortEventArgs#owner} + * property will be set to the the owner of the port + * that owned it before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in port removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the port removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removePort} + * @see {@link yfiles.graph.IGraph#removeNode} + */ + addPortRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been removed from its {@link yfiles.graph.IPort#owner owner}. + * This event will also be triggered prior to the removal of the corresponding owner + * of the port. + *

+ * Implementations may choose to use the {@link yfiles.graph.PortEventArgs} to carry + * additional port owner information. The {@link yfiles.graph.PortEventArgs#owner} + * property will be set to the the owner of the port + * that owned it before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in port removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the port removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removePort} + * @see {@link yfiles.graph.IGraph#removeNode} + */ + removePortRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setPortStyle} + */ + addPortChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setPortStyle} + */ + removePortChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if the graph has changed visually and the display should + * be updated to reflect the changes. + */ + addDisplaysInvalidatedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that is triggered if the graph has changed visually and the display should + * be updated to reflect the changes. + */ + removeDisplaysInvalidatedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Gets the mapper registry that is associated with this graph instance. + * The registry can be used to store data mappings for the items in this instance. + * @see {@link yfiles.graph.IMapperRegistry} + * @see {@link yfiles.model.IModelItem} + * @see {@link yfiles.support.ITagOwner#tag} + * @see Specified by {@link yfiles.graph.IGraph#mapperRegistry}. + */ + mapperRegistry:yfiles.graph.IMapperRegistry; + /** + * Creates and returns a node using the specified values for the initial geometry, style, and {@link yfiles.support.ITagOwner#tag}. + * The node will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.geometry.RectD} bounds The bounds to use initially. + * The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} field + * @param {yfiles.drawing.INodeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @param {Object} tag The initial value of the {@link yfiles.support.ITagOwner#tag} that will be assigned to the new node. + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + * @see {@link yfiles.drawing.common.VoidNodeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag}. + */ + createNodeWithBoundsStyleAndTag(bounds:yfiles.geometry.RectD,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.INode; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addBendAddedListener BendAdded} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onBendAdded(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addBendRemovedListener BendRemoved} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onBendRemoved(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addPortAddedListener PortAdded} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onPortAdded(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addPortRemovedListener PortRemoved} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onPortRemoved(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addLabelAddedListener LabelAdded} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onLabelAdded(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addLabelRemovedListener LabelRemoved} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onLabelRemoved(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addNodeRemovedListener NodeRemoved} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onNodeRemoved(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addEdgeRemovedListener EdgeRemoved} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onEdgeRemoved(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addNodeCreatedListener NodeCreated} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onNodeCreated(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addBendChangedListener BendChanged} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onBendChanged(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addEdgeChangedListener EdgeChanged} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onEdgeChanged(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addEdgeCreatedListener EdgeCreated} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onEdgeCreated(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addNodeChangedListener NodeChanged} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onNodeChanged(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addPortChangedListener PortChanged} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onPortChanged(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addLabelChangedListener LabelChanged} event. + * @param {yfiles.model.ItemEventArgs.} args The parameters for the event + */ + onLabelChanged(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.graph.AbstractGraphWrapper#addDisplaysInvalidatedListener DisplaysInvalidated} event. + * @param {yfiles.system.EventArgs} args The parameters for the event + */ + onInvalidateDisplays(args:yfiles.system.EventArgs):void; + } + var AbstractGraphWrapper:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that wraps a given {@link yfiles.graph.IGraph}. + * Note that this instance will {@link yfiles.graph.AbstractGraphWrapper#addEventHandlers register listeners} with the graph, so + * {@link yfiles.graph.AbstractGraphWrapper#dispose} should be called if this instance is not used any more. + * @param {yfiles.graph.IGraph} graph The graph to wrap. + */ + new (graph:yfiles.graph.IGraph):yfiles.graph.AbstractGraphWrapper; + }; + /** + * Base class for {@link yfiles.graph.ILabeledItem} instances. + * @see {@link yfiles.graph.AbstractModelItem} + */ + export interface AbstractLabeledItem extends yfiles.graph.AbstractModelItem,yfiles.graph.ILabeledItem{ + /** + * Gets or sets the collection for the labels. + * @see Specified by {@link yfiles.graph.ILabeledItem#labels}. + */ + labels:yfiles.model.IListEnumerable; + } + var AbstractLabeledItem:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the given collection of labels and a + * null {@link yfiles.graph.AbstractModelItem#getLookup lookup}. + * @param {yfiles.model.IListEnumerable.} labelCollection the collection to use + */ + WithLabels:{ + new (labelCollection:yfiles.model.IListEnumerable):yfiles.graph.AbstractLabeledItem; + }; + /** + * Creates a new instance using the given collection of labels and the given lookup. + * @param {yfiles.model.IListEnumerable.} labelCollection the collection to use + * @param {yfiles.support.ILookup} lookup the lookup to use + */ + WithLookupAndLabels:{ + new (lookup:yfiles.support.ILookup,labelCollection:yfiles.model.IListEnumerable):yfiles.graph.AbstractLabeledItem; + }; + }; + /** + * This is the default implementation of an {@link yfiles.graph.IBend}'s + * {@link yfiles.support.ILookup#lookup} method. + */ + export interface DefaultBendLookup extends yfiles.graph.DefaultItemLookup{ + /** + * Gets or sets the bend this instance uses as the context. + * Value: The bend. + */ + bend:yfiles.graph.IBend; + /** + * Subclasses need to override this method. + * @param {T} item The context item to lookup an implementation for. + * @param {yfiles.lang.Class} type The type of the implementation to find. + * @param {yfiles.support.ILookup} nextLookup The lookup to use for another type. + * @param {yfiles.support.ILookup} lastLookup The lookup to use as a fallback for the type. + * @return {Object} + */ + chainedLookup(bend:yfiles.graph.IBend,type:yfiles.lang.Class,nextLookup:yfiles.support.ILookup,lastLookup:yfiles.support.ILookup):Object; + } + var DefaultBendLookup:{ + $class:yfiles.lang.Class; + /** + * Create a new instance without a context. + */ + new ():yfiles.graph.DefaultBendLookup; + /** + * Create a new instance with the given bend as context. + */ + ForBend:{ + new (bend:yfiles.graph.IBend):yfiles.graph.DefaultBendLookup; + }; + }; + /** + * A simple implementation of a list of {@link yfiles.graph.IBend}s. + * This implementation is backed by an {@link yfiles.collections.IList}. + */ + export interface BendList extends Object,yfiles.model.IListEnumerable{ + /** + * Returns the i-th element in the collection. + * @param {number} i the zero-based index of the item in this collection + * @return {T} the item for the given index + * @see Specified by {@link yfiles.model.IListEnumerable#getItem}. + */ + getItem(i:number):yfiles.graph.IBend; + /** + * Returns the number of elements in this collection. + * @see Specified by {@link yfiles.model.IListEnumerable#count}. + */ + count:number; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Adds the bend at the specified index. + * @param {number} index The index. + * @param {yfiles.graph.IBend} bend The bend. + */ + add(index:number,bend:yfiles.graph.IBend):void; + /** + * Removes the specified bend. + * @param {yfiles.graph.IBend} bend The bend. + */ + remove(bend:yfiles.graph.IBend):void; + /** + * Clears this instance. + */ + clear():void; + } + var BendList:{ + $class:yfiles.lang.Class; + /** + * Initializes a new empty instance of the {@link yfiles.graph.BendList} class. + */ + new ():yfiles.graph.BendList; + /** + * Initializes a new instance of the {@link yfiles.graph.BendList} class using the provided list + * for the bend collection. + * @param {yfiles.collections.IList.} bends The bends. + */ + WithBackingList:{ + new (bends:yfiles.collections.IList):yfiles.graph.BendList; + }; + }; + /** + * A simple mutable implementation of the {@link yfiles.graph.IBend} + * interface that can be used stand-alone. + * Note that this class is not the one used as the default implementation + * of a {@link yfiles.graph.DefaultGraph}'s {@link yfiles.graph.IBend}s and casting an IBend + * to this class will most likely fail. + * Instances of this class can be used without an accompanying graph instance. All of the + * properties are mutable. An example of a possible use case would be the rendering of a + * {@link yfiles.graph.SimpleEdge} with bends into a graphics context: Simply Instantiate two DefaultNodes, a + * SimpleEdge to interconnect the two nodes and add instances of this + * class to the edge's {@link yfiles.graph.SimpleEdge#bends} model. Then render the edge. + */ + export interface SimpleBend extends yfiles.graph.AbstractModelItem,yfiles.graph.IBend{ + /** + * Returns the edge this bend instance belongs to. + * This implies that Owner.Bends contains + * this instance. + * @see Specified by {@link yfiles.graph.IBend#owner}. + */ + owner:yfiles.graph.IEdge; + /** + * Gets or sets the location of this bend. + * @see {@link yfiles.graph.SimpleBend#x} + * @see {@link yfiles.graph.SimpleBend#y} + * @see Specified by {@link yfiles.graph.IBend#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Gets the current x coordinate of this bend. + * Value: The value of {@link yfiles.graph.SimpleBend#location}.X + * This delegates to the {@link yfiles.graph.SimpleBend#location} instance. + */ + x:number; + /** + * Gets the current y coordinate of this bend. + * Value: The value of {@link yfiles.graph.SimpleBend#location}.Y + * This delegates to the {@link yfiles.graph.SimpleBend#location} instance. + */ + y:number; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + } + var SimpleBend:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.SimpleBend} class using the given owner + * and a default location. + * @param {yfiles.graph.IEdge} owner The owner of the bend. + */ + WithOwner:{ + new (owner:yfiles.graph.IEdge):yfiles.graph.SimpleBend; + }; + /** + * Initializes a new instance of the {@link yfiles.graph.SimpleBend} class using the given owner + * and location. + * @param {yfiles.graph.IEdge} owner The owner of the bend. + * @param {yfiles.geometry.IPoint} location The location of the bend. + */ + WithOwnerAndLocation:{ + new (owner:yfiles.graph.IEdge,location:yfiles.geometry.IPoint):yfiles.graph.SimpleBend; + }; + /** + * Initializes a new instance of the {@link yfiles.graph.SimpleBend} class. + * @param {yfiles.support.ILookup} lookup The lookup to use. + * @param {yfiles.graph.IEdge} owner The owner of the bend. + */ + WithLookupAndOwner:{ + new (lookup:yfiles.support.ILookup,owner:yfiles.graph.IEdge):yfiles.graph.SimpleBend; + }; + /** + * Initializes a new instance of the {@link yfiles.graph.SimpleBend} class. + * @param {yfiles.support.ILookup} lookup The lookup to use. + * @param {yfiles.graph.IEdge} owner The owner of the bend. + * @param {yfiles.geometry.IPoint} location The location of the bend. + */ + WithLookupOwnerAndLocation:{ + new (lookup:yfiles.support.ILookup,owner:yfiles.graph.IEdge,location:yfiles.geometry.IPoint):yfiles.graph.SimpleBend; + }; + }; + /** + * A simple mutable implementation of the {@link yfiles.graph.IPort} + * interface that can be used stand-alone. + * Note that this class is not the one used as the default implementation + * of a {@link yfiles.graph.DefaultGraph}'s {@link yfiles.graph.IPort}s and casting an IPort + * to this class will most likely fail. + * Instances of this class can be used without an accompanying graph instance. All of the + * properties are mutable. An example of a possible use case would be the rendering of a port + * into a graphics context: Simply instantiate a SimplePort, associate a style with it + * and use the style's renderer instance to obtain a rendering for the port. + */ + export interface SimplePort extends yfiles.graph.AbstractModelItem,yfiles.graph.IPort{ + /** + * Returns the style that is responsible for the visual representation + * of this port in a {@link yfiles.canvas.CanvasControl}. + * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setPortStyle} + * method. + * Note that the style instance associated with a port instance may be shared + * between multiple port instances and that the modification of this style will + * result in a change of the appearance of all ports that are associated with the same style instance. + * @see Specified by {@link yfiles.graph.IPort#style}. + */ + style:yfiles.drawing.IPortStyle; + /** + * Gets the {@link yfiles.graph.IPortLocationModelParameter} that + * is used to determine the {@link yfiles.graph.IPort#location} of this port. + * The implementations will use the {@link yfiles.graph.IPortLocationModelParameter#model}'s + * {@link yfiles.graph.IPortLocationModel#getLocation} method to update the {@link yfiles.graph.IPort#location} + * property dynamically. Note that parameters may be shared across port instances. + * @see {@link yfiles.graph.IGraph#setLocationModelParameter} + * @see Specified by {@link yfiles.graph.IPort#locationModelParameter}. + */ + locationModelParameter:yfiles.graph.IPortLocationModelParameter; + /** + * Returns the owner of this port. + * In traditional {@link yfiles.graph.IGraph} implementations, this will be + * an {@link yfiles.graph.INode} and can safely be cast to one. In order to get to + * the {@link yfiles.graph.IEdge}s that connect to this instance, use + * {@link yfiles.graph.IGraph}'s {@link yfiles.graph.IGraph#typedEdgesAtPort} + * method. + * @see Specified by {@link yfiles.graph.IPort#owner}. + */ + owner:yfiles.graph.IPortOwner; + /** + * Returns a live view of the location of the port in world coordinates. + * The location is the anchor for the edges, that connect to this port, + * however it is up to the visualization + * logic where exactly the visual part of an edge will end. + * As this will yield a live view, it is up to the client to copy the values if + * a snapshot of the state is needed. + * In order to modify the location of a port, use the {@link yfiles.graph.IGraph#setLocationModelParameter} + * in {@link yfiles.graph.IGraph}. + * @see {@link yfiles.graph.IPort#locationModelParameter} + * @see Specified by {@link yfiles.graph.IPort#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Sets the location of this port. + */ + setLocation(location:yfiles.geometry.PointD):void; + } + var SimplePort:{ + $class:yfiles.lang.Class; + /** + * Creates a port with a {@link yfiles.graph.DefaultPortLookup default lookup} + * using the given location and owner. + */ + WithParameterAndOwner:{ + new (location:yfiles.graph.IPortLocationModelParameter,owner:yfiles.graph.IPortOwner):yfiles.graph.SimplePort; + }; + /** + * Creates a port with a {@link yfiles.graph.DefaultPortLookup default lookup} + * using the given lookup, location and owner. + */ + WithLookupLocationAndOwner:{ + new (lookup:yfiles.support.ILookup,location:yfiles.geometry.IPoint,owner:yfiles.graph.IPortOwner):yfiles.graph.SimplePort; + }; + /** + * Creates a port with a {@link yfiles.graph.DefaultPortLookup default lookup} + * using the given lookup, location and owner. + */ + WithLookupParameterAndOwner:{ + new (lookup:yfiles.support.ILookup,locationModelParameter:yfiles.graph.IPortLocationModelParameter,owner:yfiles.graph.IPortOwner):yfiles.graph.SimplePort; + }; + }; + /** + * This is the default implementation of an {@link yfiles.graph.INode}'s + * {@link yfiles.support.ILookup#lookup} method. + */ + export interface DefaultNodeLookup extends yfiles.graph.DefaultItemLookup{ + /** + * Provides several default implementations for the various aspects of an {@link yfiles.graph.INode}. + * @param {yfiles.graph.INode} node The node to find an implementation for. + * @param {yfiles.lang.Class} type The type. + * @param {yfiles.support.ILookup} nextLookup The next lookup. + * @param {yfiles.support.ILookup} lastLookup The last lookup. + * @return {Object} An implementation or null. + * @see Overrides {@link yfiles.graph.DefaultItemLookup#chainedLookup} + */ + chainedLookup(node:yfiles.graph.INode,type:yfiles.lang.Class,nextLookup:yfiles.support.ILookup,lastLookup:yfiles.support.ILookup):Object; + } + var DefaultNodeLookup:{ + $class:yfiles.lang.Class; + /** + * Create a new instance without a context. + */ + new ():yfiles.graph.DefaultNodeLookup; + /** + * Create a new instance with the given node as context. + */ + ForNode:{ + new (node:yfiles.graph.INode):yfiles.graph.DefaultNodeLookup; + }; + }; + /** + * The default implementation of an {@link yfiles.graph.IPort}'s + * {@link yfiles.support.ILookup#lookup} method. + */ + export interface DefaultPortLookup extends yfiles.graph.DefaultItemLookup{ + /** + * Gets or sets the associated port. + */ + port:yfiles.graph.IPort; + /** + * Subclasses need to override this method. + * @param {T} item The context item to lookup an implementation for. + * @param {yfiles.lang.Class} type The type of the implementation to find. + * @param {yfiles.support.ILookup} nextLookup The lookup to use for another type. + * @param {yfiles.support.ILookup} lastLookup The lookup to use as a fallback for the type. + * @return {Object} + */ + chainedLookup(port:yfiles.graph.IPort,type:yfiles.lang.Class,nextLookup:yfiles.support.ILookup,lastLookup:yfiles.support.ILookup):Object; + } + var DefaultPortLookup:{ + $class:yfiles.lang.Class; + /** + * Create a new instance without a context. + */ + new ():yfiles.graph.DefaultPortLookup; + /** + * Create a new instance with the given item as context. + */ + ForPort:{ + new (port:yfiles.graph.IPort):yfiles.graph.DefaultPortLookup; + }; + }; + /** + * A simple {@link yfiles.canvas.ICanvasObjectDescriptor} that can be used + * to draw {@link yfiles.input.IPortCandidate} instances in a {@link yfiles.canvas.CanvasControl}. + */ + export interface DefaultPortCandidateDescriptor extends Object,yfiles.canvas.ICanvasObjectDescriptor,yfiles.drawing.IVisualCreator,yfiles.drawing.IBoundsProvider,yfiles.drawing.IHitTestable,yfiles.drawing.IVisibilityTest,yfiles.drawing.IMarqueeTestable{ + /** + * Gets or sets the size to use for a valid candidate. + * Note that this will have no effect if the drawings have been obtained + * via the {@link yfiles.graph.DefaultPortCandidateDescriptor#CANDIDATE_DRAWING_VALID_NON_FOCUSED_KEY resource keys.} + */ + candidateSize:number; + /** + * Gets or sets the size to use for the {@link yfiles.graph.DefaultPortCandidateDescriptor#currentPortCandidate}. + * Note that this will have no effect if the drawings have been obtained + * via the {@link yfiles.graph.DefaultPortCandidateDescriptor#CANDIDATE_DRAWING_VALID_FOCUSED_KEY resource keys.} + */ + currentCandidateSize:number; + /** + * Gets or sets the highlighted port candidate. + * If this descriptor renders the same instance, it will + * be rendered highlighted. + */ + currentPortCandidate:yfiles.input.IPortCandidate; + /** + * Sets the {@link yfiles.drawing.DataTemplate} to use for the given {@link yfiles.system.ResourceKey} by this instance. + * This method can be used to reconfigure the visualization for the various keys that are declared by this class. + * @param {yfiles.system.ResourceKey} key The key to reconfigure. This is one of {@link yfiles.graph.DefaultPortCandidateDescriptor#CANDIDATE_DRAWING_VALID_NON_FOCUSED_KEY}, {@link yfiles.graph.DefaultPortCandidateDescriptor#CANDIDATE_DRAWING_INVALID_NON_FOCUSED_KEY}, {@link yfiles.graph.DefaultPortCandidateDescriptor#CANDIDATE_DRAWING_INVALID_FOCUSED_KEY}, {@link yfiles.graph.DefaultPortCandidateDescriptor#CANDIDATE_DRAWING_VALID_FOCUSED_KEY}. + * @param {yfiles.drawing.DataTemplate} template The template to use instead of the default. + */ + setTemplate(key:yfiles.system.ResourceKey,template:yfiles.drawing.DataTemplate):void; + updateVisual(ctx:yfiles.drawing.IRenderContext,oldVisual:yfiles.drawing.Visual):yfiles.drawing.Visual; + /** + * Returns an implementation of {@link yfiles.drawing.IVisualCreator} that will create + * the {@link yfiles.drawing.Visual} tree for the user object. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to create a Visual for + * @return {yfiles.drawing.IVisualCreator} an implementation or null if nothing shall be rendered + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getVisualCreator}. + */ + getVisualCreator(forUserObject:Object):yfiles.drawing.IVisualCreator; + /** + * Determines whether the given canvas object is deemed dirty and needs + * updating. + * @param {yfiles.canvas.ICanvasObject} canvasObject The object to check. + * @param {yfiles.canvas.ICanvasContext} context The context that will be used for the update. + * @return {boolean} Whether an update is needed. + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#isDirty}. + */ + isDirty(canvasObject:yfiles.canvas.ICanvasObject,context:yfiles.canvas.ICanvasContext):boolean; + /** + * Returns an implementation of {@link yfiles.drawing.IBoundsProvider} that can determine the visible bounds + * of the rendering of the user object. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to query the bounds for + * @return {yfiles.drawing.IBoundsProvider} an implementation or null if the bounds are not known, in which + * case the bounds are treated as infinite + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getBoundsProvider}. + */ + getBoundsProvider(forUserObject:Object):yfiles.drawing.IBoundsProvider; + /** + * Returns an implementation of {@link yfiles.drawing.IVisibilityTest} that can determine if the + * rendering of the user object would be visible in a given context. + * This method may always return the same instance. By contract clients will + * not cache instances returned but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to query the bounds for + * @return {yfiles.drawing.IVisibilityTest} an implementation or null if the bounds are not known, in which + * case the bounds are treated as infinite + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getVisibilityTest}. + */ + getVisibilityTest(forUserObject:Object):yfiles.drawing.IVisibilityTest; + /** + * Returns an implementation of {@link yfiles.drawing.IHitTestable} that can determine whether + * the rendering of the user object has been hit at a given coordinate. + * This method may always return the same instance. By contract, clients will + * not cache instances returned, but will always call this method + * before the methods on the instance will be called. + * This contract enables the use of the fly-weight design pattern. + * Implementations of this class can always return the same instance and + * reconfigure this instance upon each call to this method. + * @param {Object} forUserObject the user object to do the hit testing for + * @return {yfiles.drawing.IHitTestable} an implementation or null if the rendering cannot be hit tested + * @see Specified by {@link yfiles.canvas.ICanvasObjectDescriptor#getHitTestable}. + */ + getHitTestable(forUserObject:Object):yfiles.drawing.IHitTestable; + /** + * Returns a tight rectangular area where the whole rendering + * would fit into. + * If calculating the bounds is too expensive or the painting is not + * bound to a certain area, this method may return {@link yfiles.geometry.RectD#INFINITE}. + * If nothing is painted, this method should return an empty rectangle, where + * either or both the width and height is non-positive or + * {@link yfiles.geometry.RectD#EMPTY}. + * @param {yfiles.canvas.ICanvasContext} ctx the context to calculate the bounds for + * @return {yfiles.geometry.RectD} the bounds or {@link yfiles.geometry.RectD#EMPTY} to indicate an unbound area + * @see Specified by {@link yfiles.drawing.IBoundsProvider#getBounds}. + */ + getBounds(ctx:yfiles.canvas.ICanvasContext):yfiles.geometry.RectD; + /** + * Determines if something has been hit at the given coordinates + * in the world coordinate system. + * Implementations should inspect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * and take the value into account when performing hit tests. + * This allows the user to hit elements even if the zoom level is very + * small and allows for accurate hit tests at greater zoom levels. + * @param {yfiles.geometry.PointD} p the coordinates in world coordinate system + * @param {yfiles.canvas.ICanvasContext} ctx the context the hit test is performed in + * @return {boolean} whether something has been hit + * @see Specified by {@link yfiles.drawing.IHitTestable#isHit}. + */ + isHit(p:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * Determines whether an element might intersect the visible region for a given context. + * Conservative implementations can always return true. + * @param {yfiles.geometry.RectD} clip The visible region clip. + * @param {yfiles.canvas.ICanvasContext} ctx The context to determine the visibility for. + * @return {boolean} false if and only if it is safe not to paint the element because + * it would not affect the given clipping region. + * @see Specified by {@link yfiles.drawing.IVisibilityTest#isVisible}. + */ + isVisible(clip:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + /** + * This callback returns true if the corresponding + * item is considered to intersect the given rectangular box. + * This method may return false if the item cannot be + * selected using a selection marquee or optionally if the + * item is only partially contained within the box. + * Implementations should respect the {@link yfiles.canvas.ICanvasContext#hitTestRadius} + * if marquee selections should behave differently on different zoom levels. + * @param {yfiles.geometry.RectD} box the box describing the marquee's bounds + * @param {yfiles.canvas.ICanvasContext} ctx the current canvas context + * @return {boolean} true if the item is considered to be captured by the marquee + * @see Specified by {@link yfiles.drawing.IMarqueeTestable#isInBox}. + */ + isInBox(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):boolean; + createVisual(ctx:yfiles.drawing.IRenderContext):yfiles.drawing.Visual; + } + var DefaultPortCandidateDescriptor:{ + $class:yfiles.lang.Class; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.graph.DefaultPortCandidateDescriptor} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for rendering a valid, non-focused {@link yfiles.input.IPortCandidate}. + * The drawing returned should be centered around (0,0). + */ + CANDIDATE_DRAWING_VALID_NON_FOCUSED_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.graph.DefaultPortCandidateDescriptor} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for rendering a valid, focused {@link yfiles.input.IPortCandidate}. + * The drawing returned should be centered around (0,0). + */ + CANDIDATE_DRAWING_VALID_FOCUSED_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.graph.DefaultPortCandidateDescriptor} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for rendering an invalid, non-focused {@link yfiles.input.IPortCandidate}. + * The drawing returned should be centered around (0,0). + */ + CANDIDATE_DRAWING_INVALID_NON_FOCUSED_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.graph.DefaultPortCandidateDescriptor} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for rendering a invalid, focused {@link yfiles.input.IPortCandidate}. + * The drawing returned should be centered around (0,0). + */ + CANDIDATE_DRAWING_INVALID_FOCUSED_KEY:yfiles.system.ResourceKey; + /** + * Instantiates a new descriptor. + */ + new ():yfiles.graph.DefaultPortCandidateDescriptor; + }; + /** + * A simple mutable implementation of the {@link yfiles.graph.INode} + * interface that can be used stand-alone. + * Note that this class is not the one used as the default implementation + * of a {@link yfiles.graph.DefaultGraph}'s {@link yfiles.graph.INode}s and casting an INode + * to this class will most likely fail. + * Instances of this class can be used without an accompanying graph instance. All of the + * properties are mutable. An example of a possible use case would be the rendering of a node + * into a graphics context: Simply Instantiate a SimpleNode, associate a style with it + * and use the style's renderer instance to obtain a rendering for the node. + */ + export interface SimpleNode extends yfiles.graph.AbstractLabeledItem,yfiles.graph.INode{ + /** + * Returns a live view of the layout of the node. + * The layout of a node is a rectangle in the world coordinate system + * that describes the bounding box of the representation of a node. + * Since this method will yield a live view, it is up to the client to copy the values of + * the instance if a snapshot of the state is needed. + * In order to modify the layout of a node, use the {@link yfiles.graph.IGraph#setBounds various methods} + * in {@link yfiles.graph.IGraph}. + * @see Specified by {@link yfiles.graph.INode#layout}. + */ + layout:yfiles.geometry.IRectangle; + /** + * Returns the style that is responsible for the visual representation + * of this node in a {@link yfiles.canvas.CanvasControl}. + * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setNodeStyle} + * method. + * Note that the style instance associated with a node instance may be shared + * between multiple node instances and that the modification of this style will + * result in a change of the appearance of all nodes that are associated with the same style instance. + * @see Specified by {@link yfiles.graph.INode#style}. + */ + style:yfiles.drawing.INodeStyle; + /** + * Provides access to a collection of {@link yfiles.graph.IPort ports} that + * are owned by this instance. + * This gives access to a read-only live view of the ports, i.e. the collection + * can change over time, as well as the ports contained in it. If a snapshot of the + * current state is needed, one needs to copy the collection. + * @see Specified by {@link yfiles.graph.IPortOwner#ports}. + */ + ports:yfiles.model.IListEnumerable; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + } + var SimpleNode:{ + $class:yfiles.lang.Class; + /** + * Creates a node with a {@link yfiles.graph.DefaultNodeLookup default lookup} + * using the given label and ports collection as well as the layout instance. + */ + WithLabelsLayoutAndPorts:{ + new (labelCollection:yfiles.model.IListEnumerable,layout:yfiles.geometry.IRectangle,ports:yfiles.model.IListEnumerable):yfiles.graph.SimpleNode; + }; + /** + * Creates a default node with default {@link yfiles.graph.DefaultNodeLookup lookup} and + * empty labels and port collections. + */ + new ():yfiles.graph.SimpleNode; + /** + * Initializes a new instance of the {@link yfiles.graph.SimpleNode} class. + * @param {yfiles.support.ILookup} lookup The lookup. + * @param {yfiles.model.IListEnumerable.} labelCollection The label collection. + * @param {yfiles.geometry.IRectangle} layout The layout. + * @param {yfiles.model.IListEnumerable.} ports The ports. + */ + WithLookupLabelsLayoutAndPorts:{ + new (lookup:yfiles.support.ILookup,labelCollection:yfiles.model.IListEnumerable,layout:yfiles.geometry.IRectangle,ports:yfiles.model.IListEnumerable):yfiles.graph.SimpleNode; + }; + }; + /** + * The default implementation of the {@link yfiles.drawing.IEdgeIntersectionCalculator}. + */ + export interface DefaultEdgeIntersectionCalculator extends Object,yfiles.drawing.IEdgeIntersectionCalculator{ + /** + * Crops an edge's path at the source or target side with respect to the given arrow. + * @param {yfiles.drawing.GeneralPath} edgePath The edge's path to crop. + * @param {boolean} atSource if set to true the source side is cropped. + * @param {yfiles.drawing.IArrow} arrow The arrow to consider for the cropping. + */ + cropEdgePathWithEdgePathAtSourceAndArrow(edgePath:{value:yfiles.drawing.GeneralPath;},atSource:boolean,arrow:yfiles.drawing.IArrow):void; + /** + * Crops the provided edgePath at one end of an edge. + * @param {yfiles.graph.IEdge} edge The edge whose path is to be cropped. + * @param {boolean} atSource Whether to crop the source or target side of the path. + * @param {yfiles.drawing.IArrow} arrow The arrow that is used at the end of the edge. + * @param {yfiles.drawing.GeneralPath} edgePath The path to crop. + * @see Specified by {@link yfiles.drawing.IEdgeIntersectionCalculator#cropEdgePath}. + */ + cropEdgePath(edge:yfiles.graph.IEdge,atSource:boolean,arrow:yfiles.drawing.IArrow,edgePath:{value:yfiles.drawing.GeneralPath;}):void; + /** + * Calculates the total length the edge path is cropped. + * This method can be overridden to change the length that is cropped from an edge. + * The default implementation returns the sum of {@link yfiles.graph.DefaultEdgeIntersectionCalculator#extraCropLength}, {@link yfiles.drawing.IArrow#length arrow length} + * and {@link yfiles.drawing.IArrow#cropLength arrow crop length} + * @param {yfiles.drawing.IArrow} arrow The arrow at this edge end. + * @param {boolean} atSource True if the crop length should be calculated at the edge source. + * False otherwise. + * @return {number} The total length the edge path is cropped. + * @see {@link yfiles.graph.DefaultEdgeIntersectionCalculator#cropEdgePath} + * @see {@link yfiles.graph.DefaultEdgeIntersectionCalculator#cropEdgePathWithEdgePathAtSourceAndArrow} + */ + calculateTotalCropLength(arrow:yfiles.drawing.IArrow,atSource:boolean):number; + /** + * Finds the intersection between a node and the edge. + */ + getIntersection(node:yfiles.graph.INode,nodeShapeGeometry:yfiles.drawing.IShapeGeometry,edge:yfiles.graph.IEdge,inner:yfiles.geometry.PointD,outer:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Checks whether a given point is inside a node's shape geometry with respect to the edge that is being calculated. + */ + inside(location:yfiles.geometry.PointD,node:yfiles.graph.INode,nodeShapeGeometry:yfiles.drawing.IShapeGeometry,edge:yfiles.graph.IEdge):boolean; + /** + * Returns the {@link yfiles.drawing.IShapeGeometry geometry} that is used to crop the edge at the port outline + * if {@link yfiles.graph.DefaultEdgeIntersectionCalculator#cropAtPort} is set to true. + * The default implementation returns null. This method can be overridden to + * return an arbitrary {@link yfiles.drawing.IShapeGeometry geometry} for a port. + * @param {yfiles.graph.IPort} port The port the edge should be cropped at. + * @return {yfiles.drawing.IShapeGeometry} The {@link yfiles.drawing.IShapeGeometry geometry} of the port. + * @see {@link yfiles.graph.DefaultEdgeIntersectionCalculator#cropAtPort} + */ + getPortGeometry(port:yfiles.graph.IPort):yfiles.drawing.IShapeGeometry; + /** + * Gets or sets an extra length the edge is cropped. + * The default value is 0. + */ + extraCropLength:number; + /** + * Gets the value that determines if the edge path is cropped at the port + * or at the node bounds. + * The default is false. + */ + cropAtPort:boolean; + } + var DefaultEdgeIntersectionCalculator:{ + $class:yfiles.lang.Class; + /** + * A singleton instance. + * Note that this is an immutable instance that cannot be cast to the {@link yfiles.graph.DefaultEdgeIntersectionCalculator} type. + */ + INSTANCE:yfiles.drawing.IEdgeIntersectionCalculator; + }; + /** + * Central implementation of the {@link yfiles.graph.IGraph} interface. + * This class uses an instance of {@link yfiles.graph.IGraphStructure} to delegate the + * actual work of holding the structure of the graph to. + * This implementation deals with the proper firing of events and handling of default + * values. + * This implementation has inherent support for undoability. + * If the {@link yfiles.graph.DefaultGraph#undoEngineEnabled} property is set to true, + * changes to the structure of the graph will automatically be recorded using + * the {@link yfiles.support.UndoEngine} instance that can be queried from this instance's + * {@link yfiles.graph.DefaultGraph#lookup} method. + * Clients that wish to enqueue custom undo events or that need to make non-structural + * changes to the graph can use the {@link yfiles.support.IUndoSupport} implementation to do so. + * An implementation of this interface can also be queried using the {@link yfiles.support.ILookup} method of this instance. + * Also there is an implementation of {@link yfiles.graph.IGraphUndoUnitSupport} in the lookup that will + * be used by this instance to create the actual undo units for structural changes in the graph's + * structure. If clients need to customize these events, they can {@link yfiles.support.ILookupDecorator#addLookup decorate} + * the lookup of this instance and wrap the provided implementation. + * Using this {@link yfiles.graph.IGraph} implementation with its default internal {@link yfiles.graph.IGraphStructure} + * implementation also adds the following instances to its {@link yfiles.graph.DefaultGraph#lookup}: + *
    + *
  • + * {@link yfiles.graph.INodeBoundsChangeReporter} + *
  • + *
  • + * {@link yfiles.graph.ILabelTextChangeReporter} + *
  • + *
  • + * {@link yfiles.graph.IBendLocationChangeReporter} + *
  • + *
  • + * {@link yfiles.graph.IPortLocationModelParameterChangeReporter} + *
  • + *
  • + * {@link yfiles.graph.IPreferredSizeChangeReporter} + *
  • + *
  • + * {@link yfiles.graph.ITagChangeReporter} + *
  • + *
+ * Finally this implementation offers convenient support to enable {@link yfiles.graph.DefaultGraph#groupingSupported support for grouped graphs}. + *
+ * Related Information in the Developers Guide: + *

+ * DefaultGraph is described in the section Class DefaultGraph. + *

+ * @see {@link yfiles.graph.DefaultGraph#createUndoSupport} + * @see {@link yfiles.graph.DefaultGraph#createUndoEngine} + * @see {@link yfiles.graph.DefaultGraph#groupingSupported} + * @see {@link yfiles.graph.IGroupedGraph} + * @see {@link yfiles.graph.DefaultGraph#lookup} + * @see {@link yfiles.graph.DefaultGraph} + * @see {@link yfiles.graph.FoldingManager} + */ + export interface DefaultGraph extends Object,yfiles.graph.IGraph{ + /** + * Gets the mapper registry that is associated with this graph instance. + * Value: + * The registry can be used to store data mappings for the items in this instance. + * This field is populated upon first access using the {@link yfiles.graph.DefaultGraph#createMapperRegistry}. + * Also this property provides write access. + * @see {@link yfiles.graph.IMapperRegistry} + * @see {@link yfiles.model.IModelItem} + * @see {@link yfiles.support.ITagOwner#tag} + * @see Specified by {@link yfiles.graph.IGraph#mapperRegistry}. + */ + mapperRegistry:yfiles.graph.IMapperRegistry; + /** + * Factory method for the {@link yfiles.graph.DefaultGraph#mapperRegistry} property that creates the {@link yfiles.graph.IMapperRegistry}. + * @return {yfiles.graph.IMapperRegistry} A new instance of {@link yfiles.graph.MapperRegistry} + */ + createMapperRegistry():yfiles.graph.IMapperRegistry; + /** + * Determines whether the {@link yfiles.support.UndoEngine} used for this instance + * should be enabled. + * The default is false. In order to enable undoability for this instance, + * set this property to true and {@link yfiles.graph.DefaultGraph#lookup} the {@link yfiles.support.UndoEngine} type. + * Disabling this property clears and removes the current {@link yfiles.support.UndoEngine} (and all enqueued IUndoUnits). + */ + undoEngineEnabled:boolean; + /** + * Creates the {@link yfiles.support.IUndoSupport} instance that can be + * {@link yfiles.graph.DefaultGraph#lookup looked up} on this instance. + * The instance returned will automatically record state changes of all + * entities in the graph if {@link yfiles.support.IUndoSupport#beginEdit} + * is called. + * @return {yfiles.support.IUndoSupport} An undo support instance that enqueues {@link yfiles.support.IUndoUnit}s into + * this instance's {@link yfiles.support.UndoEngine}. + */ + createUndoSupport():yfiles.support.IUndoSupport; + /** + * Creates an {@link yfiles.support.UndoEngine} instance + * that automatically triggers {@link yfiles.graph.DefaultGraph#invalidateDisplays} + * upon each invocation of {@link yfiles.support.UndoEngine#undo} + * and {@link yfiles.support.UndoEngine#redo}. + * @return {yfiles.support.UndoEngine} An {@link yfiles.support.UndoEngine} instance. + */ + createUndoEngine():yfiles.support.UndoEngine; + /** + * Adds the chain element to the lookup for this instance. + * @param {yfiles.support.IContextLookupChainLink} chainLink The lookup to decorate the current instance with. + */ + addLookup(chainLink:yfiles.support.IContextLookupChainLink):void; + /** + * Removes a previously added lookup chain element from the lookup of this. + * @param {yfiles.support.IContextLookupChainLink} chainLink The element to remove. + */ + removeLookup(chainLink:yfiles.support.IContextLookupChainLink):void; + /** + * Gets the {@link yfiles.graph.IGraphStructure graph structure} instance used internally. + * This is a convenience property for subclass implementations. + */ + graphStructure:yfiles.graph.IGraphStructure; + /** + * Convenience method that enables or disables grouping capabilities + * for this instance. + * If this property is set to true, an instance of + * {@link yfiles.graph.IGroupedGraph} can be queried from this instance's + * {@link yfiles.graph.DefaultGraph#lookup} method. + */ + groupingSupported:boolean; + /** + * Gets or sets the defaults for normal edges. + * The settings that are obtained from the instance influence newly + * created elements only. Setting different defaults afterwards + * does not influence existing elements. + * @see Specified by {@link yfiles.graph.IGraph#edgeDefaults}. + */ + edgeDefaults:yfiles.graph.IEdgeDefaults; + /** + * Gets or sets the defaults for normal nodes. + * The settings that are obtained from the instance influence newly + * created elements only. Setting different defaults afterwards + * does not influence existing elements. + * @see Specified by {@link yfiles.graph.IGraph#nodeDefaults}. + */ + nodeDefaults:yfiles.graph.INodeDefaults; + /** + * Callback method that creates the edge defaults. + * @return {yfiles.graph.IEdgeDefaults} A new instance of the {@link yfiles.graph.DefaultGraph#edgeDefaults} class that is populated + * using the return values of {@link yfiles.graph.DefaultGraph#createDefaultEdgeStyle}, {@link yfiles.graph.DefaultGraph#createEdgeLabelDefaults}, and + * {@link yfiles.graph.DefaultGraph#createEdgePortDefaults}. + */ + createEdgeDefaults():yfiles.graph.IEdgeDefaults; + /** + * Callback method that creates the edge label defaults. + * @return {yfiles.graph.ILabelDefaults} A new instance of the {@link yfiles.graph.LabelDefaults} class that is populated + * using the return values of {@link yfiles.graph.DefaultGraph#createDefaultEdgeLabelStyle} and {@link yfiles.graph.DefaultGraph#createDefaultEdgeLabelModelParameter}. + */ + createEdgeLabelDefaults():yfiles.graph.ILabelDefaults; + /** + * Callback method that creates the node label defaults. + * @return {yfiles.graph.ILabelDefaults} A new instance of the {@link yfiles.graph.LabelDefaults} class that is populated + * using the return values of {@link yfiles.graph.DefaultGraph#createDefaultNodeLabelStyle} and {@link yfiles.graph.DefaultGraph#createDefaultNodeLabelModelParameter}. + */ + createNodeLabelDefaults():yfiles.graph.ILabelDefaults; + /** + * Callback method that creates the edge port defaults. + * @return {yfiles.graph.IPortDefaults} A new instance of the {@link yfiles.graph.PortDefaults} class that is populated + * using the {@link yfiles.drawing.common.VoidPortStyle#INSTANCE} and {@link yfiles.graph.DefaultGraph#createDefaultEdgePortLocationParameter}. + */ + createEdgePortDefaults():yfiles.graph.IPortDefaults; + /** + * Creates the default edge port location parameter. + * @return {yfiles.graph.IPortLocationModelParameter} A simple default parameter suitable for edges. + */ + createDefaultEdgePortLocationParameter():yfiles.graph.IPortLocationModelParameter; + /** + * Callback method that creates the node port defaults. + * @return {yfiles.graph.IPortDefaults} A new instance of the {@link yfiles.graph.PortDefaults} class that is populated + * using the {@link yfiles.drawing.common.VoidPortStyle#INSTANCE} and {@link yfiles.graph.DefaultGraph#createDefaultNodePortLocationParameter}. + */ + createNodePortDefaults():yfiles.graph.IPortDefaults; + /** + * Creates the default node port location parameter. + * @return {yfiles.graph.IPortLocationModelParameter} {@link yfiles.drawing.NodeScaledPortLocationModel#NODE_CENTER_ANCHORED} + */ + createDefaultNodePortLocationParameter():yfiles.graph.IPortLocationModelParameter; + /** + * Callback method that creates the node defaults. + * @return {yfiles.graph.INodeDefaults} A new instance of the {@link yfiles.graph.DefaultGraph#nodeDefaults} class that is populated + * using the return values of {@link yfiles.graph.DefaultGraph#createDefaultNodeStyle}, {@link yfiles.graph.DefaultGraph#createNodeLabelDefaults}, and + * {@link yfiles.graph.DefaultGraph#createNodePortDefaults}. + */ + createNodeDefaults():yfiles.graph.INodeDefaults; + /** + * Sets the lookup implementation that will be used for {@link yfiles.graph.DefaultGraph#lookup} calls. + * A value of null will revert to the default behavior. + * @param {yfiles.support.ILookup} newLookup The lookup instance to delegate lookup calls to. + * @see {@link yfiles.graph.DefaultGraph#addLookup} + * @see {@link yfiles.graph.DefaultGraph#getLookup} + */ + setLookupImplementation(newLookup:yfiles.support.ILookup):void; + /** + * Returns the lookup implementation that is used for {@link yfiles.graph.DefaultGraph#lookup} calls. + * @return {yfiles.support.ILookup} The replacing lookup instance or null if the internal + * lookup mechanism is used. + * @see {@link yfiles.graph.DefaultGraph#setLookupImplementation} + */ + getLookup():yfiles.support.ILookup; + /** + * Factory method for the default node label style. This method will be called + * upon first access to the {@link yfiles.graph.DefaultGraph#nodeDefaults} property. + * @return {yfiles.drawing.ILabelStyle} a new instance of {@link yfiles.drawing.SimpleLabelStyle} + */ + createDefaultNodeLabelStyle():yfiles.drawing.ILabelStyle; + /** + * Factory method for the default edge label style. This method will be called + * upon first access to the {@link yfiles.graph.DefaultGraph#edgeDefaults} property. + * @return {yfiles.drawing.ILabelStyle} a new instance of {@link yfiles.drawing.SimpleLabelStyle} + */ + createDefaultEdgeLabelStyle():yfiles.drawing.ILabelStyle; + /** + * Factory method for the default node style. This method will be called + * upon first access to the {@link yfiles.graph.DefaultGraph#nodeDefaults} property. + * @return {yfiles.drawing.INodeStyle} a new instance of {@link yfiles.drawing.ShapeNodeStyle} + */ + createDefaultNodeStyle():yfiles.drawing.INodeStyle; + /** + * Factory method for the default edge style. This method will be called + * upon first access to the {@link yfiles.graph.DefaultGraph#edgeDefaults} property. + * @return {yfiles.drawing.IEdgeStyle} a new instance of {@link yfiles.drawing.PolylineEdgeStyle} + */ + createDefaultEdgeStyle():yfiles.drawing.IEdgeStyle; + /** + * Calculates the bounds of this graph using the + * {@link yfiles.graph.INode#layout}, {@link yfiles.graph.IPort#location source port + * and target port locations}, and the {@link yfiles.graph.IBend}s. + * @return {yfiles.geometry.RectD} A rectangle that is the union of all elements in the graph. + */ + getBounds():yfiles.geometry.RectD; + /** + * Creates and returns a node using the specified values for the initial geometry, style, and {@link yfiles.support.ITagOwner#tag}. + * The node will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.geometry.RectD} bounds The bounds to use initially. + * The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} field + * @param {yfiles.drawing.INodeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @param {Object} tag The initial value of the {@link yfiles.support.ITagOwner#tag} that will be assigned to the new node. + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + * @see {@link yfiles.drawing.common.VoidNodeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag}. + */ + createNodeWithBoundsStyleAndTag(bounds:yfiles.geometry.RectD,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.INode; + /** + * Callback that is invoked before the node is added to this graph's structure. + * @param {yfiles.graph.INode} node A node that is not yet contained in this graph. + */ + onCreatingNode(node:yfiles.graph.INode):void; + /** + * Convenience method that creates and returns an edge that connects to the given node instances using the + * given style instance. + * The nodes must be part + * of this graph at the time of the invocation, and the implementation will choose the {@link yfiles.graph.IPort} instances to + * which the edge will be connected. + * The edge will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.INode} source The source node the created edge will connect to. This implementation + * queries the {@link yfiles.graph.DefaultGraph#getNewSourcePort} method to determine which port to use. + * @param {yfiles.graph.INode} target The target node the created edge will connect to. This implementation + * queries the {@link yfiles.graph.DefaultGraph#getNewSourcePort} method to determine which port to use. + * @param {yfiles.drawing.IEdgeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @param {Object} tag the initial {@link yfiles.support.ITagOwner#tag} to assign. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.DefaultGraph#addEdgeCreatedListener EdgeCreated} + * @see {@link yfiles.graph.DefaultGraph#getNewSourcePort} + * @see {@link yfiles.graph.DefaultGraph#getNewTargetPort} + * @see {@link yfiles.graph.DefaultGraph#createEdgeWithPortsStyleAndTag} + * @see Specified by {@link yfiles.graph.IGraph#createEdgeWithNodesStyleAndTag}. + */ + createEdgeWithNodesStyleAndTag(source:yfiles.graph.INode,target:yfiles.graph.INode,style:yfiles.drawing.IEdgeStyle,tag:Object):yfiles.graph.IEdge; + /** + * Determines a {@link yfiles.graph.IPort} instance to use for the creation + * of a new edge that ends at the given {@link yfiles.graph.IPortOwner}. + * This implementation will either {@link yfiles.graph.DefaultGraph#addPortWithParameterStyleAndTag add a new center anchored port} + * to the node or, if {@link yfiles.graph.DefaultGraph#usePortCandidateProviders} is set to true + * it will query the target for a {@link yfiles.input.IPortCandidateProvider} + * to find a valid candidate. + * @param {yfiles.graph.IPortOwner} target The target node to find a port for. + * @return {yfiles.graph.IPort} The port to use for a newly created edge. + * @see {@link yfiles.graph.DefaultGraph#createEdgeWithNodesStyleAndTag} + */ + getNewTargetPort(target:yfiles.graph.IPortOwner):yfiles.graph.IPort; + /** + * Determines a {@link yfiles.graph.IPort} instance to use for the creation + * of a new edge that starts at the given {@link yfiles.graph.IPortOwner}. + * This implementation will either {@link yfiles.graph.DefaultGraph#addPortWithParameterStyleAndTag add a new center anchored port} + * to the node or, if {@link yfiles.graph.DefaultGraph#usePortCandidateProviders} is set to true + * it will query the source for a {@link yfiles.input.IPortCandidateProvider} + * to find a valid candidate. + * @param {yfiles.graph.IPortOwner} source The source node to find a port for. + * @return {yfiles.graph.IPort} The port to use for a newly created edge. + * @see {@link yfiles.graph.DefaultGraph#createEdgeWithNodesStyleAndTag} + */ + getNewSourcePort(source:yfiles.graph.IPortOwner):yfiles.graph.IPort; + /** + * Sets the ports of the given edge to the new values. + * This will trigger an {@link yfiles.graph.DefaultGraph#addEdgeChangedListener EdgeChanged} event if source or target ports differ + * from the current ones. Both ports and the edge must belong to the current graph instance. + * If {@link yfiles.graph.IPortDefaults#autoCleanup} is enabled, this method will remove unoccupied ports + * after they have been changed. + * @param {yfiles.graph.IEdge} edge The edge to change the ports. + * @param {yfiles.graph.IPort} sourcePort The new source port instance. + * @param {yfiles.graph.IPort} targetPort The new target port instance. + * @see Specified by {@link yfiles.graph.IGraph#setPorts}. + */ + setPorts(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + /** + * Returns an {@link yfiles.collections.IEnumerable} for all edges that are adjacent to the given + * port as a {@link yfiles.graph.IEdge#sourcePort} or {@link yfiles.graph.IEdge#targetPort}. + * @param {yfiles.graph.IPort} port the port to check + * @param {yfiles.graph.AdjacencyTypes} adjacencyType The type of adjacency to consider. + * @return {yfiles.model.IListEnumerable.} An enumeration of all adjacent edges of the given type. + * @see {@link yfiles.graph.GraphExtensions#edgesAtPort} + * @see {@link yfiles.graph.GraphExtensions#portInEdgesAt} + * @see {@link yfiles.graph.GraphExtensions#portOutEdgesAt} + * @see {@link yfiles.graph.AdjacencyTypes} + * @see Specified by {@link yfiles.graph.IGraph#typedEdgesAtPort}. + */ + typedEdgesAtPort(port:yfiles.graph.IPort,adjacencyType:yfiles.graph.AdjacencyTypes):yfiles.model.IListEnumerable; + /** + * Returns an {@link yfiles.model.IListEnumerable} for all edges that have the given port owner as their + * {@link yfiles.graph.IEdge#targetPort target port's} or {@link yfiles.graph.IEdge#sourcePort source port's} {@link yfiles.graph.IPort#owner} + * depending on the {@link yfiles.graph.AdjacencyTypes}. + * @param {yfiles.graph.AdjacencyTypes} adjacencyType The type of adjacency to consider. + * @param {yfiles.graph.IPortOwner} portOwner the port owner to check + * @return {yfiles.model.IListEnumerable.} An enumeration of all adjacent edges of the given type. + * @see {@link yfiles.graph.GraphExtensions#edgesAtOwner} + * @see {@link yfiles.graph.GraphExtensions#inEdgesAt} + * @see {@link yfiles.graph.GraphExtensions#outEdgesAt} + * @see {@link yfiles.graph.AdjacencyTypes} + * @see Specified by {@link yfiles.graph.IGraph#typedEdgesAtOwner}. + */ + typedEdgesAtOwner(portOwner:yfiles.graph.IPortOwner,adjacencyType:yfiles.graph.AdjacencyTypes):yfiles.model.IListEnumerable; + /** + * Creates and returns an edge that connects to the given port instances. + * The ports must be part + * of this graph at the time of the invocation. + * The edge will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.IPort} sourcePort The source port the created edge will connect to. + * @param {yfiles.graph.IPort} targetPort The target port the created edge will connect to. + * @param {yfiles.drawing.IEdgeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @param {Object} tag The initial value of the {@link yfiles.support.ITagOwner#tag} that will be assigned to the new edge. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + * @see {@link yfiles.drawing.common.VoidEdgeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#createEdgeWithPortsStyleAndTag}. + */ + createEdgeWithPortsStyleAndTag(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style:yfiles.drawing.IEdgeStyle,tag:Object):yfiles.graph.IEdge; + /** + * Callback that is invoked before the edge is added to this graph's structure. + * @param {yfiles.graph.IEdge} edge An edge that is not yet contained in this graph. + * @param {yfiles.graph.IPort} sourcePort The source port this edge will connect to. + * @param {yfiles.graph.IPort} targetPort The target port this edge will connect to. + */ + onCreatingEdge(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + /** + * Determines whether this graph contains the specified item. + * @param {yfiles.model.IModelItem} item The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraph#contains}. + */ + contains(item:yfiles.model.IModelItem):boolean; + /** + * Assigns the given style instance by reference to the node. + * Style instances can be shared. + * @param {yfiles.graph.INode} node The node that will be assigned the new style + * @param {yfiles.drawing.INodeStyle} style The style instance that will be assigned to the node. + * @see {@link yfiles.graph.INode#style} + * @see {@link yfiles.graph.DefaultGraph#onChangingNode} + * @see {@link yfiles.graph.DefaultGraph#addNodeChangedListener NodeChanged} + * @see Specified by {@link yfiles.graph.IGraph#setNodeStyle}. + */ + setNodeStyle(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):void; + /** + * Assigns the given style instance by reference to the label. + * Style instances can be shared. + * This implementation will {@link yfiles.graph.GraphExtensions#adjustPreferredSize adjust the preferred size} + * for the label if {@link yfiles.graph.ILabelDefaults#autoAdjustPreferredSize} is enabled. + * @param {yfiles.graph.ILabel} label The label that will be assigned the new style + * @param {yfiles.drawing.ILabelStyle} style The style instance that will be assigned to the label. + * @see {@link yfiles.graph.ILabel#style} + * @see {@link yfiles.graph.DefaultGraph#addLabelChangedListener LabelChanged} + * @see Specified by {@link yfiles.graph.IGraph#setLabelStyle}. + */ + setLabelStyle(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle):void; + /** + * Callback that is invoked before a label is being changed. + * @param {yfiles.graph.ILabel} label An element that is going to be changed. + */ + onChangingLabel(label:yfiles.graph.ILabel):void; + /** + * Callback that is invoked before a node is being changed. + * @param {yfiles.graph.INode} node An element that is going to be changed. + */ + onChangingNode(node:yfiles.graph.INode):void; + /** + * Callback that is invoked before a bend is being changed. + * @param {yfiles.graph.IBend} bend An element that is going to be changed. + */ + onChangingBend(bend:yfiles.graph.IBend):void; + /** + * Callback that is invoked after a node has changed. + * This will trigger the {@link yfiles.graph.DefaultGraph#addNodeChangedListener NodeChanged} event. + * @param {yfiles.graph.INode} node The node that has changed. + */ + onNodeChanged(node:yfiles.graph.INode):void; + /** + * Callback that is invoked after a bend has changed. + * This will trigger the {@link yfiles.graph.DefaultGraph#addBendChangedListener BendChanged} event. + * @param {yfiles.graph.IBend} bend The bend that has changed. + */ + onBendChanged(bend:yfiles.graph.IBend):void; + /** + * Callback that is invoked after a label has changed. + * This will trigger the {@link yfiles.graph.DefaultGraph#addLabelChangedListener LabelChanged} event. + * @param {yfiles.graph.ILabel} label The label that has changed. + */ + onLabelChanged(label:yfiles.graph.ILabel):void; + /** + * Assigns the given style instance by reference to the edge. + * Style instances can be shared. + * @param {yfiles.graph.IEdge} edge The edge that will be assigned the new style + * @param {yfiles.drawing.IEdgeStyle} style The style instance that will be assigned to the edge. + * @see {@link yfiles.graph.IEdge#style} + * @see {@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} + * @see {@link yfiles.drawing.common.VoidEdgeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#setEdgeStyle}. + */ + setEdgeStyle(edge:yfiles.graph.IEdge,style:yfiles.drawing.IEdgeStyle):void; + /** + * Assigns the given style instance by reference to the port. + * Style instances can be shared. + * @param {yfiles.graph.IPort} port The port that will be assigned the new style + * @param {yfiles.drawing.IPortStyle} style The style instance that will be assigned to the port. + * @see {@link yfiles.graph.IPort#style} + * @see {@link yfiles.graph.IGraph#addPortChangedListener PortChanged} + * @see {@link yfiles.drawing.common.VoidPortStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#setPortStyle}. + */ + setPortStyle(port:yfiles.graph.IPort,style:yfiles.drawing.IPortStyle):void; + /** + * Callback that is invoked before an edge is being changed. + * @param {yfiles.graph.IEdge} edge An element that is going to be changed. + */ + onChangingEdge(edge:yfiles.graph.IEdge):void; + /** + * Callback that is invoked after an edge has changed. + * This will trigger the {@link yfiles.graph.DefaultGraph#addEdgeChangedListener EdgeChanged} event. + * @param {yfiles.graph.IEdge} edge The edge that has changed. + * @param {yfiles.graph.IPort} oldSource The source port that the edge had been connected to before the change. + * @param {yfiles.graph.IPort} oldTarget The target port that the edge had been connected to before the change. + */ + onEdgeChanged(edge:yfiles.graph.IEdge,oldSource:yfiles.graph.IPort,oldTarget:yfiles.graph.IPort):void; + /** + * Callback that is invoked before a port is being changed. + * @param {yfiles.graph.IPort} port An element that is going to be changed. + */ + onChangingPort(port:yfiles.graph.IPort):void; + /** + * Callback that is invoked after a port has changed. + * This will trigger the {@link yfiles.graph.DefaultGraph#addPortChangedListener PortChanged} event. + * @param {yfiles.graph.IPort} port The port that has changed. + */ + onPortChanged(port:yfiles.graph.IPort):void; + /** + * Adds a bend at the given index to the given edge using the coordinates provided. + * The added instance will be returned. + * @param {yfiles.graph.IEdge} edge The edge to which the bend will be added. + * @param {number} index The index for the newly added bend + * @param {yfiles.geometry.PointD} location the coordinates to use for the newly created bend + * @return {yfiles.graph.IBend} a newly created live bend + * @see {@link yfiles.graph.IGraph#removeBend} + * @see {@link yfiles.graph.IGraph#setBendLocation} + * @see Specified by {@link yfiles.graph.IGraph#addBend}. + */ + addBend(edge:yfiles.graph.IEdge,index:number,location:yfiles.geometry.PointD):yfiles.graph.IBend; + /** + * Callback that is invoked before a bend is added to this graph's structure. + * @param {yfiles.graph.IEdge} edge The edge the bend will be added to. + * @param {yfiles.graph.IBend} bend The bend that will be added to the edge. + * @param {number} index The index where the bend will be added to the edge. + */ + onAddingBend(edge:yfiles.graph.IEdge,bend:yfiles.graph.IBend,index:number):void; + /** + * Callback that after a bend has been added to this graph's structure. + * @param {yfiles.graph.IBend} bend The bend that has been added to the edge. + */ + onBendAdded(bend:yfiles.graph.IBend):void; + /** + * Modifies the location of the given bend. + * This implementation will use the bend's {@link yfiles.support.ILookup#lookup} + * method to retrieve either an {@link yfiles.geometry.IPointSetter} or {@link yfiles.geometry.IMutablePoint} + * instance to set the new values to. + * This will also trigger an {@link yfiles.graph.DefaultGraph#invalidateDisplays} call. + * @param {yfiles.graph.IBend} bend the bend whose location is to be modified + * @param {yfiles.geometry.PointD} location the new coordinates of the bend + * @see {@link yfiles.graph.DefaultGraph#addBend} + * @see Specified by {@link yfiles.graph.IGraph#setBendLocation}. + */ + setBendLocation(bend:yfiles.graph.IBend,location:yfiles.geometry.PointD):void; + /** + * Removes the given bend instance from its edge. + * The bend must be part of this graph + * at the time of the invocation. + * This will trigger the corresponding events. + * @param {yfiles.graph.IBend} bend the bend to remove + * @see {@link yfiles.graph.IGraph#addBendRemovedListener BendRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeBend}. + */ + removeBend(bend:yfiles.graph.IBend):void; + /** + * Callback method that is invoked just before a bend is removed. + * @param {yfiles.graph.IBend} bend The bend that will be removed. + */ + onRemovingBend(bend:yfiles.graph.IBend):void; + /** + * Callback method that is invoked just after a bend has been removed from its edge. + * This will trigger the corresponding {@link yfiles.graph.DefaultGraph#addBendRemovedListener BendRemoved} event. + * @param {yfiles.graph.IEdge} owner The old edge. + * @param {yfiles.graph.IBend} bend The bend. + * @param {number} index The former index of the bend in the {@link yfiles.graph.IEdge#bends} list. + */ + onBendRemoved(owner:yfiles.graph.IEdge,bend:yfiles.graph.IBend,index:number):void; + /** + * Add a port to the given port owner using the coordinates as the new initial position of + * the port anchor. + * This method will throw an {@link yfiles.system.NotSupportedException} + * if the type of the portOwner instance is not of type {@link yfiles.graph.INode}. + * This will trigger the {@link yfiles.graph.DefaultGraph#addNodeChangedListener NodeChanged} event. + * @param {yfiles.graph.IPortOwner} portOwner the owner to add the port instance to. + * @param {yfiles.graph.IPortLocationModelParameter} locationModelParameter the parameter to use for the port to determine its location. + * @param {yfiles.drawing.IPortStyle} portStyle the style to assign initially to the port, e.g. {@link yfiles.drawing.common.VoidPortStyle#INSTANCE}. + * @param {Object} tag The tag to associate with the port, may be null. + * @return {yfiles.graph.IPort} the newly created port + * @see {@link yfiles.graph.DefaultGraph#addPortAddedListener PortAdded} + * @throws {yfiles.system.NotSupportedException} If this instance cannot add a port to portOwner. + * @see Specified by {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag}. + */ + addPortWithParameterStyleAndTag(portOwner:yfiles.graph.IPortOwner,locationModelParameter:yfiles.graph.IPortLocationModelParameter,portStyle:yfiles.drawing.IPortStyle,tag:Object):yfiles.graph.IPort; + /** + * Sets a new {@link yfiles.graph.IPortLocationModelParameter} for the given port. + * @param {yfiles.graph.IPort} port The port to modify + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter the new parameter that determines the coordinates of the port + * @see Specified by {@link yfiles.graph.IGraph#setLocationModelParameter}. + */ + setLocationModelParameter(port:yfiles.graph.IPort,location:yfiles.graph.IPortLocationModelParameter):void; + /** + * Called when a port is going to be added to a node. + * @param {yfiles.graph.IPortOwner} node The node. + * @param {yfiles.graph.IPort} port The port to be added. + */ + onAddingPort(node:yfiles.graph.IPortOwner,port:yfiles.graph.IPort):void; + /** + * Called when a port has been added to a node. + * This method triggers the corresponding event. + * @param {yfiles.graph.IPort} port The port that has just been added to its owner. + */ + onPortAdded(port:yfiles.graph.IPort):void; + /** + * Removes a port from its owner. + * The port must be part of this graph + * at the time of the invocation. This will also remove all edges that are currently connected to the port. + * This will trigger the {@link yfiles.graph.IGraph#addNodeChangedListener NodeChanged} or {@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} event respectively. + * @param {yfiles.graph.IPort} port the port that will be removed + * @see {@link yfiles.graph.IGraph#addPortRemovedListener PortRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removePort}. + */ + removePort(port:yfiles.graph.IPort):void; + /** + * Callback method that is called just after a port has been removed from its + * owner. + * @param {yfiles.graph.IPort} port The port that has been removed. + * @param {yfiles.graph.IPortOwner} oldOwner The previous owner of the port. + */ + onPortRemoved(oldOwner:yfiles.graph.IPortOwner,port:yfiles.graph.IPort):void; + /** + * Callback method that is called just before a port + * will be removed. + * @param {yfiles.graph.IPort} port The port that is about to be removed. + */ + onRemovingPort(port:yfiles.graph.IPort):void; + /** + * Add a label to the given item using the text as the initial label text and label model parameter, style and tag. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} labelModelParameter The label model parameter instance to use. + * @param {string} text the initial text of the label + * @param {yfiles.drawing.ILabelStyle} style The style to use for the label + * @param {yfiles.geometry.SizeD} preferredSize The initial values to use for the {@link yfiles.graph.ILabel#preferredSize}. + * @param {Object} tag the initial {@link yfiles.support.ITagOwner#tag} to assign. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + * @see {@link yfiles.graph.IGraph#setLabelStyle} + * @see {@link yfiles.drawing.common.VoidLabelStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#addLabelWithParameterStylePreferredSizeAndTag}. + */ + addLabelWithParameterStylePreferredSizeAndTag(item:yfiles.graph.ILabeledItem,labelModelParameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,preferredSize:yfiles.geometry.SizeD,tag:Object):yfiles.graph.ILabel; + /** + * Factory method that obtains a {@link yfiles.graph.ILabelModelParameter} + * to use for a newly created node label. + * This implementation returns the {@link yfiles.graph.ILabelModel#createDefaultParameter default + * parameter} of a newly created {@link yfiles.drawing.InteriorLabelModel}. + * @return {yfiles.graph.ILabelModelParameter} A model parameter instance to use for the newly created node label. + */ + createDefaultNodeLabelModelParameter():yfiles.graph.ILabelModelParameter; + /** + * Factory method that obtains a {@link yfiles.graph.ILabelModelParameter} + * to use for a newly created edge label. + * This implementation returns the {@link yfiles.graph.ILabelModel#createDefaultParameter default + * parameter} of a new {@link yfiles.drawing.RotatingEdgeLabelModel}. + * @return {yfiles.graph.ILabelModelParameter} A model parameter instance to use for the newly created edge label. + */ + createDefaultEdgeLabelModelParameter():yfiles.graph.ILabelModelParameter; + /** + * Gets or sets a property that determines whether + * {@link yfiles.graph.DefaultGraph#createEdgeWithNodesStyleAndTag} + * should use {@link yfiles.input.IPortCandidateProvider} implementations to + * find the ports to connect the newly created edge to. + * If this property is set to true the implementation + * in {@link yfiles.graph.DefaultGraph#getNewSourcePort} and {@link yfiles.graph.DefaultGraph#getNewTargetPort} + * will try to query a {@link yfiles.input.IPortCandidateProvider} from the + * respective nodes in order to determine what ports to use. + * If no such provider can be found or no suitable candidate can be found + * this implementation will {@link yfiles.graph.DefaultGraph#addPortWithParameterStyleAndTag add a new port} to the nodes. + * The default is false. + * Note that not all {@link yfiles.input.IPortCandidateProvider} implementations might work in this + * scenario since the {@link yfiles.input.SimpleInputModeContext#EMPTY} is used for the context of the + * candidate retrieval. + */ + usePortCandidateProviders:boolean; + /** + * Sets the label text of the given label. + * This implementation will {@link yfiles.graph.GraphExtensions#adjustPreferredSize adjust the preferred size} + * for the label if {@link yfiles.graph.ILabelDefaults#autoAdjustPreferredSize} is enabled. + * @param {yfiles.graph.ILabel} label the label to modify + * @param {string} text the new text of the label + * @see {@link yfiles.graph.ILabel#text} + * @see Specified by {@link yfiles.graph.IGraph#setLabelText}. + */ + setLabelText(label:yfiles.graph.ILabel,text:string):void; + /** + * Callback method that will be called just before a node label is added to a node. + */ + onAddingNodeLabel(item:yfiles.graph.INode,label:yfiles.graph.ILabel):void; + /** + * Callback method that will be called just before an edge label is added to an edge. + */ + onAddingEdgeLabel(item:yfiles.graph.IEdge,label:yfiles.graph.ILabel):void; + /** + * Removes the given label from its owner. + * This will trigger the corresponding event. + * @param {yfiles.graph.ILabel} label the label to remove + * @see {@link yfiles.graph.DefaultGraph#addLabelRemovedListener LabelRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeLabel}. + */ + removeLabel(label:yfiles.graph.ILabel):void; + /** + * Sets the preferred size of the label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.geometry.SizeD} preferredSize The new preferred size. + * @see {@link yfiles.graph.ILabel#preferredSize} + * @see Specified by {@link yfiles.graph.IGraph#setPreferredSize}. + */ + setPreferredSize(label:yfiles.graph.ILabel,size:yfiles.geometry.SizeD):void; + /** + * Sets the label model parameter for the given label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.graph.ILabelModelParameter} parameter The new parameter. + * @throws {yfiles.system.ArgumentException} If the parameter cannot be used for this label. + * @see Specified by {@link yfiles.graph.IGraph#setLabelModelParameter}. + */ + setLabelModelParameter(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):void; + /** + * Called after a label has been added to a node. + * This method triggers the corresponding events. + * @param {yfiles.graph.ILabel} label The label that has just been added. + */ + onNodeLabelAdded(label:yfiles.graph.ILabel):void; + /** + * Called after a label has been added to an edge. + * This method triggers the corresponding events. + * @param {yfiles.graph.ILabel} label The label that has just been added. + */ + onEdgeLabelAdded(label:yfiles.graph.ILabel):void; + /** + * Callback method that will be called just before a node label is removed from its node. + */ + onRemovingNodeLabel(label:yfiles.graph.ILabel):void; + /** + * Called after a label has been removed from its node. + * This method triggers the corresponding events. + * @param {yfiles.graph.ILabel} label The label that has just been removed. + * @param {yfiles.graph.ILabeledItem} owner The old owner of the label. + */ + onNodeLabelRemoved(owner:yfiles.graph.ILabeledItem,label:yfiles.graph.ILabel):void; + /** + * Callback method that will be called just before an edge label is removed from its edge. + */ + onRemovingEdgeLabel(label:yfiles.graph.ILabel):void; + /** + * Called after a label has been removed from its edge. + * This method triggers the corresponding events. + * @param {yfiles.graph.ILabel} label The label that has just been removed. + * @param {yfiles.graph.ILabeledItem} owner The previous owner of the label. + */ + onEdgeLabelRemoved(owner:yfiles.graph.ILabeledItem,label:yfiles.graph.ILabel):void; + /** + * Sets the bounds of the given node to the new values. + * This method will use the node's {@link yfiles.support.ILookup#lookup} + * to get an {@link yfiles.geometry.IReshapeable} instance, or if that is not + * available an {@link yfiles.geometry.IMutableRectangle} to {@link yfiles.geometry.IReshapeable#reshapeToValues} + * the node's layout. + * This will trigger a call to {@link yfiles.graph.DefaultGraph#invalidateDisplays}. + * @param {yfiles.graph.INode} node a live node that belongs to this graph + * @param {yfiles.geometry.RectD} bounds the new absolute bounds in world coordinates of the node + * @see {@link yfiles.graph.INode#layout} + * @see Specified by {@link yfiles.graph.IGraph#setBounds}. + */ + setBounds(node:yfiles.graph.INode,bounds:yfiles.geometry.RectD):void; + /** + * A collection view that combines all nodes, edges, labels, ports, and bends of this graph. + * This is a read-only live view of all model items of this graph that always represents the current + * state. The same reference will be returned for each invocation. + * @see Specified by {@link yfiles.graph.IGraph#collectionModel}. + */ + collectionModel:yfiles.model.ICollectionModel; + /** + * A collection view of the nodes contained in this graph. + * This is a live view of the nodes that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Nodes can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#nodes}. + */ + nodes:yfiles.model.ICollectionModel; + /** + * A collection view of the edge labels contained in this graph. + * This is a live view of the edge labels that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Edge labels can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#edgeLabels}. + */ + edgeLabels:yfiles.model.ICollectionModel; + /** + * A collection view of the node labels contained in this graph. + * This is a live view of the node labels that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Node labels can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#nodeLabels}. + */ + nodeLabels:yfiles.model.ICollectionModel; + /** + * A collection view of the bends contained in this graph. + * This is a live view of the bends that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Bends can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#bends}. + */ + bends:yfiles.model.ICollectionModel; + /** + * A collection view of the ports contained in this graph. + * This is a live view of the ports that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Ports can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#ports}. + */ + ports:yfiles.model.ICollectionModel; + /** + * A collection view of the edges contained in this graph. + * This is a live view of the edges that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Edges can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#edges}. + */ + edges:yfiles.model.ICollectionModel; + /** + * Triggers the {@link yfiles.graph.DefaultGraph#addDisplaysInvalidatedListener DisplaysInvalidated} event. + * Clients can call this method to force an invalidation of the displays that + * show this graph instance. + * This implementation delegates to {@link yfiles.graph.DefaultGraph#onInvalidateDisplays}. + * @see Specified by {@link yfiles.graph.IGraph#invalidateDisplays}. + */ + invalidateDisplays():void; + /** + * Triggers the {@link yfiles.graph.DefaultGraph#addDisplaysInvalidatedListener DisplaysInvalidated} event. + * @param {yfiles.system.EventArgs} args The event arguments. + */ + onInvalidateDisplays(args:yfiles.system.EventArgs):void; + /** + * Removes the given node instance from this graph. + * The node must be a part of this graph. + * This will trigger the corresponding event. This method will remove all adjacent edges and their + * corresponding ports in proper order before the node will be removed. Also this will trigger + * the removal of all labels owned by this instance. + * @param {yfiles.graph.INode} node the live node to be removed from this graph instance + * @see {@link yfiles.graph.IGraph#addNodeRemovedListener NodeRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeNode}. + */ + removeNode(node:yfiles.graph.INode):void; + /** + * Removes the given edge instance from this graph. + * The edge must be a part of this graph. + * This will trigger the corresponding event and the removal of all labels and bends owned by this instance. + * Depending on the setting of {@link yfiles.graph.IPortDefaults#autoCleanup} this implementation will + * remove the ports that this edge was connected to if that edge was the last edge connecting these ports. + * @param {yfiles.graph.IEdge} edge the live edge to be removed from this graph instance + * @see {@link yfiles.graph.DefaultGraph#addEdgeRemovedListener EdgeRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeEdge}. + */ + removeEdge(edge:yfiles.graph.IEdge):void; + /** + * Event that is triggered if a node has been created. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in node creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the node creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + */ + addNodeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a node has been created. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in node creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the node creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + */ + removeNodeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a node has been removed. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in node removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the node removal that has triggered this event. + * @see {@link yfiles.graph.IGraph#removeNode} + */ + addNodeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a node has been removed. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in node removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the node removal that has triggered this event. + * @see {@link yfiles.graph.IGraph#removeNode} + */ + removeNodeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a node has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setNodeStyle} + */ + addNodeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a node has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setNodeStyle} + */ + removeNodeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been created. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in edge creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the edge creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#createEdgeWithPortsStyleAndTag} + */ + addEdgeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been created. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in edge creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the edge creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#createEdgeWithPortsStyleAndTag} + */ + removeEdgeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been removed. + * This event will be triggered, too, prior to a node removal. + *

+ * Implementations may choose to use the {@link yfiles.graph.EdgeEventArgs} to carry + * additional port information. The {@link yfiles.graph.EdgeEventArgs#sourcePort} + * and {@link yfiles.graph.EdgeEventArgs#targetPort} properties will be set to the the instances + * the edge was connected to before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in edge removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the edge removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removeNode} + * @see {@link yfiles.graph.IGraph#removeEdge} + */ + addEdgeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been removed. + * This event will be triggered, too, prior to a node removal. + *

+ * Implementations may choose to use the {@link yfiles.graph.EdgeEventArgs} to carry + * additional port information. The {@link yfiles.graph.EdgeEventArgs#sourcePort} + * and {@link yfiles.graph.EdgeEventArgs#targetPort} properties will be set to the the instances + * the edge was connected to before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in edge removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the edge removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removeNode} + * @see {@link yfiles.graph.IGraph#removeEdge} + */ + removeEdgeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been changed, e.g. if its style + * has been replaced. + *

+ * Also this event will be triggered if the {@link yfiles.graph.IEdge#sourcePort} + * or {@link yfiles.graph.IEdge#targetPort} have been changed by a call to {@link yfiles.graph.IGraph#setPorts}. + * Implementations may choose to use the {@link yfiles.graph.EdgeEventArgs} to carry + * additional port information. In the case of {@link yfiles.graph.IGraph#setPorts}, the {@link yfiles.graph.EdgeEventArgs#sourcePort} + * and {@link yfiles.graph.EdgeEventArgs#targetPort} properties will be set to the the old instances + * that the edge was connected to previously. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + *

+ * @see {@link yfiles.graph.IGraph#setEdgeStyle} + */ + addEdgeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been changed, e.g. if its style + * has been replaced. + *

+ * Also this event will be triggered if the {@link yfiles.graph.IEdge#sourcePort} + * or {@link yfiles.graph.IEdge#targetPort} have been changed by a call to {@link yfiles.graph.IGraph#setPorts}. + * Implementations may choose to use the {@link yfiles.graph.EdgeEventArgs} to carry + * additional port information. In the case of {@link yfiles.graph.IGraph#setPorts}, the {@link yfiles.graph.EdgeEventArgs#sourcePort} + * and {@link yfiles.graph.EdgeEventArgs#targetPort} properties will be set to the the old instances + * that the edge was connected to previously. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + *

+ * @see {@link yfiles.graph.IGraph#setEdgeStyle} + */ + removeEdgeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been added to an edge in this graph. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in bend creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the bend creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addBend} + */ + addBendAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been added to an edge in this graph. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in bend creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the bend creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addBend} + */ + removeBendAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been removed from an edge in this graph. + * This event will be triggered, too, if an edge has been removed from the graph, for each + * of the bends that belonged to the edge. + *

+ * Implementations may choose to use the {@link yfiles.graph.BendEventArgs} to carry + * additional bend owner and index information. The {@link yfiles.graph.BendEventArgs#owner} + * and {@link yfiles.graph.BendEventArgs#index} properties will be set to the the edge and + * index that the bend belonged to before the removal. + *

+ *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in bend removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the bend removal that has triggered this event. + *

+ *

+ * @see {@link yfiles.graph.IGraph#removeBend} + * @see {@link yfiles.graph.IGraph#removeEdge} + * @see {@link yfiles.graph.IGraph#removePort} + * @see {@link yfiles.graph.IGraph#removeNode} + */ + addBendRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been removed from an edge in this graph. + * This event will be triggered, too, if an edge has been removed from the graph, for each + * of the bends that belonged to the edge. + *

+ * Implementations may choose to use the {@link yfiles.graph.BendEventArgs} to carry + * additional bend owner and index information. The {@link yfiles.graph.BendEventArgs#owner} + * and {@link yfiles.graph.BendEventArgs#index} properties will be set to the the edge and + * index that the bend belonged to before the removal. + *

+ *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in bend removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the bend removal that has triggered this event. + *

+ *

+ * @see {@link yfiles.graph.IGraph#removeBend} + * @see {@link yfiles.graph.IGraph#removeEdge} + * @see {@link yfiles.graph.IGraph#removePort} + * @see {@link yfiles.graph.IGraph#removeNode} + */ + removeBendRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been changed. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + */ + addBendChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been changed. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + */ + removeBendChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been added to this graph instance. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in label creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the label creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addLabelWithParameterStylePreferredSizeAndTag} + */ + addLabelAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been added to this graph instance. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in label creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the label creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addLabelWithParameterStylePreferredSizeAndTag} + */ + removeLabelAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been removed from this graph instance. + * This event will also be triggered, prior to the removal of the {@link yfiles.graph.ILabel#owner owner} + * of the label. + *

+ * Implementations may choose to use the {@link yfiles.graph.LabelEventArgs} to carry + * additional label owner information. The {@link yfiles.graph.LabelEventArgs#owner} + * property will be set to the the owner of the label + * that owned it before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in label removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the label removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removeLabel} + * @see {@link yfiles.graph.IGraph#removeNode} + * @see {@link yfiles.graph.IGraph#removeEdge} + */ + addLabelRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been removed from this graph instance. + * This event will also be triggered, prior to the removal of the {@link yfiles.graph.ILabel#owner owner} + * of the label. + *

+ * Implementations may choose to use the {@link yfiles.graph.LabelEventArgs} to carry + * additional label owner information. The {@link yfiles.graph.LabelEventArgs#owner} + * property will be set to the the owner of the label + * that owned it before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in label removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the label removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removeLabel} + * @see {@link yfiles.graph.IGraph#removeNode} + * @see {@link yfiles.graph.IGraph#removeEdge} + */ + removeLabelRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setLabelStyle} + */ + addLabelChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setLabelStyle} + */ + removeLabelChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been added to this graph instance. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the port creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag} + * @see {@link yfiles.graph.IGraph#createEdgeWithNodesStyleAndTag} + */ + addPortAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been added to this graph instance. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the port creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag} + * @see {@link yfiles.graph.IGraph#createEdgeWithNodesStyleAndTag} + */ + removePortAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been removed from its {@link yfiles.graph.IPort#owner owner}. + * This event will also be triggered prior to the removal of the corresponding owner + * of the port. + *

+ * Implementations may choose to use the {@link yfiles.graph.PortEventArgs} to carry + * additional port owner information. The {@link yfiles.graph.PortEventArgs#owner} + * property will be set to the the owner of the port + * that owned it before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in port removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the port removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removePort} + * @see {@link yfiles.graph.IGraph#removeNode} + */ + addPortRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been removed from its {@link yfiles.graph.IPort#owner owner}. + * This event will also be triggered prior to the removal of the corresponding owner + * of the port. + *

+ * Implementations may choose to use the {@link yfiles.graph.PortEventArgs} to carry + * additional port owner information. The {@link yfiles.graph.PortEventArgs#owner} + * property will be set to the the owner of the port + * that owned it before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in port removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the port removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removePort} + * @see {@link yfiles.graph.IGraph#removeNode} + */ + removePortRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setPortStyle} + */ + addPortChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setPortStyle} + */ + removePortChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if the graph has changed visually and the display should + * be updated to reflect the changes. + */ + addDisplaysInvalidatedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that is triggered if the graph has changed visually and the display should + * be updated to reflect the changes. + */ + removeDisplaysInvalidatedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Callback that will be invoked before the node will be removed. + * @param {yfiles.graph.INode} node That node that is going to be removed. + */ + onRemovingNode(node:yfiles.graph.INode):void; + /** + * Callback that will be invoked before the node will be removed. + * @param {yfiles.graph.IEdge} edge That edge that is going to be removed. + */ + onRemovingEdge(edge:yfiles.graph.IEdge):void; + /** + * Callback that triggers the {@link yfiles.graph.DefaultGraph#addNodeRemovedListener NodeRemoved} event. + * @param {yfiles.graph.INode} node The node that got removed + */ + onNodeRemoved(node:yfiles.graph.INode):void; + /** + * Callback that triggers the {@link yfiles.graph.DefaultGraph#addEdgeRemovedListener EdgeRemoved} event. + * @param {yfiles.graph.IEdge} edge The edge that got removed + * @param {yfiles.graph.IPort} oldSource The source port that the edge had been connected to. + * @param {yfiles.graph.IPort} oldTarget The target port that the edge had been connected to. + */ + onEdgeRemoved(edge:yfiles.graph.IEdge,oldSource:yfiles.graph.IPort,oldTarget:yfiles.graph.IPort):void; + /** + * Callback that triggers the {@link yfiles.graph.DefaultGraph#addNodeCreatedListener NodeCreated} event. + * @param {yfiles.graph.INode} node The node that has been created. + */ + onNodeCreated(node:yfiles.graph.INode):void; + /** + * Callback that triggers the {@link yfiles.graph.DefaultGraph#addEdgeCreatedListener EdgeCreated} event. + * @param {yfiles.graph.IEdge} edge The edge that has been created. + */ + onEdgeCreated(edge:yfiles.graph.IEdge):void; + /** + * Returns an instance that provides another aspect of this instance of the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. This method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be re-obtained for subsequent use. + * This implementation uses the {@link yfiles.graph.DefaultGraph#setLookupImplementation set lookup implementation} if it has been + * set or an internal {@link yfiles.support.LookupChain lookup chain}, that can be customized using the {@link yfiles.graph.DefaultGraph#addLookup} + * and {@link yfiles.graph.DefaultGraph#removeLookup} methods. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} + * An instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * The last element in the lookup chain is implemented by this method. + */ + innerLookup(type:yfiles.lang.Class):Object; + toString():string; + } + var DefaultGraph:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of a graph that provides an {@link yfiles.support.ILookupDecorator} for + * all of its entities. + */ + new ():yfiles.graph.DefaultGraph; + /** + * Creates a new instance that delegates to the given graph structure. + * Normally there is no need to use this constructor, unless you want to implement your own + * graph structure. + * @param {yfiles.graph.IGraphStructure} graphStructure The structure that actually generates and holds the items in the + * graph. + * @throws {yfiles.system.ArgumentNullException} If graphStructure is null. + * @see {@link yfiles.graph.SimpleGraphStructure} + */ + WithStructure:{ + new (graphStructure:yfiles.graph.IGraphStructure):yfiles.graph.DefaultGraph; + }; + }; + /** + * This class can be used to build a specialized {@link yfiles.graph.DefaultGraph} instance. + * Note that this class is not the one used as the default implementation + * of a {@link yfiles.graph.DefaultGraph}'s {@link yfiles.graph.DefaultGraph#graphStructure}s and casting the one + * used in a DefaultGraph to this class will most likely fail. + * This class may be used as a foundation to build one's own {@link yfiles.graph.IGraph} implementation, although + * this should rarely be needed. + * In order to customize the behavior of an {@link yfiles.graph.IGraph} and its contents, it is recommended to + * use the {@link yfiles.support.ILookupDecorator} mechanism of the default {@link yfiles.graph.DefaultGraph} implementation. + */ + export interface SimpleGraphStructure extends Object,yfiles.graph.IGraphStructure{ + /** + * Creates the default node. + * @return {yfiles.graph.SimpleNode} + */ + createDefaultNode():yfiles.graph.SimpleNode; + /** + * Creates the label collection for the owner. + * @param {yfiles.graph.INode} owner The owner. + * @return {yfiles.model.IListEnumerable.} A new {@link yfiles.graph.ListLabelCollection} + */ + createNodeLabelCollection(owner:yfiles.graph.INode):yfiles.model.IListEnumerable; + /** + * Creates the label collection for the owner. + * @param {yfiles.graph.IEdge} owner The owner. + * @return {yfiles.model.IListEnumerable.} A new {@link yfiles.graph.ListLabelCollection} + */ + createEdgeLabelCollection(owner:yfiles.graph.IEdge):yfiles.model.IListEnumerable; + /** + * Creates the port collection for the owner. + * @param {yfiles.graph.INode} owner The owner. + * @return {yfiles.model.IListEnumerable.} A new {@link yfiles.graph.ListPortCollection} + */ + createPortCollection(owner:yfiles.graph.INode):yfiles.model.IListEnumerable; + /** + * Creates the node layout. + * @return {yfiles.geometry.IRectangle} A rectangle of (0,0,30,30) + */ + createNodeLayout():yfiles.geometry.IRectangle; + /** + * Gets a collection view over the nodes in the graph. + * @see Specified by {@link yfiles.graph.IGraphStructure#nodes}. + */ + nodes:yfiles.collections.ICollection; + /** + * Gets a collection view over the edges in the graph. + * @see Specified by {@link yfiles.graph.IGraphStructure#edges}. + */ + edges:yfiles.collections.ICollection; + /** + * Callback factory method that creates an INode implementation. + * Implementations may not add the instance to the + * collection until the {@link yfiles.graph.IGraphStructure#addNode} method is invoked. + * @return {yfiles.graph.INode} a non-live node instance + * @see Specified by {@link yfiles.graph.IGraphStructure#createNode}. + */ + createNode():yfiles.graph.INode; + /** + * Adds a previously created node to the collection of nodes. + * @param {yfiles.graph.INode} node the node to add + * @see Specified by {@link yfiles.graph.IGraphStructure#addNode}. + */ + addNode(node:yfiles.graph.INode):void; + /** + * Callback factory method that creates an IEdge implementation. + * Implementations may not add the instance to the + * collection until the {@link yfiles.graph.IGraphStructure#addEdge} method is invoked. + * @return {yfiles.graph.IEdge} a non-live edge instance + * @see Specified by {@link yfiles.graph.IGraphStructure#createEdge}. + */ + createEdge():yfiles.graph.IEdge; + /** + * Factory method. + */ + createDefaultEdge():yfiles.graph.SimpleEdge; + /** + * Creates a bend list. + * @return {yfiles.model.IListEnumerable.} {@link yfiles.graph.BendList} + */ + createBendList():yfiles.model.IListEnumerable; + /** + * Adds a previously created edge to the collection of edges. + * @param {yfiles.graph.IEdge} edge the edge to add + * @param {yfiles.graph.IPort} sourcePort the source port to connect the edge to + * @param {yfiles.graph.IPort} targetPort the target port to connect the edge to + * @see Specified by {@link yfiles.graph.IGraphStructure#addEdge}. + */ + addEdge(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + /** + * Remove a node from the current set of nodes. + * @param {yfiles.graph.INode} node the node to remove + * @see Specified by {@link yfiles.graph.IGraphStructure#removeNode}. + */ + removeNode(node:yfiles.graph.INode):void; + /** + * Remove an edge from the current set of edges. + * @param {yfiles.graph.IEdge} edge the edge to remove + * @see Specified by {@link yfiles.graph.IGraphStructure#removeEdge}. + */ + removeEdge(edge:yfiles.graph.IEdge):void; + /** + * Enumerates all edges that are incident to ports owned by the given owner. + * @param {yfiles.graph.IPortOwner} portOwner the item that owns the ports + * @param {yfiles.graph.AdjacencyTypes} adjacencyType what kind of adjacent edges to yield + * @return {yfiles.model.IListEnumerable.} an enumerable that yields the edges + * @see Specified by {@link yfiles.graph.IGraphStructure#getEdges}. + */ + getEdges(model:yfiles.graph.IPortOwner,adjacencyType:yfiles.graph.AdjacencyTypes):yfiles.model.IListEnumerable; + /** + * Enumerates all edges that are incident to the given port. + * @param {yfiles.graph.IPort} port the port + * @param {yfiles.graph.AdjacencyTypes} adjacencyType what kind of adjacent edges to yield + * @return {yfiles.model.IListEnumerable.} an enumerable that yields the edges + * @see Specified by {@link yfiles.graph.IGraphStructure#getPortEdges}. + */ + getPortEdges(port:yfiles.graph.IPort,adjacencyType:yfiles.graph.AdjacencyTypes):yfiles.model.IListEnumerable; + /** + * Associates the style with the given item. + * @param {yfiles.graph.INode} node the item to associate the style with + * @param {yfiles.drawing.INodeStyle} style the new style instance + * @see Specified by {@link yfiles.graph.IGraphStructure#setNodeStyle}. + */ + setNodeStyle(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):void; + /** + * Associates the style with the given item. + * @param {yfiles.graph.IPort} port the item to associate the style with + * @param {yfiles.drawing.IPortStyle} style the new style instance + * @see Specified by {@link yfiles.graph.IGraphStructure#setPortStyle}. + */ + setPortStyle(port:yfiles.graph.IPort,style:yfiles.drawing.IPortStyle):void; + /** + * Associates the style with the given item. + * @param {yfiles.graph.IEdge} edge the item to associate the style with + * @param {yfiles.drawing.IEdgeStyle} style the new style instance + * @see Specified by {@link yfiles.graph.IGraphStructure#setEdgeStyle}. + */ + setEdgeStyle(edge:yfiles.graph.IEdge,style:yfiles.drawing.IEdgeStyle):void; + /** + * Associates the style with the given item. + * @param {yfiles.graph.ILabel} label the item to associate the style with + * @param {yfiles.drawing.ILabelStyle} style the new style instance + * @see Specified by {@link yfiles.graph.IGraphStructure#setLabelStyle}. + */ + setLabelStyle(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle):void; + /** + * Create but don't yet add a port for a given node. + * @see {@link yfiles.graph.IGraphStructure#addPort} + * @see Specified by {@link yfiles.graph.IGraphStructure#createPort}. + */ + createPort(owner:yfiles.graph.IPortOwner):yfiles.graph.IPort; + /** + * Creates the default port for the owner. + * @param {yfiles.graph.IPortOwner} owner The owner. + * @return {yfiles.graph.SimplePort} A new {@link yfiles.graph.SimplePort}. + */ + createDefaultPort(owner:yfiles.graph.IPortOwner):yfiles.graph.SimplePort; + /** + * Add a previously created port to a given node. + * @param {yfiles.graph.IPortOwner} owner The owner of the port. + * @param {yfiles.graph.IPort} port The port that is not owned by another item. + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter The location of the port + * @see Specified by {@link yfiles.graph.IGraphStructure#addPort}. + */ + addPort(portOwner:yfiles.graph.IPortOwner,port:yfiles.graph.IPort,parameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * Removes the port from its owner. + * @param {yfiles.graph.IPort} port The port. + * @see Specified by {@link yfiles.graph.IGraphStructure#removePort}. + */ + removePort(port:yfiles.graph.IPort):void; + /** + * Determines whether this instance contains the specified item. + * @param {yfiles.model.IModelItem} item The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraphStructure#containsItem}. + */ + containsItem(item:yfiles.model.IModelItem):boolean; + /** + * Determines whether this instance contains the specified item. + * @param {yfiles.graph.INode} node The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraphStructure#containsNode}. + */ + containsNode(node:yfiles.graph.INode):boolean; + /** + * Determines whether this instance contains the specified item. + * @param {yfiles.graph.IEdge} edge The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraphStructure#containsEdge}. + */ + containsEdge(edge:yfiles.graph.IEdge):boolean; + /** + * Determines whether this instance contains the specified item. + * @param {yfiles.graph.IPort} port The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraphStructure#containsPort}. + */ + containsPort(port:yfiles.graph.IPort):boolean; + /** + * Determines whether this instance contains the specified item. + * @param {yfiles.graph.IBend} bend The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraphStructure#containsBend}. + */ + containsBend(bend:yfiles.graph.IBend):boolean; + /** + * Determines whether this instance contains the specified item. + * @param {yfiles.graph.ILabel} label The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraphStructure#containsLabel}. + */ + containsLabel(label:yfiles.graph.ILabel):boolean; + /** + * Creates but does not add a bend for a given edge instance. + * @param {yfiles.graph.IEdge} forEdge The edge to add the bend to. + * @return {yfiles.graph.IBend} The newly created bend + * @see {@link yfiles.graph.IGraphStructure#addBend} + * @see Specified by {@link yfiles.graph.IGraphStructure#createBend}. + */ + createBend(forEdge:yfiles.graph.IEdge):yfiles.graph.IBend; + /** + * Creates a default bend for the edge. + * @param {yfiles.graph.IEdge} forEdge The edge. + * @return {yfiles.graph.SimpleBend} A new {@link yfiles.graph.SimpleBend} + */ + createDefaultBend(forEdge:yfiles.graph.IEdge):yfiles.graph.SimpleBend; + /** + * Adds a bend to an edge at the given index. + * @see Specified by {@link yfiles.graph.IGraphStructure#addBend}. + */ + addBend(forEdge:yfiles.graph.IEdge,index:number,bend:yfiles.graph.IBend):void; + /** + * Removes the bend from its edge. + * @param {yfiles.graph.IBend} bend The bend. + * @see Specified by {@link yfiles.graph.IGraphStructure#removeBend}. + */ + removeBend(bend:yfiles.graph.IBend):void; + /** + * Creates a label for a given owner using the provided model parameter. + * @param {yfiles.graph.ILabeledItem} owner The owner. + * @param {yfiles.graph.ILabelModelParameter} modelParameter The model parameter. + * @return {yfiles.graph.ILabel} A newly created label. + * @see {@link yfiles.graph.IGraphStructure#addLabel} + * @see Specified by {@link yfiles.graph.IGraphStructure#createLabel}. + */ + createLabel(owner:yfiles.graph.ILabeledItem,parameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabel; + /** + * Creates a default label using the given parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter. + * @return {yfiles.graph.SimpleLabel} The {@link yfiles.graph.SimpleLabel}. + */ + createDefaultLabel(parameter:yfiles.graph.ILabelModelParameter):yfiles.graph.SimpleLabel; + /** + * Adds a previously created label to its owner. + * @param {yfiles.graph.ILabeledItem} owner The new owner. + * @param {yfiles.graph.ILabel} label The label to add. + * @see Specified by {@link yfiles.graph.IGraphStructure#addLabel}. + */ + addLabel(owner:yfiles.graph.ILabeledItem,label:yfiles.graph.ILabel):void; + /** + * Removes the label from its owner. + * @param {yfiles.graph.ILabel} label The label. + * @see Specified by {@link yfiles.graph.IGraphStructure#removeLabel}. + */ + removeLabel(label:yfiles.graph.ILabel):void; + /** + * Sets the label text for a given label to the specified text. + * @param {yfiles.graph.ILabel} label The label. + * @param {string} text The text. + * @see {@link yfiles.graph.ILabel#text} + * @see Specified by {@link yfiles.graph.IGraphStructure#setLabelText}. + */ + setLabelText(label:yfiles.graph.ILabel,text:string):void; + /** + * Sets the {@link yfiles.graph.ILabel#labelModelParameter} for a given label. + * @param {yfiles.graph.ILabel} label The label to modify. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to set. + * @see Specified by {@link yfiles.graph.IGraphStructure#setLabelModelParameter}. + */ + setLabelModelParameter(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):void; + /** + * Sets the location model parameter for the given port. + * @param {yfiles.graph.IPort} port The port to set the parameter. + * @param {yfiles.graph.IPortLocationModelParameter} locationModelParameter The new location model parameter for the port. + * @see Specified by {@link yfiles.graph.IGraphStructure#setLocationModelParameter}. + */ + setLocationModelParameter(port:yfiles.graph.IPort,locationModelParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * Sets the ports of the given edge to the new values. + * Both ports and the edge are already live in this graph. + * @param {yfiles.graph.IEdge} edge The edge to change the ports. + * @param {yfiles.graph.IPort} sourcePort The new source port instance. + * @param {yfiles.graph.IPort} targetPort The new target port instance. + * @see Specified by {@link yfiles.graph.IGraphStructure#setPorts}. + */ + setPorts(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + } + var SimpleGraphStructure:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.SimpleGraphStructure} class. + */ + new ():yfiles.graph.SimpleGraphStructure; + }; + /** + * A simple mutable implementation of the {@link yfiles.graph.ILabel} + * interface that can be used stand-alone. + * Note that this class is not the one used as the default implementation + * of a {@link yfiles.graph.DefaultGraph}'s {@link yfiles.graph.ILabel}s and casting an ILabel + * to this class will most likely fail. + * Instances of this class can be used without an accompanying graph instance. All of the + * properties are mutable. An example of a possible use case would be the rendering of a label + * into a graphics context: Simply instantiate a SimpleLabel, associate a style with it + * and use the style's renderer instance to obtain a rendering for the label. + */ + export interface SimpleLabel extends yfiles.graph.AbstractModelItem,yfiles.graph.ILabel{ + /** + * Gets the label model's parameter that determines the positioning of this label. + * In order to set a different parameter for this label, use {@link yfiles.graph.IGraph}'s {@link yfiles.graph.IGraph#setLabelModelParameter} + * method. + * Note that the label model parameter instance associated with a label instance may be shared + * between multiple label instances and that the modification of this instance or its {@link yfiles.graph.ILabelModelParameter#model} + * will result in a change of the positioning of all labels that are associated with the same parameter or model instance. + * @see Specified by {@link yfiles.graph.ILabel#labelModelParameter}. + */ + labelModelParameter:yfiles.graph.ILabelModelParameter; + /** + * Gets the text string associated with this label. + * It is up to the visualization engine to interpret this property for the + * visualization of the label. Normally, it will render the text into the + * {@link yfiles.graph.ILabel#layout} of this instance. + * @see Specified by {@link yfiles.graph.ILabel#text}. + */ + text:string; + /** + * Returns the style that is responsible for the visual representation + * of this node in a {@link yfiles.canvas.CanvasControl}. + * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setLabelStyle} + * method. + * Note that the style instance associated with a label instance may be shared + * between multiple label instances and that the modification of this style will + * result in a change of the appearance of all labels that are associated with the same style instance. + * @see Specified by {@link yfiles.graph.ILabel#style}. + */ + style:yfiles.drawing.ILabelStyle; + /** + * Gets the owner of this label. + * Typically this will yield an instance of {@link yfiles.graph.INode} or {@link yfiles.graph.IEdge}. + * @see Specified by {@link yfiles.graph.ILabel#owner}. + */ + owner:yfiles.graph.ILabeledItem; + /** + * Provides access to the layout of a label. + * Labels have a {@link yfiles.geometry.ISize size} and are anchored at + * a given location in world coordinate space. The anchor is + * the point around which the oriented rectangle is rotated in the world coordinate system. + * If the oriented rectangle has default orientation, i.e. its up vector points north (<0,-1>), + * it coincides with its lower left corner. + * The positioning of the label is determined using a pair of {@link yfiles.graph.ILabelModel} + * and {@link yfiles.graph.ILabelModelParameter}. + * In order to modify the layout of a label instance, set another {@link yfiles.graph.ILabel#labelModelParameter} + * for this label or modify its associated instance. + * @see Specified by {@link yfiles.graph.ILabel#layout}. + */ + layout:yfiles.geometry.IOrientedRectangle; + /** + * Gets the preferred size of the label with respect to its current + * contents and the implementation of the visualization. + * Often times the {@link yfiles.graph.ILabel#layout layout's} size will be the same + * as the preferred size, but it's up to the implementation of the {@link yfiles.graph.ILabelModel} + * to interpret it differently. + * In order to set a different preferred size for this label instance use {@link yfiles.graph.IGraph}'s + * {@link yfiles.graph.IGraph#setPreferredSize} method. + * @see Specified by {@link yfiles.graph.ILabel#preferredSize}. + */ + preferredSize:yfiles.geometry.SizeD; + /** + * Gets the {@link yfiles.drawing.ILabelStyleRenderer#getPreferredSize} from + * the labels style and sets the {@link yfiles.graph.SimpleLabel#preferredSize} to that value. + */ + adoptPreferredSizeFromStyle():void; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + } + var SimpleLabel:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.SimpleLabel} class + * using the provided parameter and text. + * @param {yfiles.graph.ILabelModelParameter} modelParameter The model parameter. + * @param {string} text The text. + */ + WithParameterAndText:{ + new (modelParameter:yfiles.graph.ILabelModelParameter,text:string):yfiles.graph.SimpleLabel; + }; + /** + * Initializes a new instance of the {@link yfiles.graph.SimpleLabel} class + * using the provided lookup, parameter, and text. + * @param {yfiles.support.ILookup} lookup The lookup. + * @param {yfiles.graph.ILabelModelParameter} modelParameter The model parameter. + * @param {string} text The text. + */ + WithLookupParameterAndText:{ + new (lookup:yfiles.support.ILookup,modelParameter:yfiles.graph.ILabelModelParameter,text:string):yfiles.graph.SimpleLabel; + }; + }; + /** + * This is the default implementation of an {@link yfiles.graph.ILabel}'s + * {@link yfiles.support.ILookup#lookup} method. + */ + export interface DefaultLabelLookup extends yfiles.graph.DefaultItemLookup{ + /** + * Gets or sets the label this instance is acting upon. + */ + label:yfiles.graph.ILabel; + /** + * Subclasses need to override this method. + * @param {T} item The context item to lookup an implementation for. + * @param {yfiles.lang.Class} type The type of the implementation to find. + * @param {yfiles.support.ILookup} nextLookup The lookup to use for another type. + * @param {yfiles.support.ILookup} lastLookup The lookup to use as a fallback for the type. + * @return {Object} + */ + chainedLookup(label:yfiles.graph.ILabel,type:yfiles.lang.Class,nextLookup:yfiles.support.ILookup,lastLookup:yfiles.support.ILookup):Object; + } + var DefaultLabelLookup:{ + $class:yfiles.lang.Class; + /** + * Create a new instance without a context. + */ + new ():yfiles.graph.DefaultLabelLookup; + /** + * Create a new instance with the given item as context. + */ + ForLabel:{ + new (label:yfiles.graph.ILabel):yfiles.graph.DefaultLabelLookup; + }; + }; + /** + * A basic implementation of the {@link yfiles.graph.IHierarchy} interface. + */ + export interface DefaultHierarchy extends Object,yfiles.graph.IHierarchy,yfiles.collections.IEnumerable,yfiles.graph.IObservableHierarchy{ + /** + * Raises the {@link yfiles.graph.DefaultHierarchy#addItemAddedListener ItemAdded} event. + * @param {T} item The item that is added + * @param {T} parent The parent of the item + */ + onItemAdded(item:T,parent:T):void; + /** + * Raises the {@link yfiles.graph.DefaultHierarchy#addItemRemovedListener ItemRemoved} event. + * @param {T} item The item that is removed + * @param {T} oldParent The original parent of the item + */ + onItemRemoved(item:T,oldParent:T):void; + /** + * Raises the {@link yfiles.graph.DefaultHierarchy#addItemMovedListener ItemMoved} event. + * @param {T} item The item that is reparented. + * @param {T} oldParent The old parent of the item. + * @param {T} newParent The new parent of the item. + */ + onItemMoved(item:T,oldParent:T,newParent:T):void; + /** + * Raises the {@link yfiles.graph.DefaultHierarchy#addItemChangedListener ItemChanged} event. + * @param {T} item The item that is changed. + * @param {T} parent The parent of the item. + */ + onItemChanged(item:T,parent:T):void; + /** + * Gets the root item of the hierarchy. + * @see {@link yfiles.graph.IHierarchy#getChildren} + * @see Specified by {@link yfiles.graph.IHierarchy#root}. + */ + root:T; + /** + * Event that will be triggered if an item has been added to the model. + */ + addItemAddedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been added to the model. + */ + removeItemAddedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been removed from the model. + */ + addItemRemovedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been removed from the model. + */ + removeItemRemovedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been reparented in the model. + */ + addItemMovedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been reparented in the model. + */ + removeItemMovedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Event that will be triggered if an item has changed somehow in the model. + * This excludes structural changes. + */ + addItemChangedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Event that will be triggered if an item has changed somehow in the model. + * This excludes structural changes. + */ + removeItemChangedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Triggers the firing of an {@link yfiles.graph.IHierarchy#addItemChangedListener ItemChanged} event for the given item. + * @param {T} item The item that has changed. + * @see Specified by {@link yfiles.graph.IHierarchy#publishItemChanged}. + */ + publishItemChanged(item:T):void; + /** + * Determines whether the given item is part of this hierarchy. + * @param {T} item The item to check. + * @return {boolean} Whether the item is contained. + * @see Specified by {@link yfiles.graph.IHierarchy#contains}. + */ + contains(item:T):boolean; + /** + * Determines whether the given item should be considered a leaf. + * Leaves may not have children. However, a non-leaf item does not + * necessarily need to have {@link yfiles.graph.IHierarchy#getChildren children}. + * Attempting to set an item to the leaf-state while it has children at the + * same time will result in an {@link yfiles.system.InvalidOperationException} + * @param {T} item The item to check. + * @param {boolean} leaf Whether to make the item a leaf. + * @see {@link yfiles.graph.IHierarchy#getChildren} + * @see {@link yfiles.graph.IHierarchy#getChildCount} + * @see {@link yfiles.graph.IHierarchy#isLeaf} + * @throws {yfiles.system.InvalidOperationException} If the item currently has children. + * @see Specified by {@link yfiles.graph.IHierarchy#setLeaf}. + */ + setLeaf(item:T,leaf:boolean):void; + /** + * Returns an enumerable over the children of the provided item. + * @param {T} item The item for which to return the children. + * @return {yfiles.collections.IEnumerable.} All items that have item as their {@link yfiles.graph.IHierarchy#getParent parent}. + * @see Specified by {@link yfiles.graph.IHierarchy#getChildren}. + */ + getChildren(item:T):yfiles.collections.IEnumerable; + getChildrenWithParent(item:T):yfiles.collections.IEnumerable; + /** + * Modifies the hierarchy by adding another child to the given parent. + * child may not be part of the hierarchy prior to this call. + * This triggers the {@link yfiles.graph.IHierarchy#addItemAddedListener ItemAdded} event. + * This will make the parent a non-{@link yfiles.graph.IHierarchy#isLeaf leaf}. + * @param {T} parent The parent to add the child to. + * @param {T} child The child to add to the parent. + * @see Specified by {@link yfiles.graph.IHierarchy#addChild}. + */ + addChild(parent:T,child:T):void; + /** + * Removes the given item from its parent and this hierarchy. + * This will trigger the {@link yfiles.graph.IHierarchy#addItemRemovedListener ItemRemoved} event. If child has children itself, they are reparented + * to the parent of child. + * @param {T} child The child to remove from this hierarchy. + * @see Specified by {@link yfiles.graph.IHierarchy#remove}. + */ + remove(child:T):void; + /** + * Returns the parent item of the item or {@link yfiles.graph.IHierarchy#root} + * if child is a top-level item. + * @param {T} child The item to retrieve the parent item for. + * @return {T} The parent item in this hierarchy or {@link yfiles.graph.IHierarchy#root}. + * @see Specified by {@link yfiles.graph.IHierarchy#getParent}. + */ + getParent(child:T):T; + /** + * Returns the number of children for the given parent item. + * @param {T} parent The parent to get the number of child items for. + * @return {number} The number of children. + * @see {@link yfiles.graph.IHierarchy#getChildren} + * @see Specified by {@link yfiles.graph.IHierarchy#getChildCount}. + */ + getChildCount(parent:T):number; + /** + * Returns whether the given item is considered a leaf item. + * Leaves may not have children. However, a non-leaf item does not + * necessarily need to have {@link yfiles.graph.IHierarchy#getChildren children}. + * @param {T} item The item to check. + * @return {boolean} Whether the item is considered a leaf. + * @see {@link yfiles.graph.IHierarchy#getChildren} + * @see {@link yfiles.graph.IHierarchy#getChildCount} + * @see {@link yfiles.graph.IHierarchy#setLeaf} + * @see Specified by {@link yfiles.graph.IHierarchy#isLeaf}. + */ + isLeaf(item:T):boolean; + /** + * Reparents a child item that already belongs to this hierarchy instance + * to a new parent. + * This will trigger the {@link yfiles.graph.IHierarchy#addItemMovedListener ItemMoved} event. + * Note that child may not be an ancestor of parent. + * @param {T} child The child to reparent. + * @param {T} parent The new parent. + * @throws {yfiles.system.InvalidOperationException} If child is currently an ancestor of parent. + * @see Specified by {@link yfiles.graph.IHierarchy#setParent}. + */ + setParent(child:T,parent:T):void; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + } + var DefaultHierarchy:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the provided parameter as the root element. + * This implementation uses a {@link yfiles.model.DictionaryMapper} for the mapping. + * @param {T} rootValue The value for the root element. + */ + WithRoot:{ + new (rootValue:T):yfiles.graph.DefaultHierarchy; + }; + /** + * Creates a new instance using the provided parameter as the root element + * and the given mapper to do the mapping. + * @param {T} rootValue The value for the root element. + * @param {yfiles.model.IMapper.} mapper The instance to do the mapping of the items in the hierarchy to the internally used data structure. + */ + WithRootValueAndMapper:{ + new (rootValue:T,mapper:yfiles.model.IMapper):yfiles.graph.DefaultHierarchy; + }; + }; + /** + * An abstract base class for a {@link yfiles.support.ILookup} implementation + * that also implements {@link yfiles.support.IContextLookupChainLink}, + * {@link yfiles.support.IContextLookup} for a given type T. + * Subclass implementers should override {@link yfiles.graph.DefaultItemLookup#chainedLookup} only. + */ + export interface DefaultItemLookup extends Object,yfiles.support.IContextLookupChainLink,yfiles.support.IContextLookup,yfiles.support.ILookup{ + /** + * The item to use in context-less lookup calls. + */ + itemInstance:T; + /** + * Gets or sets the context. + */ + item:T; + /** + * This method is called by the framework to register the fallback lookup implementation + * that should be used during a call to {@link yfiles.support.IContextLookup#lookupForItem}. + * If the implementation cannot satisfy the query, it will use the provided context as a fallback. + * Note that implementations can also use the results returned by the next lookup and decorate + * it appropriately. + * @param {yfiles.support.IContextLookup} next The context to use as a fallback. + * @see Specified by {@link yfiles.support.IContextLookupChainLink#setNext}. + */ + setNext(contextLookup:yfiles.support.IContextLookup):void; + /** + * Returns an instance that implements the given type or null. + * This implementation delegates to {@link yfiles.graph.DefaultItemLookup#chainedLookup}, unless + * {@link yfiles.graph.DefaultItemLookup#itemInstance} is null in which case it will return null. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} + * an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Tries to create or retrieve an implementation of the given type + * for a given item. + * @param {Object} item the item to lookup a type for + * @param {yfiles.lang.Class} type the type to look up + * @return {Object} an implementation or null + * @see {@link yfiles.support.ILookup#lookup} + * @see Specified by {@link yfiles.support.IContextLookup#lookupForItem}. + */ + lookupForItem(item:Object,type:yfiles.lang.Class):Object; + /** + * Subclasses need to override this method. + * @param {T} item The context item to lookup an implementation for. + * @param {yfiles.lang.Class} type The type of the implementation to find. + * @param {yfiles.support.ILookup} nextLookup The lookup to use for another type. + * @param {yfiles.support.ILookup} lastLookup The lookup to use as a fallback for the type. + * @return {Object} + */ + chainedLookup(item:T,type:yfiles.lang.Class,nextLookup:yfiles.support.ILookup,lastLookup:yfiles.support.ILookup):Object; + } + var DefaultItemLookup:{ + $class:yfiles.lang.Class; + /** + * Instantiates an instance without a context {@link yfiles.graph.DefaultItemLookup#itemInstance}. + */ + new (itemType:yfiles.lang.Class):yfiles.graph.DefaultItemLookup; + /** + * Instantiates an instance with a context {@link yfiles.graph.DefaultItemLookup#itemInstance}. + */ + ForItem:{ + new (itemType:yfiles.lang.Class,item:T):yfiles.graph.DefaultItemLookup; + }; + }; + /** + * The interface used in an {@link yfiles.graph.IGraph} implementation + * for labels. + * This interface provides read-only access to the properties of a label. + * In order to modify the state of an instance use the various methods provided by the + * {@link yfiles.graph.IGraph} this instance belongs to. + * Labels are stored in {@link yfiles.model.IListEnumerable IListEnumerable<ILabel>}s, that + * can be obtained from {@link yfiles.graph.ILabeledItem} implementations' {@link yfiles.graph.ILabeledItem#labels} + * property. + * Typical owners of a label are {@link yfiles.graph.INode} and {@link yfiles.graph.IEdge} instances. + * Like all items in an IGraph, this item supports the + * {@link yfiles.support.ILookup#lookup} method that can be used + * to query additional aspects of the item. + *
+ * Related Information in the Developers Guide: + *

+ * The graph model with all relevant types and their relationships is presented in detail + * in the section Graph Structure. + *

+ *

+ * Using the look-up mechanism is explained in the section + * Look-up Mechanism. + *

+ */ + export interface ILabel extends Object,yfiles.model.IModelItem{ + /** + * Provides access to the layout of a label. + * Labels have a {@link yfiles.geometry.ISize size} and are anchored at + * a given location in world coordinate space. The anchor is + * the point around which the oriented rectangle is rotated in the world coordinate system. + * If the oriented rectangle has default orientation, i.e. its up vector points north (<0,-1>), + * it coincides with its lower left corner. + * The positioning of the label is determined using a pair of {@link yfiles.graph.ILabelModel} + * and {@link yfiles.graph.ILabelModelParameter}. + * In order to modify the layout of a label instance, set another {@link yfiles.graph.ILabel#labelModelParameter} + * for this label or modify its associated instance. + * @see Specified by {@link yfiles.graph.ILabel#layout}. + */ + layout:yfiles.geometry.IOrientedRectangle; + /** + * Returns the style that is responsible for the visual representation + * of this node in a {@link yfiles.canvas.CanvasControl}. + * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setLabelStyle} + * method. + * Note that the style instance associated with a label instance may be shared + * between multiple label instances and that the modification of this style will + * result in a change of the appearance of all labels that are associated with the same style instance. + * @see Specified by {@link yfiles.graph.ILabel#style}. + */ + style:yfiles.drawing.ILabelStyle; + /** + * Gets the preferred size of the label with respect to its current + * contents and the implementation of the visualization. + * Often times the {@link yfiles.graph.ILabel#layout layout's} size will be the same + * as the preferred size, but it's up to the implementation of the {@link yfiles.graph.ILabelModel} + * to interpret it differently. + * In order to set a different preferred size for this label instance use {@link yfiles.graph.IGraph}'s + * {@link yfiles.graph.IGraph#setPreferredSize} method. + * @see Specified by {@link yfiles.graph.ILabel#preferredSize}. + */ + preferredSize:yfiles.geometry.SizeD; + /** + * Gets the owner of this label. + * Typically this will yield an instance of {@link yfiles.graph.INode} or {@link yfiles.graph.IEdge}. + * @see Specified by {@link yfiles.graph.ILabel#owner}. + */ + owner:yfiles.graph.ILabeledItem; + /** + * Gets the text string associated with this label. + * It is up to the visualization engine to interpret this property for the + * visualization of the label. Normally, it will render the text into the + * {@link yfiles.graph.ILabel#layout} of this instance. + * @see Specified by {@link yfiles.graph.ILabel#text}. + */ + text:string; + /** + * Gets the label model's parameter that determines the positioning of this label. + * In order to set a different parameter for this label, use {@link yfiles.graph.IGraph}'s {@link yfiles.graph.IGraph#setLabelModelParameter} + * method. + * Note that the label model parameter instance associated with a label instance may be shared + * between multiple label instances and that the modification of this instance or its {@link yfiles.graph.ILabelModelParameter#model} + * will result in a change of the positioning of all labels that are associated with the same parameter or model instance. + * @see Specified by {@link yfiles.graph.ILabel#labelModelParameter}. + */ + labelModelParameter:yfiles.graph.ILabelModelParameter; + /** + * Gets the index of the label at its {@link yfiles.graph.ILabel#owner}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#getLabelIndex}. + * @return {number} The zero based index of the label in the {@link yfiles.graph.ILabeledItem#labels} list; -1 if the label is not part of a labeled item. + */ + getIndex():number; + } + var ILabel:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.graph.IGraph} and the like to declare and obtain the defaults + * for labels. + * @see {@link yfiles.graph.INodeDefaults#labels} + * @see {@link yfiles.graph.IEdgeDefaults#labels} + * @see {@link yfiles.graph.IGraph#nodeDefaults} + * @see {@link yfiles.graph.IGraph#edgeDefaults} + * @see {@link yfiles.graph.IGroupedGraph#groupNodeDefaults} + */ + export interface ILabelDefaults extends Object{ + /** + * Gets or sets the style to use for labels. + * Depending on the setting of {@link yfiles.graph.ILabelDefaults#shareStyleInstance}, the {@link yfiles.graph.ILabelDefaults#getStyleInstance} + * method should return a {@link yfiles.system.ICloneable#clone clone} of this instance or the very same instance. + * Value: The style to use as a template. + * @see {@link yfiles.graph.ILabelDefaults#shareStyleInstance} + * @see Specified by {@link yfiles.graph.ILabelDefaults#style}. + */ + style:yfiles.drawing.ILabelStyle; + /** + * Gets or sets a property that determines whether to automatically adjust + * the preferred size of a label. + * On a call to {@link yfiles.graph.IGraph#setLabelText} or + * {@link yfiles.graph.IGraph#setLabelStyle}, the + * preferred size of the label will automatically be adjusted to the preferred size that + * is suggested by the label's style renderer, if this property is set to true. + * @see {@link yfiles.drawing.ILabelStyleRenderer#getPreferredSize} + * @see Specified by {@link yfiles.graph.ILabelDefaults#autoAdjustPreferredSize}. + */ + autoAdjustPreferredSize:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.ILabelDefaults#labelModelParameter} + * instance should be shared referentially or {@link yfiles.system.ICloneable#clone cloned} + * upon a call to {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance}. + * Value: + * true if the reference should be shared; otherwise, false. + * @see {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance} + * @see {@link yfiles.graph.ILabelDefaults#labelModelParameter} + * @see Specified by {@link yfiles.graph.ILabelDefaults#shareLabelModelParameterInstance}. + */ + shareLabelModelParameterInstance:boolean; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.ILabelDefaults#style} + * instance should be shared referentially or {@link yfiles.system.ICloneable#clone cloned} + * upon a call to {@link yfiles.graph.ILabelDefaults#getStyleInstance}. + * Value: + * true if the reference should be shared; otherwise, false. + * @see {@link yfiles.graph.ILabelDefaults#getStyleInstance} + * @see {@link yfiles.graph.ILabelDefaults#style} + * @see Specified by {@link yfiles.graph.ILabelDefaults#shareStyleInstance}. + */ + shareStyleInstance:boolean; + /** + * Factory method that returns a style instance for use with newly created labels. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.ILabelDefaults#style} property, if {@link yfiles.graph.ILabelDefaults#shareStyleInstance} + * is enabled, but they might use more complicated logic, too. + * @param {yfiles.graph.ILabeledItem} owner The owner of the label that will be created. + * @return {yfiles.drawing.ILabelStyle} The style to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.ILabelDefaults#style} property, if {@link yfiles.graph.ILabelDefaults#shareStyleInstance} + * is enabled. + * @see Specified by {@link yfiles.graph.ILabelDefaults#getStyleInstance}. + */ + getStyleInstance(owner:yfiles.graph.ILabeledItem):yfiles.drawing.ILabelStyle; + /** + * Gets or sets the label model parameter to use for labels. + * Depending on the setting of {@link yfiles.graph.ILabelDefaults#shareLabelModelParameterInstance}, the {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance} + * method should return a {@link yfiles.system.ICloneable#clone clone} of this instance or the very same instance. + * Value: The parameter to use as a template. + * @see {@link yfiles.graph.ILabelDefaults#shareLabelModelParameterInstance} + * @see {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance} + * @see Specified by {@link yfiles.graph.ILabelDefaults#labelModelParameter}. + */ + labelModelParameter:yfiles.graph.ILabelModelParameter; + /** + * Factory method that returns a label model parameter instance for use with newly created labels. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.ILabelDefaults#labelModelParameter} property, if {@link yfiles.graph.ILabelDefaults#shareLabelModelParameterInstance} + * is enabled, but they might use more complicated logic, too. + * @param {yfiles.graph.ILabeledItem} owner The owner of the label that will be created. + * @return {yfiles.graph.ILabelModelParameter} The parameter to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.ILabelDefaults#labelModelParameter} property, if {@link yfiles.graph.ILabelDefaults#shareLabelModelParameterInstance} + * is enabled. + * @see Specified by {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance}. + */ + getLabelModelParameterInstance(owner:yfiles.graph.ILabeledItem):yfiles.graph.ILabelModelParameter; + } + var ILabelDefaults:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The event argument class used by {@link yfiles.graph.IHierarchy}s to notify + * listeners of changes to the hierarchy. + */ + export interface HierarchyEventArgs extends yfiles.system.EventArgs{ + /** + * Yields the type of this event. + */ + eventType:yfiles.graph.HierarchyChange; + /** + * Yields the old parent of the {@link yfiles.graph.HierarchyEventArgs#item}, if applicable. + */ + oldParent:T; + /** + * Yields the new parent of the {@link yfiles.graph.HierarchyEventArgs#item}, if applicable. + */ + newParent:T; + /** + * Yields the item that is the subject of this event. + */ + item:T; + } + var HierarchyEventArgs:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of the event using the provided parameters. + * @see {@link yfiles.graph.HierarchyEventArgs#createItemAdded} + * @see {@link yfiles.graph.HierarchyEventArgs#createItemMoved} + * @see {@link yfiles.graph.HierarchyEventArgs#createItemChanged} + * @see {@link yfiles.graph.HierarchyEventArgs#createItemRemoved} + */ + new (eventType:yfiles.graph.HierarchyChange,item:T,oldParent:T,newParent:T):yfiles.graph.HierarchyEventArgs; + /** + * Factory method that creates an event for {@link yfiles.graph.IHierarchy#addItemAddedListener ItemAdded} notifications. + * @param {T} item The item that has been added. + * @param {T} newParent The new parent. + * @return {yfiles.graph.HierarchyEventArgs.} The event to use. + */ + createItemAdded(item:T,newParent:T):yfiles.graph.HierarchyEventArgs; + /** + * Factory method that creates an event for {@link yfiles.graph.IHierarchy#addItemRemovedListener ItemRemoved} notifications. + * @param {T} item The item that has been removed. + * @param {T} oldParent The last valid parent. + * @return {yfiles.graph.HierarchyEventArgs.} The event to use. + */ + createItemRemoved(item:T,oldParent:T):yfiles.graph.HierarchyEventArgs; + /** + * Factory method that creates an event for {@link yfiles.graph.IHierarchy#addItemMovedListener ItemMoved} notifications. + * @param {T} item The item that has been reparented. + * @param {T} oldParent The old parent. + * @param {T} newParent The new parent. + * @return {yfiles.graph.HierarchyEventArgs.} The event to use. + */ + createItemMoved(item:T,oldParent:T,newParent:T):yfiles.graph.HierarchyEventArgs; + /** + * Factory method that creates an event for {@link yfiles.graph.IHierarchy#addItemChangedListener ItemChanged} notifications. + * @param {T} item The item that has been changed. + * @param {T} parent The current parent. + * @return {yfiles.graph.HierarchyEventArgs.} The event to use. + */ + createItemChanged(item:T,parent:T):yfiles.graph.HierarchyEventArgs; + }; + /** + * The interface that models an observable tree-like hierarchy. + */ + export interface IHierarchy extends Object,yfiles.support.ILookup{ + /** + * Gets the root item of the hierarchy. + * @see {@link yfiles.graph.IHierarchy#getChildren} + * @see Specified by {@link yfiles.graph.IHierarchy#root}. + */ + root:T; + /** + * Event that will be triggered if an item has been added to the model. + */ + addItemAddedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been added to the model. + */ + removeItemAddedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been removed from the model. + */ + addItemRemovedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been removed from the model. + */ + removeItemRemovedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been reparented in the model. + */ + addItemMovedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been reparented in the model. + */ + removeItemMovedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Event that will be triggered if an item has changed somehow in the model. + * This excludes structural changes. + */ + addItemChangedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Event that will be triggered if an item has changed somehow in the model. + * This excludes structural changes. + */ + removeItemChangedListener(value:(source:Object,eventArgs:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Triggers the firing of an {@link yfiles.graph.IHierarchy#addItemChangedListener ItemChanged} event for the given item. + * @param {T} item The item that has changed. + * @see Specified by {@link yfiles.graph.IHierarchy#publishItemChanged}. + */ + publishItemChanged(item:T):void; + /** + * Determines whether the given item is part of this hierarchy. + * @param {T} item The item to check. + * @return {boolean} Whether the item is contained. + * @see Specified by {@link yfiles.graph.IHierarchy#contains}. + */ + contains(item:T):boolean; + /** + * Returns an enumerable over the children of the provided item. + * @param {T} item The item for which to return the children. + * @return {yfiles.collections.IEnumerable.} All items that have item as their {@link yfiles.graph.IHierarchy#getParent parent}. + * @see Specified by {@link yfiles.graph.IHierarchy#getChildren}. + */ + getChildren(item:T):yfiles.collections.IEnumerable; + /** + * Modifies the hierarchy by adding another child to the given parent. + * child may not be part of the hierarchy prior to this call. + * This triggers the {@link yfiles.graph.IHierarchy#addItemAddedListener ItemAdded} event. + * This will make the parent a non-{@link yfiles.graph.IHierarchy#isLeaf leaf}. + * @param {T} parent The parent to add the child to. + * @param {T} child The child to add to the parent. + * @see Specified by {@link yfiles.graph.IHierarchy#addChild}. + */ + addChild(parent:T,child:T):void; + /** + * Removes the given item from its parent and this hierarchy. + * This will trigger the {@link yfiles.graph.IHierarchy#addItemRemovedListener ItemRemoved} event. If child has children itself, they are reparented + * to the parent of child. + * @param {T} child The child to remove from this hierarchy. + * @see Specified by {@link yfiles.graph.IHierarchy#remove}. + */ + remove(child:T):void; + /** + * Returns the parent item of the item or {@link yfiles.graph.IHierarchy#root} + * if child is a top-level item. + * @param {T} child The item to retrieve the parent item for. + * @return {T} The parent item in this hierarchy or {@link yfiles.graph.IHierarchy#root}. + * @see Specified by {@link yfiles.graph.IHierarchy#getParent}. + */ + getParent(child:T):T; + /** + * Returns the number of children for the given parent item. + * @param {T} parent The parent to get the number of child items for. + * @return {number} The number of children. + * @see {@link yfiles.graph.IHierarchy#getChildren} + * @see Specified by {@link yfiles.graph.IHierarchy#getChildCount}. + */ + getChildCount(parent:T):number; + /** + * Returns whether the given item is considered a leaf item. + * Leaves may not have children. However, a non-leaf item does not + * necessarily need to have {@link yfiles.graph.IHierarchy#getChildren children}. + * @param {T} item The item to check. + * @return {boolean} Whether the item is considered a leaf. + * @see {@link yfiles.graph.IHierarchy#getChildren} + * @see {@link yfiles.graph.IHierarchy#getChildCount} + * @see {@link yfiles.graph.IHierarchy#setLeaf} + * @see Specified by {@link yfiles.graph.IHierarchy#isLeaf}. + */ + isLeaf(item:T):boolean; + /** + * Determines whether the given item should be considered a leaf. + * Leaves may not have children. However, a non-leaf item does not + * necessarily need to have {@link yfiles.graph.IHierarchy#getChildren children}. + * Attempting to set an item to the leaf-state while it has children at the + * same time will result in an {@link yfiles.system.InvalidOperationException} + * @param {T} item The item to check. + * @param {boolean} leaf Whether to make the item a leaf. + * @see {@link yfiles.graph.IHierarchy#getChildren} + * @see {@link yfiles.graph.IHierarchy#getChildCount} + * @see {@link yfiles.graph.IHierarchy#isLeaf} + * @throws {yfiles.system.InvalidOperationException} If the item currently has children. + * @see Specified by {@link yfiles.graph.IHierarchy#setLeaf}. + */ + setLeaf(item:T,leaf:boolean):void; + /** + * Reparents a child item that already belongs to this hierarchy instance + * to a new parent. + * This will trigger the {@link yfiles.graph.IHierarchy#addItemMovedListener ItemMoved} event. + * Note that child may not be an ancestor of parent. + * @param {T} child The child to reparent. + * @param {T} parent The new parent. + * @throws {yfiles.system.InvalidOperationException} If child is currently an ancestor of parent. + * @see Specified by {@link yfiles.graph.IHierarchy#setParent}. + */ + setParent(child:T,parent:T):void; + /** + * Calculates the minimum area to enclose by the given group node with respect to its {@link yfiles.drawing.IGroupBoundsCalculator}. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#calculateMinimumEnclosedArea}. + * @param {yfiles.graph.INode} groupNode The group node to calculate the minimum enclosed area of. + * @return {yfiles.geometry.RectD} The area to enclose for the given group node. This is {@link yfiles.geometry.RectD#EMPTY} if the node is not a group node, or + * if it hasn't any children. + */ + calculateMinimumEnclosedArea(groupNode:yfiles.graph.INode):yfiles.geometry.RectD; + /** + * Returns all elements that are part of the hierarchy. + * This is a bridge method that delegates to {@link yfiles.graph.HierarchyExtensions#elements}. + * @return {yfiles.collections.IEnumerable.} An enumeration of the contents of the hierarchy at the time of this invocation. + */ + getElements():yfiles.collections.IEnumerable; + /** + * Returns all descendants of the provided item that are part of the hierarchy. + * This is a bridge method that delegates to {@link yfiles.graph.HierarchyExtensions#getDescendants}. + * @return {yfiles.collections.IEnumerable.} An enumeration of the children of the item at the time of this invocation in reverse DFS prefix order. + * @param {T} root The root item to get the descendants from. + */ + getDescendants(root:T):yfiles.collections.IEnumerable; + /** + * Gets the path to root traversing all {@link yfiles.graph.IHierarchy#getParent parents} + * of the given item. + * This is a bridge method that delegates to {@link yfiles.graph.HierarchyExtensions#getPathToRoot}. + * @param {T} item The item to start. + * @return {yfiles.collections.IList.} A list that includes the item but not the {@link yfiles.graph.IHierarchy#root}, unless they are identical and all parents in between them. + */ + getPathToRoot(item:T):yfiles.collections.IList; + /** + * Returns all descendants of the provided item that are part of the hierarchy. + * This is a bridge method that delegates to {@link yfiles.graph.HierarchyExtensions#getDescendantsBottomUp}. + * @return {yfiles.collections.IEnumerable.} An enumeration of the children of the item at the time of this invocation in DFS postfix order. + * @param {T} root The root item to get the descendants from. + */ + getDescendantsBottomUp(root:T):yfiles.collections.IEnumerable; + /** + * Determines whether parent is a parent of node + * in the hierarchy. + * This is a bridge method that delegates to {@link yfiles.graph.HierarchyExtensions#isDescendant}. + * @param {T} node The node to check. + * @param {T} parent The parent to check. + * @return {boolean} Whether parent is an ancestor of node. + */ + isDescendant(node:T,parent:T):boolean; + /** + * Determines the nearest common ancestor of the items provided in the hierarchy. + * This is a bridge method that delegates to {@link yfiles.graph.HierarchyExtensions#getNearestCommonAncestorOfArray}. + * @param {T[]} items The items to find the nearest common ancestor of. + */ + getNearestCommonAncestorWithArray(items:T):T; + /** + * Determines the nearest common ancestor of the items provided in the hierarchy. + * This is a bridge method that delegates to {@link yfiles.graph.HierarchyExtensions#getNearestCommonAncestor}. + * @param {yfiles.collections.IEnumerator.} items The items to find the nearest common ancestor of. + */ + getNearestCommonAncestorWithEnumerator(items:yfiles.collections.IEnumerator):T; + } + var IHierarchy:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Common interface for items in an {@link yfiles.graph.IGraph} implementation + * that may own {@link yfiles.graph.ILabel labels}. + * Like all items in an IGraph, this item supports the + * {@link yfiles.support.ILookup#lookup} method that can be used + * to query additional aspects of the item. + * @see {@link yfiles.graph.INode} + * @see {@link yfiles.graph.IEdge} + */ + export interface ILabeledItem extends Object,yfiles.model.IModelItem{ + /** + * Provides access to a collection of {@link yfiles.graph.ILabel labels} that + * are owned by this instance. + * This gives access to a read-only live view of the labels, i.e. the collection + * can change over time, as well as the labels contained in it. If a snapshot of the + * current state is needed, one needs to copy the collection and its contents. + * @see Specified by {@link yfiles.graph.ILabeledItem#labels}. + */ + labels:yfiles.model.IListEnumerable; + } + var ILabeledItem:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface that can be used to retrieve {@link yfiles.graph.ILabelCandidateDescriptor} + * instances for a given combination of {@link yfiles.graph.ILabel}s and + * {@link yfiles.graph.ILabelModelParameter parameter candidates}. + * This interface can be used by automatic labeling algorithms to help decide + * which labels candidate positions should be used. + * @see {@link yfiles.graph.ILabelCandidateDescriptor} + */ + export interface ILabelCandidateDescriptorProvider extends Object{ + /** + * Gets the descriptor for a given combination of label and {@link yfiles.graph.ILabelModelParameter}. + * @param {yfiles.graph.ILabel} label The label to possibly assign the parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to provide a descriptor for if applied to the given label. + * @return {yfiles.graph.ILabelCandidateDescriptor} A descriptor or null. + * @see Specified by {@link yfiles.graph.ILabelCandidateDescriptorProvider#getDescriptor}. + */ + getDescriptor(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; + } + var ILabelCandidateDescriptorProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An implementation of the {@link yfiles.graph.ILabelCandidateDescriptorProvider} interface + * that always yields a constant {@link yfiles.graph.ILabelCandidateDescriptor}. + */ + export interface ConstantLabelCandidateDescriptorProvider extends Object,yfiles.graph.ILabelCandidateDescriptorProvider{ + /** + * Always yields the parameter that has been passed to the constructor. + * @see Specified by {@link yfiles.graph.ILabelCandidateDescriptorProvider#getDescriptor}. + */ + getDescriptor(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabelCandidateDescriptor; + } + var ConstantLabelCandidateDescriptorProvider:{ + $class:yfiles.lang.Class; + /** + * A sharable implementation of the {@link yfiles.graph.ILabelCandidateDescriptorProvider} + * interface that always yields {@link yfiles.graph.LabelCandidateDescriptor#EXTERNAL_DESCRIPTOR}. + */ + EXTERNAL_DESCRIPTOR_PROVIDER:yfiles.graph.ILabelCandidateDescriptorProvider; + /** + * A sharable implementation of the {@link yfiles.graph.ILabelCandidateDescriptorProvider} + * interface that always yields {@link yfiles.graph.LabelCandidateDescriptor#INTERNAL_DESCRIPTOR}. + */ + INTERNAL_DESCRIPTOR_PROVIDER:yfiles.graph.ILabelCandidateDescriptorProvider; + /** + * Initializes a new instance of the {@link yfiles.graph.ConstantLabelCandidateDescriptorProvider} class. + * that always yields descriptor in {@link yfiles.graph.ConstantLabelCandidateDescriptorProvider#getDescriptor}. + * @param {yfiles.graph.ILabelCandidateDescriptor} descriptor The descriptor to yield in {@link yfiles.graph.ConstantLabelCandidateDescriptorProvider#getDescriptor}. + */ + new (descriptor:yfiles.graph.ILabelCandidateDescriptor):yfiles.graph.ConstantLabelCandidateDescriptorProvider; + }; + /** + * Yields the geometry of {@link yfiles.graph.ILabel} instances. + * Label models can be used to describe the geometry of labels, respecting + * their {@link yfiles.graph.ILabel#preferredSize} and a {@link yfiles.graph.ILabelModelParameter} + * instance associated with a label. + * Typically, a label model is used as a factory for label model parameters that + * can be associated with different label instances, e.g. using the + * {@link yfiles.graph.IGraph#setLabelModelParameter} method. + * Label model instances are designed to be shared by multiple model parameters, + * which themselves can be shared by multiple label instances. + * This interface supports the + * {@link yfiles.support.ILookup#lookup} method that can be used + * to query additional aspects of the implementation. + * @see {@link yfiles.graph.ILabelModelParameter} + * @see {@link yfiles.graph.ILabel} + * @see {@link yfiles.graph.IGraph} + */ + export interface ILabelModel extends Object,yfiles.support.ILookup{ + /** + * Calculates the geometry in form of an {@link yfiles.geometry.IOrientedRectangle} + * for a given label using the given model parameter. + * @param {yfiles.graph.ILabelModelParameter} parameter A parameter that has been created by this model. + * This is typically the parameter that yielded this instance through its + * {@link yfiles.graph.ILabelModelParameter#model} property. + * @param {yfiles.graph.ILabel} label the label to calculate the geometry for + * @return {yfiles.geometry.IOrientedRectangle} An instance that describes the geometry. This is typically + * an instance designed as a flyweight, so clients should not cache the + * instance but store the values if they need a snapshot for later use + * @see Specified by {@link yfiles.graph.ILabelModel#getGeometry}. + */ + getGeometry(parameter:yfiles.graph.ILabelModelParameter,label:yfiles.graph.ILabel):yfiles.geometry.IOrientedRectangle; + /** + * Creates a default parameter that can be used for this model. + * @return {yfiles.graph.ILabelModelParameter} a parameter for this model instance + * @see Specified by {@link yfiles.graph.ILabelModel#createDefaultParameter}. + */ + createDefaultParameter():yfiles.graph.ILabelModelParameter; + /** + * Provides a {@link yfiles.support.ILookup lookup context} for the given combination of label + * and parameter. + * @param {yfiles.graph.ILabel} label The label to use in the context. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to use for the label in the context. + * @return {yfiles.support.ILookup} An implementation of the {@link yfiles.support.ILookup} interface that can be used to query additional aspects + * of the label/parameter combination. + * @see {@link yfiles.support.Lookups#EMPTY} + * @see Specified by {@link yfiles.graph.ILabelModel#getContext}. + */ + getContext(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):yfiles.support.ILookup; + } + var ILabelModel:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that describes the properties of a candidate {@link yfiles.graph.ILabelModelParameter}. + * Automatic labeling algorithms may require additional properties for a set of {@link yfiles.graph.ILabelModelParameter}s. + * This interface can be used to provide this information for a pair of {@link yfiles.graph.ILabel} + * and {@link yfiles.graph.ILabelModelParameter} via the {@link yfiles.graph.ILabelCandidateDescriptorProvider} + * provider interface. + * @see {@link yfiles.graph.ILabelCandidateDescriptorProvider} + */ + export interface ILabelCandidateDescriptor extends Object{ + /** + * Gets a value indicating whether this candidate is deemed an external candidate. + * This is mainly for {@link yfiles.graph.INode} labels, where the label may be a visual part of the + * node's internals, but could be used for edge labels, too, if the edge occupies significant + * amounts of space, visually. + * Value: true if this describes an external candidate; otherwise, false. + * @see Specified by {@link yfiles.graph.ILabelCandidateDescriptor#externalCandidate}. + */ + externalCandidate:boolean; + /** + * Gets the edge overlap penalty that is used by labeling algorithms to weigh in the + * penalty if this label candidate overlaps with an edge path. + * Note that due to a known issue, if the penalty is greater than 0.0, all potential label candidates are + * rejected and thus a label placement algorithm will not calculate any new locations. + * Value: The edge overlap penalty. + * @see Specified by {@link yfiles.graph.ILabelCandidateDescriptor#edgeOverlapPenalty}. + */ + edgeOverlapPenalty:number; + /** + * Gets the edge overlap penalty that is used by labeling algorithms to weigh in the + * penalty if this label candidate overlaps with a node's bounds. + * Note that due to a known issue, if the penalty is greater than 0.0, all potential label candidates are + * rejected and thus a label placement algorithm will not calculate any new locations. + * Value: The node overlap penalty. + * @see Specified by {@link yfiles.graph.ILabelCandidateDescriptor#nodeOverlapPenalty}. + */ + nodeOverlapPenalty:number; + /** + * Gets the profit to weigh in if this candidate is chosen. + * Value: The profit to be used by labeling algorithms. + * @see Specified by {@link yfiles.graph.ILabelCandidateDescriptor#profit}. + */ + profit:number; + } + var ILabelCandidateDescriptor:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum HierarchyChange{ + /** + * The type of change that is triggered by {@link yfiles.graph.IHierarchy#addItemAddedListener ItemAdded} events. + */ + ADDED, + /** + * The type of change that is triggered by {@link yfiles.graph.IHierarchy#addItemMovedListener ItemMoved} events. + */ + MOVED, + /** + * The type of change that is triggered by {@link yfiles.graph.IHierarchy#addItemRemovedListener ItemRemoved} events. + */ + REMOVED, + /** + * The type of change that is triggered by {@link yfiles.graph.IHierarchy#addItemChangedListener ItemChanged} events. + */ + CHANGED + } + /** + * A specialized subclass of the {@link yfiles.model.ItemEventArgs} + * class that is bound to the {@link yfiles.graph.ILabel} type and carries + * additional {@link yfiles.graph.ILabeledItem owner} information. + * Since for some events ({@link yfiles.graph.IGraph#addLabelRemovedListener LabelRemoved}) + * it is unclear what {@link yfiles.graph.ILabel#owner} the label + * was owned by before the event, this event can be used to carry exactly that information. + */ + export interface LabelEventArgs extends yfiles.model.ItemEventArgs{ + /** + * Gets the owner of the label that owned the label before the event happened. + * Value: The old owner. + */ + owner:yfiles.graph.ILabeledItem; + } + var LabelEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.LabelEventArgs} class. + * @param {yfiles.graph.ILabel} label The label to assign to the {@link yfiles.model.ItemEventArgs#item} property. + * @param {yfiles.graph.ILabeledItem} owner The previous owner of the label. + */ + new (label:yfiles.graph.ILabel,owner:yfiles.graph.ILabeledItem):yfiles.graph.LabelEventArgs; + }; + /** + * A specialized subclass of the {@link yfiles.model.ItemEventArgs} + * class that is bound to the {@link yfiles.graph.IBend} type and carries + * additional {@link yfiles.graph.IEdge owner} and index information. + * Since for some events ({@link yfiles.graph.IGraph#addBendRemovedListener BendRemoved}) + * it is unclear what {@link yfiles.graph.IBend#owner} the bend + * was owned by before the event, this event can be used to carry exactly that information. + */ + export interface BendEventArgs extends yfiles.model.ItemEventArgs{ + /** + * Gets the owner of the bend that owned the bend before the event happened. + * Value: The old owner. + */ + owner:yfiles.graph.IEdge; + /** + * Gets the former index of the bend in the {@link yfiles.graph.IEdge#bends} list. + * Value: The index of the bend before the event happened. + */ + index:number; + } + var BendEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.BendEventArgs} class. + * @param {yfiles.graph.IBend} bend The bend to assign to the {@link yfiles.model.ItemEventArgs#item} property. + * @param {yfiles.graph.IEdge} owner The previous owner of the bend. + * @param {number} index The previous index of the bend in the {@link yfiles.graph.IEdge#bends} list. + */ + new (bend:yfiles.graph.IBend,owner:yfiles.graph.IEdge,index:number):yfiles.graph.BendEventArgs; + }; + /** + * A specialized subclass of the {@link yfiles.model.ItemEventArgs} + * class that is bound to the {@link yfiles.graph.IEdge} type and carries + * additional source and target port information. + * Since for some events ({@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} and {@link yfiles.graph.IGraph#addEdgeRemovedListener EdgeRemoved}) + * it is unclear what {@link yfiles.graph.IEdge#sourcePort} and {@link yfiles.graph.IEdge#targetPort} the edge + * had been connected to before the event, this event can be used to carry exactly that information. + */ + export interface EdgeEventArgs extends yfiles.model.ItemEventArgs{ + /** + * Gets the source port the edge was connected to before the event happened. + * Value: The old source port. + */ + sourcePort:yfiles.graph.IPort; + /** + * Gets the target port the edge was connected to before the event happened. + * Value: The old target port. + */ + targetPort:yfiles.graph.IPort; + } + var EdgeEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.EdgeEventArgs} class. + * @param {yfiles.graph.IEdge} edge The edge to assign to the {@link yfiles.model.ItemEventArgs#item} property. + * @param {yfiles.graph.IPort} sourcePort The source port the edge was connected to before the event happened. + * @param {yfiles.graph.IPort} targetPort The target port the edge was connected to before the event happened. + */ + new (edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):yfiles.graph.EdgeEventArgs; + }; + /** + * A specialized subclass of the {@link yfiles.model.ItemEventArgs} + * class that is bound to the {@link yfiles.graph.IPort} type and carries + * additional {@link yfiles.graph.IPortOwner} information. + * Since for some events ({@link yfiles.graph.IGraph#addPortRemovedListener PortRemoved}) + * it is unclear what {@link yfiles.graph.IPort#owner} the port + * had been attached to before the event, this event can be used to carry exactly that information. + */ + export interface PortEventArgs extends yfiles.model.ItemEventArgs{ + /** + * Gets the owner the port the was connected to before the event happened. + * Value: The old owner. + */ + owner:yfiles.graph.IPortOwner; + } + var PortEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.PortEventArgs} class. + * @param {yfiles.graph.IPort} port The port to assign to the {@link yfiles.model.ItemEventArgs#item} property. + * @param {yfiles.graph.IPortOwner} owner The owner of the port the port was attached to. + */ + new (port:yfiles.graph.IPort,owner:yfiles.graph.IPortOwner):yfiles.graph.PortEventArgs; + }; + /** + * Manages the selection state of items in an {@link yfiles.graph.IGraph} + * instance. + * This interface provides access to the {@link yfiles.model.ISelectionModel} + * instances that manage the selection of nodes, edges, labels, ports, and bends. + * The generic methods that use {@link yfiles.model.IModelItem} parameters + * delegate to the corresponding domain-specific selection models. + * @see {@link yfiles.model.ISelectionModel} + */ + export interface IGraphSelection extends Object,yfiles.model.ISelectionModel{ + /** + * An {@link yfiles.model.ISelectionModel} of the selected nodes. + * This is the node part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedNodes}. + */ + selectedNodes:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of the selected labels. + * This is the label part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedLabels}. + */ + selectedLabels:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of the selected edges. + * This is the edge part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedEdges}. + */ + selectedEdges:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of the selected ports. + * This is the ports part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedPorts}. + */ + selectedPorts:yfiles.model.ISelectionModel; + /** + * An {@link yfiles.model.ISelectionModel} of the selected bends. + * This is the bend part of the selection that this instance is a composite of. + * @see Specified by {@link yfiles.graph.IGraphSelection#selectedBends}. + */ + selectedBends:yfiles.model.ISelectionModel; + } + var IGraphSelection:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Provides a hierarchic view over an {@link yfiles.graph.IGraph}. + * The {@link yfiles.graph.IGraph#nodes} in a graph can be put into a {@link yfiles.graph.IHierarchy hierarchical relationship}. + * This interface provides access to the {@link yfiles.graph.IGroupedGraph#hierarchy} of the nodes and offers methods + * to modify the graph's node hierarchy. + * An implementation of this interface can be queried from {@link yfiles.graph.DefaultGraph}'s {@link yfiles.support.ILookup#lookup} method, if + * {@link yfiles.graph.DefaultGraph#groupingSupported} is set to true. + * + *

+    *     var graph = GraphControl.graph;
+    *  
+    *     // Turn on grouping support in DefaultGraph.
+    *     var defaultGraph = graph.lookup(yfiles.graph.DefaultGraph.$class);
+    *     if (defaultGraph !== null) {
+    *       defaultGraph.groupingSupported = true;
+    *     }
+    *     // Use the grouping support.
+    *     var grouped = graph.getGroupedGraph();
+    *     if (grouped != null) {
+    *       grouped.groupNodeDefaults.style = new yfiles.drawing.ShapeNodeStyle(yfiles.drawing.ShapeNodeShape.ROUND_RECTANGLE, yfiles.system.Pens.Aquamarine, null);
+    *       var groupNode = grouped.createGroupNode();
+    *       grouped.groupNodes(groupNode, { node1, node2, node3 });
+    *     }
+    *    
+ * @see {@link yfiles.graph.GroupedGraph} + */ + export interface IGroupedGraph extends Object{ + /** + * Gets or sets a property that determines whether the bounds of group nodes should automatically + * be adjusted whenever the nodes that belong to the group node change their bounds. + * This behavior is turned on by default and should only be turned off temporarily to + * allow for programmatic batch updates to the bounds of nodes. + * The default is true + * @see Specified by {@link yfiles.graph.IGroupedGraph#autoAdjustGroupNodeBounds}. + */ + autoAdjustGroupNodeBounds:boolean; + /** + * Yields the hierarchy of the nodes in this grouped graph. + * @see Specified by {@link yfiles.graph.IGroupedGraph#hierarchy}. + */ + hierarchy:yfiles.graph.IHierarchy; + /** + * Yields the graph instance that this instance is working on. + * @see Specified by {@link yfiles.graph.IGroupedGraph#graph}. + */ + graph:yfiles.graph.IGraph; + /** + * Gets or sets the defaults for group nodes. + * @see Specified by {@link yfiles.graph.IGroupedGraph#groupNodeDefaults}. + */ + groupNodeDefaults:yfiles.graph.INodeDefaults; + /** + * Sets the parent node for a given node. + * Use {@link yfiles.graph.IGroupedGraph#hierarchy}'s {@link yfiles.graph.IHierarchy#root} field + * to make node a top-level node for this graph. + * @param {yfiles.graph.INode} node The node to assign a new parent. + * @param {yfiles.graph.INode} parent The parent group node to assign to node. + * @see {@link yfiles.graph.IHierarchy#getParent} + * @see {@link yfiles.graph.IGroupedGraph#hierarchy} + * @see Specified by {@link yfiles.graph.IGroupedGraph#setParent}. + */ + setParent(node:yfiles.graph.INode,parent:yfiles.graph.INode):void; + /** + * Creates a new group node using the provided style and bounds as a child of parent. + * The group node will be a direct descendant of parent. + * @return {yfiles.graph.INode} The newly created group node. + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + * @param {yfiles.geometry.RectD} bounds The initial bounds to use for the new node. + * @param {yfiles.drawing.INodeStyle} style The style to use for the new node. + * @param {Object} tag The {@link yfiles.support.ITagOwner#tag} to assign to the {@link yfiles.graph.INode}. + * @see Specified by {@link yfiles.graph.IGroupedGraph#createGroupNodeWithParentBoundsStyleAndTag}. + */ + createGroupNodeWithParentBoundsStyleAndTag(parent:yfiles.graph.INode,bounds:yfiles.geometry.RectD,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.INode; + /** + * Creates a new ordinary node as a direct descendant of parent using the given bounds + * and style. + * This method ultimately delegates to the {@link yfiles.graph.IGroupedGraph#graph}'s {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} method. + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + * @return {yfiles.graph.INode} The newly created node. + * @param {yfiles.geometry.RectD} bounds The bounds to use initially. + * The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} field. + * @param {yfiles.drawing.INodeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @param {Object} tag The {@link yfiles.support.ITagOwner#tag} to assign to the {@link yfiles.graph.INode}. + * @see {@link yfiles.graph.IGroupedGraph#setParent} + * @see {@link yfiles.graph.IGroupedGraph#createNodeWithParentBoundsStyleAndTag} + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + * @see Specified by {@link yfiles.graph.IGroupedGraph#createNodeWithParentBoundsStyleAndTag}. + */ + createNodeWithParentBoundsStyleAndTag(parent:yfiles.graph.INode,bounds:yfiles.geometry.RectD,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.INode; + /** + * Creates a new group node using the {@link yfiles.graph.IGroupedGraph#groupNodeDefaults}. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#createGroupNode}. + * @return {yfiles.graph.INode} The newly created group node. + * @see {@link yfiles.graph.IGroupedGraph#createGroupNodeWithParentBoundsStyleAndTag} + */ + createGroupNode():yfiles.graph.INode; + /** + * Method to adjust the size of a group node. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#adjustGroupNodeBounds}. + * @see {@link yfiles.drawing.IGroupBoundsCalculator} + * @see {@link yfiles.input.ISizeConstraintProvider} + * @see {@link yfiles.graph.GroupedGraphExtensions#calculateMinimumEnclosedArea} + * @param {yfiles.graph.INode} groupNode The group node to adjust the size of. + */ + adjustGroupNodeBounds(groupNode:yfiles.graph.INode):void; + /** + * Enlarges the given group node to ensure that the {@link yfiles.graph.GroupedGraphExtensions#calculateMinimumEnclosedArea minimum enclosed} + * area is inside of its bounds. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#enlargeGroupNode}. + * @param {yfiles.graph.INode} groupNode The group node to resize. + * @param {boolean} ancestors if set to true all ancestor group nodes will be resized, too, if necessary + * @see {@link yfiles.graph.GroupedGraphExtensions#enlargeGroupNodeWithContextNodeAndAncestors} + */ + enlargeGroupNode(groupNode:yfiles.graph.INode,ancestors:boolean):void; + /** + * Enlarges all group nodes in the given groupedGraph so that the + * {@link yfiles.graph.GroupedGraphExtensions#calculateMinimumEnclosedArea minimum enclosed area} is respected. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#enlargeAllGroupNodes}. + * @see {@link yfiles.graph.GroupedGraphExtensions#enlargeGroupNode} + */ + enlargeAllGroupNodes():void; + /** + * Enlarges all group nodes in the given groupedGraph in an interactive scenario, so that the + * {@link yfiles.graph.GroupedGraphExtensions#calculateMinimumEnclosedArea minimum enclosed area} is respected. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#enlargeAllGroupNodesWithContext}. + * @param {yfiles.input.IInputModeContext} context The context to use for the {@link yfiles.input.IReshapeHandler}s. + * @see {@link yfiles.graph.GroupedGraphExtensions#enlargeGroupNodeWithContextNodeAndAncestors} + */ + enlargeAllGroupNodesWithContext(context:yfiles.input.IInputModeContext):void; + /** + * Enlarges the group nodes in an interactive scenario, using {@link yfiles.input.IReshapeHandler} implementations of the group nodes + * to perform the actual resizing. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#enlargeGroupNodeWithContextNodeAndAncestors}. + * @param {yfiles.input.IInputModeContext} context The context to use for the {@link yfiles.input.IReshapeHandler}s. + * @param {yfiles.graph.INode} node The node to enlarge appropriately. + * @param {boolean} ancestors if set to true ancestors the ancestor group nodes will be adjusted, too, if necessary. + * @see {@link yfiles.input.IReshapeHandler} + */ + enlargeGroupNodeWithContextNodeAndAncestors(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,ancestors:boolean):void; + /** + * Creates a group node style using the {@link yfiles.graph.IGroupedGraph#groupNodeDefaults}. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#createGroupNodeStyle}. + * @return {yfiles.drawing.INodeStyle} A style instance to use for new group nodes. + */ + createGroupNodeStyle():yfiles.drawing.INodeStyle; + /** + * Groups the nodes in children into the provided group node. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#groupNodesWithParent}. + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + * @param {yfiles.collections.IEnumerable.} children The children to group into the group node. + * @see {@link yfiles.graph.GroupedGraphExtensions#groupNodes} + * @see {@link yfiles.graph.IGroupedGraph#setParent} + * @see {@link yfiles.graph.IGroupedGraph#createGroupNodeWithParentBoundsStyleAndTag} + */ + groupNodesWithParent(parent:yfiles.graph.INode,children:yfiles.collections.IEnumerable):void; + /** + * Groups the nodes into a newly created group node. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#groupNodesArray}. + * @param {yfiles.graph.INode[]} children The children to group into the new group node. + * @return {yfiles.graph.INode} The newly created group node. + * @see {@link yfiles.graph.HierarchyExtensions#getNearestCommonAncestorOfArray} + * @see {@link yfiles.graph.GroupedGraphExtensions#groupNodes} + */ + groupNodesArray(children:yfiles.graph.INode):yfiles.graph.INode; + /** + * Groups the nodes in children into a newly created group node. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#groupNodes}. + * @param {yfiles.collections.IEnumerable.} children The children to group into the new group node. + * @return {yfiles.graph.INode} The newly created group node. + * @see {@link yfiles.graph.HierarchyExtensions#getNearestCommonAncestorOfArray} + * @see {@link yfiles.graph.GroupedGraphExtensions#groupNodes} + */ + groupNodes(children:yfiles.collections.IEnumerable):yfiles.graph.INode; + /** + * Creates a new group node using the {@link yfiles.graph.IGroupedGraph#groupNodeDefaults} as a child of parent. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#createGroupNodeWithParent}. + * @return {yfiles.graph.INode} The newly created group node. + * @see {@link yfiles.graph.GroupedGraphExtensions#createGroupNode} + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + */ + createGroupNodeWithParent(parent:yfiles.graph.INode):yfiles.graph.INode; + /** + * Creates a new ordinary node as a direct descendant of parent. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#createNodeWithParent}. + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + * @return {yfiles.graph.INode} The newly created node. + * @see {@link yfiles.graph.IGroupedGraph#setParent} + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + */ + createNodeWithParent(parent:yfiles.graph.INode):yfiles.graph.INode; + /** + * Gets the bounds for a default group node using {@link yfiles.graph.IGroupedGraph#groupNodeDefaults}. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#getDefaultGroupNodeBounds}. + * @return {yfiles.geometry.RectD} The bounds for a newly created group node. + */ + getDefaultGroupNodeBounds():yfiles.geometry.RectD; + /** + * Creates a new ordinary node as a direct descendant of parent. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#createNodeWithParentAndBounds}. + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + * @param {yfiles.geometry.RectD} bounds The new bounds of the node. + * @return {yfiles.graph.INode} The newly created node. + * @see {@link yfiles.graph.IGroupedGraph#setParent} + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + */ + createNodeWithParentAndBounds(parent:yfiles.graph.INode,bounds:yfiles.geometry.RectD):yfiles.graph.INode; + /** + * Creates a new ordinary node as a direct descendant of parent. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#createNodeWithParentBoundsAndStyle}. + * @param {yfiles.geometry.RectD} bounds The new bounds of the node. + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + * @param {yfiles.drawing.INodeStyle} nodeStyle The initial style to assign. + * @return {yfiles.graph.INode} The newly created node. + * @see {@link yfiles.graph.IGroupedGraph#setParent} + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + */ + createNodeWithParentBoundsAndStyle(parent:yfiles.graph.INode,bounds:yfiles.geometry.RectD,nodeStyle:yfiles.drawing.INodeStyle):yfiles.graph.INode; + /** + * Creates a new ordinary node as a direct descendant of parent. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#createGroupNodeWithParentBoundsAndStyle}. + * @param {yfiles.geometry.RectD} bounds The new bounds of the node. + * @param {yfiles.graph.INode} parent The node to use as the parent in the grouping hierarchy. + * @param {yfiles.drawing.INodeStyle} nodeStyle The initial style to assign. + * @return {yfiles.graph.INode} The newly created node. + * @see {@link yfiles.graph.IGroupedGraph#setParent} + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + */ + createGroupNodeWithParentBoundsAndStyle(parent:yfiles.graph.INode,bounds:yfiles.geometry.RectD,nodeStyle:yfiles.drawing.INodeStyle):yfiles.graph.INode; + } + var IGroupedGraph:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface used by utility classes that {@link yfiles.graph.DefaultGraph} + * delegates most of its work to. Normally you don't need to deal with this interface. + * If a custom {@link yfiles.graph.IGraph} implementation needs to be implemented, + * {@link yfiles.graph.DefaultGraph} can be used to quickly accomplish this task. + * All that has to be done is provide the DefaultGraph constructor an + * implementation of this relatively simple interface. Most of the work + * is performed by the DefaultGraph implementation. The IGraphStructure implementation + * serves as a facade to the structure of the graph. + * @see {@link yfiles.graph.DefaultGraph} + * @see {@link yfiles.graph.IGraph} + */ + export interface IGraphStructure extends Object{ + /** + * Gets a collection view over the nodes in the graph. + * @see Specified by {@link yfiles.graph.IGraphStructure#nodes}. + */ + nodes:yfiles.collections.ICollection; + /** + * Gets a collection view over the edges in the graph. + * @see Specified by {@link yfiles.graph.IGraphStructure#edges}. + */ + edges:yfiles.collections.ICollection; + /** + * Callback factory method that creates an INode implementation. + * Implementations may not add the instance to the + * collection until the {@link yfiles.graph.IGraphStructure#addNode} method is invoked. + * @return {yfiles.graph.INode} a non-live node instance + * @see Specified by {@link yfiles.graph.IGraphStructure#createNode}. + */ + createNode():yfiles.graph.INode; + /** + * Adds a previously created node to the collection of nodes. + * @param {yfiles.graph.INode} node the node to add + * @see Specified by {@link yfiles.graph.IGraphStructure#addNode}. + */ + addNode(node:yfiles.graph.INode):void; + /** + * Callback factory method that creates an IEdge implementation. + * Implementations may not add the instance to the + * collection until the {@link yfiles.graph.IGraphStructure#addEdge} method is invoked. + * @return {yfiles.graph.IEdge} a non-live edge instance + * @see Specified by {@link yfiles.graph.IGraphStructure#createEdge}. + */ + createEdge():yfiles.graph.IEdge; + /** + * Adds a previously created edge to the collection of edges. + * @param {yfiles.graph.IEdge} edge the edge to add + * @param {yfiles.graph.IPort} sourcePort the source port to connect the edge to + * @param {yfiles.graph.IPort} targetPort the target port to connect the edge to + * @see Specified by {@link yfiles.graph.IGraphStructure#addEdge}. + */ + addEdge(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + /** + * Remove a node from the current set of nodes. + * @param {yfiles.graph.INode} node the node to remove + * @see Specified by {@link yfiles.graph.IGraphStructure#removeNode}. + */ + removeNode(node:yfiles.graph.INode):void; + /** + * Remove an edge from the current set of edges. + * @param {yfiles.graph.IEdge} edge the edge to remove + * @see Specified by {@link yfiles.graph.IGraphStructure#removeEdge}. + */ + removeEdge(edge:yfiles.graph.IEdge):void; + /** + * Enumerates all edges that are incident to ports owned by the given owner. + * @param {yfiles.graph.IPortOwner} portOwner the item that owns the ports + * @param {yfiles.graph.AdjacencyTypes} adjacencyType what kind of adjacent edges to yield + * @return {yfiles.model.IListEnumerable.} an enumerable that yields the edges + * @see Specified by {@link yfiles.graph.IGraphStructure#getEdges}. + */ + getEdges(portOwner:yfiles.graph.IPortOwner,adjacencyType:yfiles.graph.AdjacencyTypes):yfiles.model.IListEnumerable; + /** + * Enumerates all edges that are incident to the given port. + * @param {yfiles.graph.IPort} port the port + * @param {yfiles.graph.AdjacencyTypes} adjacencyType what kind of adjacent edges to yield + * @return {yfiles.model.IListEnumerable.} an enumerable that yields the edges + * @see Specified by {@link yfiles.graph.IGraphStructure#getPortEdges}. + */ + getPortEdges(port:yfiles.graph.IPort,adjacencyType:yfiles.graph.AdjacencyTypes):yfiles.model.IListEnumerable; + /** + * Associates the style with the given item. + * @param {yfiles.graph.INode} node the item to associate the style with + * @param {yfiles.drawing.INodeStyle} style the new style instance + * @see Specified by {@link yfiles.graph.IGraphStructure#setNodeStyle}. + */ + setNodeStyle(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):void; + /** + * Associates the style with the given item. + * @param {yfiles.graph.IPort} port the item to associate the style with + * @param {yfiles.drawing.IPortStyle} style the new style instance + * @see Specified by {@link yfiles.graph.IGraphStructure#setPortStyle}. + */ + setPortStyle(port:yfiles.graph.IPort,style:yfiles.drawing.IPortStyle):void; + /** + * Associates the style with the given item. + * @param {yfiles.graph.IEdge} edge the item to associate the style with + * @param {yfiles.drawing.IEdgeStyle} style the new style instance + * @see Specified by {@link yfiles.graph.IGraphStructure#setEdgeStyle}. + */ + setEdgeStyle(edge:yfiles.graph.IEdge,style:yfiles.drawing.IEdgeStyle):void; + /** + * Associates the style with the given item. + * @param {yfiles.graph.ILabel} label the item to associate the style with + * @param {yfiles.drawing.ILabelStyle} style the new style instance + * @see Specified by {@link yfiles.graph.IGraphStructure#setLabelStyle}. + */ + setLabelStyle(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle):void; + /** + * Create but don't yet add a port for a given node. + * @see {@link yfiles.graph.IGraphStructure#addPort} + * @see Specified by {@link yfiles.graph.IGraphStructure#createPort}. + */ + createPort(forOwner:yfiles.graph.IPortOwner):yfiles.graph.IPort; + /** + * Add a previously created port to a given node. + * @param {yfiles.graph.IPortOwner} owner The owner of the port. + * @param {yfiles.graph.IPort} port The port that is not owned by another item. + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter The location of the port + * @see Specified by {@link yfiles.graph.IGraphStructure#addPort}. + */ + addPort(owner:yfiles.graph.IPortOwner,port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * Removes the port from its owner. + * @param {yfiles.graph.IPort} port The port. + * @see Specified by {@link yfiles.graph.IGraphStructure#removePort}. + */ + removePort(port:yfiles.graph.IPort):void; + /** + * Determines whether this instance contains the specified item. + * @param {yfiles.model.IModelItem} item The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraphStructure#containsItem}. + */ + containsItem(item:yfiles.model.IModelItem):boolean; + /** + * Determines whether this instance contains the specified item. + * @param {yfiles.graph.INode} node The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraphStructure#containsNode}. + */ + containsNode(node:yfiles.graph.INode):boolean; + /** + * Determines whether this instance contains the specified item. + * @param {yfiles.graph.IEdge} edge The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraphStructure#containsEdge}. + */ + containsEdge(edge:yfiles.graph.IEdge):boolean; + /** + * Determines whether this instance contains the specified item. + * @param {yfiles.graph.IPort} port The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraphStructure#containsPort}. + */ + containsPort(port:yfiles.graph.IPort):boolean; + /** + * Determines whether this instance contains the specified item. + * @param {yfiles.graph.ILabel} label The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraphStructure#containsLabel}. + */ + containsLabel(label:yfiles.graph.ILabel):boolean; + /** + * Determines whether this instance contains the specified item. + * @param {yfiles.graph.IBend} bend The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraphStructure#containsBend}. + */ + containsBend(bend:yfiles.graph.IBend):boolean; + /** + * Creates but does not add a bend for a given edge instance. + * @param {yfiles.graph.IEdge} forEdge The edge to add the bend to. + * @return {yfiles.graph.IBend} The newly created bend + * @see {@link yfiles.graph.IGraphStructure#addBend} + * @see Specified by {@link yfiles.graph.IGraphStructure#createBend}. + */ + createBend(forEdge:yfiles.graph.IEdge):yfiles.graph.IBend; + /** + * Adds a bend to an edge at the given index. + * @see Specified by {@link yfiles.graph.IGraphStructure#addBend}. + */ + addBend(forEdge:yfiles.graph.IEdge,index:number,bend:yfiles.graph.IBend):void; + /** + * Removes the bend from its edge. + * @param {yfiles.graph.IBend} bend The bend. + * @see Specified by {@link yfiles.graph.IGraphStructure#removeBend}. + */ + removeBend(bend:yfiles.graph.IBend):void; + /** + * Creates a label for a given owner using the provided model parameter. + * @param {yfiles.graph.ILabeledItem} owner The owner. + * @param {yfiles.graph.ILabelModelParameter} modelParameter The model parameter. + * @return {yfiles.graph.ILabel} A newly created label. + * @see {@link yfiles.graph.IGraphStructure#addLabel} + * @see Specified by {@link yfiles.graph.IGraphStructure#createLabel}. + */ + createLabel(owner:yfiles.graph.ILabeledItem,modelParameter:yfiles.graph.ILabelModelParameter):yfiles.graph.ILabel; + /** + * Adds a previously created label to its owner. + * @param {yfiles.graph.ILabeledItem} owner The new owner. + * @param {yfiles.graph.ILabel} label The label to add. + * @see Specified by {@link yfiles.graph.IGraphStructure#addLabel}. + */ + addLabel(owner:yfiles.graph.ILabeledItem,label:yfiles.graph.ILabel):void; + /** + * Removes the label from its owner. + * @param {yfiles.graph.ILabel} label The label. + * @see Specified by {@link yfiles.graph.IGraphStructure#removeLabel}. + */ + removeLabel(label:yfiles.graph.ILabel):void; + /** + * Sets the label text for a given label to the specified text. + * @param {yfiles.graph.ILabel} label The label. + * @param {string} text The text. + * @see {@link yfiles.graph.ILabel#text} + * @see Specified by {@link yfiles.graph.IGraphStructure#setLabelText}. + */ + setLabelText(label:yfiles.graph.ILabel,text:string):void; + /** + * Sets the {@link yfiles.graph.ILabel#labelModelParameter} for a given label. + * @param {yfiles.graph.ILabel} label The label to modify. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter to set. + * @see Specified by {@link yfiles.graph.IGraphStructure#setLabelModelParameter}. + */ + setLabelModelParameter(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):void; + /** + * Sets the ports of the given edge to the new values. + * Both ports and the edge are already live in this graph. + * @param {yfiles.graph.IEdge} edge The edge to change the ports. + * @param {yfiles.graph.IPort} sourcePort The new source port instance. + * @param {yfiles.graph.IPort} targetPort The new target port instance. + * @see Specified by {@link yfiles.graph.IGraphStructure#setPorts}. + */ + setPorts(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + /** + * Sets the location model parameter for the given port. + * @param {yfiles.graph.IPort} port The port to set the parameter. + * @param {yfiles.graph.IPortLocationModelParameter} locationModelParameter The new location model parameter for the port. + * @see Specified by {@link yfiles.graph.IGraphStructure#setLocationModelParameter}. + */ + setLocationModelParameter(port:yfiles.graph.IPort,locationModelParameter:yfiles.graph.IPortLocationModelParameter):void; + } + var IGraphStructure:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Support interface that is used by {@link yfiles.graph.DefaultGraph} + * to create the {@link yfiles.support.IUndoUnit}s for structural graph changes. + * An implementation of this interface can be found in {@link yfiles.graph.DefaultGraph}'s + * {@link yfiles.support.ILookup#lookup}. + * If the undoability mechanism needs customization, client code can wrap the existing + * support instance and do the necessary adjustments. + * @see {@link yfiles.graph.DefaultGraph#undoEngineEnabled} + * @see {@link yfiles.support.ILookupDecorator} + * @see {@link yfiles.support.IUndoUnit} + */ + export interface IGraphUndoUnitSupport extends Object{ + /** + * Creates the node creation {@link yfiles.support.IUndoUnit undo unit} for the given node. + * @param {yfiles.graph.INode} node The node that has been created. + * @return {yfiles.support.IUndoUnit} The unit that can be used to undo and redo the creation. + * @see Specified by {@link yfiles.graph.IGraphUndoUnitSupport#createCreateNodeUndoUnit}. + */ + createCreateNodeUndoUnit(node:yfiles.graph.INode):yfiles.support.IUndoUnit; + /** + * Creates the edge creation {@link yfiles.support.IUndoUnit undo unit} for the given edge. + * @param {yfiles.graph.IEdge} edge The edge that has been created. + * @return {yfiles.support.IUndoUnit} The unit that can be used to undo and redo the creation. + * @see Specified by {@link yfiles.graph.IGraphUndoUnitSupport#createCreateEdgeUndoUnit}. + */ + createCreateEdgeUndoUnit(edge:yfiles.graph.IEdge):yfiles.support.IUndoUnit; + /** + * Creates the port creation {@link yfiles.support.IUndoUnit undo unit} for the given port. + * @param {yfiles.graph.IPort} port The port that has been added. + * @return {yfiles.support.IUndoUnit} The unit that can be used to undo and redo the creation. + * @see Specified by {@link yfiles.graph.IGraphUndoUnitSupport#createAddPortUndoUnit}. + */ + createAddPortUndoUnit(port:yfiles.graph.IPort):yfiles.support.IUndoUnit; + /** + * Creates the label creation {@link yfiles.support.IUndoUnit undo unit} for the given label. + * @param {yfiles.graph.ILabel} label The label that has been added. + * @return {yfiles.support.IUndoUnit} The unit that can be used to undo and redo the creation. + * @see Specified by {@link yfiles.graph.IGraphUndoUnitSupport#createAddLabelUndoUnit}. + */ + createAddLabelUndoUnit(label:yfiles.graph.ILabel):yfiles.support.IUndoUnit; + /** + * Creates the bend creation {@link yfiles.support.IUndoUnit undo unit} for the given bend. + * @param {yfiles.graph.IBend} bend The bend that has been created. + * @param {number} index The index at which the bend has been added. + * @return {yfiles.support.IUndoUnit} The unit that can be used to undo and redo the creation. + * @see Specified by {@link yfiles.graph.IGraphUndoUnitSupport#createAddBendUndoUnit}. + */ + createAddBendUndoUnit(bend:yfiles.graph.IBend,index:number):yfiles.support.IUndoUnit; + /** + * Creates the node removal {@link yfiles.support.IUndoUnit undo unit} for the given node. + * @param {yfiles.graph.INode} node The node that will be removed. + * @return {yfiles.support.IUndoUnit} The unit that can be used to undo and redo the removal. + * @see Specified by {@link yfiles.graph.IGraphUndoUnitSupport#createRemoveNodeUndoUnit}. + */ + createRemoveNodeUndoUnit(node:yfiles.graph.INode):yfiles.support.IUndoUnit; + /** + * Creates the edge removal {@link yfiles.support.IUndoUnit undo unit} for the given edge. + * @param {yfiles.graph.IEdge} edge The edge that will be removed. + * @return {yfiles.support.IUndoUnit} The unit that can be used to undo and redo the removal. + * @see Specified by {@link yfiles.graph.IGraphUndoUnitSupport#createRemoveEdgeUndoUnit}. + */ + createRemoveEdgeUndoUnit(edge:yfiles.graph.IEdge):yfiles.support.IUndoUnit; + /** + * Creates the bend removal {@link yfiles.support.IUndoUnit undo unit} for the given bend. + * @param {yfiles.graph.IBend} bend The bend that will be removed. + * @return {yfiles.support.IUndoUnit} The unit that can be used to undo and redo the removal. + * @see Specified by {@link yfiles.graph.IGraphUndoUnitSupport#createRemoveBendUndoUnit}. + */ + createRemoveBendUndoUnit(bend:yfiles.graph.IBend):yfiles.support.IUndoUnit; + /** + * Creates the port removal {@link yfiles.support.IUndoUnit undo unit} for the given port. + * @param {yfiles.graph.IPort} port The port that will be removed. + * @return {yfiles.support.IUndoUnit} The unit that can be used to undo and redo the removal. + * @see Specified by {@link yfiles.graph.IGraphUndoUnitSupport#createRemovePortUndoUnit}. + */ + createRemovePortUndoUnit(port:yfiles.graph.IPort):yfiles.support.IUndoUnit; + /** + * Creates the label removal {@link yfiles.support.IUndoUnit undo unit} for the given label. + * @param {yfiles.graph.ILabel} label The label that will be removed. + * @return {yfiles.support.IUndoUnit} The unit that can be used to undo and redo the removal. + * @see Specified by {@link yfiles.graph.IGraphUndoUnitSupport#createRemoveLabelUndoUnit}. + */ + createRemoveLabelUndoUnit(label:yfiles.graph.ILabel):yfiles.support.IUndoUnit; + /** + * Creates the change ports {@link yfiles.support.IUndoUnit undo unit} for the given edge. + * @param {yfiles.graph.IEdge} edge The edge that has been reconnected to other ports. + * @param {yfiles.graph.IPort} oldSource The old source port the edge connected to before the change. + * @param {yfiles.graph.IPort} oldTarget The old target port the edge connected to before the change. + * @return {yfiles.support.IUndoUnit} The unit that can be used to undo and redo the port change operation. + * @see Specified by {@link yfiles.graph.IGraphUndoUnitSupport#createChangePortsUndoUnit}. + */ + createChangePortsUndoUnit(edge:yfiles.graph.IEdge,oldSource:yfiles.graph.IPort,oldTarget:yfiles.graph.IPort):yfiles.support.IUndoUnit; + } + var IGraphUndoUnitSupport:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A simple mutable default implementation of the {@link yfiles.graph.ILabelCandidateDescriptor} + * interface. + * All properties are read/write in this implementation. + */ + export interface LabelCandidateDescriptor extends Object,yfiles.graph.ILabelCandidateDescriptor{ + /** + * Gets a value indicating whether this candidate is deemed an external candidate. + * This is mainly for {@link yfiles.graph.INode} labels, where the label may be a visual part of the + * node's internals, but could be used for edge labels, too, if the edge occupies significant + * amounts of space, visually. + * Value: true if this describes an external candidate; otherwise, false. + * @see Specified by {@link yfiles.graph.ILabelCandidateDescriptor#externalCandidate}. + */ + externalCandidate:boolean; + /** + * Gets the edge overlap penalty that is used by labeling algorithms to weigh in the + * penalty if this label candidate overlaps with an edge path. + * Note that due to a known issue, if the penalty is greater than 0.0, all potential label candidates are + * rejected and thus a label placement algorithm will not calculate any new locations. + * Value: The edge overlap penalty. + * @see Specified by {@link yfiles.graph.ILabelCandidateDescriptor#edgeOverlapPenalty}. + */ + edgeOverlapPenalty:number; + /** + * Gets the edge overlap penalty that is used by labeling algorithms to weigh in the + * penalty if this label candidate overlaps with a node's bounds. + * Note that due to a known issue, if the penalty is greater than 0.0, all potential label candidates are + * rejected and thus a label placement algorithm will not calculate any new locations. + * Value: The node overlap penalty. + * @see Specified by {@link yfiles.graph.ILabelCandidateDescriptor#nodeOverlapPenalty}. + */ + nodeOverlapPenalty:number; + /** + * Gets the profit to weigh in if this candidate is chosen. + * Value: The profit to be used by labeling algorithms. + * @see Specified by {@link yfiles.graph.ILabelCandidateDescriptor#profit}. + */ + profit:number; + } + var LabelCandidateDescriptor:{ + $class:yfiles.lang.Class; + /** + * A sharable immutable implementation of the {@link yfiles.graph.ILabelCandidateDescriptor} + * interface that has penalties of 0.0 and a profit of 1.0 and yields true + * for the {@link yfiles.graph.ILabelCandidateDescriptor#externalCandidate} property. + */ + EXTERNAL_DESCRIPTOR:yfiles.graph.ILabelCandidateDescriptor; + /** + * A sharable immutable implementation of the {@link yfiles.graph.ILabelCandidateDescriptor} + * interface that has penalties of 0.0 and a profit of 1.0 and yields false + * for the {@link yfiles.graph.ILabelCandidateDescriptor#externalCandidate} property. + */ + INTERNAL_DESCRIPTOR:yfiles.graph.ILabelCandidateDescriptor; + }; + /** + * The interface for node entities in an {@link yfiles.graph.IGraph}. + * This interface provides read-only access to the properties of a node. + * In order to modify the state of an instance use the various methods provided by the + * {@link yfiles.graph.IGraph} this instance belongs to. + * Nodes and {@link yfiles.graph.IEdge edges} are the main entities + * that make up an {@link yfiles.graph.IGraph}. + * Nodes have zero or more {@link yfiles.graph.IPortOwner#ports} to which zero or more + * edges can connect. + * {@link yfiles.graph.IGraph} provides the {@link yfiles.graph.IGraph#typedEdgesAtOwner} + * method for querying the edges that connect to nodes. + * Also it is possible to query the {@link yfiles.graph.IGraph#typedEdgesAtPort adjacent edges for + * each port} that is owned by nodes. + * This interface combines the functionality of {@link yfiles.graph.IPortOwner} to get access to + * the ports, {@link yfiles.graph.ILabeledItem} to get access to the labels, and, + * like all items in an IGraph, nodes support the + * {@link yfiles.support.ILookup#lookup} method inherited from the {@link yfiles.model.IModelItem} interface + * can be used to query additional aspects of each instance. + *
+ * Related Information in the Developers Guide: + *

+ * The graph model with all relevant types and their relationships is presented in detail + * in the section Graph Structure. + *

+ *

+ * Using the look-up mechanism is explained in the section + * Look-up Mechanism. + *

+ * @see {@link yfiles.graph.IGraph} + * @see {@link yfiles.graph.IEdge} + */ + export interface INode extends Object,yfiles.graph.IPortOwner,yfiles.graph.ILabeledItem{ + /** + * Returns a live view of the layout of the node. + * The layout of a node is a rectangle in the world coordinate system + * that describes the bounding box of the representation of a node. + * Since this method will yield a live view, it is up to the client to copy the values of + * the instance if a snapshot of the state is needed. + * In order to modify the layout of a node, use the {@link yfiles.graph.IGraph#setBounds various methods} + * in {@link yfiles.graph.IGraph}. + * @see Specified by {@link yfiles.graph.INode#layout}. + */ + layout:yfiles.geometry.IRectangle; + /** + * Returns the style that is responsible for the visual representation + * of this node in a {@link yfiles.canvas.CanvasControl}. + * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setNodeStyle} + * method. + * Note that the style instance associated with a node instance may be shared + * between multiple node instances and that the modification of this style will + * result in a change of the appearance of all nodes that are associated with the same style instance. + * @see Specified by {@link yfiles.graph.INode#style}. + */ + style:yfiles.drawing.INodeStyle; + } + var INode:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A registry that can be used to store {@link yfiles.model.IMapper} implementations + * by tag. + * Implementations of this interface can be found in the {@link yfiles.support.ILookup#lookup} + * of the default {@link yfiles.graph.IGraph} implementations in the framework. + *
+ * Related Information in the Developers Guide: + *

+ * Using IMapperRegistry is described in the section + * Binding Data to Graph Elements. + *

+ * @see {@link yfiles.graph.MapperRegistry} + */ + export interface IMapperRegistry extends Object{ + /** + * Returns a mapper that has previously been registered with this instance for the given tag. + * @param {Object} tag The tag to use to look up the mapper. + * @return {yfiles.model.IMapper.} The previously registered instance or null. + * @see Specified by {@link yfiles.graph.IMapperRegistry#getMapper}. + */ + getMapper(tag:Object):yfiles.model.IMapper; + /** + * Registers a mapper for the given tag. + * If there already was a mapper for tag, it will be replaced. + * @param {Object} tag The tag to use. + * @param {yfiles.model.IMapper.} mapper The mapper to register. + * @see Specified by {@link yfiles.graph.IMapperRegistry#addMapper}. + */ + addMapper(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,tag:Object,mapper:yfiles.model.IMapper):void; + /** + * Removes a previously registered mapper for the given tag. + * @param {Object} tag The tag that has been used for registering the mapper. + * @see Specified by {@link yfiles.graph.IMapperRegistry#removeMapper}. + */ + removeMapper(tag:Object):void; + /** + * Gets an enumerable over all tags that have been used to + * register mapper implementations with this interface. + * @see Specified by {@link yfiles.graph.IMapperRegistry#registeredTags}. + */ + registeredTags:yfiles.collections.IEnumerable; + /** + * Gets the mapper {@link yfiles.graph.IMapperMetadata meta data} for the mapper + * that is registered using the tag. + * @param {Object} tag The tag. + * @return {yfiles.graph.IMapperMetadata} The meta data or null if there is no such mapper registered for the given tag. + * @see Specified by {@link yfiles.graph.IMapperRegistry#getMapperMetadata}. + */ + getMapperMetadata(tag:Object):yfiles.graph.IMapperMetadata; + /** + * Sets the mapper meta data for the mapper that has been {@link yfiles.graph.IMapperRegistry#addMapper registered} + * using the provided tag. + * @param {Object} tag The tag. + * @param {yfiles.graph.IMapperMetadata} metadata The meta data to store with the mapper. + * @throws {yfiles.system.ArgumentOutOfRangeException} If the {@link yfiles.graph.IMapperMetadata#keyType} + * or {@link yfiles.graph.IMapperMetadata#valueType} mismatch the mapper instance in the registry. + * @see Specified by {@link yfiles.graph.IMapperRegistry#setMapperMetadata}. + */ + setMapperMetadata(tag:Object,metadata:yfiles.graph.IMapperMetadata):void; + /** + * Creates and {@link yfiles.graph.IMapperRegistry#addMapper adds} + * a new {@link yfiles.model.WeakDictionaryMapper} to the registry + * using the provided tag. + * This is a bridge method that delegates to {@link yfiles.graph.MapperRegistryExtensions#addMapper}. + * @param {Object} tag The tag. + * @return {yfiles.model.WeakDictionaryMapper.} The newly created mapper instance. + * @see {@link yfiles.model.WeakDictionaryMapper} + */ + addMapperWithTag(kType:yfiles.lang.Class,vType:yfiles.lang.Class,tag:Object):yfiles.model.WeakDictionaryMapper; + /** + * Creates and {@link yfiles.graph.IMapperRegistry#addMapper adds} + * a new {@link yfiles.model.DictionaryMapper} to the registry + * using the provided tag. + * This is a bridge method that delegates to {@link yfiles.graph.MapperRegistryExtensions#addDictionaryMapper}. + * @param {Object} tag The tag. + * @return {yfiles.model.DictionaryMapper.} The newly created mapper instance. + * @see {@link yfiles.model.DictionaryMapper} + */ + addDictionaryMapper(kType:yfiles.lang.Class,vType:yfiles.lang.Class,tag:Object):yfiles.model.DictionaryMapper; + /** + * Creates a delegate-based read-only {@link yfiles.model.IMapper} + * implementation and {@link yfiles.graph.IMapperRegistry#addMapper adds} + * it to the registry + * using the provided tag. + * This is a bridge method that delegates to {@link yfiles.graph.MapperRegistryExtensions#addMapperGetter}. + * @param {Object} tag The tag. + * @param {function(K):V} getter The getter delegate to which {@link yfiles.model.IMapper} reads will be delegated. + * @return {yfiles.model.IMapper.} The newly created mapper instance. + * @see {@link yfiles.model.Mappers#createMapper} + */ + addMapperWithTagAndGetter(kType:yfiles.lang.Class,vType:yfiles.lang.Class,tag:Object,getter:(key:K)=>V):yfiles.model.IMapper; + /** + * Creates a simple read-only {@link yfiles.model.IMapper} + * implementation and {@link yfiles.graph.IMapperRegistry#addMapper adds} + * it to the registry + * using the provided tag. + * This is a bridge method that delegates to {@link yfiles.graph.MapperRegistryExtensions#addConstantMapper}. + * @param {Object} tag The tag. + * @param {V} constant The value to yield during {@link yfiles.model.IMapper} reads. + * @return {yfiles.model.IMapper.} The newly created mapper instance. + * @see {@link yfiles.model.Mappers#createMapper} + */ + addConstantMapper(kType:yfiles.lang.Class,vType:yfiles.lang.Class,tag:Object,constant:V):yfiles.model.IMapper; + /** + * Returns a mapper instance for which there has previously been registered an instance for the given tag, + * however using a different type parameter set. + * This is a bridge method that delegates to {@link yfiles.graph.MapperRegistryExtensions#getObjectObjectMapper}. + * @param {Object} tag The tag to use to look up the mapper. + * @return {yfiles.model.IMapper.} + * An instance that delegates to the original mapper or null if no mapper has been + * found for the provided tag. + */ + getObjectObjectMapper(tag:Object):yfiles.model.IMapper; + } + var IMapperRegistry:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Provides static convenience extension methods for the {@link yfiles.graph.IMapperRegistry}. + */ + export interface MapperRegistryExtensions extends Object{ + } + var MapperRegistryExtensions:{ + $class:yfiles.lang.Class; + /** + * Creates and {@link yfiles.graph.IMapperRegistry#addMapper adds} + * a new {@link yfiles.model.WeakDictionaryMapper} to the registry + * using the provided tag. + * If there already was a mapper for tag, it will be replaced. + * @param {yfiles.graph.IMapperRegistry} registry The registry. + * @param {Object} tag The tag. + * @return {yfiles.model.WeakDictionaryMapper.} The newly created mapper instance. + * @see {@link yfiles.model.WeakDictionaryMapper} + */ + addMapper(kType:yfiles.lang.Class,vType:yfiles.lang.Class,registry:yfiles.graph.IMapperRegistry,tag:Object):yfiles.model.WeakDictionaryMapper; + /** + * Creates and {@link yfiles.graph.IMapperRegistry#addMapper adds} + * a new {@link yfiles.model.DictionaryMapper} to the registry + * using the provided tag. + * If there already was a mapper for tag, it will be replaced. + * @param {yfiles.graph.IMapperRegistry} registry The registry. + * @param {Object} tag The tag. + * @return {yfiles.model.DictionaryMapper.} The newly created mapper instance. + * @see {@link yfiles.model.DictionaryMapper} + */ + addDictionaryMapper(kType:yfiles.lang.Class,vType:yfiles.lang.Class,registry:yfiles.graph.IMapperRegistry,tag:Object):yfiles.model.DictionaryMapper; + /** + * Creates a delegate-based read-only {@link yfiles.model.IMapper} + * implementation and {@link yfiles.graph.IMapperRegistry#addMapper adds} + * it to the registry + * using the provided tag. + * If there already was a mapper for tag, it will be replaced. + * @param {yfiles.graph.IMapperRegistry} registry The registry. + * @param {Object} tag The tag. + * @param {function(K):V} getter The getter delegate to which {@link yfiles.model.IMapper} reads will be delegated. + * @return {yfiles.model.IMapper.} The newly created mapper instance. + * @see {@link yfiles.model.Mappers#createMapper} + */ + addMapperGetter(kType:yfiles.lang.Class,vType:yfiles.lang.Class,registry:yfiles.graph.IMapperRegistry,tag:Object,getter:(key:K)=>V):yfiles.model.IMapper; + /** + * Creates a simple read-only {@link yfiles.model.IMapper} + * implementation and {@link yfiles.graph.IMapperRegistry#addMapper adds} + * it to the registry + * using the provided tag. + * If there already was a mapper for tag, it will be replaced. + * @param {yfiles.graph.IMapperRegistry} registry The registry. + * @param {Object} tag The tag. + * @param {V} constant The value to yield during {@link yfiles.model.IMapper} reads. + * @return {yfiles.model.IMapper.} The newly created mapper instance. + * @see {@link yfiles.model.Mappers#createMapper} + */ + addConstantMapper(kType:yfiles.lang.Class,vType:yfiles.lang.Class,registry:yfiles.graph.IMapperRegistry,tag:Object,constant:V):yfiles.model.IMapper; + /** + * Returns a mapper instance for which there has previously been registered an instance for the given tag, + * however using a different type parameter set. + * If the original mapper instance matches the type parameters, it will be returned, otherwise a dynamic + * wrapping implementation will be returned. + * This method can be used by generic code that does not know about the exact type parameters. + * @param {yfiles.graph.IMapperRegistry} registry The registry to retrieve and wrap the mapper from. + * @param {Object} tag The tag to use to look up the mapper. + * @return {yfiles.model.IMapper.} + * An instance that delegates to the original mapper or null if no mapper has been + * found for the provided tag. + */ + getObjectObjectMapper(registry:yfiles.graph.IMapperRegistry,tag:Object):yfiles.model.IMapper; + }; + /** + * A specialized subclass of the {@link yfiles.model.ItemEventArgs} + * class that is bound to the {@link yfiles.graph.IStripe} type and carries + * additional {@link yfiles.graph.IStripe owner} information. + * Since for some events ({@link yfiles.graph.ITable#addStripeRemovedListener StripeRemoved}) + * it is unclear what {@link yfiles.graph.StripeExtensions#getParent owner} the stripe + * was owned by before the event, this event can be used to carry exactly that information. + */ + export interface StripeEventArgs extends yfiles.model.ItemEventArgs{ + /** + * Gets the owner of the label that owned the label before the event happened. + * Value: The old owner. + */ + owner:yfiles.graph.IStripe; + } + var StripeEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graph.StripeEventArgs} class. + * @param {yfiles.graph.IStripe} stripe The stripe to assign to the {@link yfiles.model.ItemEventArgs#item} property. + * @param {yfiles.graph.IStripe} owner The previous owner of the stripe. + */ + new (stripe:yfiles.graph.IStripe,owner:yfiles.graph.IStripe):yfiles.graph.StripeEventArgs; + }; + /** + * An interface that can be used to register an event listener + * that will be notified of changes of an {@link yfiles.graph.INode}'s {@link yfiles.graph.INode#layout}. + * An implementation of this interface can be found in the {@link yfiles.support.ILookup#lookup} of a {@link yfiles.graph.DefaultGraph} + * instance. + */ + export interface INodeBoundsChangeReporter extends Object{ + /** + * The event that notifies listeners of node bounds changes. + */ + addBoundsChangedListener(value:(node:yfiles.graph.INode,oldLayout:yfiles.geometry.RectD)=> void):void; + /** + * The event that notifies listeners of node bounds changes. + */ + removeBoundsChangedListener(value:(node:yfiles.graph.INode,oldLayout:yfiles.geometry.RectD)=> void):void; + } + var INodeBoundsChangeReporter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.graph.IGraph} and the like to declare and obtain the defaults + * for nodes and their labels or ports. + * @see {@link yfiles.graph.IGraph#nodeDefaults} + * @see {@link yfiles.graph.IGroupedGraph#groupNodeDefaults} + */ + export interface INodeDefaults extends Object{ + /** + * Gets or sets the style to use for nodes. + * Depending on the setting of {@link yfiles.graph.INodeDefaults#shareStyleInstance}, the {@link yfiles.graph.INodeDefaults#getStyleInstance} + * method should return a {@link yfiles.system.ICloneable#clone clone} of this instance or the very same instance. + * Value: The style to use as a template. + * @see {@link yfiles.graph.INodeDefaults#shareStyleInstance} + * @see Specified by {@link yfiles.graph.INodeDefaults#style}. + */ + style:yfiles.drawing.INodeStyle; + /** + * Factory method that returns a style instance for use with newly created nodes. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.INodeDefaults#style} property, if {@link yfiles.graph.INodeDefaults#shareStyleInstance} + * is enabled, but they might use more complicated logic, too. + * @return {yfiles.drawing.INodeStyle} The style to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.INodeDefaults#style} property, if {@link yfiles.graph.INodeDefaults#shareStyleInstance} + * is enabled. + * @see Specified by {@link yfiles.graph.INodeDefaults#getStyleInstance}. + */ + getStyleInstance():yfiles.drawing.INodeStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.INodeDefaults#style} + * instance should be shared referentially or {@link yfiles.system.ICloneable#clone cloned} + * upon a call to {@link yfiles.graph.INodeDefaults#getStyleInstance}. + * Value: + * true if the reference should be shared; otherwise, false. + * @see {@link yfiles.graph.INodeDefaults#getStyleInstance} + * @see {@link yfiles.graph.INodeDefaults#style} + * @see Specified by {@link yfiles.graph.INodeDefaults#shareStyleInstance}. + */ + shareStyleInstance:boolean; + /** + * Gets or sets the defaults for ports at nodes. + * Value: The port defaults. + * @see Specified by {@link yfiles.graph.INodeDefaults#ports}. + */ + ports:yfiles.graph.IPortDefaults; + /** + * Gets or sets the defaults for labels at nodes. + * Value: The label defaults. + * @see Specified by {@link yfiles.graph.INodeDefaults#labels}. + */ + labels:yfiles.graph.ILabelDefaults; + /** + * Gets or sets the default node size. + * The values of this size will be used by the {@link yfiles.graph.GraphExtensions#createNode} + * and {@link yfiles.graph.GraphExtensions#createNodeWithCenter} methods. + * Value: The default size of newly created nodes. + * @see Specified by {@link yfiles.graph.INodeDefaults#size}. + */ + size:yfiles.geometry.SizeD; + } + var INodeDefaults:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A simple implementation of the {@link yfiles.graph.IMapperMetadata} interface that can be + * used as a base class. + */ + export interface MapperMetadata extends Object,yfiles.graph.IMapperMetadata{ + /** + * Gets the type of the keys in the {@link yfiles.model.IMapper}. + * Value: The type of the key. + * @see Specified by {@link yfiles.graph.IMapperMetadata#keyType}. + */ + keyType:yfiles.lang.Class; + /** + * Gets the type of the values in the {@link yfiles.model.IMapper}. + * Value: The type of the values. + * @see Specified by {@link yfiles.graph.IMapperMetadata#valueType}. + */ + valueType:yfiles.lang.Class; + } + var MapperMetadata:{ + $class:yfiles.lang.Class; + /** + * Creates an instance for the specified mapper. + * @param {yfiles.model.IMapper.} mapper The mapper instance to create the metadata for. + * @return {yfiles.graph.MapperMetadata} An instance that uses the {@link yfiles.graph.IMapperMetadata#keyType} and + * {@link yfiles.graph.IMapperMetadata#valueType} of the mapper. + */ + create(keyType:yfiles.lang.Class,valueType:yfiles.lang.Class,mapper:yfiles.model.IMapper):yfiles.graph.MapperMetadata; + /** + * Initializes a new instance of the {@link yfiles.graph.MapperMetadata} from the given instance class. + * @param {yfiles.graph.IMapperMetadata} metadata The metadata to copy key and value type from. + */ + FromMetadata:{ + new (metadata:yfiles.graph.IMapperMetadata):yfiles.graph.MapperMetadata; + }; + /** + * Initializes a new instance of the {@link yfiles.graph.MapperMetadata} class. + * @param {yfiles.lang.Class} keyType Type of the keys. + * @param {yfiles.lang.Class} valueType Type of the values. + */ + WithTypes:{ + new (keyType:yfiles.lang.Class,valueType:yfiles.lang.Class):yfiles.graph.MapperMetadata; + }; + }; + /** + * A simple default implementation of the {@link yfiles.graph.ILabelModelParameterFinder} + * interface that uses the {@link yfiles.graph.ILabelModel}'s own {@link yfiles.graph.ILabelModelParameterProvider} + * instance to find the closest match. + * This implementation uses a metric to find the closest of the + * provided parameter candidates to the layout provided in {@link yfiles.graph.DefaultLabelModelParameterFinder#findBestParameterForLabelLayoutAndParameters}. + */ + export interface DefaultLabelModelParameterFinder extends Object,yfiles.graph.ILabelModelParameterFinder{ + /** + * Tries to find a parameter that best matches the given layout for the + * provided label instance. + * This method may not necessarily find a parameter that matches the provided + * layout exactly. It will first query the {@link yfiles.graph.DefaultLabelModelParameterFinder#getCandidateParameters} parameter + * for an enumeration of candidates and will then find the best matching candidate + * using a metric calculated by {@link yfiles.graph.DefaultLabelModelParameterFinder#calculateMetric}. + * If no parameter can be found this method returns + * the {@link yfiles.graph.ILabelModel#createDefaultParameter default parameter} + * for the model. + * @param {yfiles.graph.ILabel} label The label to find a parameter for. + * @param {yfiles.graph.ILabelModel} model The model instance to use. This should be the instance + * this instance has been obtained from. + * @param {yfiles.geometry.IOrientedRectangle} labelLayout The anticipated layout for the label. + * @return {yfiles.graph.ILabelModelParameter} + * A non-null parameter that can be used for the label to approximate the provided layout. + * @see Specified by {@link yfiles.graph.ILabelModelParameterFinder#findBestParameter}. + */ + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,labelLayout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + /** + * Tries to find a parameter that best matches the given layout for the + * provided label instance among the set of given parameters. + * Null may be returned if an empty enumerable is passed. + * @param {yfiles.graph.ILabel} label The label to find a parameter for. + * @param {yfiles.geometry.IOrientedRectangle} labelLayout The anticipated layout for the label. + * @param {yfiles.collections.IEnumerable.} parameters A set of parameters to choose from. + * @return {yfiles.graph.ILabelModelParameter} A parameter that can be used for the label to approximate the provided layout. + */ + findBestParameterForLabelLayoutAndParameters(label:yfiles.graph.ILabel,labelLayout:yfiles.geometry.IOrientedRectangle,parameters:yfiles.collections.IEnumerable):yfiles.graph.ILabelModelParameter; + /** + * Retrieves an enumerator over all candidates for a given label and model. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.graph.ILabelModel} model The model of the label. + * @return {yfiles.collections.IEnumerable.} An enumerator over the candidates. The enumerator may be empty. + */ + getCandidateParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + /** + * Calculates a metric for the given label/parameter pair and the target label layout. + * This implementation gets the geometry from the parameter's model's {@link yfiles.graph.ILabelModel#getGeometry} + * method and returns the result of a call to {@link yfiles.graph.DefaultLabelModelParameterFinder#distance}. + * @param {yfiles.graph.ILabel} label The label to apply the parameter to. + * @param {yfiles.graph.ILabelModelParameter} parameter The parameter candidate. + * @param {yfiles.geometry.IOrientedRectangle} layout The targeted layout rectangle. + * @return {number} A metric that indicates the distance between the candidate's layout and the target layout. + */ + calculateMetric(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter,layout:yfiles.geometry.IOrientedRectangle):number; + /** + * Returns the distance between two {@link yfiles.geometry.IOrientedRectangle} instances. + * The distance is calculated using the Euclidean distance between the two centers + * and the angular deviation between the two up vectors. + * @param {yfiles.geometry.IOrientedRectangle} geometry The first geometry. + * @param {yfiles.geometry.IOrientedRectangle} targetGeometry The geometry to compare the first one with. + * @return {number} A value indicating the distance between the two instances. + */ + distance(geometry:yfiles.geometry.IOrientedRectangle,targetGeometry:yfiles.geometry.IOrientedRectangle):number; + } + var DefaultLabelModelParameterFinder:{ + $class:yfiles.lang.Class; + /** + * A singleton instance of this class. + */ + INSTANCE:yfiles.graph.DefaultLabelModelParameterFinder; + }; + /** + * Helper interface used by {@link yfiles.graph.ILabelModel} implementations + * to provide possible candidate {@link yfiles.graph.ILabelModelParameter}s + * for a given label and model. + * Implementations of this interface can be retrieved from the {@link yfiles.graph.ILabelModel}'s + * {@link yfiles.support.ILookup#lookup} method. + * Note that not all models necessarily need to or can provide implementations of this interface. + */ + export interface ILabelModelParameterProvider extends Object{ + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.ILabelModelParameter} + * instances that can be used for the given label and model. + * @param {yfiles.graph.ILabel} label The label instance to use. + * @param {yfiles.graph.ILabelModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of label model parameters. + * @see Specified by {@link yfiles.graph.ILabelModelParameterProvider#getParameters}. + */ + getParameters(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel):yfiles.collections.IEnumerable; + } + var ILabelModelParameterProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Common interface for parameters that are created by + * {@link yfiles.graph.ILabelModel} instances. + * A parameter encapsulates a certain state that can be interpreted by its + * {@link yfiles.graph.ILabelModelParameter#model} to calculate a {@link yfiles.graph.ILabel#layout} + * given an {@link yfiles.graph.ILabel} instance. + * Implementations of this interface can usually be obtained through factory methods + * of the corresponding {@link yfiles.graph.ILabelModel} implementations. + * This interface extends the {@link yfiles.system.ICloneable} interface. This allows clients + * to obtain a persistent copy of the current state of this parameter. + * Immutable parameter implementations may return themselves. + * @see {@link yfiles.graph.ILabelModel} + * @see {@link yfiles.graph.ILabel} + */ + export interface ILabelModelParameter extends Object,yfiles.system.ICloneable{ + /** + * Gets the model that can be used to query the geometry of a label given + * this parameter and a label instance. + * @see Specified by {@link yfiles.graph.ILabelModelParameter#model}. + */ + model:yfiles.graph.ILabelModel; + /** + * Determines whether this parameter can be used for a given label instance. + * Some parameters cannot be used with all types of labels. E.g. they can only + * be used with labels that belong to {@link yfiles.graph.INode} instances. + * @param {yfiles.graph.ILabel} label the label this parameter should be associated with + * @return {boolean} whether this parameter instance can be used for the given label + * @see Specified by {@link yfiles.graph.ILabelModelParameter#supports}. + */ + supports(label:yfiles.graph.ILabel):boolean; + } + var ILabelModelParameter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Utility interface used by {@link yfiles.graph.ILabelModel} implementations to + * find the best {@link yfiles.graph.ILabelModelParameter} + * to approximate a given layout. + * Implementations of this class may be retrieved from {@link yfiles.graph.ILabelModel} + * implementations using their {@link yfiles.support.ILookup#lookup} method. + * Note that implementations are not required to return an instance if queried + * for this interface. + * @see {@link yfiles.graph.DefaultLabelModelParameterFinder} + */ + export interface ILabelModelParameterFinder extends Object{ + /** + * Tries to find a parameter that best matches the given layout for the + * provided label instance. + * This method may not necessarily find a parameter that matches the provided + * layout exactly. Implementations may choose to simply return the model's + * {@link yfiles.graph.ILabelModel#createDefaultParameter default parameter} + * but may never return null. + * @param {yfiles.graph.ILabel} label The label to find a parameter for. + * @param {yfiles.graph.ILabelModel} model The model instance to use. This should be the instance + * this instance has been obtained from. + * @param {yfiles.geometry.IOrientedRectangle} labelLayout The anticipated layout for the label. + * @return {yfiles.graph.ILabelModelParameter} A non-null parameter that can be used for the label to approximate the provided layout. + * @see Specified by {@link yfiles.graph.ILabelModelParameterFinder#findBestParameter}. + */ + findBestParameter(label:yfiles.graph.ILabel,model:yfiles.graph.ILabelModel,labelLayout:yfiles.geometry.IOrientedRectangle):yfiles.graph.ILabelModelParameter; + } + var ILabelModelParameterFinder:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface that can be used to register an event listener + * that will be notified of changes of an {@link yfiles.graph.ILabel}'s {@link yfiles.graph.ILabel#text}. + * An implementation of this interface can be found in the {@link yfiles.support.ILookup#lookup} of a {@link yfiles.graph.DefaultGraph} + * instance. + */ + export interface ILabelTextChangeReporter extends Object{ + /** + * The event that will be triggered once the label's text property has changed. + */ + addTextChangedListener(value:(label:yfiles.graph.ILabel,oldText:string)=> void):void; + /** + * The event that will be triggered once the label's text property has changed. + */ + removeTextChangedListener(value:(label:yfiles.graph.ILabel,oldText:string)=> void):void; + } + var ILabelTextChangeReporter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface for the meta data that is associated with {@link yfiles.model.IMapper}s in + * a {@link yfiles.graph.IMapperRegistry}. + * @see {@link yfiles.graph.IMapperRegistry#getMapperMetadata} + * @see {@link yfiles.graph.IMapperRegistry#setMapperMetadata} + * @see {@link yfiles.graph.MapperMetadata} + */ + export interface IMapperMetadata extends Object{ + /** + * Gets the type of the keys in the {@link yfiles.model.IMapper}. + * Value: The type of the key. + * @see Specified by {@link yfiles.graph.IMapperMetadata#keyType}. + */ + keyType:yfiles.lang.Class; + /** + * Gets the type of the values in the {@link yfiles.model.IMapper}. + * Value: The type of the values. + * @see Specified by {@link yfiles.graph.IMapperMetadata#valueType}. + */ + valueType:yfiles.lang.Class; + } + var IMapperMetadata:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface that can be used to register an event listener + * that will be notified of changes of an {@link yfiles.support.ITagOwner}'s {@link yfiles.support.ITagOwner#tag}. + * An implementation of this interface can be found in the {@link yfiles.support.ILookup#lookup} of a {@link yfiles.graph.DefaultGraph} + * instance. + */ + export interface ITagChangeReporter extends Object{ + /** + * The event that will be triggered once a tag has changed. + */ + addTagChangedListener(value:(owner:yfiles.support.ITagOwner,oldTag:Object,newTag:Object)=> void):void; + /** + * The event that will be triggered once a tag has changed. + */ + removeTagChangedListener(value:(owner:yfiles.support.ITagOwner,oldTag:Object,newTag:Object)=> void):void; + } + var ITagChangeReporter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface that can be used to register an event listener + * that will be notified of changes of an {@link yfiles.graph.IBend}'s {@link yfiles.geometry.IPoint#x coordinates}. + * An implementation of this interface can be found in the {@link yfiles.support.ILookup#lookup} of a {@link yfiles.graph.DefaultGraph} + * instance. + */ + export interface IBendLocationChangeReporter extends Object{ + /** + * The event that notifies listeners of bend location changes. + */ + addLocationChangedListener(value:(bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.PointD)=> void):void; + /** + * The event that notifies listeners of bend location changes. + */ + removeLocationChangedListener(value:(bend:yfiles.graph.IBend,oldLocation:yfiles.geometry.PointD)=> void):void; + } + var IBendLocationChangeReporter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Enumerates the bends that are hit at a certain position in world coordinates. + */ + export interface IBendHitTestEnumerator extends Object,yfiles.drawing.IHitTestEnumerator{ + } + var IBendHitTestEnumerator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface used in an {@link yfiles.graph.IGraph} implementation + * to control the layout of {@link yfiles.graph.IEdge edges}. + * This interface provides read-only access to the properties of a bend. + * In order to modify the state of an instance use the various methods provided by the + * {@link yfiles.graph.IGraph} this instance belongs to. + * Bends are stored in {@link yfiles.model.IListEnumerable}s, that + * can be obtained from the {@link yfiles.graph.IEdge} implementation that owns this bend. + * Like all items in an IGraph, this item supports the + * {@link yfiles.support.ILookup#lookup} method that can be used + * to query additional aspects of the item. + *
+ * Related Information in the Developers Guide: + *

+ * The graph model with all relevant types and their relationships is presented in detail + * in the section Graph Structure. + *

+ *

+ * Using the look-up mechanism is explained in the section + * Look-up Mechanism. + *

+ */ + export interface IBend extends Object,yfiles.model.IModelItem{ + /** + * Returns the edge this bend instance belongs to. + * This implies that Owner.Bends contains + * this instance. + * @see Specified by {@link yfiles.graph.IBend#owner}. + */ + owner:yfiles.graph.IEdge; + /** + * Gets a view of the location of the bend in the world coordinate system. + * The {@link yfiles.geometry.IPoint#x} and {@link yfiles.geometry.IPoint#y} properties + * describe the location of the bend in the world coordinate system. + * This property is a live view of the location and will be updated in the future + * if the location changes. To keep the current state of the location, callers need to + * create a copy of it + * @see {@link yfiles.support.PointExtensions#toPoint} + * @see Specified by {@link yfiles.graph.IBend#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Gets the index of the bend at its {@link yfiles.graph.IBend#owner}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#getBendIndex}. + * @return {number} The zero based index of the bend in the {@link yfiles.graph.IEdge#bends} list; -1 if the bend is not part of an edge. + */ + getIndex():number; + } + var IBend:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface that can be used to register an event listener + * that will be notified of changes of an {@link yfiles.graph.ILabel}'s {@link yfiles.graph.ILabel#preferredSize preferred size}. + * An implementation of this interface can be found in the {@link yfiles.support.ILookup#lookup} of a {@link yfiles.graph.DefaultGraph} + * instance. + * @see {@link yfiles.graph.IPreferredSizeChangeReporter#addPreferredSizeChangedListener PreferredSizeChanged} + */ + export interface IPreferredSizeChangeReporter extends Object{ + /** + * The event that notifies listeners of bend location changes. + */ + addPreferredSizeChangedListener(value:(label:yfiles.graph.ILabel,oldPreferredSize:yfiles.geometry.SizeD)=> void):void; + /** + * The event that notifies listeners of bend location changes. + */ + removePreferredSizeChangedListener(value:(label:yfiles.graph.ILabel,oldPreferredSize:yfiles.geometry.SizeD)=> void):void; + } + var IPreferredSizeChangeReporter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface that can be used to register an event listener + * that will be notified of changes of an {@link yfiles.graph.IPort}'s {@link yfiles.graph.IPort#locationModelParameter parameter}. + * An implementation of this interface can be found in the {@link yfiles.support.ILookup#lookup} of a {@link yfiles.graph.DefaultGraph} + * instance. + */ + export interface IPortLocationModelParameterChangeReporter extends Object{ + /** + * The event that notifies listeners of port location model parameter changes. + */ + addLocationModelParameterChangedListener(value:(port:yfiles.graph.IPort,oldParameter:yfiles.graph.IPortLocationModelParameter)=> void):void; + /** + * The event that notifies listeners of port location model parameter changes. + */ + removeLocationModelParameterChangedListener(value:(port:yfiles.graph.IPort,oldParameter:yfiles.graph.IPortLocationModelParameter)=> void):void; + } + var IPortLocationModelParameterChangeReporter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Enumerates the edges that are hit at a certain position in world coordinates. + */ + export interface IEdgeHitTestEnumerator extends Object,yfiles.drawing.IHitTestEnumerator{ + } + var IEdgeHitTestEnumerator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Static utility class that offers convenience methods for + * often used tasks in conjunction with {@link yfiles.graph.IHierarchy} + * instances. + */ + export interface HierarchyExtensions extends Object{ + } + var HierarchyExtensions:{ + $class:yfiles.lang.Class; + /** + * Returns all elements that are part of the hierarchy. + * @param {yfiles.graph.IHierarchy.} hierarchy The hierarchy itself. + * @return {yfiles.collections.IEnumerable.} An enumeration of the contents of the hierarchy at the time of this invocation. + */ + elements(hierarchy:yfiles.graph.IHierarchy):yfiles.collections.IEnumerable; + /** + * Returns all descendants of the provided item that are part of the hierarchy. + * The enumeration will be top down, i.e. all of an item's ancestors will + * be enumerated before the respective item. + * @param {yfiles.graph.IHierarchy.} hierarchy The hierarchy itself. + * @return {yfiles.collections.IEnumerable.} An enumeration of the children of the item at the time of this invocation in reverse DFS prefix order. + * @param {T} root The root item to get the descendants from. + */ + getDescendants(hierarchy:yfiles.graph.IHierarchy,root:T):yfiles.collections.IEnumerable; + /** + * Gets the path to root traversing all {@link yfiles.graph.IHierarchy#getParent parents} + * of the given item. + * @param {yfiles.graph.IHierarchy.} hierarchy The hierarchy to use for retrieving the {@link yfiles.graph.IHierarchy#getParent parent}. + * @param {T} item The item to start. + * @return {yfiles.collections.IList.} A list that includes the item but not the {@link yfiles.graph.IHierarchy#root}, unless they are identical and all parents in between them. + */ + getPathToRoot(hierarchy:yfiles.graph.IHierarchy,item:T):yfiles.collections.IList; + /** + * Returns all descendants of the provided item that are part of the hierarchy. + * The enumeration will be bottom up, i.e. all of an item's children will + * be enumerated before the respective item. + * @param {yfiles.graph.IHierarchy.} hierarchy The hierarchy itself. + * @return {yfiles.collections.IEnumerable.} An enumeration of the children of the item at the time of this invocation in DFS postfix order. + * @param {T} root The root item to get the descendants from. + */ + getDescendantsBottomUp(hierarchy:yfiles.graph.IHierarchy,root:T):yfiles.collections.IEnumerable; + /** + * Determines whether parent is a parent of node + * in the hierarchy. + * @param {yfiles.graph.IHierarchy.} hierarchy The hierarchy itself. + * @param {T} node The node to check. + * @param {T} parent The parent to check. + * @return {boolean} Whether parent is an ancestor of node. + */ + isDescendant(hierarchy:yfiles.graph.IHierarchy,node:T,parent:T):boolean; + /** + * Determines the nearest common ancestor of the items provided in the hierarchy. + * @param {yfiles.graph.IHierarchy.} hierarchy The hierarchy itself. + * @param {T[]} items The items to find the nearest common ancestor of. + */ + getNearestCommonAncestorOfArray(hierarchy:yfiles.graph.IHierarchy,items:T[]):T; + /** + * Determines the nearest common ancestor of the items provided in the hierarchy. + * @param {yfiles.graph.IHierarchy.} hierarchy The hierarchy itself. + * @param {yfiles.collections.IEnumerator.} items The items to find the nearest common ancestor of. + */ + getNearestCommonAncestor(hierarchy:yfiles.graph.IHierarchy,items:yfiles.collections.IEnumerator):T; + }; + /** + * Enumerates the {@link yfiles.graph.ILabeledItem} that are hit at a certain position in world coordinates. + */ + export interface ILabeledItemHitTestEnumerator extends Object,yfiles.drawing.IHitTestEnumerator{ + } + var ILabeledItemHitTestEnumerator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Enumerates the ports that are hit at a certain position in world coordinates. + */ + export interface IPortHitTestEnumerator extends Object,yfiles.drawing.IHitTestEnumerator{ + } + var IPortHitTestEnumerator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Enumerates the nodes that are hit at a certain position in world coordinates. + */ + export interface INodeHitTestEnumerator extends Object,yfiles.drawing.IHitTestEnumerator{ + } + var INodeHitTestEnumerator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Enumerates the labels that are hit at a certain position in world coordinates. + */ + export interface ILabelHitTestEnumerator extends Object,yfiles.drawing.IHitTestEnumerator{ + } + var ILabelHitTestEnumerator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum StripeTypes{ + /** + * Constant for rows. + * @see {@link yfiles.graph.StripeTypes#ROW} + */ + ROW, + /** + * Constant for columns. + * @see {@link yfiles.graph.StripeTypes#COLUMN} + */ + COLUMN, + /** + * Constant for all item types. + * This is a bitwise combination of all other types declared in this enum. + */ + ALL, + /** + * Constant for no item type. + * This is a constant where no type bit has been set, i.e. it is 0. + */ + NONE + } + /** + * Interface that is used for manipulating a {@link yfiles.graph.FoldingManager#createManagedView managed view} + * of an {@link yfiles.graph.IGraph} that supports folding operations like {@link yfiles.graph.IFoldedGraph#expand expanding} and + * {@link yfiles.graph.IFoldedGraph#collapse collapsing} of nodes. + * The {@link yfiles.graph.FoldingManager} creates views of a {@link yfiles.graph.IFoldingManager#masterGraph} and + * {@link yfiles.graph.FoldingManager#masterHierarchy} which are created using copies of the original "master" entities. + * The views are being synchronized via the {@link yfiles.graph.FoldingManager#masterGraph}, but may contain additional + * {@link yfiles.graph.FoldingManager#getNodeViewState view state}. + * Typically nodes and edges are being copied from the {@link yfiles.graph.FoldingManager#masterGraph} and they share + * many of their properties by reference (e.g. {@link yfiles.graph.INode#style}). + * However if group nodes are being represented by {@link yfiles.graph.IFoldedGraph#collapse collapsed} group nodes in this view, + * they maintain a separate set of {@link yfiles.graph.ILabel labels}, {@link yfiles.graph.IPort ports}, {@link yfiles.graph.IBend bends}, + * and {@link yfiles.graph.INode#layout geometry}. This view-local state is shared between all views + * that have been {@link yfiles.graph.FoldingManager#createManagedView created} by the same + * {@link yfiles.graph.IFoldedGraph#manager} and can be obtained and modified via the + * {@link yfiles.graph.FoldingManager}'s GetViewState methods for {@link yfiles.graph.FoldingManager#getEdgeViewState dummy edges} + * and {@link yfiles.graph.FoldingManager#getNodeViewState dummy nodes} in the absence of a corresponding {@link yfiles.graph.IFoldedGraph} + * view instance. + * Developers typically don't need to implement this interface themselves, rather an implementation is provided by the framework + * and can be obtained from the {@link yfiles.graph.FoldingManager} implementation. + * Use {@link yfiles.graph.FoldingManager#createManagedView} to obtain an {@link yfiles.graph.IGraph} implementation + * that contains an implementation of this class in its {@link yfiles.support.ILookup#lookup} method: + *

+    * var manager = new FoldingManager();
+    * var foldedGraph = manager.createManagedView();
+    * var graph = foldedGraph.graph;
+    * // obtain the foldedGraph instance using the lookup, this
+    * // will yield the same instance as above but can be used 
+    * // at other places in the code that have access to the graph 
+    * // instance, only.
+    * foldedGraph = graph.getFoldedGraph();
+    * 
+ * This interface extends the {@link yfiles.system.INotifyPropertyChanged} interface. + * This can be used to easily monitor the {@link yfiles.graph.IFoldedGraph#invalid validity} of this view. + * Also changes to the {@link yfiles.graph.IFoldedGraph#localRoot} property will be published via this event. + *
+ * Related Information in the Developers Guide: + *

+ * A brief description of the interface's API and some usage aspects is given + * in the section Class IFoldedGraph. + * Class FoldingManager's central role for folding support in general + * is discussed in the section Folding Characteristics. + *

+ * @see {@link yfiles.graph.FoldingManager} + */ + export interface IFoldedGraph extends Object,yfiles.support.ILookup,yfiles.system.INotifyPropertyChanged{ + /** + * Determines whether the given group node from the {@link yfiles.graph.FoldingManager#masterGraph} + * will be displayed in {@link yfiles.graph.IFoldedGraph#expand}ed state the next time it will be included in this view. + * The initial state had been queried using the {@link system.Predicate} function, + * that has been specified during the + * {@link yfiles.graph.FoldingManager#createManagedViewWithRootAndExpandedPredicate creation of the view} + * but can be different for this view due to + * subsequent calls to {@link yfiles.graph.IFoldedGraph#collapse} and {@link yfiles.graph.IFoldedGraph#expand}. + * This method can be used to yield the last known expanded state for a node, even if it is not currently + * visible in the view. + * @param {yfiles.graph.INode} masterGroupNode The group node in the {@link yfiles.graph.FoldingManager#masterHierarchy}. + * @return {boolean} true iff the node should be displayed in {@link yfiles.graph.IFoldedGraph#expand expanded} state + * the next time it will become visible in this view. + * @see {@link yfiles.graph.FoldingManager#setInitiallyExpanded} + * @see {@link yfiles.graph.FoldingManager#isInitiallyExpanded} + * @see {@link yfiles.graph.FoldingManager#defaultExpandedPredicate} + * @see Specified by {@link yfiles.graph.IFoldedGraph#isInitiallyExpanded}. + */ + isInitiallyExpanded(masterGroupNode:yfiles.graph.INode):boolean; + /** + * Event that will be triggered whenever a group has been {@link yfiles.graph.IFoldedGraph#collapse}d. + */ + addGroupCollapsedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered whenever a group has been {@link yfiles.graph.IFoldedGraph#collapse}d. + */ + removeGroupCollapsedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered whenever a group has been {@link yfiles.graph.IFoldedGraph#expand}ed. + */ + addGroupExpandedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered whenever a group has been {@link yfiles.graph.IFoldedGraph#expand}ed. + */ + removeGroupExpandedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Provides access to the manager that created this view and that contains references to + * the {@link yfiles.graph.FoldingManager#masterGraph} and {@link yfiles.graph.FoldingManager#masterHierarchy}. + * @see Specified by {@link yfiles.graph.IFoldedGraph#manager}. + */ + manager:yfiles.graph.IFoldingManager; + /** + * Provides a reference to the {@link yfiles.graph.IGraph} implementation that provides the actual view data. + * The instance has an implementation of this interface in its {@link yfiles.support.ILookup} that + * has been obtained from the {@link yfiles.graph.FoldingManager}'s {@link yfiles.graph.FoldingManager#createManagedView} + * set of methods. + * The instance holds the elements in the view only, which in general is a subset of the {@link yfiles.graph.FoldingManager#masterGraph}. + * Also note that the elements are not the same references as their {@link yfiles.graph.IFoldedGraph#getMaster masters}, they + * are copies that may share the same attributes. + * @see Specified by {@link yfiles.graph.IFoldedGraph#graph}. + */ + graph:yfiles.graph.IGraph; + /** + * Provides a reference to the {@link yfiles.graph.IGroupedGraph} implementation that is backing the + * {@link yfiles.graph.IFoldedGraph#graph} view. + * This is a convenience accessor, that yields the implementation that is bound to the {@link yfiles.graph.IFoldedGraph#graph} instance. + * The instance manages the elements in the view only, which in general is a subset of the {@link yfiles.graph.FoldingManager#masterGroupedGraph}. + * @see Specified by {@link yfiles.graph.IFoldedGraph#groupedGraph}. + */ + groupedGraph:yfiles.graph.IGroupedGraph; + /** + * Determines whether this instance should automatically switch the {@link yfiles.graph.IFoldedGraph#localRoot} to an ancestor + * of the current root, if this view becomes {@link yfiles.graph.IFoldedGraph#invalid}. + * By default this property is set to true which assures that this view will never become {@link yfiles.graph.IFoldedGraph#invalid}. + * It is the responsibility of the client code to check for the validity of this view before trying to modify it if + * this feature is disabled. + * @see Specified by {@link yfiles.graph.IFoldedGraph#autoSwitchToAncestor}. + */ + autoSwitchToAncestor:boolean; + /** + * Determines if this view is currently valid and can be edited. + * A view is invalid if the {@link yfiles.graph.IFoldedGraph#localRoot} is not currently part of the {@link yfiles.graph.FoldingManager#masterHierarchy}. + * This can happen if the root node is removed from the {@link yfiles.graph.FoldingManager#masterGraph}. + * Note that the view can become valid again if the removal is undone. + * @see {@link yfiles.graph.IFoldedGraph#autoSwitchToAncestor} + * @see Specified by {@link yfiles.graph.IFoldedGraph#invalid}. + */ + invalid:boolean; + /** + * Determines whether changes to the {@link yfiles.graph.IFoldedGraph#localRoot} property and calls to + * {@link yfiles.graph.IFoldedGraph#collapse} and {@link yfiles.graph.IFoldedGraph#expand} should be recorded in undo history. + * By default this property is set to false, however depending on the use case + * it may make sense to enqueue {@link yfiles.support.IUndoUnit}s for this type of operations. + * @see {@link yfiles.graph.IFoldedGraph#autoSwitchToAncestor} + * @see Specified by {@link yfiles.graph.IFoldedGraph#enqueueNavigationalUndoUnits}. + */ + enqueueNavigationalUndoUnits:boolean; + /** + * Provides a reference to the {@link yfiles.graph.IHierarchy} implementation that is backing the + * {@link yfiles.graph.IFoldedGraph#graph} view. + * This is a convenience accessor, that yields the implementation that is bound to the {@link yfiles.graph.IFoldedGraph#groupedGraph} instance. + * The instance manages the elements in the view only, which in general is a subset of the {@link yfiles.graph.FoldingManager#masterHierarchy} + * and is induced by {@link yfiles.graph.IFoldedGraph#localRoot}. + * Note that the {@link yfiles.graph.IHierarchy#root} property of the provides instance is not the same as {@link yfiles.graph.IFoldedGraph#localRoot}. + * Instead {@link yfiles.graph.IFoldedGraph#localRoot} is a node from the {@link yfiles.graph.FoldingManager#masterHierarchy} (including the root of the master hierarchy), + * whereas the root property of this instance is set to an unmodifiable value. + * @see Specified by {@link yfiles.graph.IFoldedGraph#hierarchy}. + */ + hierarchy:yfiles.graph.IHierarchy; + /** + * Gets or sets an entity of the {@link yfiles.graph.FoldingManager#masterHierarchy} to serve as the virtual {@link yfiles.graph.IHierarchy#root} + * for the view's local {@link yfiles.graph.IFoldedGraph#hierarchy}. + * This property can be set to any {@link yfiles.graph.IHierarchy#isLeaf non-leaf} node in the {@link yfiles.graph.FoldingManager#masterHierarchy} + * whose contents will then be represented in this view. + * Note that the {@link yfiles.graph.IHierarchy#root} property of the view's local {@link yfiles.graph.IFoldedGraph#hierarchy} is not set to the same instance. + * @see Specified by {@link yfiles.graph.IFoldedGraph#localRoot}. + */ + localRoot:yfiles.graph.INode; + /** + * This method will expand a previously {@link yfiles.graph.IFoldedGraph#collapse collapsed} group node to make its contents + * appear in this view. + * If a node that belongs to this view's {@link yfiles.graph.IFoldedGraph#hierarchy} is in {@link yfiles.graph.IFoldedGraph#collapse collapsed} state, + * calling this method will make the {@link yfiles.graph.IHierarchy#getChildren children} appear in this {@link yfiles.graph.IFoldedGraph#graph view}. + * This method will do nothing if the node is already expanded. Note that expanding a collapsed group node + * will make the node a non-{@link yfiles.graph.IHierarchy#isLeaf leaf}, whereas a collapsed group node is a leaf in + * this {@link yfiles.graph.IFoldedGraph#hierarchy} and thus cannot have visible children. + * The expanded group node has its own separate set of attributes, which may be different from the collapsed state that + * can be obtained using the {@link yfiles.graph.FoldingManager#getNodeViewState} + * method. The expanded state is always the same as the state of the {@link yfiles.graph.IFoldedGraph#getMaster master node}. + * Because of these differences it may appear that the node changes its location during an expand operation. This behavior ensures that + * expanding a node does not modify the state of the model by moving the node or its descendants (only the state in the view is changed), + * but depending on the application this may confuse the user because he might loose his mental map of the diagram. + * In order to customize the behavior custom code can register with the {@link yfiles.graph.IFoldedGraph#addGroupExpandedListener GroupExpanded} event to perform the necessary + * modifications, like adjusting the view port or moving the node and its descendants to the desired location. + * @param {yfiles.graph.INode} groupNode A group node that is part of the {@link yfiles.graph.IFoldedGraph#graph} and {@link yfiles.graph.IFoldedGraph#hierarchy} that belongs to this instance. + * @see {@link yfiles.graph.IFoldedGraph#isExpanded} + * @see {@link yfiles.graph.IFoldedGraph#collapse} + * @see Specified by {@link yfiles.graph.IFoldedGraph#expand}. + */ + expand(groupNode:yfiles.graph.INode):void; + /** + * This method will collapse the {@link yfiles.graph.IHierarchy#getChildren children} of a group node into the group node. + * If a non-{@link yfiles.graph.IHierarchy#isLeaf leaf} node that belongs to this view's {@link yfiles.graph.IFoldedGraph#hierarchy} is in {@link yfiles.graph.IFoldedGraph#expand expanded} state, + * calling this method will remove the {@link yfiles.graph.IHierarchy#getChildren children} from this {@link yfiles.graph.IFoldedGraph#graph view}. + * This method will do nothing if the node is already collapsed. Note that collapsing a group node + * will make it a {@link yfiles.graph.IHierarchy#isLeaf leaf} node in the {@link yfiles.graph.IFoldedGraph#hierarchy}. + * The collapsed group node has its own separate set of attributes, which can be obtained using the {@link yfiles.graph.FoldingManager#getNodeViewState} + * method. Therefore it may appear that the node changes its location during a collapse operation. This behavior ensures that + * collapsing a node does not modify the state of the model (only the state in the view is changed), but depending on the application + * this may confuse the user because he might loose his mental map of the diagram. + * In order to customize the behavior custom code can register with the {@link yfiles.graph.IFoldedGraph#addGroupCollapsedListener GroupCollapsed} event to perform the necessary + * modifications, like adjusting the view port or moving the node to the desired location. + * @param {yfiles.graph.INode} groupNode A group node that is part of the {@link yfiles.graph.IFoldedGraph#graph} and {@link yfiles.graph.IFoldedGraph#hierarchy} that belongs to this instance. + * @see {@link yfiles.graph.IFoldedGraph#isExpanded} + * @see Specified by {@link yfiles.graph.IFoldedGraph#collapse}. + */ + collapse(groupNode:yfiles.graph.INode):void; + /** + * Determines whether the provided node from this + * {@link yfiles.graph.IFoldedGraph#hierarchy} is currently {@link yfiles.graph.IFoldedGraph#expand expanded}. + * Expanded group nodes will have all of their {@link yfiles.graph.IHierarchy#getChildren children} visible in this {@link yfiles.graph.IFoldedGraph#graph view} + * and {@link yfiles.graph.IFoldedGraph#hierarchy}. + * @param {yfiles.graph.INode} groupNode The group node for which the {@link yfiles.graph.IFoldedGraph#expand expanded} state will be returned. + * @return {boolean} true, if the group node can be {@link yfiles.graph.IFoldedGraph#collapse collapsed}. + * @see Specified by {@link yfiles.graph.IFoldedGraph#isExpanded}. + */ + isExpanded(groupNode:yfiles.graph.INode):boolean; + /** + * Helper method that can be used to retrieve the original "master" items in the {@link yfiles.graph.FoldingManager#masterGraph} + * that is managed by the {@link yfiles.graph.IFoldedGraph#manager} associated with this view. + * Since the {@link yfiles.graph.IFoldedGraph#graph} view that is associated with this instance maintains a copy of the entities in the + * {@link yfiles.graph.IFoldedGraph#manager}'s {@link yfiles.graph.FoldingManager#masterGraph}, there is a mapping between elements that + * belong to this view's {@link yfiles.graph.IFoldedGraph#graph} and the elements in the master graph. + * This method can be called for the elements contained in this {@link yfiles.graph.IGraph#collectionModel graph's item collection} + * and will return the corresponding item in the master graph that the element corresponds to, if any. + * Note that for some items in the {@link yfiles.graph.IFoldedGraph#graph}, there is no master item in the {@link yfiles.graph.FoldingManager#masterGraph}, e.g. + * the {@link yfiles.graph.IPort} instances to which {@link yfiles.graph.DummyEdgeId dummy edges} connect have no corresponding + * ports in the master graph. The same holds true for the {@link yfiles.graph.IBend bends} and {@link yfiles.graph.ILabel labels} + * of dummy edges and {@link yfiles.graph.DummyNodeId dummy nodes}. + * For dummy edges, this method will yield the main representing edge + * in the master, if the dummy edge represents more than one master edge. For dummy nodes, the master node will be returned, no matter + * whether the node is currently {@link yfiles.graph.IFoldedGraph#collapse collapsed} or not. + * @param {T} item The item that is part of this {@link yfiles.graph.IFoldedGraph#graph} for which the original "master" item in the + * {@link yfiles.graph.FoldingManager#masterGraph} will be returned. + * @return {T} An item in the {@link yfiles.graph.FoldingManager#masterGraph} that corresponds to the item + * or null, if there is no such item. + * @see {@link yfiles.graph.IFoldedGraph#getRepresentative} + * @see Specified by {@link yfiles.graph.IFoldedGraph#getMaster}. + */ + getMaster(item:T):T; + /** + * Determines whether the specified item is a dummy in this view. + * This method can be used to determine if an {@link yfiles.graph.INode}, {@link yfiles.graph.IEdge}, {@link yfiles.graph.IPort}, {@link yfiles.graph.ILabel}, + * or {@link yfiles.graph.IBend} has a {@link yfiles.graph.FoldingManager#getNodeViewState view local state} and + * is not a direct copy of the {@link yfiles.graph.IFoldedGraph#getMaster master item}, if any. + * Note that {@link yfiles.graph.IFoldedGraph#collapse collapsed} group nodes are dummy items, even though they do have a {@link yfiles.graph.IFoldedGraph#getMaster master} + * item in the master graph and dummy edges always have at least one {@link yfiles.graph.IFoldedGraph#getMasterEdges master edge}, while + * all other dummy items don't have a corresponding master item in the master graph. + * @param {yfiles.model.IModelItem} item One of the items that are {@link yfiles.graph.IGraph#contains contained} in the {@link yfiles.graph.IFoldedGraph#graph}. + * @return {boolean} + * Whether the item is a dummy that is not an exact copy of an item in the {@link yfiles.graph.FoldingManager#masterGraph}. + * @see Specified by {@link yfiles.graph.IFoldedGraph#isDummy}. + */ + isDummy(item:yfiles.model.IModelItem):boolean; + /** + * Helper method that corresponds to the {@link yfiles.graph.IFoldedGraph#getMaster} method, but is used for dummy edges, only. + * Since dummy edges can represent more than one master edge, this method can be used to query all of the master + * edges that the provided dummy edge represents. If the dummy edge corresponds to a single master edge, the result will + * enumerate that edge, only. + * @param {yfiles.graph.IEdge} dummyEdge The dummy edge for which the master edges should be returned. + * @return {yfiles.collections.IEnumerable.} An enumerable that can enumerate all of the edges in the {@link yfiles.graph.FoldingManager#masterGraph} + * that are being represented by the dummy edge in this {@link yfiles.graph.IFoldedGraph#graph view}. + * @see {@link yfiles.graph.IAddDummyEdgeCallback#addToExistingDummy} + * @see {@link yfiles.graph.IFoldedGraph#getRepresentative} + * @see Specified by {@link yfiles.graph.IFoldedGraph#getMasterEdges}. + */ + getMasterEdges(dummyEdge:yfiles.graph.IEdge):yfiles.collections.IEnumerable; + /** + * Helper method that can be used to retrieve the representing items in this {@link yfiles.graph.IFoldedGraph#graph}-view + * for all items that are part of the {@link yfiles.graph.FoldingManager#masterGraph} that is associated + * with the {@link yfiles.graph.IFoldedGraph#manager} of this instance. + * Since the {@link yfiles.graph.IFoldedGraph#graph} view that is associated with this instance maintains a copy of the entities in the + * {@link yfiles.graph.IFoldedGraph#manager}'s {@link yfiles.graph.FoldingManager#masterGraph}, there is a mapping between elements that + * belong to master graph and the elements in the {@link yfiles.graph.IFoldedGraph#graph} of this view. + * This method can be called for the elements contained in this {@link yfiles.graph.FoldingManager#masterGraph master graph's} + * {@link yfiles.graph.IGraph#collectionModel item collection} + * and will return the corresponding item in this view's {@link yfiles.graph.IFoldedGraph#graph} if the element is represented by an item in this view. + * Note that for some items in the {@link yfiles.graph.FoldingManager#masterGraph}, there may be no item in the {@link yfiles.graph.IFoldedGraph#graph} instance, e.g. + * those elements which are part of a {@link yfiles.graph.IFoldedGraph#collapse collapsed} subtree in the {@link yfiles.graph.FoldingManager#masterHierarchy} + * or those items that do not belong to the subtree that is induced by the {@link yfiles.graph.IFoldedGraph#localRoot} of this view. + * Also, for nodes and edges that are being represented by dummies in this view, labels, ports, and bends are not + * being represented directly by corresponding entities in this graph. + * If more than one edge is represented by a dummy edge in this view, this method will yield the same dummy edge instance + * for each of them. + * @param {T} item An item that is part of the {@link yfiles.graph.FoldingManager#masterGraph} that is associated with the + * {@link yfiles.graph.IFoldedGraph#manager} of this instance. + * @return {T} An item in the {@link yfiles.graph.IFoldedGraph#graph local graph view} that corresponds to the item + * or null, if the item is not currently being represented in this view. + * @see {@link yfiles.graph.IFoldedGraph#getMaster} + * @see {@link yfiles.graph.IFoldedGraph#getMasterEdges} + * @see Specified by {@link yfiles.graph.IFoldedGraph#getRepresentative}. + */ + getRepresentative(item:T):T; + /** + * Disposes of this view explicitly. + * Normally it is not necessary to do so, because the view will be garbage collected automatically. + * However if the view still displays contents, this might have unwanted negative side effects + * (group node sizes being calculated, etc.) + * A disposed of instance is not synchronized with the {@link yfiles.graph.FoldingManager} anymore + * and should not be used anymore. + * @see Specified by {@link yfiles.graph.IFoldedGraph#dispose}. + */ + dispose():void; + } + var IFoldedGraph:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Extension method holder class that extends the + * {@link yfiles.graph.ITable} type with utility methods. + * @see {@link yfiles.graph.ITable} + */ + export interface TableExtensions extends Object{ + } + var TableExtensions:{ + $class:yfiles.lang.Class; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter and style. + * @param {yfiles.graph.IStripe} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {yfiles.drawing.ILabelStyle} style The style to assign to the new label. + * @param {string} text the initial text of the label + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.ITable#setLabelText} + * @see {@link yfiles.graph.ITable#setLabelModelParameter} + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + addLabelWithParameterAndStyle(table:yfiles.graph.ITable,item:yfiles.graph.IStripe,parameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter, preferred size, and style. + * @param {yfiles.graph.IStripe} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {yfiles.drawing.ILabelStyle} style The style to assign to the new label. + * @param {string} text the initial text of the label + * @param {yfiles.geometry.SizeD} preferredSize The initial preferred size to assign. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.ITable#setLabelText} + * @see {@link yfiles.graph.ITable#setLabelModelParameter} + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + addLabelWithParameterStyleAndPreferredSize(table:yfiles.graph.ITable,item:yfiles.graph.IStripe,parameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,preferredSize:yfiles.geometry.SizeD):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter and style. + * This method will {@link yfiles.graph.TableExtensions#calculatePreferredSize + * calculate the preferred size} of the new label before hand. + * @param {yfiles.graph.IStripe} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {yfiles.drawing.ILabelStyle} style The style to assign to the new label. + * @param {string} text the initial text of the label + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {Object} tag The {@link yfiles.support.ITagOwner#tag} to assign to the new label. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.ITable#setLabelText} + * @see {@link yfiles.graph.ITable#setLabelModelParameter} + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + addLabelWithParameterStyleAndTag(table:yfiles.graph.ITable,item:yfiles.graph.IStripe,parameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,tag:Object):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter. + * @param {yfiles.graph.IStripe} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {string} text the initial text of the label + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.ITable#setLabelText} + * @see {@link yfiles.graph.ITable#setLabelModelParameter} + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + addLabelWithParameter(table:yfiles.graph.ITable,item:yfiles.graph.IStripe,parameter:yfiles.graph.ILabelModelParameter,text:string):yfiles.graph.ILabel; + /** + * Convenience method that delegates to the {@link yfiles.graph.ILabelDefaults#getStyleInstance} + * method for the given {@link yfiles.graph.IStripe stripe}. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IStripe} item The item the newly created label will belong to. + * @return {yfiles.drawing.ILabelStyle} The style instance to use for newly created stripes. + */ + createLabelStyle(table:yfiles.graph.ITable,item:yfiles.graph.IStripe):yfiles.drawing.ILabelStyle; + /** + * Creates the label model parameter for a given {@link yfiles.graph.ILabeledItem}. + * This implementation uses the label defaults for the table + * to {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance obtain the parameter instance}. + * @param {yfiles.graph.ITable} table The table to retrieve the {@link yfiles.graph.ILabelDefaults} from. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IStripe} item The item that is the {@link yfiles.graph.ILabel#owner} of the label in question. + * @return {yfiles.graph.ILabelModelParameter} The default label model parameter to use for newly created labels at the item. + * @see {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance} + */ + createLabelModelParameter(table:yfiles.graph.ITable,item:yfiles.graph.IStripe):yfiles.graph.ILabelModelParameter; + /** + * Add a label to the given item using the text as the initial label text. + * @param {yfiles.graph.IStripe} item the item to add the label to. + * @param {string} text the initial text of the label + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.ITable#setLabelText} + * @see {@link yfiles.graph.ITable#setLabelModelParameter} + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + addLabel(table:yfiles.graph.ITable,item:yfiles.graph.IStripe,text:string):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text and a given tag. + * @param {yfiles.graph.IStripe} item the item to add the label to. + * @param {string} text the initial text of the label + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {Object} tag The tag to assign to the label. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.ITable#setLabelText} + * @see {@link yfiles.graph.ITable#setLabelModelParameter} + * @see {@link yfiles.graph.ITable#setLabelStyle} + */ + addLabelWithTag(table:yfiles.graph.ITable,item:yfiles.graph.IStripe,text:string,tag:Object):yfiles.graph.ILabel; + /** + * Calculates the preferred size of a label with the given properties. + * @param {yfiles.graph.ITable} table The graph to which the label will be added. + * @param {yfiles.graph.IStripe} item The item that will own the label. + * @param {yfiles.drawing.ILabelStyle} labelStyle The label style. + * @param {yfiles.graph.ILabelModelParameter} labelModelParameter The label model parameter. + * @param {string} text The text. + * @param {Object} tag The tag for the label. + * @return {yfiles.geometry.SizeD} The size as calculated by the {@link yfiles.drawing.ILabelStyleRenderer}. + */ + calculatePreferredSize(table:yfiles.graph.ITable,item:yfiles.graph.IStripe,labelStyle:yfiles.drawing.ILabelStyle,labelModelParameter:yfiles.graph.ILabelModelParameter,text:string,tag:Object):yfiles.geometry.SizeD; + /** + * Creates and returns a row as last child of owner using default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IRow} owner The owner of the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRow(table:yfiles.graph.ITable,owner:yfiles.graph.IRow):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of owner with a given size value and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} size The size to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowWithSize(table:yfiles.graph.ITable,owner:yfiles.graph.IRow,size:number):yfiles.graph.IRow; + /** + * Creates and returns a row as indexth child of owner with a given size value and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} index The index of the newly created row in its parent child list + * @param {number} size The size to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowAtIndexWithSize(table:yfiles.graph.ITable,owner:yfiles.graph.IRow,index:number,size:number):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of owner with a given style value and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowWithStyle(table:yfiles.graph.ITable,owner:yfiles.graph.IRow,style:yfiles.drawing.INodeStyle):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of owner with given style and size values and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} size The size to use for the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowWithSizeAndStyle(table:yfiles.graph.ITable,owner:yfiles.graph.IRow,size:number,style:yfiles.drawing.INodeStyle):yfiles.graph.IRow; + /** + * Creates and returns a row as indexth child of owner with given style and size values and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} index The index of the newly created row in its parent child list + * @param {number} size The size to use for the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowAtIndexWithSizeAndStyle(table:yfiles.graph.ITable,owner:yfiles.graph.IRow,index:number,size:number,style:yfiles.drawing.INodeStyle):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of owner with a given tag value and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowWithTag(table:yfiles.graph.ITable,owner:yfiles.graph.IRow,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of owner with given size and tag values and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} size The size to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowWithSizeAndTag(table:yfiles.graph.ITable,owner:yfiles.graph.IRow,size:number,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as indexth child of owner with given size and tag values and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} index The index of the newly created row in its parent child list + * @param {number} size The size to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowAtIndexWithSizeAndTag(table:yfiles.graph.ITable,owner:yfiles.graph.IRow,index:number,size:number,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of owner with given style and tag values and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowWithStyleAndTag(table:yfiles.graph.ITable,owner:yfiles.graph.IRow,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of owner with given style, size and tag values and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} size The size to use for the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowWithSizeStyleAndTag(table:yfiles.graph.ITable,owner:yfiles.graph.IRow,size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as indexth child of owner with given style, size and tag values and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IRow} owner The owner of the row + * @param {number} index The index of the newly created row in its parent child list + * @param {number} size The size to use for the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRowAtIndexWithSizeStyleAndTag(table:yfiles.graph.ITable,owner:yfiles.graph.IRow,index:number,size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table using default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRow(table:yfiles.graph.ITable):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table with a given size value and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} size The size to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowWithSize(table:yfiles.graph.ITable,size:number):yfiles.graph.IRow; + /** + * Creates and returns a row as indexth child of table with a given size value and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} index The index of the newly created row in its parent child list + * @param {number} size The size to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowAtIndexWithSize(table:yfiles.graph.ITable,index:number,size:number):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table with a given style value and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowWithStyle(table:yfiles.graph.ITable,style:yfiles.drawing.INodeStyle):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table with given style and size values and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} size The size to use for the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowWithSizeAndStyle(table:yfiles.graph.ITable,size:number,style:yfiles.drawing.INodeStyle):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table with a given tag value and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowWithTag(table:yfiles.graph.ITable,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table with given size and tag values and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} size The size to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowWithSizeAndTag(table:yfiles.graph.ITable,size:number,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as indexth child of table with given size and tag values and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} index The index of the newly created row in its parent child list + * @param {number} size The size to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowAtIndexWithSizeAndTag(table:yfiles.graph.ITable,index:number,size:number,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table with given style and tag values and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowWithStyleAndTag(table:yfiles.graph.ITable,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as last child of table with given style, size and tag values and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} size The size to use for the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowWithSizeStyleAndTag(table:yfiles.graph.ITable,size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a row as indexth child of table with given style, size and tag values and default values for all other row properties. + * The row will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} index The index of the newly created row in its parent child list + * @param {number} size The size to use for the row + * @param {yfiles.drawing.INodeStyle} style The style to use for the row + * @param {Object} tag The tag to use for the row + * @return {yfiles.graph.IRow} A newly created row instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootRowAtIndexWithSizeStyleAndTag(table:yfiles.graph.ITable,index:number,size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IRow; + /** + * Creates and returns a column as last child of owner using default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumn(table:yfiles.graph.ITable,owner:yfiles.graph.IColumn):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of owner with a given size value and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} size The size to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnWithSize(table:yfiles.graph.ITable,owner:yfiles.graph.IColumn,size:number):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of owner with a given size value and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnAtIndexWithSize(table:yfiles.graph.ITable,owner:yfiles.graph.IColumn,index:number,size:number):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of owner with a given style value and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnWithStyle(table:yfiles.graph.ITable,owner:yfiles.graph.IColumn,style:yfiles.drawing.INodeStyle):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of owner with given style and size values and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnWithSizeAndStyle(table:yfiles.graph.ITable,owner:yfiles.graph.IColumn,size:number,style:yfiles.drawing.INodeStyle):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of owner with given style and size values and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnAtIndexWithSizeAndStyle(table:yfiles.graph.ITable,owner:yfiles.graph.IColumn,index:number,size:number,style:yfiles.drawing.INodeStyle):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of owner with a given tag value and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnWithTag(table:yfiles.graph.ITable,owner:yfiles.graph.IColumn,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of owner with given size and tag values and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} size The size to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnWithSizeAndTag(table:yfiles.graph.ITable,owner:yfiles.graph.IColumn,size:number,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of owner with given size and tag values and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnAtIndexWithSizeAndTag(table:yfiles.graph.ITable,owner:yfiles.graph.IColumn,index:number,size:number,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of owner with given style and tag values and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnWithStyleAndTag(table:yfiles.graph.ITable,owner:yfiles.graph.IColumn,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of owner with given style, size and tag values and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnWithSizeStyleAndTag(table:yfiles.graph.ITable,owner:yfiles.graph.IColumn,size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of owner with given style, size and tag values and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IColumn} owner The owner of the column + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createColumnAtIndexWithSizeStyleAndTag(table:yfiles.graph.ITable,owner:yfiles.graph.IColumn,index:number,size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table using default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumn(table:yfiles.graph.ITable):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table with a given size value and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} size The size to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnWithSize(table:yfiles.graph.ITable,size:number):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of table with a given size value and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnAtIndexWithSize(table:yfiles.graph.ITable,index:number,size:number):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table with a given style value and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnWithStyle(table:yfiles.graph.ITable,style:yfiles.drawing.INodeStyle):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table with given style and size values and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnWithSizeAndStyle(table:yfiles.graph.ITable,size:number,style:yfiles.drawing.INodeStyle):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of table with given style and size values and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnAtIndexWithSizeAndStyle(table:yfiles.graph.ITable,index:number,size:number,style:yfiles.drawing.INodeStyle):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table with a given tag value and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnWithTag(table:yfiles.graph.ITable,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table with given size and tag values and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} size The size to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnWithSizeAndTag(table:yfiles.graph.ITable,size:number,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of table with given size and tag values and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnAtIndexWithSizeAndTag(table:yfiles.graph.ITable,index:number,size:number,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table with given style and tag values and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnWithStyleAndTag(table:yfiles.graph.ITable,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as last child of table with given style, size and tag values and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnWithSizeStyleAndTag(table:yfiles.graph.ITable,size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IColumn; + /** + * Creates and returns a column as indexth child of table with given style, size and tag values and default values for all other column properties. + * The column will be a part of this table after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} index The index of the newly created column in its parent child list + * @param {number} size The size to use for the column + * @param {yfiles.drawing.INodeStyle} style The style to use for the column + * @param {Object} tag The tag to use for the column + * @return {yfiles.graph.IColumn} A newly created column instance + * @see {@link yfiles.graph.ITable#addStripeCreatedListener StripeCreated} + */ + createRootColumnAtIndexWithSizeStyleAndTag(table:yfiles.graph.ITable,index:number,size:number,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.IColumn; + /** + * Sets owner as new parent of row. + * The row will be inserted as last child of the new parent. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IRow} owner The new owner of the stripe + * @param {yfiles.graph.IRow} row The row to reparent + */ + setRowParent(table:yfiles.graph.ITable,owner:yfiles.graph.IRow,row:yfiles.graph.IRow):void; + /** + * Sets owner as new parent of column. + * The column will be inserted as last child of the new parent. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IColumn} owner The new owner of the stripe + * @param {yfiles.graph.IColumn} column The column to reparent + */ + setColumnParent(table:yfiles.graph.ITable,owner:yfiles.graph.IColumn,column:yfiles.graph.IColumn):void; + /** + * {@link yfiles.graph.ITable#removeStripe}s stripe from table and resizes all affected stripes + * so that the table size does not change if possible. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IStripe} stripe The stripe to remove + */ + removeWithResize(table:yfiles.graph.ITable,stripe:yfiles.graph.IStripe):void; + /** + * {@link yfiles.graph.ITable#removeStripe}s stripe and all of its descendants from table. + * This method does not resize any stripes, use {@link yfiles.graph.TableExtensions#removeRecursivelyWithResize} instead. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IStripe} stripe The stripe to remove + */ + removeRecursively(table:yfiles.graph.ITable,stripe:yfiles.graph.IStripe):void; + /** + * {@link yfiles.graph.TableExtensions#removeWithResize Removes} the given stripe and all of its descendants from table and resizes all affected stripes + * so that the table size does not change if possible. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.IStripe} stripe The stripe to remove + */ + removeRecursivelyWithResize(table:yfiles.graph.ITable,stripe:yfiles.graph.IStripe):void; + /** + * Convenience method to find a stripe underneath a certain point. + * @param {yfiles.geometry.PointD} location The location to test. + * @param {yfiles.graph.StripeTypes} stripeTypes An enumeration value of {@link yfiles.graph.StripeTypes} to specify the stripe type. + * @param {yfiles.graph.StripeSubregion} subregions An enumeration value of {@link yfiles.graph.StripeSubregion} to further restrict the stripe region. + * @param {yfiles.canvas.CanvasControl} canvas The canvas that provides necessary context for hit determination, such as {@link yfiles.canvas.ICanvasContext#hitTestRadius}. + * @param {function(yfiles.graph.StripeSubregionDescriptor):boolean} predicate Additional predicate to further restrict the hit test results. + * @return {yfiles.graph.StripeSubregionDescriptor} The stripe subregions that have been found for the location or null. + */ + findStripe(location:yfiles.geometry.PointD,stripeTypes:yfiles.graph.StripeTypes,subregions:yfiles.graph.StripeSubregion,canvas:yfiles.canvas.CanvasControl,predicate:(obj:yfiles.graph.StripeSubregionDescriptor)=>boolean):yfiles.graph.StripeSubregionDescriptor; + /** + * Convenience method to find all stripes underneath a certain point. + * The stripes are always returned in bottom up, rows first order. Note that this method does not take any {@link yfiles.canvas.ICanvasContext#hitTestRadius} into account. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {yfiles.graph.INode} node The node this table is currently bound to + * @param {yfiles.geometry.PointD} location The location to test. + * @param {yfiles.graph.StripeTypes} stripeTypes An enumeration value of {@link yfiles.graph.StripeTypes} to specify the stripe type. + * @param {function(yfiles.graph.IStripe):boolean} predicate Additional predicate to further restrict the hit test results. + * @return {yfiles.collections.IEnumerable.} The stripes that have been found for the location or null. + */ + findStripesInNode(table:yfiles.graph.ITable,node:yfiles.graph.INode,location:yfiles.geometry.PointD,stripeTypes:yfiles.graph.StripeTypes,predicate:(obj:yfiles.graph.IStripe)=>boolean):yfiles.collections.IEnumerable; + /** + * Used as a callback to find the items underneath a certain point. + * @param {yfiles.geometry.PointD} location The location to test. + * @param {yfiles.graph.StripeTypes} stripeTypes An enumeration value of {@link yfiles.graph.StripeTypes} to specify the stripe type. + * @param {yfiles.graph.StripeSubregion} subregions An enumeration value of {@link yfiles.graph.StripeSubregion} to further restrict the stripe region. + * @param {yfiles.canvas.CanvasControl} canvas The canvas that provides necessary context for hit determination, such as {@link yfiles.canvas.ICanvasContext#hitTestRadius}. + * @param {function(yfiles.graph.StripeSubregionDescriptor):boolean} predicate Additional predicate to further restrict the hit test results. + * @return {yfiles.collections.IEnumerable.} The stripe subregions that have been found for the location. + */ + findStripes(location:yfiles.geometry.PointD,stripeTypes:yfiles.graph.StripeTypes,subregions:yfiles.graph.StripeSubregion,canvas:yfiles.canvas.CanvasControl,predicate:(obj:yfiles.graph.StripeSubregionDescriptor)=>boolean):yfiles.collections.IEnumerable; + /** + * Convenience method that creates a columns x rows. + * All existing rows and columns are cleared from table + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @param {number} columns The number of columns to test. + * @param {number} rows The number of rows to test. + */ + createGrid(table:yfiles.graph.ITable,columns:number,rows:number):void; + /** + * Convenience method that clears all stripes from a table. + * All existing rows and columns are cleared from table + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + */ + clear(table:yfiles.graph.ITable):void; + /** + * Adjusts the {@link yfiles.graph.ILabel#preferredSize} property of a label to + * fit the suggested size of its {@link yfiles.drawing.ILabelStyleRenderer}. + * This implementation uses the {@link yfiles.graph.ILabel#style style's} + * renderer for the label to determine the preferred rendering size. + * This is useful after the label's content or style have been changed. + * @param {yfiles.graph.ITable} table The table to use. This is a this parameter, so that the method can be used + * as an extension method. + * @see {@link yfiles.graph.ILabelDefaults#autoAdjustPreferredSize} + * @param {yfiles.graph.ILabel} label The label to adjust the size for. + */ + adjustPreferredSize(table:yfiles.graph.ITable,label:yfiles.graph.ILabel):void; + /** + * Return the accumulated insets for the table. + */ + getAccumulatedInsets(table:yfiles.graph.ITable):yfiles.geometry.InsetsD; + }; + /** + * This interface is considered internal but is public for technical reasons. + * Please see the {@link yfiles.graph.FoldingManager} class instead, which is available in the + * "yfiles/graph-folding" module. + */ + export interface IFoldingManager extends Object{ + masterGraph:yfiles.graph.IGraph; + masterHierarchy:yfiles.graph.IHierarchy; + masterGroupedGraph:yfiles.graph.IGroupedGraph; + defaultExpandedPredicate:(obj:yfiles.graph.INode)=>boolean; + views:yfiles.collections.IEnumerable; + dummyNodeConverter:yfiles.graph.IDummyNodeConverter; + dummyEdgeConverter:yfiles.graph.IDummyEdgeConverter; + hasEdgeViewState(id:yfiles.graph.DummyEdgeId):boolean; + hasNodeViewState(id:yfiles.graph.DummyNodeId):boolean; + hasPortViewState(id:yfiles.graph.DummyNodePortId):boolean; + getEdgeViewState(edgeId:yfiles.graph.DummyEdgeId):yfiles.graph.IEdge; + getNodeViewState(nodeId:yfiles.graph.DummyNodeId):yfiles.graph.INode; + getPortViewState(nodePortId:yfiles.graph.DummyNodePortId):yfiles.graph.IPort; + getChangeDummyNodeAppearanceCallback(nodeId:yfiles.graph.DummyNodeId):yfiles.graph.IChangeDummyNodeAppearanceCallback; + getChangeDummyEdgeAppearanceCallback(idedgeId:yfiles.graph.DummyEdgeId):yfiles.graph.IChangeDummyEdgeAppearanceCallback; + createManagedView():yfiles.graph.IFoldedGraph; + setInitiallyExpanded(createdNode:yfiles.graph.INode,expanded:boolean):void; + getAllViewStates(masterEdge:yfiles.graph.IEdge):yfiles.collections.IEnumerable>; + } + var IFoldingManager:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Helper class that deals with the {@link yfiles.graph.GraphItemTypes} + * enumeration. + */ + export interface GraphItemType extends Object{ + } + var GraphItemType:{ + $class:yfiles.lang.Class; + /** + * Gets the type of the item. + * @param {yfiles.model.IModelItem} item The item. + * @return {yfiles.graph.GraphItemTypes} The type. + */ + getItemType(item:yfiles.model.IModelItem):yfiles.graph.GraphItemTypes; + /** + * Determines whether the item is of the specified type. + * @param {yfiles.model.IModelItem} item The item. + * @param {yfiles.graph.GraphItemTypes} type The type. + * @return {boolean} + * true if the item is of the specified type; otherwise, false. + */ + modelItemIs(type:yfiles.graph.GraphItemTypes,item:yfiles.model.IModelItem):boolean; + /** + * Determines whether the specified items collection contains all of the types described + * by types. + * @param {yfiles.collections.IEnumerable.} items The items. + * @param {yfiles.graph.GraphItemTypes} types The types. + * @return {boolean} + * true if the specified items contains all of the types; otherwise, false. + */ + enumerableContainsAll(types:yfiles.graph.GraphItemTypes,items:yfiles.collections.IEnumerable):boolean; + /** + * Determines whether the specified items collection contains any of the types described + * by types. + * @param {yfiles.collections.IEnumerable.} items The items. + * @param {yfiles.graph.GraphItemTypes} types The types. + * @return {boolean} + * true if the specified items contains any of the types; otherwise, false. + */ + enumerableContains(types:yfiles.graph.GraphItemTypes,items:yfiles.collections.IEnumerable):boolean; + /** + * Determines whether the specified items collection contains none of the types described + * by types. + * @param {yfiles.collections.IEnumerable.} items The items. + * @param {yfiles.graph.GraphItemTypes} types The types. + * @return {boolean} + * true if the specified items contains none of the types; otherwise, false. + */ + enumerableNotContains(types:yfiles.graph.GraphItemTypes,items:yfiles.collections.IEnumerable):boolean; + /** + * Determines whether the specified items collection contains all of the types described + * by types. + * @param {yfiles.collections.IEnumerator.} items The items. + * @param {yfiles.graph.GraphItemTypes} types The types. + * @return {boolean} + * true if the specified items contains all of the types; otherwise, false. + */ + enumeratorContainsAll(types:yfiles.graph.GraphItemTypes,items:yfiles.collections.IEnumerator):boolean; + /** + * Determines whether the specified items collection contains any of the types described + * by types. + * @param {yfiles.collections.IEnumerator.} items The items. + * @param {yfiles.graph.GraphItemTypes} types The types. + * @return {boolean} + * true if the specified items contains any of the types; otherwise, false. + */ + enumeratorContains(types:yfiles.graph.GraphItemTypes,items:yfiles.collections.IEnumerator):boolean; + /** + * Determines whether the specified items collection contains none of the types described + * by types. + * @param {yfiles.collections.IEnumerator.} items The items. + * @param {yfiles.graph.GraphItemTypes} types The types. + * @return {boolean} + * true if the specified items contains none of the types; otherwise, false. + */ + enumeratorNotContains(types:yfiles.graph.GraphItemTypes,items:yfiles.collections.IEnumerator):boolean; + /** + * Determines whether the specified items collection contains all of the types described + * by types. + * @param {yfiles.objectcollections.IEnumerator} items The items. + * @param {yfiles.graph.GraphItemTypes} types The types. + * @return {boolean} + * true if the specified items contains all of the types; otherwise, false. + */ + objectEnumeratorContainsAll(types:yfiles.graph.GraphItemTypes,items:yfiles.objectcollections.IEnumerator):boolean; + /** + * Determines whether the specified items collection contains any of the types described + * by types. + * @param {yfiles.objectcollections.IEnumerator} items The items. + * @param {yfiles.graph.GraphItemTypes} types The types. + * @return {boolean} + * true if the specified items contains any of the types; otherwise, false. + */ + objectEnumeratorContains(types:yfiles.graph.GraphItemTypes,items:yfiles.objectcollections.IEnumerator):boolean; + /** + * Determines whether the specified items collection contains none of the types described + * by types. + * @param {yfiles.objectcollections.IEnumerator} items The items. + * @param {yfiles.graph.GraphItemTypes} types The types. + * @return {boolean} + * true if the specified items contains none of the types; otherwise, false. + */ + objectEnumeratorNotContains(types:yfiles.graph.GraphItemTypes,items:yfiles.objectcollections.IEnumerator):boolean; + /** + * Determines the types of the items contained in the collection of items. + * @param {yfiles.collections.IEnumerable.} items The items. + * @return {yfiles.graph.GraphItemTypes} The types of the items. + */ + getEnumerableItemTypes(items:yfiles.collections.IEnumerable):yfiles.graph.GraphItemTypes; + /** + * Determines the types of the items contained in the collection of items. + * @param {yfiles.collections.IEnumerator.} items The items. + * @return {yfiles.graph.GraphItemTypes} The types of the items. + */ + getEnumeratorItemTypes(items:yfiles.collections.IEnumerator):yfiles.graph.GraphItemTypes; + /** + * Determines the types of the items contained in the collection of items. + * @param {yfiles.objectcollections.IEnumerator} items The items. + * @return {yfiles.graph.GraphItemTypes} The types of the items. + */ + getObjectEnumeratorItemTypes(items:yfiles.objectcollections.IEnumerator):yfiles.graph.GraphItemTypes; + }; + /** + * Central interface that models a graph which can be displayed + * in a {@link yfiles.canvas.CanvasControl canvas} or {@link yfiles.canvas.GraphControl}. + *

+ * This interface can be used to query structural information, it also offers + * methods that change the structure of the graph and its attributes. + * A number of events will trigger appropriate events if the structure + * of the graph changes. + *

+ *

+ * The graph is made up of collections of {@link yfiles.graph.INode nodes} and {@link yfiles.graph.IEdge edges}. + * Each node and edge can be associated + * with a number of {@link yfiles.graph.ILabel labels} and possibly {@link yfiles.graph.IPort ports} + * to which edges connect. An edge connects to two + * ports and may consist of zero or more {@link yfiles.graph.IBend bends}. + * The graph is treated as a directed graph, i.e. edges have a {@link yfiles.graph.IEdge#sourcePort source port} + * and a {@link yfiles.graph.IEdge#targetPort target port}. It is up to the algorithms + * and the visualization to possibly treat them as undirected. + *

+ *

+ * The {@link yfiles.graph.IGraph#typedEdgesAtPort} and {@link yfiles.graph.IGraph#typedEdgesAtOwner} methods + * can be used to query adjacency information from the graph's structure. + *

+ *

+ * Each element in the graph can be associated with a {@link yfiles.drawing.IVisualStyle visual style} + * that is used for the visualization + * of the element. Styles can be shared between multiple instances. + *

+ *

+ * To associate data with the elements in the graph, code can make use of the {@link yfiles.support.ITagOwner#tag} + * property that all {@link yfiles.model.IModelItem}s provide. In order to associate more than one data element with + * the graph items, compound data objects can be used. Alternatively the {@link yfiles.graph.IMapperRegistry} + * that can be obtained from the {@link yfiles.graph.IGraph#mapperRegistry} property can be used to associate arbitrary + * data sets with the items in this graph. + *

+ *

+ * This interface contains core methods that may use complicated argument lists. {@link yfiles.graph.GraphExtensions} + * is a static utility class that contains {@link system.runtime.compilerservices.ExtensionAttribute extension methods} for + * this interface that improve the usability of this interface dramatically. + *

+ *

+ * This interface provides a number of events that can be used to get notified for changes in the graph structure. These events are raised + * whenever the corresponding state change occurs, e.g. also when loading the graph from a file. If you are only interested in changes + * that are triggered interactively, you should subscribe to the corresponding events on the {@link yfiles.input.IInputMode} implementations + * that implement the user interaction. Especially, you may not modify the graph structure in handlers for these event, e.g. try to prevent or undo the + * change that has raised the event. + *

+ *
+ * Related Information in the Developers Guide: + *

+ * The graph model with all relevant types and their relationships is presented in detail + * in the section Graph Structure. + *

+ *

+ * More information on visual styles can be found in the section + * Visual Representation of Graph Elements. + *

+ * @see {@link yfiles.graph.DefaultGraph} + * @see {@link yfiles.graph.INode} + * @see {@link yfiles.graph.IEdge} + * @see {@link yfiles.graph.IPort} + * @see {@link yfiles.graph.ILabel} + * @see {@link yfiles.graph.IBend} + * @see {@link yfiles.graph.GraphExtensions} + * @see {@link yfiles.graph.IMapperRegistry} + */ + export interface IGraph extends Object,yfiles.support.ILookup{ + /** + * A collection view that combines all nodes, edges, labels, ports, and bends of this graph. + * This is a read-only live view of all model items of this graph that always represents the current + * state. The same reference will be returned for each invocation. + * @see Specified by {@link yfiles.graph.IGraph#collectionModel}. + */ + collectionModel:yfiles.model.ICollectionModel; + /** + * A collection view of the nodes contained in this graph. + * This is a live view of the nodes that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Nodes can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#nodes}. + */ + nodes:yfiles.model.ICollectionModel; + /** + * A collection view of the edges contained in this graph. + * This is a live view of the edges that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Edges can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#edges}. + */ + edges:yfiles.model.ICollectionModel; + /** + * A collection view of the edge labels contained in this graph. + * This is a live view of the edge labels that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Edge labels can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#edgeLabels}. + */ + edgeLabels:yfiles.model.ICollectionModel; + /** + * A collection view of the node labels contained in this graph. + * This is a live view of the node labels that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Node labels can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#nodeLabels}. + */ + nodeLabels:yfiles.model.ICollectionModel; + /** + * A collection view of the ports contained in this graph. + * This is a live view of the ports that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Ports can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#ports}. + */ + ports:yfiles.model.ICollectionModel; + /** + * A collection view of the bends contained in this graph. + * This is a live view of the bends that always represents the current + * state of the graph. The same reference will be returned for each invocation. + *

+ * Bends can be removed from this graph with the {@link yfiles.collections.ICollection#remove} and + * {@link yfiles.collections.ICollection#clear} methods of this collection. Calling its + * {@link yfiles.collections.ICollection#add} method is not allowed. + *

+ * @see Specified by {@link yfiles.graph.IGraph#bends}. + */ + bends:yfiles.model.ICollectionModel; + /** + * Gets or sets the defaults for normal nodes. + * The settings that are obtained from the instance influence newly + * created elements only. Setting different defaults afterwards + * does not influence existing elements. + * @see Specified by {@link yfiles.graph.IGraph#nodeDefaults}. + */ + nodeDefaults:yfiles.graph.INodeDefaults; + /** + * Gets or sets the defaults for normal edges. + * The settings that are obtained from the instance influence newly + * created elements only. Setting different defaults afterwards + * does not influence existing elements. + * @see Specified by {@link yfiles.graph.IGraph#edgeDefaults}. + */ + edgeDefaults:yfiles.graph.IEdgeDefaults; + /** + * Gets the mapper registry that is associated with this graph instance. + * The registry can be used to store data mappings for the items in this instance. + * @see {@link yfiles.graph.IMapperRegistry} + * @see {@link yfiles.model.IModelItem} + * @see {@link yfiles.support.ITagOwner#tag} + * @see Specified by {@link yfiles.graph.IGraph#mapperRegistry}. + */ + mapperRegistry:yfiles.graph.IMapperRegistry; + /** + * Creates and returns a node using the specified values for the initial geometry, style, and {@link yfiles.support.ITagOwner#tag}. + * The node will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.geometry.RectD} bounds The bounds to use initially. + * The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} field + * @param {yfiles.drawing.INodeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @param {Object} tag The initial value of the {@link yfiles.support.ITagOwner#tag} that will be assigned to the new node. + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + * @see {@link yfiles.drawing.common.VoidNodeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag}. + */ + createNodeWithBoundsStyleAndTag(bounds:yfiles.geometry.RectD,style:yfiles.drawing.INodeStyle,tag:Object):yfiles.graph.INode; + /** + * Sets the ports of the given edge to the new values. + * This will trigger an {@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} event if source or target ports differ + * from the current ones. Both ports and the edge must belong to the current graph instance. + * @param {yfiles.graph.IEdge} edge The edge to change the ports. + * @param {yfiles.graph.IPort} sourcePort The new source port instance. + * @param {yfiles.graph.IPort} targetPort The new target port instance. + * @see Specified by {@link yfiles.graph.IGraph#setPorts}. + */ + setPorts(edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + /** + * Returns an {@link yfiles.collections.IEnumerable} for all edges that are adjacent to the given + * port as a {@link yfiles.graph.IEdge#sourcePort} or {@link yfiles.graph.IEdge#targetPort}. + * @param {yfiles.graph.IPort} port the port to check + * @param {yfiles.graph.AdjacencyTypes} adjacencyType The type of adjacency to consider. + * @return {yfiles.model.IListEnumerable.} An enumeration of all adjacent edges of the given type. + * @see {@link yfiles.graph.GraphExtensions#edgesAtPort} + * @see {@link yfiles.graph.GraphExtensions#portInEdgesAt} + * @see {@link yfiles.graph.GraphExtensions#portOutEdgesAt} + * @see {@link yfiles.graph.AdjacencyTypes} + * @see Specified by {@link yfiles.graph.IGraph#typedEdgesAtPort}. + */ + typedEdgesAtPort(port:yfiles.graph.IPort,adjacencyType:yfiles.graph.AdjacencyTypes):yfiles.model.IListEnumerable; + /** + * Returns an {@link yfiles.model.IListEnumerable} for all edges that have the given port owner as their + * {@link yfiles.graph.IEdge#targetPort target port's} or {@link yfiles.graph.IEdge#sourcePort source port's} {@link yfiles.graph.IPort#owner} + * depending on the {@link yfiles.graph.AdjacencyTypes}. + * @param {yfiles.graph.AdjacencyTypes} adjacencyType The type of adjacency to consider. + * @param {yfiles.graph.IPortOwner} portOwner the port owner to check + * @return {yfiles.model.IListEnumerable.} An enumeration of all adjacent edges of the given type. + * @see {@link yfiles.graph.GraphExtensions#edgesAtOwner} + * @see {@link yfiles.graph.GraphExtensions#inEdgesAt} + * @see {@link yfiles.graph.GraphExtensions#outEdgesAt} + * @see {@link yfiles.graph.AdjacencyTypes} + * @see Specified by {@link yfiles.graph.IGraph#typedEdgesAtOwner}. + */ + typedEdgesAtOwner(portOwner:yfiles.graph.IPortOwner,adjacencyType:yfiles.graph.AdjacencyTypes):yfiles.model.IListEnumerable; + /** + * Creates and returns an edge that connects to the given port instances. + * The ports must be part + * of this graph at the time of the invocation. + * The edge will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.IPort} sourcePort The source port the created edge will connect to. + * @param {yfiles.graph.IPort} targetPort The target port the created edge will connect to. + * @param {yfiles.drawing.IEdgeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @param {Object} tag The initial value of the {@link yfiles.support.ITagOwner#tag} that will be assigned to the new edge. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + * @see {@link yfiles.drawing.common.VoidEdgeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#createEdgeWithPortsStyleAndTag}. + */ + createEdgeWithPortsStyleAndTag(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style:yfiles.drawing.IEdgeStyle,tag:Object):yfiles.graph.IEdge; + /** + * Convenience method that creates and returns an edge that connects to the given node instances using the + * given style instance. + * The nodes must be part + * of this graph at the time of the invocation, and the implementation will choose the {@link yfiles.graph.IPort} instances to + * which the edge will be connected. + * The edge will be a part of this graph after the method returns. + * This will trigger the corresponding events. + * @param {yfiles.graph.INode} source The source node the created edge will connect to. It is up to the implementation + * to decide which port to use at the given node. The implementation may create a new port of the edge. + * @param {yfiles.graph.INode} target The target node the created edge will connect to. It is up to the implementation + * to decide which port to use at the given node. The implementation may create a new port of the edge. + * @param {yfiles.drawing.IEdgeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @param {Object} tag The initial value of the {@link yfiles.support.ITagOwner#tag} that will be assigned to the new edge. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + * @see {@link yfiles.drawing.common.VoidEdgeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#createEdgeWithNodesStyleAndTag}. + */ + createEdgeWithNodesStyleAndTag(source:yfiles.graph.INode,target:yfiles.graph.INode,style:yfiles.drawing.IEdgeStyle,tag:Object):yfiles.graph.IEdge; + /** + * Removes the given node instance from this graph. + * The node must be a part of this graph. + * This will trigger the corresponding event. This method will remove all adjacent edges and their + * corresponding ports in proper order before the node will be removed. Also this will trigger + * the removal of all labels owned by this instance. + * @param {yfiles.graph.INode} node the live node to be removed from this graph instance + * @see {@link yfiles.graph.IGraph#addNodeRemovedListener NodeRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeNode}. + */ + removeNode(node:yfiles.graph.INode):void; + /** + * Removes the given edge instance from this graph. + * The edge must be a part of this graph. + * This will trigger the corresponding event. The implementation may decide to remove the + * corresponding ports from the node if no other edge connects to them after the given + * edge has been removed. Also this will trigger the removal of all labels and bends owned by this instance. + * @param {yfiles.graph.IEdge} edge the live edge to be removed from this graph instance + * @see {@link yfiles.graph.IGraph#addEdgeRemovedListener EdgeRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeEdge}. + */ + removeEdge(edge:yfiles.graph.IEdge):void; + /** + * Event that is triggered if a node has been created. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in node creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the node creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + */ + addNodeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a node has been created. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in node creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the node creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + */ + removeNodeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if the graph has changed visually and the display should + * be updated to reflect the changes. + */ + addDisplaysInvalidatedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that is triggered if the graph has changed visually and the display should + * be updated to reflect the changes. + */ + removeDisplaysInvalidatedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Causes the {@link yfiles.graph.IGraph#addDisplaysInvalidatedListener DisplaysInvalidated} event to be triggered. + * This method may be called by client code to invalidate all views of the graph + * that have registered with the {@link yfiles.graph.IGraph#addDisplaysInvalidatedListener DisplaysInvalidated} event. + * Views that need to be informed if non-structural changes have been made + * to the graph should register with the corresponding event. + * @see Specified by {@link yfiles.graph.IGraph#invalidateDisplays}. + */ + invalidateDisplays():void; + /** + * Event that is triggered if a node has been removed. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in node removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the node removal that has triggered this event. + * @see {@link yfiles.graph.IGraph#removeNode} + */ + addNodeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a node has been removed. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in node removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the node removal that has triggered this event. + * @see {@link yfiles.graph.IGraph#removeNode} + */ + removeNodeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a node has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setNodeStyle} + */ + addNodeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a node has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setNodeStyle} + */ + removeNodeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been created. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in edge creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the edge creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#createEdgeWithPortsStyleAndTag} + */ + addEdgeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been created. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in edge creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the edge creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#createEdgeWithPortsStyleAndTag} + */ + removeEdgeCreatedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been removed. + * This event will be triggered, too, prior to a node removal. + *

+ * Implementations may choose to use the {@link yfiles.graph.EdgeEventArgs} to carry + * additional port information. The {@link yfiles.graph.EdgeEventArgs#sourcePort} + * and {@link yfiles.graph.EdgeEventArgs#targetPort} properties will be set to the the instances + * the edge was connected to before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in edge removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the edge removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removeNode} + * @see {@link yfiles.graph.IGraph#removeEdge} + */ + addEdgeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been removed. + * This event will be triggered, too, prior to a node removal. + *

+ * Implementations may choose to use the {@link yfiles.graph.EdgeEventArgs} to carry + * additional port information. The {@link yfiles.graph.EdgeEventArgs#sourcePort} + * and {@link yfiles.graph.EdgeEventArgs#targetPort} properties will be set to the the instances + * the edge was connected to before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in edge removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the edge removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removeNode} + * @see {@link yfiles.graph.IGraph#removeEdge} + */ + removeEdgeRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been changed, e.g. if its style + * has been replaced. + *

+ * Also this event will be triggered if the {@link yfiles.graph.IEdge#sourcePort} + * or {@link yfiles.graph.IEdge#targetPort} have been changed by a call to {@link yfiles.graph.IGraph#setPorts}. + * Implementations may choose to use the {@link yfiles.graph.EdgeEventArgs} to carry + * additional port information. In the case of {@link yfiles.graph.IGraph#setPorts}, the {@link yfiles.graph.EdgeEventArgs#sourcePort} + * and {@link yfiles.graph.EdgeEventArgs#targetPort} properties will be set to the the old instances + * that the edge was connected to previously. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + *

+ * @see {@link yfiles.graph.IGraph#setEdgeStyle} + */ + addEdgeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if an edge has been changed, e.g. if its style + * has been replaced. + *

+ * Also this event will be triggered if the {@link yfiles.graph.IEdge#sourcePort} + * or {@link yfiles.graph.IEdge#targetPort} have been changed by a call to {@link yfiles.graph.IGraph#setPorts}. + * Implementations may choose to use the {@link yfiles.graph.EdgeEventArgs} to carry + * additional port information. In the case of {@link yfiles.graph.IGraph#setPorts}, the {@link yfiles.graph.EdgeEventArgs#sourcePort} + * and {@link yfiles.graph.EdgeEventArgs#targetPort} properties will be set to the the old instances + * that the edge was connected to previously. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + *

+ * @see {@link yfiles.graph.IGraph#setEdgeStyle} + */ + removeEdgeChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been added to an edge in this graph. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in bend creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the bend creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addBend} + */ + addBendAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been added to an edge in this graph. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in bend creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the bend creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addBend} + */ + removeBendAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been removed from an edge in this graph. + * This event will be triggered, too, if an edge has been removed from the graph, for each + * of the bends that belonged to the edge. + *

+ * Implementations may choose to use the {@link yfiles.graph.BendEventArgs} to carry + * additional bend owner and index information. The {@link yfiles.graph.BendEventArgs#owner} + * and {@link yfiles.graph.BendEventArgs#index} properties will be set to the the edge and + * index that the bend belonged to before the removal. + *

+ *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in bend removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the bend removal that has triggered this event. + *

+ *

+ * @see {@link yfiles.graph.IGraph#removeBend} + * @see {@link yfiles.graph.IGraph#removeEdge} + * @see {@link yfiles.graph.IGraph#removePort} + * @see {@link yfiles.graph.IGraph#removeNode} + */ + addBendRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been removed from an edge in this graph. + * This event will be triggered, too, if an edge has been removed from the graph, for each + * of the bends that belonged to the edge. + *

+ * Implementations may choose to use the {@link yfiles.graph.BendEventArgs} to carry + * additional bend owner and index information. The {@link yfiles.graph.BendEventArgs#owner} + * and {@link yfiles.graph.BendEventArgs#index} properties will be set to the the edge and + * index that the bend belonged to before the removal. + *

+ *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in bend removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the bend removal that has triggered this event. + *

+ *

+ * @see {@link yfiles.graph.IGraph#removeBend} + * @see {@link yfiles.graph.IGraph#removeEdge} + * @see {@link yfiles.graph.IGraph#removePort} + * @see {@link yfiles.graph.IGraph#removeNode} + */ + removeBendRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been changed. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + */ + addBendChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a bend has been changed. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + */ + removeBendChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been added to this graph instance. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in label creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the label creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addLabelWithParameterStylePreferredSizeAndTag} + */ + addLabelAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been added to this graph instance. + * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in label creation events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the label creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addLabelWithParameterStylePreferredSizeAndTag} + */ + removeLabelAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been removed from this graph instance. + * This event will also be triggered, prior to the removal of the {@link yfiles.graph.ILabel#owner owner} + * of the label. + *

+ * Implementations may choose to use the {@link yfiles.graph.LabelEventArgs} to carry + * additional label owner information. The {@link yfiles.graph.LabelEventArgs#owner} + * property will be set to the the owner of the label + * that owned it before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in label removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the label removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removeLabel} + * @see {@link yfiles.graph.IGraph#removeNode} + * @see {@link yfiles.graph.IGraph#removeEdge} + */ + addLabelRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been removed from this graph instance. + * This event will also be triggered, prior to the removal of the {@link yfiles.graph.ILabel#owner owner} + * of the label. + *

+ * Implementations may choose to use the {@link yfiles.graph.LabelEventArgs} to carry + * additional label owner information. The {@link yfiles.graph.LabelEventArgs#owner} + * property will be set to the the owner of the label + * that owned it before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in label removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the label removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removeLabel} + * @see {@link yfiles.graph.IGraph#removeNode} + * @see {@link yfiles.graph.IGraph#removeEdge} + */ + removeLabelRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setLabelStyle} + */ + addLabelChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a label has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setLabelStyle} + */ + removeLabelChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been added to this graph instance. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the port creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag} + * @see {@link yfiles.graph.IGraph#createEdgeWithNodesStyleAndTag} + */ + addPortAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been added to this graph instance. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the port creation that has triggered this event. + * @see {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag} + * @see {@link yfiles.graph.IGraph#createEdgeWithNodesStyleAndTag} + */ + removePortAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been removed from its {@link yfiles.graph.IPort#owner owner}. + * This event will also be triggered prior to the removal of the corresponding owner + * of the port. + *

+ * Implementations may choose to use the {@link yfiles.graph.PortEventArgs} to carry + * additional port owner information. The {@link yfiles.graph.PortEventArgs#owner} + * property will be set to the the owner of the port + * that owned it before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in port removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the port removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removePort} + * @see {@link yfiles.graph.IGraph#removeNode} + */ + addPortRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been removed from its {@link yfiles.graph.IPort#owner owner}. + * This event will also be triggered prior to the removal of the corresponding owner + * of the port. + *

+ * Implementations may choose to use the {@link yfiles.graph.PortEventArgs} to carry + * additional port owner information. The {@link yfiles.graph.PortEventArgs#owner} + * property will be set to the the owner of the port + * that owned it before the removal. + *

+ *

+ * This event is intended to provide notification of low level changes in the graph structure. + * Please use the event + * if you are interested only in port removal events that result from user interaction. + * Note:You may not modify the graph in the event handler for this event. + * Especially you may not prevent/undo the port removal that has triggered this event. + *

+ * @see {@link yfiles.graph.IGraph#removePort} + * @see {@link yfiles.graph.IGraph#removeNode} + */ + removePortRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setPortStyle} + */ + addPortChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered if a port has been changed, e.g. if its style + * has been replaced. + * This event is intended to provide notification of low level changes in the graph structure. + * Note:You may not modify the graph in the event handler for this event. + * @see {@link yfiles.graph.IGraph#setPortStyle} + */ + removePortChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Assigns the given style instance by reference to the node. + * Style instances can be shared. + * @param {yfiles.graph.INode} node The node that will be assigned the new style + * @param {yfiles.drawing.INodeStyle} style The style instance that will be assigned to the node. + * @see {@link yfiles.graph.INode#style} + * @see {@link yfiles.graph.IGraph#addNodeChangedListener NodeChanged} + * @see {@link yfiles.drawing.common.VoidNodeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#setNodeStyle}. + */ + setNodeStyle(node:yfiles.graph.INode,style:yfiles.drawing.INodeStyle):void; + /** + * Assigns the given style instance by reference to the label. + * Style instances can be shared. + * @param {yfiles.graph.ILabel} label The label that will be assigned the new style + * @param {yfiles.drawing.ILabelStyle} style The style instance that will be assigned to the label. + * @see {@link yfiles.graph.ILabel#style} + * @see {@link yfiles.graph.IGraph#addLabelChangedListener LabelChanged} + * @see {@link yfiles.drawing.common.VoidLabelStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#setLabelStyle}. + */ + setLabelStyle(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle):void; + /** + * Assigns the given style instance by reference to the edge. + * Style instances can be shared. + * @param {yfiles.graph.IEdge} edge The edge that will be assigned the new style + * @param {yfiles.drawing.IEdgeStyle} style The style instance that will be assigned to the edge. + * @see {@link yfiles.graph.IEdge#style} + * @see {@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} + * @see {@link yfiles.drawing.common.VoidEdgeStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#setEdgeStyle}. + */ + setEdgeStyle(edge:yfiles.graph.IEdge,style:yfiles.drawing.IEdgeStyle):void; + /** + * Assigns the given style instance by reference to the port. + * Style instances can be shared. + * @param {yfiles.graph.IPort} port The port that will be assigned the new style + * @param {yfiles.drawing.IPortStyle} style The style instance that will be assigned to the port. + * @see {@link yfiles.graph.IPort#style} + * @see {@link yfiles.graph.IGraph#addPortChangedListener PortChanged} + * @see {@link yfiles.drawing.common.VoidPortStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#setPortStyle}. + */ + setPortStyle(port:yfiles.graph.IPort,style:yfiles.drawing.IPortStyle):void; + /** + * Determines whether this graph contains the specified item. + * @param {yfiles.model.IModelItem} item The item. + * @return {boolean} + * true if this graph contains the specified item; otherwise, false. + * @see Specified by {@link yfiles.graph.IGraph#contains}. + */ + contains(item:yfiles.model.IModelItem):boolean; + /** + * Adds a bend at the given index to the given edge using the coordinates provided. + * The added instance will be returned. + * @param {yfiles.graph.IEdge} edge The edge to which the bend will be added. + * @param {number} index The index for the newly added bend + * @param {yfiles.geometry.PointD} location the coordinates to use for the newly created bend + * @return {yfiles.graph.IBend} a newly created live bend + * @see {@link yfiles.graph.IGraph#removeBend} + * @see {@link yfiles.graph.IGraph#setBendLocation} + * @see Specified by {@link yfiles.graph.IGraph#addBend}. + */ + addBend(edge:yfiles.graph.IEdge,index:number,location:yfiles.geometry.PointD):yfiles.graph.IBend; + /** + * Modifies the location of the given bend. + * @param {yfiles.graph.IBend} bend the bend whose location is to be modified + * @param {yfiles.geometry.PointD} location the new location of the bend + * @see {@link yfiles.graph.IGraph#addBend} + * @see Specified by {@link yfiles.graph.IGraph#setBendLocation}. + */ + setBendLocation(bend:yfiles.graph.IBend,location:yfiles.geometry.PointD):void; + /** + * Removes the given bend instance from its edge. + * The bend must be part of this graph + * at the time of the invocation. + * This will trigger the corresponding events. + * @param {yfiles.graph.IBend} bend the bend to remove + * @see {@link yfiles.graph.IGraph#addBendRemovedListener BendRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeBend}. + */ + removeBend(bend:yfiles.graph.IBend):void; + /** + * Add a port to the given port owner using the location model parameter, style and tag. + * The locationModelParameter determines the location of the port. + * Depending on the implementation this method may throw an {@link yfiles.system.NotSupportedException} + * if the type of the portOwner instance does not support adding of ports. + * This will trigger the {@link yfiles.graph.IGraph#addNodeChangedListener NodeChanged} or {@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} + * event correspondingly. + * @param {yfiles.graph.IPortOwner} portOwner the owner to add the port instance to. + * @param {yfiles.graph.IPortLocationModelParameter} locationModelParameter the parameter to use for the port to determine its location. + * @param {yfiles.drawing.IPortStyle} style the style to initially assign to the {@link yfiles.graph.IPort#style} property, e.g. + * {@link yfiles.drawing.common.VoidPortStyle#INSTANCE}. + * @param {Object} tag the initial {@link yfiles.support.ITagOwner#tag} to assign. + * @return {yfiles.graph.IPort} the newly created port + * @see {@link yfiles.graph.IGraph#addPortAddedListener PortAdded} + * @see {@link yfiles.drawing.common.VoidPortStyle#INSTANCE} + * @throws {yfiles.system.NotSupportedException} If this instance cannot add a port to portOwner. + * @see Specified by {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag}. + */ + addPortWithParameterStyleAndTag(portOwner:yfiles.graph.IPortOwner,locationModelParameter:yfiles.graph.IPortLocationModelParameter,style:yfiles.drawing.IPortStyle,tag:Object):yfiles.graph.IPort; + /** + * Removes a port from its owner. + * The port must be part of this graph + * at the time of the invocation. This will also remove all edges that are currently connected to the port. + * This will trigger the {@link yfiles.graph.IGraph#addNodeChangedListener NodeChanged} or {@link yfiles.graph.IGraph#addEdgeChangedListener EdgeChanged} event respectively. + * @param {yfiles.graph.IPort} port the port that will be removed + * @see {@link yfiles.graph.IGraph#addPortRemovedListener PortRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removePort}. + */ + removePort(port:yfiles.graph.IPort):void; + /** + * Add a label to the given item using the text as the initial label text and label model parameter, style and tag. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} labelModelParameter The label model parameter instance to use. + * @param {string} text the initial text of the label + * @param {yfiles.drawing.ILabelStyle} style The style to use for the label + * @param {yfiles.geometry.SizeD} preferredSize The initial values to use for the {@link yfiles.graph.ILabel#preferredSize}. + * @param {Object} tag the initial {@link yfiles.support.ITagOwner#tag} to assign. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + * @see {@link yfiles.graph.IGraph#setLabelStyle} + * @see {@link yfiles.drawing.common.VoidLabelStyle#INSTANCE} + * @see Specified by {@link yfiles.graph.IGraph#addLabelWithParameterStylePreferredSizeAndTag}. + */ + addLabelWithParameterStylePreferredSizeAndTag(item:yfiles.graph.ILabeledItem,labelModelParameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,preferredSize:yfiles.geometry.SizeD,tag:Object):yfiles.graph.ILabel; + /** + * Sets the label text of the given label. + * @param {yfiles.graph.ILabel} label the label to modify + * @param {string} text the new text of the label + * @see {@link yfiles.graph.ILabel#text} + * @see Specified by {@link yfiles.graph.IGraph#setLabelText}. + */ + setLabelText(label:yfiles.graph.ILabel,text:string):void; + /** + * Removes the given label from its owner. + * This will trigger the corresponding event. + * The label must be part of this graph + * at the time of the invocation. + * This will trigger the corresponding events. + * @param {yfiles.graph.ILabel} label the label to remove + * @see {@link yfiles.graph.IGraph#addLabelRemovedListener LabelRemoved} + * @see Specified by {@link yfiles.graph.IGraph#removeLabel}. + */ + removeLabel(label:yfiles.graph.ILabel):void; + /** + * Sets the preferred size of the label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.geometry.SizeD} preferredSize The new preferred size. + * @see {@link yfiles.graph.ILabel#preferredSize} + * @see Specified by {@link yfiles.graph.IGraph#setPreferredSize}. + */ + setPreferredSize(label:yfiles.graph.ILabel,preferredSize:yfiles.geometry.SizeD):void; + /** + * Sets the label model parameter for the given label. + * @param {yfiles.graph.ILabel} label The label. + * @param {yfiles.graph.ILabelModelParameter} parameter The new parameter. + * @throws {yfiles.system.ArgumentException} If the parameter cannot be used for this label. + * @see Specified by {@link yfiles.graph.IGraph#setLabelModelParameter}. + */ + setLabelModelParameter(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):void; + /** + * Sets a new {@link yfiles.graph.IPortLocationModelParameter} for the given port. + * @param {yfiles.graph.IPort} port The port to modify + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter the new parameter that determines the coordinates of the port + * @see Specified by {@link yfiles.graph.IGraph#setLocationModelParameter}. + */ + setLocationModelParameter(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * Sets the bounds of the given node to the new values. + * @param {yfiles.graph.INode} node a live node that belongs to this graph + * @param {yfiles.geometry.RectD} bounds The new bounds of the node to assign to its {@link yfiles.graph.INode#layout}. + * @see {@link yfiles.graph.INode#layout} + * @see Specified by {@link yfiles.graph.IGraph#setBounds}. + */ + setBounds(node:yfiles.graph.INode,bounds:yfiles.geometry.RectD):void; + /** + * Clears the graph instance, removing all entities in proper order. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#clear}. + * @see {@link yfiles.graph.IGraph#removeEdge} + * @see {@link yfiles.graph.IGraph#removeNode} + */ + clear():void; + /** + * Reverses an edge by {@link yfiles.graph.IGraph#setPorts setting source and target port} + * to {@link yfiles.graph.IEdge#targetPort} and {@link yfiles.graph.IEdge#sourcePort}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#reverse}. + * @param {yfiles.graph.IEdge} edge The edge to reverse. + */ + reverse(edge:yfiles.graph.IEdge):void; + /** + * Gets the default node bounds for newly created nodes in the graph. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#getDefaultNodeBounds}. + * @return {yfiles.geometry.RectD} The bounds anchored at (0,0) with {@link yfiles.graph.IGraph#nodeDefaults}' {@link yfiles.graph.INodeDefaults#size}. + */ + getDefaultNodeBounds():yfiles.geometry.RectD; + /** + * Convenience method that removes a {@link yfiles.graph.IPortOwner} from the graph. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#removePortOwner}. + * @param {yfiles.graph.IPortOwner} portOwner The port owner to remove. + * @throws {yfiles.system.ArgumentOutOfRangeException} If portOwner is neither {@link yfiles.graph.INode} nor {@link yfiles.graph.IEdge}. + */ + removePortOwner(portOwner:yfiles.graph.IPortOwner):void; + /** + * Convenience method that removes a {@link yfiles.graph.ILabeledItem} from the graph. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#removeLabeledItem}. + * @param {yfiles.graph.ILabeledItem} labeledItem The item to remove. + * @throws {yfiles.system.ArgumentOutOfRangeException} If labeledItem is neither {@link yfiles.graph.INode} nor {@link yfiles.graph.IEdge}. + */ + removeLabeledItem(labeledItem:yfiles.graph.ILabeledItem):void; + /** + * Appends a new bend to the list of bends at the given edge. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#appendBend}. + * @param {yfiles.graph.IEdge} edge The edge to add the bend to. + * @param {yfiles.geometry.PointD} location The location of the bend. + * @return {yfiles.graph.IBend} The newly created bend. + */ + appendBend(edge:yfiles.graph.IEdge,location:yfiles.geometry.PointD):yfiles.graph.IBend; + /** + * Appends bends to the given edge using the provided locations. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#appendBends}. + * @param {yfiles.graph.IEdge} edge The edge to add the bends to. + * @param {yfiles.collections.IEnumerable.} locations The locations of the bends. + */ + appendBends(edge:yfiles.graph.IEdge,locations:yfiles.collections.IEnumerable):void; + /** + * Convenience method that uses the {@link yfiles.support.IUndoSupport} from the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup} + * to {@link yfiles.support.IUndoSupport#beginEditForItems begin an edit}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#beginNamedEditWithItems}. + * @param {string} undoName The name of the undo operation. + * @param {string} redoName The name of the redo operation. + * @param {yfiles.collections.IEnumerable.} items The items to pass to {@link yfiles.support.IUndoSupport#beginEditForItems}. + * @return {yfiles.support.ICompoundEdit} An edit that can be used for editing. This will return a dummy implementation if no {@link yfiles.support.IUndoSupport} + * is available. + */ + beginEditWithUndoNameRedoNameAndItems(undoName:string,redoName:string,items:yfiles.collections.IEnumerable):yfiles.support.ICompoundEdit; + /** + * Convenience method that uses the {@link yfiles.support.IUndoSupport} from the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup} + * to {@link yfiles.support.IUndoSupport#beginEdit begin an edit}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#beginEdit}. + * @param {string} undoName The name of the undo operation. + * @param {string} redoName The name of the redo operation. + * @return {yfiles.support.ICompoundEdit} An edit that can be used for editing. This will return a dummy implementation if no {@link yfiles.support.IUndoSupport} + * is available. + */ + beginEdit(undoName:string,redoName:string):yfiles.support.ICompoundEdit; + /** + * Convenience method that uses the {@link yfiles.support.IUndoSupport} from the {@link yfiles.graph.IGraph}'s {@link yfiles.support.ILookup} + * to {@link yfiles.support.IUndoSupport#addUnit add a unit}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#addUndoUnit}. + * @param {string} undoName The name of the undo operation. + * @param {string} redoName The name of the redo operation. + * @param {function()} undoAction The undo action. + * @param {function()} redoAction The redo action. + */ + addUndoUnit(undoName:string,redoName:string,undoAction:()=> void,redoAction:()=> void):void; + /** + * Creates and returns a node using the specified initial style and geometry. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createNodeWithBoundsAndStyle}. + * @param {yfiles.geometry.RectD} bounds The bounds to use initially. + * The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} field + * @param {yfiles.drawing.INodeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + * @see {@link yfiles.drawing.common.VoidNodeStyle#INSTANCE} + */ + createNodeWithBoundsAndStyle(bounds:yfiles.geometry.RectD,style:yfiles.drawing.INodeStyle):yfiles.graph.INode; + /** + * Sets the center of a node to the given world coordinates. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#setCenter}. + * @param {yfiles.graph.INode} node The node to recenter. + * @param {yfiles.geometry.PointD} center The new center coordinates of the node in the world coordinate system. + */ + setCenter(node:yfiles.graph.INode,center:yfiles.geometry.PointD):void; + /** + * Adjusts the {@link yfiles.graph.ILabel#preferredSize} property of a label to + * fit the suggested size of its {@link yfiles.drawing.ILabelStyleRenderer}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#adjustPreferredSize}. + * @see {@link yfiles.graph.ILabelDefaults#autoAdjustPreferredSize} + * @param {yfiles.graph.ILabel} label The label to adjust the size for. + */ + adjustPreferredSize(label:yfiles.graph.ILabel):void; + /** + * Calculates the preferred size of a label with the given properties. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#calculatePreferredSizeWithStyleAndParameter}. + * @param {yfiles.graph.ILabeledItem} item The item that will own the label. + * @param {yfiles.drawing.ILabelStyle} labelStyle The label style. + * @param {yfiles.graph.ILabelModelParameter} labelModelParameter The label model parameter. + * @param {string} text The text. + * @return {yfiles.geometry.SizeD} The size as calculated by the {@link yfiles.drawing.ILabelStyleRenderer}. + */ + calculatePreferredSizeWithStyleAndParameter(item:yfiles.graph.ILabeledItem,labelStyle:yfiles.drawing.ILabelStyle,labelModelParameter:yfiles.graph.ILabelModelParameter,text:string):yfiles.geometry.SizeD; + /** + * Calculates the preferred size of a label with the given properties. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#calculatePreferredSize}. + * @param {yfiles.graph.ILabeledItem} item The item that will own the label. + * @param {string} text The text. + * @return {yfiles.geometry.SizeD} The size as calculated by the {@link yfiles.drawing.ILabelStyleRenderer}. + * @see {@link yfiles.graph.GraphExtensions#getLabelDefaults} + * @see {@link yfiles.graph.GraphExtensions#calculatePreferredSizeWithStyleParameterAndTag} + */ + calculatePreferredSize(item:yfiles.graph.ILabeledItem,text:string):yfiles.geometry.SizeD; + /** + * Calculates the preferred size of a label with the given properties. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#calculatePreferredSizeWithStyleParameterAndTag}. + * @param {yfiles.graph.ILabeledItem} item The item that will own the label. + * @param {yfiles.drawing.ILabelStyle} labelStyle The label style. + * @param {yfiles.graph.ILabelModelParameter} labelModelParameter The label model parameter. + * @param {string} text The text. + * @param {Object} tag The tag for the label. + * @return {yfiles.geometry.SizeD} The size as calculated by the {@link yfiles.drawing.ILabelStyleRenderer}. + */ + calculatePreferredSizeWithStyleParameterAndTag(item:yfiles.graph.ILabeledItem,labelStyle:yfiles.drawing.ILabelStyle,labelModelParameter:yfiles.graph.ILabelModelParameter,text:string,tag:Object):yfiles.geometry.SizeD; + /** + * Add a label to the given item using the text as the initial label text. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#addLabel}. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {string} text the initial text of the label + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + */ + addLabel(item:yfiles.graph.ILabeledItem,text:string):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text and a given tag. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#addLabelWithTag}. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {string} text the initial text of the label + * @param {Object} tag The tag to assign to the label. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + */ + addLabelWithTag(item:yfiles.graph.ILabeledItem,text:string,tag:Object):yfiles.graph.ILabel; + /** + * Yields the neighbors of a given portOwner. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#neighbors}. + * @param {T} portOwner The port owner. + * @return {yfiles.collections.IEnumerable.} An enumerable over all neighbors. + */ + neighbors(tType:yfiles.lang.Class,portOwner:T):yfiles.collections.IEnumerable; + /** + * Yields the successors of a given portOwner. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#successors}. + * @param {T} portOwner The port owner. + * @return {yfiles.collections.IEnumerable.} An enumerable over all successors. + */ + successors(tType:yfiles.lang.Class,portOwner:T):yfiles.collections.IEnumerable; + /** + * Yields the predecessors of a given portOwner. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#predecessors}. + * @param {T} portOwner The port owner. + * @return {yfiles.collections.IEnumerable.} An enumerable over all predecessors. + */ + predecessors(tType:yfiles.lang.Class,portOwner:T):yfiles.collections.IEnumerable; + /** + * Calculates the number of edges at the given {@link yfiles.graph.IPortOwner} + * for this graph. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#portOwnerDegree}. + * @param {yfiles.graph.IPortOwner} portOwner The port owner to count the degree of. + * @return {number} The number of edges that are incident to the port owner. + */ + portOwnerDegree(portOwner:yfiles.graph.IPortOwner):number; + /** + * Calculates the number of incoming edges at the given {@link yfiles.graph.IPortOwner} + * for this graph. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#inDegree}. + * @param {yfiles.graph.IPortOwner} portOwner The port owner to count the incoming edges of. + * @return {number} The number of edges that have the port owner as their target port's owner. + */ + inDegree(portOwner:yfiles.graph.IPortOwner):number; + /** + * Calculates the number of outgoing edges at the given {@link yfiles.graph.IPortOwner} + * for this graph. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#outDegree}. + * @param {yfiles.graph.IPortOwner} portOwner The port owner to count the outgoing edges of. + * @return {number} The number of edges that have the port owner as their source port's owner. + */ + outDegree(portOwner:yfiles.graph.IPortOwner):number; + /** + * Calculates the number of edges at the given {@link yfiles.graph.IPort} + * for this graph. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#portDegree}. + * @param {yfiles.graph.IPort} port The port owner to count the degree of. + * @return {number} The number of edges that are incident to the port. + */ + portDegree(port:yfiles.graph.IPort):number; + /** + * Calculates the number of incoming edges at the given {@link yfiles.graph.IPort} + * for this graph. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#portInDegree}. + * @param {yfiles.graph.IPort} port The port to count the incoming edges of. + * @return {number} The number of edges that have the port as their target port. + */ + portInDegree(port:yfiles.graph.IPort):number; + /** + * Calculates the number of outgoing edges at the given {@link yfiles.graph.IPort} + * for this graph. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#portOutDegree}. + * @param {yfiles.graph.IPort} port The port to count the outgoing edges of. + * @return {number} The number of edges that have the port as their source port. + */ + portOutDegree(port:yfiles.graph.IPort):number; + /** + * Removes all bends from the given edge. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#clearBends}. + * @param {yfiles.graph.IEdge} edge the edge whose bends will be removed + * @see {@link yfiles.graph.IGraph#removeBend} + * @see {@link yfiles.graph.IGraph#addBendRemovedListener BendRemoved} + */ + clearBends(edge:yfiles.graph.IEdge):void; + /** + * Convenience method that tries to set the absolute coordinates of the given port to the given values. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#setPortLocation}. + * @see {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag} + * @param {yfiles.graph.IPort} port The port to modify + * @param {yfiles.geometry.PointD} location the new absolute coordinates of the port + */ + setPortLocation(port:yfiles.graph.IPort,location:yfiles.geometry.PointD):void; + /** + * Add a port to the given port owner using the absolute coordinates as the new initial position of + * the port anchor. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#addPortAtLocationWithStyle}. + * @param {yfiles.graph.IPortOwner} portOwner the owner to add the port instance to. + * @param {yfiles.geometry.PointD} location the location to use for the port to determine its location. + * This is passed to the {@link yfiles.graph.GraphExtensions#createLocationModelParameterForLocation} method + * to determine the initial {@link yfiles.graph.IPortLocationModelParameter} to use. + * @param {yfiles.drawing.IPortStyle} style the style to initially assign to the {@link yfiles.graph.IPort#style} property, e.g. + * {@link yfiles.drawing.common.VoidPortStyle#INSTANCE}. + * @return {yfiles.graph.IPort} the newly created port + * @throws {yfiles.system.NotSupportedException} If this instance cannot add a port to portOwner. + */ + addPortAtLocationWithStyle(portOwner:yfiles.graph.IPortOwner,location:yfiles.geometry.PointD,style:yfiles.drawing.IPortStyle):yfiles.graph.IPort; + /** + * Finds an edge that connects from and to in the given graph. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#getEdgeAtOwners}. + * @param {yfiles.graph.IPortOwner} from The {@link yfiles.graph.IEdge#sourcePort} owner of the edge to find. + * @param {yfiles.graph.IPortOwner} to The {@link yfiles.graph.IEdge#targetPort} owner of the edge to find. + * @return {yfiles.graph.IEdge} An edge that satisfies the constraints or null, if none was found. + */ + getEdgeAtOwners(from:yfiles.graph.IPortOwner,to:yfiles.graph.IPortOwner):yfiles.graph.IEdge; + /** + * Finds an edge that connects from and to in the given graph. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#getEdgeAtPorts}. + * @param {yfiles.graph.IPort} from The {@link yfiles.graph.IEdge#sourcePort} of the edge to find. + * @param {yfiles.graph.IPort} to The {@link yfiles.graph.IEdge#targetPort} of the edge to find. + * @return {yfiles.graph.IEdge} An edge that satisfies the constraints or null, if none was found. + */ + getEdgeAtPorts(from:yfiles.graph.IPort,to:yfiles.graph.IPort):yfiles.graph.IEdge; + /** + * Tries to set the location of the port relative to its {@link yfiles.graph.IPort#owner owner} if + * the owner is a {@link yfiles.graph.INode node}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#setRelativeLocation}. + * @param {yfiles.graph.IPort} port the port + * @param {yfiles.geometry.PointD} relativeLocation the new coordinate offsets relative to the center of the node's {@link yfiles.graph.INode#layout}'s + * center. + * @see {@link yfiles.graph.INode#layout The owner's layout} + * @throws {yfiles.system.ArgumentOutOfRangeException} If the port is not owned by a node + */ + setRelativeLocation(port:yfiles.graph.IPort,relativeLocation:yfiles.geometry.PointD):void; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter and style. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#addLabelWithParameterAndStyle}. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {yfiles.drawing.ILabelStyle} style The style to assign to the new label. + * @param {string} text the initial text of the label + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + * @see {@link yfiles.graph.IGraph#setLabelStyle} + */ + addLabelWithParameterAndStyle(item:yfiles.graph.ILabeledItem,parameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter, preferred size, and style. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#addLabelWithParameterStyleAndPreferredSize}. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {yfiles.drawing.ILabelStyle} style The style to assign to the new label. + * @param {string} text the initial text of the label + * @param {yfiles.geometry.SizeD} preferredSize The initial preferred size to assign. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + * @see {@link yfiles.graph.IGraph#setLabelStyle} + */ + addLabelWithParameterStyleAndPreferredSize(item:yfiles.graph.ILabeledItem,parameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,preferredSize:yfiles.geometry.SizeD):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter and style. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#addLabelWithParameterStyleAndTag}. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {yfiles.drawing.ILabelStyle} style The style to assign to the new label. + * @param {string} text the initial text of the label + * @param {Object} tag The {@link yfiles.support.ITagOwner#tag} to assign to the new label. + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + * @see {@link yfiles.graph.IGraph#setLabelStyle} + */ + addLabelWithParameterStyleAndTag(item:yfiles.graph.ILabeledItem,parameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,tag:Object):yfiles.graph.ILabel; + /** + * Add a label to the given item using the text as the initial label text as well as label model parameter. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#addLabelWithParameter}. + * @param {yfiles.graph.ILabeledItem} item the item to add the label to. + * @param {yfiles.graph.ILabelModelParameter} parameter The label model parameter instance to use. + * @param {string} text the initial text of the label + * @return {yfiles.graph.ILabel} the newly created label + * @see {@link yfiles.graph.IGraph#addLabelAddedListener LabelAdded} + * @see {@link yfiles.graph.IGraph#setLabelText} + * @see {@link yfiles.graph.IGraph#setLabelModelParameter} + * @see {@link yfiles.graph.IGraph#setLabelStyle} + */ + addLabelWithParameter(item:yfiles.graph.ILabeledItem,parameter:yfiles.graph.ILabelModelParameter,text:string):yfiles.graph.ILabel; + /** + * Convenience method that yields the incoming edges at the given owner. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#inEdgesAt}. + * @param {yfiles.graph.IPortOwner} owner The owner of the edges. + * @return {yfiles.model.IListEnumerable.} An enumerable for the edges. + */ + inEdgesAt(owner:yfiles.graph.IPortOwner):yfiles.model.IListEnumerable; + /** + * Convenience method that yields the outgoing edges at the given owner. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#outEdgesAt}. + * @param {yfiles.graph.IPortOwner} owner The owner of the edges. + * @return {yfiles.model.IListEnumerable.} An enumerable for the edges. + */ + outEdgesAt(owner:yfiles.graph.IPortOwner):yfiles.model.IListEnumerable; + /** + * Convenience method that yields all adjacent edges at the given owner. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#edgesAtOwner}. + * @param {yfiles.graph.IPortOwner} owner The owner of the edges. + * @return {yfiles.model.IListEnumerable.} An enumerable for the edges. + */ + edgesAtOwner(owner:yfiles.graph.IPortOwner):yfiles.model.IListEnumerable; + /** + * Convenience method that yields the incoming edges at the given owner. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#portInEdgesAt}. + * @param {yfiles.graph.IPort} owner The owner of the edges. + * @return {yfiles.model.IListEnumerable.} An enumerable for the edges. + */ + portInEdgesAt(owner:yfiles.graph.IPort):yfiles.model.IListEnumerable; + /** + * Convenience method that yields the outgoing edges at the given owner. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#portOutEdgesAt}. + * @param {yfiles.graph.IPort} owner The owner of the edges. + * @return {yfiles.model.IListEnumerable.} An enumerable for the edges. + */ + portOutEdgesAt(owner:yfiles.graph.IPort):yfiles.model.IListEnumerable; + /** + * Convenience method that yields all adjacent edges at the given owner. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#edgesAtPort}. + * @param {yfiles.graph.IPort} owner The owner of the edges. + * @return {yfiles.model.IListEnumerable.} An enumerable for the edges. + */ + edgesAtPort(owner:yfiles.graph.IPort):yfiles.model.IListEnumerable; + /** + * Adds a new port to the graph at the port using the given location. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#addPortAtLocation}. + * @param {yfiles.graph.IPortOwner} owner The owner of the port. + * @param {yfiles.geometry.PointD} location The absolute world coordinate location to add the port at. + * @return {yfiles.graph.IPort} The newly added port instance. + * @see {@link yfiles.graph.GraphExtensions#createPortStyle} + * @see {@link yfiles.graph.GraphExtensions#createLabelModelParameter} + */ + addPortAtLocation(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.PointD):yfiles.graph.IPort; + /** + * Adds a new port to the graph at the port using the default location model parameter + * for the owner. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#addPort}. + * @param {yfiles.graph.IPortOwner} owner The owner of the port. + * @return {yfiles.graph.IPort} The newly added port instance. + * @see {@link yfiles.graph.GraphExtensions#createPortStyle} + * @see {@link yfiles.graph.GraphExtensions#createLabelModelParameter} + */ + addPort(owner:yfiles.graph.IPortOwner):yfiles.graph.IPort; + /** + * Adds a new port to the graph at the port owner using the given location parameter. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#addPortWithParameter}. + * @param {yfiles.graph.IPortOwner} owner The owner of the port. + * @param {yfiles.graph.IPortLocationModelParameter} locationModelParameter The location model parameter to use for the newly created port. + * @return {yfiles.graph.IPort} The newly added port instance. + * @see {@link yfiles.graph.GraphExtensions#createPortStyle} + */ + addPortWithParameter(owner:yfiles.graph.IPortOwner,locationModelParameter:yfiles.graph.IPortLocationModelParameter):yfiles.graph.IPort; + /** + * Adds a new port to the graph using a null {@link yfiles.support.ITagOwner#tag}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#addPortWithParameterAndStyle}. + * @param {yfiles.graph.IPortOwner} owner The owner of the port. + * @param {yfiles.graph.IPortLocationModelParameter} locationModelParameter The location model parameter to use for the newly created port. + * @param {yfiles.drawing.IPortStyle} portStyle The port style to assign to the port. + * @return {yfiles.graph.IPort} The newly added port instance. + */ + addPortWithParameterAndStyle(owner:yfiles.graph.IPortOwner,locationModelParameter:yfiles.graph.IPortLocationModelParameter,portStyle:yfiles.drawing.IPortStyle):yfiles.graph.IPort; + /** + * Creates and returns a node using default values for the geometry and style. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createNode}. + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#createNodeWithBoundsStyleAndTag} + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + */ + createNode():yfiles.graph.INode; + /** + * Convenience method that creates and returns an edge that connects to the given node instances. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createEdge}. + * @param {yfiles.graph.INode} sourceNode The source node the created edge will connect to. It is up to the implementation + * to decide which port to use at the given node. The implementation may create a new port for the edge. + * @param {yfiles.graph.INode} targetNode The target node the created edge will connect to. It is up to the implementation + * to decide which port to use at the given node. The implementation may create a new port for the edge. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#createEdgeWithNodesStyleAndTag} + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + */ + createEdge(sourceNode:yfiles.graph.INode,targetNode:yfiles.graph.INode):yfiles.graph.IEdge; + /** + * Convenience method that creates and returns an edge that connects to the given node instances. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createEdgeWithNodesAndStyle}. + * @param {yfiles.graph.INode} sourceNode The source node the created edge will connect to. It is up to the implementation + * to decide which port to use at the given node. The implementation may create a new port for the edge. + * @param {yfiles.graph.INode} targetNode The target node the created edge will connect to. It is up to the implementation + * to decide which port to use at the given node. The implementation may create a new port for the edge. + * @param {yfiles.drawing.IEdgeStyle} edgeStyle The initial style to use for the edge. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + * @see {@link yfiles.graph.IGraph#createEdgeWithNodesStyleAndTag} + */ + createEdgeWithNodesAndStyle(sourceNode:yfiles.graph.INode,targetNode:yfiles.graph.INode,edgeStyle:yfiles.drawing.IEdgeStyle):yfiles.graph.IEdge; + /** + * Creates and returns an edge that connects to the given port instances. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createEdgeAtPorts}. + * @param {yfiles.graph.IPort} sourcePort The source port the created edge will connect to. + * @param {yfiles.graph.IPort} targetPort The target port the created edge will connect to. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + */ + createEdgeAtPorts(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):yfiles.graph.IEdge; + /** + * Creates and returns an edge that connects to the given port instances. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createEdgeWithPortsAndStyle}. + * @param {yfiles.graph.IPort} sourcePort The source port the created edge will connect to. + * @param {yfiles.graph.IPort} targetPort The target port the created edge will connect to. + * @param {yfiles.drawing.IEdgeStyle} edgeStyle The initial style to assign to the edge. + * @return {yfiles.graph.IEdge} the newly created edge instance + * @see {@link yfiles.graph.IGraph#addEdgeCreatedListener EdgeCreated} + */ + createEdgeWithPortsAndStyle(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,edgeStyle:yfiles.drawing.IEdgeStyle):yfiles.graph.IEdge; + /** + * Convenience method that delegates to the {@link yfiles.graph.IEdgeDefaults#getStyleInstance} + * method of the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.IGraph#edgeDefaults}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createEdgeStyle}. + * @return {yfiles.drawing.IEdgeStyle} The style instance to use for newly created edges. + */ + createEdgeStyle():yfiles.drawing.IEdgeStyle; + /** + * Adds a new port to the graph at the node using a location that is relative to the center of the node. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#addRelativePort}. + * @param {yfiles.graph.INode} owner The owner of the port. + * @param {yfiles.geometry.PointD} relativeLocation The offset of the port relative to the center of the {@link yfiles.graph.INode#layout}. + * @return {yfiles.graph.IPort} The newly added port instance. + * @see {@link yfiles.graph.GraphExtensions#createPortStyle} + */ + addRelativePort(owner:yfiles.graph.INode,relativeLocation:yfiles.geometry.PointD):yfiles.graph.IPort; + /** + * Creates and returns a node using default values for the style and the specified initial center location. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createNodeWithCenter}. + * @param {yfiles.geometry.PointD} location the initial coordinates of the center of + * the node's {@link yfiles.graph.INode#layout Layout} property + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + */ + createNodeWithCenter(location:yfiles.geometry.PointD):yfiles.graph.INode; + /** + * Creates and returns a node using default values for the style and the specified initial center location, as well as the tag. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createNodeWithCenterAndTag}. + * @param {yfiles.geometry.PointD} location the initial coordinates of the center of + * the node's {@link yfiles.graph.INode#layout Layout} property + * @param {Object} tag The initial value of the {@link yfiles.support.ITagOwner#tag} that will be assigned to the new node. + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + */ + createNodeWithCenterAndTag(location:yfiles.geometry.PointD,tag:Object):yfiles.graph.INode; + /** + * Creates and returns a node using the specified initial center location and style. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createNodeWithCenterAndStyle}. + * @param {yfiles.geometry.PointD} location the initial coordinates of the center of + * the node's {@link yfiles.graph.INode#layout Layout} property + * @param {yfiles.drawing.INodeStyle} style The style instance that will be assigned to the newly created instance. This is done + * by reference. + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + */ + createNodeWithCenterAndStyle(location:yfiles.geometry.PointD,style:yfiles.drawing.INodeStyle):yfiles.graph.INode; + /** + * Creates and returns a node using default values for the style and the specified initial geometry. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createNodeWithBounds}. + * @param {yfiles.geometry.RectD} bounds The bounds to use initially. + * The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} property + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + */ + createNodeWithBounds(bounds:yfiles.geometry.RectD):yfiles.graph.INode; + /** + * Creates and returns a node using default values for the style and the specified initial geometry, as well as the provided + * tag. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createNodeWithBoundsAndTag}. + * @param {yfiles.geometry.RectD} bounds The bounds to use initially. + * The values will be copied to the node's {@link yfiles.graph.INode#layout Layout} property + * @param {Object} tag The initial value of the {@link yfiles.support.ITagOwner#tag} that will be assigned to the new node. + * @return {yfiles.graph.INode} A newly created node instance + * @see {@link yfiles.graph.IGraph#addNodeCreatedListener NodeCreated} + */ + createNodeWithBoundsAndTag(bounds:yfiles.geometry.RectD,tag:Object):yfiles.graph.INode; + /** + * Convenience method that delegates to the {@link yfiles.graph.INodeDefaults#getStyleInstance} + * method of the {@link yfiles.graph.IGraph}'s {@link yfiles.graph.IGraph#nodeDefaults}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createNodeStyle}. + * @return {yfiles.drawing.INodeStyle} The style instance to use for newly created nodes. + */ + createNodeStyle():yfiles.drawing.INodeStyle; + /** + * Uses the {@link yfiles.graph.GraphExtensions#getPortDefaults port defaults} for the owner + * to obtain the {@link yfiles.graph.IPortDefaults#getLocationModelParameterInstance location model parameter}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createLocationModelParameter}. + * @param {yfiles.graph.IPortOwner} owner The owner of the port to be created. + * @return {yfiles.graph.IPortLocationModelParameter} The default parameter to use for the {@link yfiles.graph.IPortOwner} as returned by {@link yfiles.graph.IPortDefaults#getLocationModelParameterInstance}. + * @see {@link yfiles.graph.GraphExtensions#getPortDefaults} + */ + createLocationModelParameter(owner:yfiles.graph.IPortOwner):yfiles.graph.IPortLocationModelParameter; + /** + * Creates a location model parameter for a newly created {@link yfiles.graph.IPort} at the owner that matches the + * location. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createLocationModelParameterForLocation}. + * @param {yfiles.graph.IPortOwner} owner The owner of the port. + * @param {yfiles.geometry.PointD} location The location in the world coordinate system where the port should be added. + * @return {yfiles.graph.IPortLocationModelParameter} A location model parameter that matches the location. + * @see {@link yfiles.graph.IPortLocationModel#createParameter} + * @see {@link yfiles.graph.GraphExtensions#getPortDefaults} + */ + createLocationModelParameterForLocation(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.PointD):yfiles.graph.IPortLocationModelParameter; + /** + * Creates the label model parameter for a given {@link yfiles.graph.ILabeledItem}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createLabelModelParameter}. + * @param {yfiles.graph.ILabeledItem} item The item that is the {@link yfiles.graph.ILabel#owner} of the label in question. + * @return {yfiles.graph.ILabelModelParameter} The default label model parameter to use for newly created labels at the item. + * @see {@link yfiles.graph.ILabelDefaults#getLabelModelParameterInstance} + * @see {@link yfiles.graph.GraphExtensions#getLabelDefaults} + */ + createLabelModelParameter(item:yfiles.graph.ILabeledItem):yfiles.graph.ILabelModelParameter; + /** + * Gets the {@link yfiles.graph.ILabelDefaults label defaults} for a given {@link yfiles.graph.ILabeledItem} + * in the context of the graph. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#getLabelDefaults}. + * @param {yfiles.graph.ILabeledItem} item The item that the label defaults are returned for. If this is a {@link yfiles.graph.IGroupedGraph group node}, + * the {@link yfiles.graph.IGroupedGraph#groupNodeDefaults}'s {@link yfiles.graph.INodeDefaults#labels label defaults} will be returned, + * otherwise the {@link yfiles.graph.IGraph#nodeDefaults} or {@link yfiles.graph.IGraph#edgeDefaults} {@link yfiles.graph.INodeDefaults#labels labels} + * will be returned. + * @return {yfiles.graph.ILabelDefaults} Appropriate {@link yfiles.graph.ILabelDefaults} for the provided item. + */ + getLabelDefaults(item:yfiles.graph.ILabeledItem):yfiles.graph.ILabelDefaults; + /** + * Gets the {@link yfiles.graph.IPortDefaults port defaults} for a given {@link yfiles.graph.IPortOwner} + * in the context of the graph. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#getPortDefaults}. + * @param {yfiles.graph.IPortOwner} item The item that the label defaults are returned for. If this is a {@link yfiles.graph.IGroupedGraph group node}, + * the {@link yfiles.graph.IGroupedGraph#groupNodeDefaults}'s {@link yfiles.graph.INodeDefaults#ports port defaults} will be returned, + * otherwise the {@link yfiles.graph.IGraph#nodeDefaults} or {@link yfiles.graph.IGraph#edgeDefaults} {@link yfiles.graph.INodeDefaults#ports ports} + * will be returned. + * @return {yfiles.graph.IPortDefaults} Appropriate {@link yfiles.graph.IPortDefaults} for the provided item. + */ + getPortDefaults(item:yfiles.graph.IPortOwner):yfiles.graph.IPortDefaults; + /** + * Convenience method that delegates to the {@link yfiles.graph.IPortDefaults#getStyleInstance} + * method of the {@link yfiles.graph.GraphExtensions#getPortDefaults} for the given owner. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createPortStyle}. + * @param {yfiles.graph.IPortOwner} owner The owner that be used for the newly created port. + * @return {yfiles.drawing.IPortStyle} The style instance to use for newly created ports. + * @see {@link yfiles.graph.GraphExtensions#getPortDefaults} + */ + createPortStyle(owner:yfiles.graph.IPortOwner):yfiles.drawing.IPortStyle; + /** + * Convenience method that delegates to the {@link yfiles.graph.IEdgeDefaults#getStyleInstance} + * method of the {@link yfiles.graph.GraphExtensions#getLabelDefaults} for the given {@link yfiles.graph.ILabeledItem labeled item}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#createLabelStyle}. + * @param {yfiles.graph.ILabeledItem} item The item the newly created label will belong to. + * @return {yfiles.drawing.ILabelStyle} The style instance to use for newly created edges. + */ + createLabelStyle(item:yfiles.graph.ILabeledItem):yfiles.drawing.ILabelStyle; + /** + * Gets the {@link yfiles.graph.IGroupedGraph grouped graph} instance associated with this + * {@link yfiles.graph.IGraph} or null if none is associated with it. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#getGroupedGraph}. + * @return {yfiles.graph.IGroupedGraph} The implementation of the {@link yfiles.graph.IGroupedGraph} or null if + * {@link yfiles.graph.DefaultGraph#groupingSupported grouping is not supported}. + * @see {@link yfiles.graph.GroupedGraph} + * @see {@link yfiles.graph.DefaultGraph#groupingSupported} + */ + getGroupedGraph():yfiles.graph.IGroupedGraph; + /** + * Gets the {@link yfiles.graph.IFoldedGraph folded graph} instance associated with this + * {@link yfiles.graph.IGraph} or null if none is associated with it. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#getFoldedGraph}. + * @return {yfiles.graph.IFoldedGraph} The implementation of the {@link yfiles.graph.IFoldedGraph} or null if + * the graph has not been created by a {@link yfiles.graph.FoldingManager}. + * @see {@link yfiles.graph.FoldingManager} + * @see {@link yfiles.graph.FoldingManager#createManagedView} + */ + getFoldedGraph():yfiles.graph.IFoldedGraph; + /** + * Gets a {@link yfiles.graph.GraphDecorator} instance for use with the given graph. + * This is a bridge method that delegates to {@link yfiles.graph.GraphDecoratorExtensions#getDecorator}. + * @return {yfiles.graph.GraphDecorator} A new {@link yfiles.graph.GraphDecorator} + */ + getDecorator():yfiles.graph.GraphDecorator; + /** + * Convenience method that runs a layouter on a graph using + * {@link yfiles.graph.CopiedLayoutIGraph#applyLayout}. + * This is a bridge method that delegates to {@link yfiles.graph.LayoutExtensions#applyLayout}. + * @param {yfiles.layout.ILayouter} layouter The layouter. + */ + applyLayout(layouter:yfiles.layout.ILayouter):void; + /** + * Convenience method that runs a layouter on a graph and animates the transition + * to the new layout in a graph control that displays the graph. + * This is a bridge method that delegates to {@link yfiles.graph.LayoutExtensions#applyLayoutWithControl}. + * @param {yfiles.layout.ILayouter} layouter The layouter to run. + * @param {yfiles.system.TimeSpan} morphDuration Duration of the animation of the layout. + * @param {yfiles.canvas.GraphControl} control The graph control displaying the graph. + * @see {@link yfiles.graph.LayoutExecutor} + * @see {@link yfiles.graph.LayoutExtensions#applyLayoutWithControlAndCallback} + */ + applyLayoutWithControl(layouter:yfiles.layout.ILayouter,morphDuration:yfiles.system.TimeSpan,control:yfiles.canvas.GraphControl):void; + /** + * Convenience method that runs a layouter on a graph and animates the transition + * to the new layout in a graph control that displays the graph. An event is called + * once the animation has finished. + * This is a bridge method that delegates to {@link yfiles.graph.LayoutExtensions#applyLayoutWithControlAndCallback}. + * @param {yfiles.layout.ILayouter} layouter The layouter to run. + * @param {yfiles.system.TimeSpan} morphDuration Duration of the animation of the layout. + * @param {yfiles.canvas.GraphControl} control The graph control displaying the graph. + * @param {function(Object, yfiles.system.EventArgs)} doneHandler The handler that is called after the animation has finished. See {@link yfiles.graph.LayoutExecutor#finishHandler}. + * @see {@link yfiles.graph.LayoutExecutor} + * @see {@link yfiles.graph.LayoutExtensions#doLayout} + */ + applyLayoutWithControlAndCallback(layouter:yfiles.layout.ILayouter,morphDuration:yfiles.system.TimeSpan,control:yfiles.canvas.GraphControl,doneHandler:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + } + var IGraph:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum AdjacencyTypes{ + /** + * Neither {@link yfiles.graph.AdjacencyTypes#INCOMING} nor {@link yfiles.graph.AdjacencyTypes#OUTGOING}. + */ + NONE, + /** + * The constant for incoming edges. An edge that is incoming at its + * owner has the owner as its target. + */ + INCOMING, + /** + * The constant for outgoing edges. An edge that is outgoing from its + * owner has the owner as its source. + */ + OUTGOING, + /** + * Both {@link yfiles.graph.AdjacencyTypes#INCOMING} and {@link yfiles.graph.AdjacencyTypes#OUTGOING}. + */ + ALL + } + export enum GraphItemTypes{ + /** + * Constant for nodes. + * @see {@link yfiles.graph.INode} + */ + NODE, + /** + * Constant for edges. + * @see {@link yfiles.graph.IEdge} + */ + EDGE, + /** + * Constant for node labels. + * @see {@link yfiles.graph.ILabel} + */ + NODE_LABEL, + /** + * Constant for edge labels. + * @see {@link yfiles.graph.ILabel} + */ + EDGE_LABEL, + /** + * Constant for ports. + * @see {@link yfiles.graph.IPort} + */ + PORT, + /** + * Constant for all kinds of labels. + * This is a bitwise combination of {@link yfiles.graph.GraphItemTypes#NODE_LABEL} + * and {@link yfiles.graph.GraphItemTypes#EDGE_LABEL}. + * @see {@link yfiles.graph.ILabel} + */ + LABEL, + /** + * Constant for all kinds of {@link yfiles.graph.ILabeledItem}. + * This is a bitwise combination of {@link yfiles.graph.GraphItemTypes#NODE} + * and {@link yfiles.graph.GraphItemTypes#EDGE}. + * @see {@link yfiles.graph.ILabeledItem} + */ + LABELED_ITEM, + /** + * Constant for edge bends. + * @see {@link yfiles.graph.IBend} + */ + BEND, + /** + * Constant for all item types. + * This is a bitwise combination of all other types declared in this enum. + */ + ALL, + /** + * Constant for no item type. + * This is a constant where no type bit has been set, i.e. it is 0. + */ + NONE + } + /** + * The interface of the callback that is passed to implementations of the {@link yfiles.graph.IDummyNodeConverter}'s + * {@link yfiles.graph.IDummyNodeConverter#changeDummyNodeAppearance} and {@link yfiles.graph.IDummyNodeConverter#createDummyNodeAppearance} + * methods. + * This interface can be used by the {@link yfiles.graph.IDummyNodeConverter} implementations to adjust + * the appearance of the {@link yfiles.graph.DummyNodeId dummy nodes} in a {@link yfiles.graph.IFoldedGraph} view. + * Modifying the {@link yfiles.graph.FoldingManager#getNodeViewState view state} of a dummy node + * through this interface will prevent the undo queue from being corrupted and is the only way of modifying + * a dummy node that is not currently being displayed in any view. + * @see {@link yfiles.graph.IChangeLabeledItemAppearanceCallback} + * @see {@link yfiles.graph.FoldingManager#getChangeDummyNodeAppearanceCallback} + */ + export interface IChangeDummyNodeAppearanceCallback extends Object,yfiles.graph.IChangeLabeledItemAppearanceCallback{ + /** + * Performs the {@link yfiles.graph.IGraph#setNodeStyle} operation for the node + * that this callback has been configured for. + * @param {yfiles.drawing.INodeStyle} nodeStyle The style to assign. + * @see Specified by {@link yfiles.graph.IChangeDummyNodeAppearanceCallback#setNodeStyle}. + */ + setNodeStyle(nodeStyle:yfiles.drawing.INodeStyle):void; + /** + * Performs the {@link yfiles.graph.IGraph#setBounds} operation for the node + * that this callback has been configured for. + * @param {yfiles.geometry.RectD} bounds The new bounds of the node. + * @see {@link yfiles.graph.IGraph#setBounds} + * @see Specified by {@link yfiles.graph.IChangeDummyNodeAppearanceCallback#setBounds}. + */ + setBounds(bounds:yfiles.geometry.RectD):void; + /** + * Performs the {@link yfiles.graph.IGraph#setLocationModelParameter} operation for port at the node + * that this callback has been configured for. + * @param {yfiles.graph.IPort} port The port at the node to assign the style. + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter The new location parameter for the port. + * @see Specified by {@link yfiles.graph.IChangeDummyNodeAppearanceCallback#setPortLocationModelParameter}. + */ + setPortLocationModelParameter(port:yfiles.graph.IPort,locationParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * Performs the {@link yfiles.graph.IGraph#setPortStyle} operation for port at the node + * that this callback has been configured for. + * @param {yfiles.graph.IPort} port The port at the node to assign the style. + * @param {yfiles.drawing.IPortStyle} portStyle The style to assign. + * @see Specified by {@link yfiles.graph.IChangeDummyNodeAppearanceCallback#setPortStyle}. + */ + setPortStyle(port:yfiles.graph.IPort,portStyle:yfiles.drawing.IPortStyle):void; + } + var IChangeDummyNodeAppearanceCallback:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Common base interface for both the {@link yfiles.graph.IChangeDummyNodeAppearanceCallback} + * and {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback}. + * This interface can be used to manage the {@link yfiles.graph.ILabeledItem#labels} + * of an {@link yfiles.graph.ILabeledItem}. + * @see {@link yfiles.graph.IChangeDummyNodeAppearanceCallback} + * @see {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback} + */ + export interface IChangeLabeledItemAppearanceCallback extends Object{ + /** + * Performs the {@link yfiles.graph.IGraph#addLabelWithParameterStylePreferredSizeAndTag} operation for the item + * that this callback has been configured for. + * @param {yfiles.graph.ILabelModelParameter} labelModelParameter The label model parameter to use. + * @param {yfiles.drawing.ILabelStyle} style The style to use. + * @param {string} text The text to assign. + * @param {yfiles.geometry.SizeD} preferredSize The initial preferred size of the label to assign to the {@link yfiles.graph.ILabel#preferredSize}. + * @param {Object} tag the initial {@link yfiles.support.ITagOwner#tag} to assign. + * @return {yfiles.graph.ILabel} The label instance that has been added to the item. + * @see Specified by {@link yfiles.graph.IChangeLabeledItemAppearanceCallback#addLabel}. + */ + addLabel(labelModelParameter:yfiles.graph.ILabelModelParameter,style:yfiles.drawing.ILabelStyle,text:string,preferredSize:yfiles.geometry.SizeD,tag:Object):yfiles.graph.ILabel; + /** + * Performs the {@link yfiles.graph.IGraph#setLabelText} operation for the item + * that this callback has been configured for. + * @param {yfiles.graph.ILabel} label The label to change. + * @param {string} text The new text. + * @see Specified by {@link yfiles.graph.IChangeLabeledItemAppearanceCallback#setLabelText}. + */ + setLabelText(label:yfiles.graph.ILabel,text:string):void; + /** + * Sets the tag for the label of the item that + * that this callback has been configured for. + * Although the {@link yfiles.support.ITagOwner#tag} property of the label can be written to, + * this method should be used instead to ensure that if this interface is used to modify the appearance of a dummy edge + * or node, no undo units are enqueued. + * @param {yfiles.graph.ILabel} label The label to change. + * @param {Object} newTag The new tag. + * @see Specified by {@link yfiles.graph.IChangeLabeledItemAppearanceCallback#setLabelTag}. + */ + setLabelTag(label:yfiles.graph.ILabel,newTag:Object):void; + /** + * Performs the {@link yfiles.graph.IGraph#setLabelModelParameter} operation for the item + * that this callback has been configured for. + * @param {yfiles.graph.ILabel} label The label to change. + * @param {yfiles.graph.ILabelModelParameter} parameter The new parameter. + * @see Specified by {@link yfiles.graph.IChangeLabeledItemAppearanceCallback#setLabelModelParameter}. + */ + setLabelModelParameter(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):void; + /** + * Performs the {@link yfiles.graph.IGraph#setPreferredSize} operation for the item + * that this callback has been configured for. + * @param {yfiles.graph.ILabel} label The label to change. + * @param {number} width The width of the preferred size. + * @param {number} height The height of the preferred size. + * @see Specified by {@link yfiles.graph.IChangeLabeledItemAppearanceCallback#setPreferredSize}. + */ + setPreferredSize(label:yfiles.graph.ILabel,width:number,height:number):void; + /** + * Performs the {@link yfiles.graph.IGraph#setLabelStyle} operation for the provided label + * that this callback has been configured for. + * @param {yfiles.graph.ILabel} label The label instance to assign the {@link yfiles.graph.ILabel#style} property. + * @param {yfiles.drawing.ILabelStyle} style The style to assign. + * @see Specified by {@link yfiles.graph.IChangeLabeledItemAppearanceCallback#setLabelStyle}. + */ + setLabelStyle(label:yfiles.graph.ILabel,style:yfiles.drawing.ILabelStyle):void; + /** + * Performs the {@link yfiles.graph.IGraph#removeLabel} operation for the item + * that this callback has been configured for. + * @param {yfiles.graph.ILabel} label The label instance to remove. + * @see Specified by {@link yfiles.graph.IChangeLabeledItemAppearanceCallback#removeLabel}. + */ + removeLabel(label:yfiles.graph.ILabel):void; + /** + * Convenience method that {@link yfiles.graph.IGraph#removeLabel removes} all labels from the item + * that this callback has been configured for. + * @see Specified by {@link yfiles.graph.IChangeLabeledItemAppearanceCallback#clearLabels}. + */ + clearLabels():void; + } + var IChangeLabeledItemAppearanceCallback:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.graph.FoldingManager} and {@link yfiles.graph.IFoldedGraph} + * which is responsible for managing edges between dummy nodes. + * Since {@link yfiles.graph.FoldingManager#createManagedView} creates views that can potentially + * contain edges that connect to nodes which have a different set of attributes, these edges might need to + * have a separate set of attributes, too. Implementations of this interface are being called by + * the {@link yfiles.graph.IFoldedGraph} views to configure these kind of dummy edges. + * @see {@link yfiles.graph.DefaultDummyEdgeConverter} + * @see {@link yfiles.graph.FoldingManager#dummyEdgeConverter} + * @see {@link yfiles.graph.DummyEdgeId} + */ + export interface IDummyEdgeConverter extends Object{ + /** + * This method gets called by the {@link yfiles.graph.IFoldedGraph} implementation to determine + * whether a given edge in the {@link yfiles.graph.FoldingManager#masterGraph} should be represented by a dummy edge + * in the given view. + * The implementation will be passed in a callback object that implements the {@link yfiles.graph.IAddDummyEdgeCallback} + * interface, which needs to be used by the implementation to communicate the result of the query. + * The implementation needs to either call {@link yfiles.graph.IAddDummyEdgeCallback#addAsSeparateEdge}, + * {@link yfiles.graph.IAddDummyEdgeCallback#addToExistingDummy}, or {@link yfiles.graph.IAddDummyEdgeCallback#excludeDummyEdge} and return + * the values that these implementation yields to the caller. + * The implementation can optionally query the {@link yfiles.graph.IAddDummyEdgeCallback#getExistingDummyEdges existing dummy edges} + * between the source and target node and decide whether to add the edge {@link yfiles.graph.IAddDummyEdgeCallback#addToExistingDummy to the existing dummy}. + * @param {yfiles.graph.IAddDummyEdgeCallback} callback The {@link yfiles.graph.IAddDummyEdgeCallback} implementation that needs to be called in order to + * communicate the results of this query. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The instance into which the dummy edge is going to be inserted. + * @param {yfiles.graph.IEdge} masterEdge The edge from the {@link yfiles.graph.FoldingManager#masterGraph} that needs to be represented by a dummy + * edge. Note that you may not return this instance. + * @param {yfiles.graph.INode} localSourceNode The source node that belongs to the {@link yfiles.graph.IFoldedGraph} view that will act as the local + * representative of the actual source node. + * @param {boolean} sourceDummy Determines whether the localSourceNode is currently a dummy node. + * @param {yfiles.graph.INode} localTargetNode The target node that belongs to the {@link yfiles.graph.IFoldedGraph} view that will act as the local + * representative of the actual target node. + * @param {boolean} targetDummy Determines whether the localTargetNode is currently a dummy node. + * @return {yfiles.graph.IEdge} The edge as returned by {@link yfiles.graph.IAddDummyEdgeCallback#addAsSeparateEdge}, or {@link yfiles.graph.IAddDummyEdgeCallback#addToExistingDummy}, + * or null if the edge will be {@link yfiles.graph.IAddDummyEdgeCallback#excludeDummyEdge excluded} from the view. + * @see Specified by {@link yfiles.graph.IDummyEdgeConverter#addDummyEdge}. + */ + addDummyEdge(callback:yfiles.graph.IAddDummyEdgeCallback,foldedGraph:yfiles.graph.IFoldedGraph,masterEdge:yfiles.graph.IEdge,localSourceNode:yfiles.graph.INode,sourceDummy:boolean,localTargetNode:yfiles.graph.INode,targetDummy:boolean):yfiles.graph.IEdge; + /** + * Callback that is triggered by the {@link yfiles.graph.IFoldedGraph} view to adjust the appearance of a dummy edge, e.g. to + * reflect a state change in the {@link yfiles.graph.IFoldedGraph#getMasterEdges master edges} that make up + * that dummy edge. + * Implementations may not use the {@link yfiles.graph.IFoldedGraph}'s {@link yfiles.graph.IFoldedGraph#graph} instance to modify + * the localDummyEdge, because this would create and enqueue undo events. Rather + * the callbacks provided by the callback's {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback} + * implementation must be used. + * @param {yfiles.graph.IChangeDummyEdgeAppearanceCallback} callback The callback to use for changing the appearance. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The graph to which the dummy edge belongs. + * @param {yfiles.graph.IEdge} localDummyEdge The dummy edge for which the appearance might need an update. + * @param {yfiles.collections.IList.} masterEdges The list of {@link yfiles.graph.IFoldedGraph#getMasterEdges master edges}, that + * the dummy edge currently represents. + * @see {@link yfiles.graph.IDummyEdgeConverter#createDummyEdgeAppearance} + * @see Specified by {@link yfiles.graph.IDummyEdgeConverter#changeDummyEdgeAppearance}. + */ + changeDummyEdgeAppearance(callback:yfiles.graph.IChangeDummyEdgeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,localDummyEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + /** + * Callback that is triggered by the {@link yfiles.graph.IFoldedGraph} view to initially create the appearance of a dummy edge. + * Implementations may not use the {@link yfiles.graph.IFoldedGraph}'s {@link yfiles.graph.IFoldedGraph#graph} instance to modify + * the localDummyEdge, because this would create and enqueue undo events. Rather + * the callbacks provided by the callback's {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback} + * implementation must be used. + * @param {yfiles.graph.IChangeDummyEdgeAppearanceCallback} callback The callback to use for changing the appearance. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The graph to which the dummy edge belongs. + * @param {yfiles.graph.IEdge} localDummyEdge The dummy edge for which the appearance shall be determined. + * @param {yfiles.collections.IList.} masterEdges The list of {@link yfiles.graph.IFoldedGraph#getMasterEdges master edges}, that + * the dummy edge initially represents. + * @see {@link yfiles.graph.IDummyEdgeConverter#changeDummyEdgeAppearance} + * @see Specified by {@link yfiles.graph.IDummyEdgeConverter#createDummyEdgeAppearance}. + */ + createDummyEdgeAppearance(callback:yfiles.graph.IChangeDummyEdgeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,localDummyEdge:yfiles.graph.IEdge,masterEdges:yfiles.collections.IList):void; + } + var IDummyEdgeConverter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.graph.FoldingManager} and {@link yfiles.graph.IFoldedGraph} + * which is responsible for managing the appearance of dummy nodes. + * Since {@link yfiles.graph.FoldingManager#createManagedView} creates views that can potentially + * contain nodes which have a different set of attributes, these attributes need to be determined somehow. + * Implementations of this interface are being called by + * the {@link yfiles.graph.IFoldedGraph} views to configure the appearance of these {@link yfiles.graph.IFoldedGraph#isDummy dummy nodes}. + * @see {@link yfiles.graph.DefaultDummyNodeConverter} + * @see {@link yfiles.graph.FoldingManager#dummyNodeConverter} + * @see {@link yfiles.graph.DummyNodeId} + * @see {@link yfiles.graph.IFoldedGraph#isDummy} + */ + export interface IDummyNodeConverter extends Object{ + /** + * Callback that is used by {@link yfiles.graph.IFoldedGraph} view implementations to change the appearance + * of a {@link yfiles.graph.IFoldedGraph#isDummy dummy} node. + * This method is called by the view to allow for adjusting the appearance of a local dummy node in + * the view when the {@link yfiles.graph.IFoldedGraph#getMaster master} node for it has + * changed properties. + * This can be used, e.g. to synchronize the label or style properties with the corresponding properties + * of the masterNode. + * Note that changing the appearance has to be done using the callback that + * implements the {@link yfiles.graph.IChangeDummyNodeAppearanceCallback} interface. Direct changes to the dummyNode + * would otherwise be enqueued into the undo queue and could thus break the undo stack. + * @param {yfiles.graph.IChangeDummyNodeAppearanceCallback} callback The callback to use for changing the appearance. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The graph instance for which the dummy node can be changed. + * @param {yfiles.graph.INode} dummyNode The dummy node instance in the view + * @param {yfiles.graph.INode} masterNode The node that represents the {@link yfiles.graph.IFoldedGraph#getMaster} item that + * is represented in the local view by the dummyNode. + * @see {@link yfiles.graph.IDummyNodeConverter#createDummyNodeAppearance} + * @see Specified by {@link yfiles.graph.IDummyNodeConverter#changeDummyNodeAppearance}. + */ + changeDummyNodeAppearance(callback:yfiles.graph.IChangeDummyNodeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,dummyNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + /** + * Callback that is used by {@link yfiles.graph.IFoldedGraph} view implementations to initially create the appearance + * of a {@link yfiles.graph.IFoldedGraph#isDummy dummy} node. + * This method is called by the view to allow for initially creating the appearance of a local dummy node in + * the view when it is included in the view for the first time. + * This can be used, e.g. to initialize the labels or style properties with the corresponding properties + * of the masterNode. + * Note that changing the appearance has to be done using the callback that + * implements the {@link yfiles.graph.IChangeDummyNodeAppearanceCallback} interface. Direct changes to the dummyNode + * would otherwise be enqueued into the undo queue and could thus break the undo stack. + * @param {yfiles.graph.IChangeDummyNodeAppearanceCallback} callback The callback to use for determining the appearance. + * @param {yfiles.graph.IFoldedGraph} foldedGraph The graph instance for which the dummy node has been created. + * @param {yfiles.graph.INode} dummyNode The dummy node instance in the view + * @param {yfiles.graph.INode} masterNode The node that represents the {@link yfiles.graph.IFoldedGraph#getMaster} item that + * is represented in the local view by the dummyNode. + * @see {@link yfiles.graph.IDummyNodeConverter#changeDummyNodeAppearance} + * @see Specified by {@link yfiles.graph.IDummyNodeConverter#createDummyNodeAppearance}. + */ + createDummyNodeAppearance(callback:yfiles.graph.IChangeDummyNodeAppearanceCallback,foldedGraph:yfiles.graph.IFoldedGraph,dummyNode:yfiles.graph.INode,masterNode:yfiles.graph.INode):void; + } + var IDummyNodeConverter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface of the callback that is passed to implementations of the {@link yfiles.graph.IDummyEdgeConverter}'s + * {@link yfiles.graph.IDummyEdgeConverter#changeDummyEdgeAppearance} and {@link yfiles.graph.IDummyEdgeConverter#createDummyEdgeAppearance} + * methods. + * This interface can be used by the {@link yfiles.graph.IDummyEdgeConverter} implementations to adjust + * the appearance of the {@link yfiles.graph.DummyEdgeId dummy edges} in a {@link yfiles.graph.IFoldedGraph} view. + * Modifying the {@link yfiles.graph.FoldingManager#getEdgeViewState view state} of a dummy edge + * through this interface will prevent the undo queue from being corrupted and is the only way of modifying + * a dummy edge that is not currently being displayed in any view. + * @see {@link yfiles.graph.IChangeLabeledItemAppearanceCallback} + * @see {@link yfiles.graph.FoldingManager#getChangeDummyEdgeAppearanceCallback} + */ + export interface IChangeDummyEdgeAppearanceCallback extends Object,yfiles.graph.IChangeLabeledItemAppearanceCallback{ + /** + * Performs the {@link yfiles.graph.IGraph#setEdgeStyle} operation for the edge + * that this callback has been configured for. + * @param {yfiles.drawing.IEdgeStyle} edgeStyle The new edge style. + * @see Specified by {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#setStyle}. + */ + setStyle(edgeStyle:yfiles.drawing.IEdgeStyle):void; + /** + * Performs the {@link yfiles.graph.IGraph#addBend} operation for the edge + * that this callback has been configured for. + * @param {number} index The index where the new bend needs to be inserted. + * @param {yfiles.geometry.PointD} location The new coordinates of the bend. + * @return {yfiles.graph.IBend} The new bend for this dummy edge. + * @see Specified by {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#addBend}. + */ + addBend(index:number,location:yfiles.geometry.PointD):yfiles.graph.IBend; + /** + * Performs the {@link yfiles.graph.IGraph#setBendLocation} operation for the given + * bend at the item + * that this callback has been configured for. + * @param {yfiles.graph.IBend} bend The bend instance to set the location. + * @param {yfiles.geometry.PointD} location The new coordinates of the bend. + * @see Specified by {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#setLocation}. + */ + setLocation(bend:yfiles.graph.IBend,location:yfiles.geometry.PointD):void; + /** + * Performs the {@link yfiles.graph.IGraph#removeBend} operation for the item + * that this callback has been configured for. + * @param {yfiles.graph.IBend} bend The bend instance to remove. + * @see Specified by {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#removeBend}. + */ + removeBend(bend:yfiles.graph.IBend):void; + /** + * Removes all bends from the edge + * that this callback has been configured for. + * @see Specified by {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#clearBends}. + */ + clearBends():void; + /** + * Performs the {@link yfiles.graph.IGraph#setLocationModelParameter} operation for the source + * port of the edge + * that this callback has been configured for. + * Since the {@link yfiles.graph.IEdge#sourcePort} of a dummy edge can be a {@link yfiles.graph.IFoldedGraph#isDummy dummy} + * item and a dummy edge needs to be connected to a dummy port if the actual source node is not currently visible, + * this method can be used to + * relocate the source port of the dummy edge that does not connect to the true master source node. + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter The new parameter for the location of the port. + * @see Specified by {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#setSourcePortLocationParameter}. + */ + setSourcePortLocationParameter(locationParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * Performs the {@link yfiles.graph.IGraph#setLocationModelParameter} operation for the target + * port of the edge + * that this callback has been configured for. + * Since the {@link yfiles.graph.IEdge#targetPort} of a dummy edge is always a {@link yfiles.graph.IFoldedGraph#isDummy dummy} + * item and each dummy edge is connected to its own set of source and target ports, this method can be used to + * relocate the target port of the dummy edge. + * @param {yfiles.graph.IPortLocationModelParameter} locationParameter The parameter for the location of the port. + * @see Specified by {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#setTargetPortLocationParameter}. + */ + setTargetPortLocationParameter(locationParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * Performs the {@link yfiles.graph.IGraph#setPortStyle} operation for the source + * port of the edge + * that this callback has been configured for. + * Since the {@link yfiles.graph.IEdge#sourcePort} of a dummy edge is always a {@link yfiles.graph.IFoldedGraph#isDummy dummy} + * item and each dummy edge is connected to its own set of source and target ports, this method can be used to + * reassign the style of the source port of the dummy edge. + * @param {yfiles.drawing.IPortStyle} portStyle The new style for the port. + * @see Specified by {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#setSourcePortStyle}. + */ + setSourcePortStyle(portStyle:yfiles.drawing.IPortStyle):void; + /** + * Performs the {@link yfiles.graph.IGraph#setPortStyle} operation for the target + * port of the edge + * that this callback has been configured for. + * Since the {@link yfiles.graph.IEdge#targetPort} of a dummy edge is always a {@link yfiles.graph.IFoldedGraph#isDummy dummy} + * item and each dummy edge is connected to its own set of source and target ports, this method can be used to + * reassign the style of the target port of the dummy edge. + * @param {yfiles.drawing.IPortStyle} portStyle The new style for the port. + * @see Specified by {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#setTargetPortStyle}. + */ + setTargetPortStyle(portStyle:yfiles.drawing.IPortStyle):void; + /** + * Sets the {@link yfiles.support.ITagOwner#tag} of the dummy edge. + * The tag can differ from the original edge's tag especially if the dummy edge represents more than one edge. + * Although the {@link yfiles.support.ITagOwner#tag} property of the can be written to, + * this method should be used instead to ensure that if this interface is used to modify the appearance of a dummy edge + * no undo units are enqueued. + * @param {Object} newTag The new tag. + * @see Specified by {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#setTag}. + */ + setTag(newTag:Object):void; + /** + * Sets the {@link yfiles.support.ITagOwner#tag} of the source port of the dummy edge. + * The tag can differ from the original edge's source port tag especially if the dummy edge represents more than one edge. + * Although the {@link yfiles.support.ITagOwner#tag} property of the can be written to, + * this method should be used instead to ensure that if this interface is used to modify the appearance of a dummy edge's ports + * no undo units are enqueued. + * @param {Object} newTag The new tag. + * @see Specified by {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#setSourcePortTag}. + */ + setSourcePortTag(newTag:Object):void; + /** + * Sets the {@link yfiles.support.ITagOwner#tag} of the target port of the dummy edge. + * The tag can differ from the original edge's target port tag especially if the dummy edge represents more than one edge. + * Although the {@link yfiles.support.ITagOwner#tag} property of the can be written to, + * this method should be used instead to ensure that if this interface is used to modify the appearance of a dummy edge's ports + * no undo units are enqueued. + * @param {Object} newTag The new tag. + * @see Specified by {@link yfiles.graph.IChangeDummyEdgeAppearanceCallback#setTargetPortTag}. + */ + setTargetPortTag(newTag:Object):void; + } + var IChangeDummyEdgeAppearanceCallback:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.graph.IGraph} to declare and obtain the defaults + * for edges and their labels or ports. + * @see {@link yfiles.graph.IGraph#edgeDefaults} + */ + export interface IEdgeDefaults extends Object{ + /** + * Gets or sets the defaults for ports at edges. + * Note that these are not the {@link yfiles.graph.IEdge#sourcePort}s or {@link yfiles.graph.IEdge#targetPort}s, + * because conceptually they belong to the nodes (and their {@link yfiles.graph.INodeDefaults}), but rather for ports + * at edges to which other edges can connect. + * Value: The port defaults. + * @see Specified by {@link yfiles.graph.IEdgeDefaults#ports}. + */ + ports:yfiles.graph.IPortDefaults; + /** + * Gets or sets the defaults for labels at edges. + * Value: The label defaults. + * @see Specified by {@link yfiles.graph.IEdgeDefaults#labels}. + */ + labels:yfiles.graph.ILabelDefaults; + /** + * Gets or sets the style to use for edges. + * Depending on the setting of {@link yfiles.graph.IEdgeDefaults#shareStyleInstance}, the {@link yfiles.graph.IEdgeDefaults#getStyleInstance} + * method should return a {@link yfiles.system.ICloneable#clone clone} of this instance or the very same instance. + * Value: The style to use as a template. + * @see {@link yfiles.graph.IEdgeDefaults#shareStyleInstance} + * @see Specified by {@link yfiles.graph.IEdgeDefaults#style}. + */ + style:yfiles.drawing.IEdgeStyle; + /** + * Factory method that returns a style instance for use with newly created edges. + * Most implementations will yield either, a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IEdgeDefaults#style} property, if {@link yfiles.graph.IEdgeDefaults#shareStyleInstance} + * is enabled, but they might use more complicated logic, too. + * @return {yfiles.drawing.IEdgeStyle} The style to use, which for most implementations is either a {@link yfiles.system.ICloneable#clone clone} + * of or the {@link yfiles.graph.IEdgeDefaults#style} property, if {@link yfiles.graph.IEdgeDefaults#shareStyleInstance} + * is enabled. + * @see Specified by {@link yfiles.graph.IEdgeDefaults#getStyleInstance}. + */ + getStyleInstance():yfiles.drawing.IEdgeStyle; + /** + * Gets or sets a value indicating whether the {@link yfiles.graph.IEdgeDefaults#style} + * instance should be shared referentially or {@link yfiles.system.ICloneable#clone cloned} + * upon a call to {@link yfiles.graph.IEdgeDefaults#getStyleInstance}. + * Value: + * true if the reference should be shared; otherwise, false. + * @see {@link yfiles.graph.IEdgeDefaults#getStyleInstance} + * @see {@link yfiles.graph.IEdgeDefaults#style} + * @see Specified by {@link yfiles.graph.IEdgeDefaults#shareStyleInstance}. + */ + shareStyleInstance:boolean; + } + var IEdgeDefaults:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface of the callback that is passed to implementations of the {@link yfiles.graph.IDummyEdgeConverter}'s + * {@link yfiles.graph.IDummyEdgeConverter#addDummyEdge} method. + * Implementors of the {@link yfiles.graph.IDummyEdgeConverter} need to use this interface to tell the + * calling {@link yfiles.graph.IFoldedGraph} view implementation how to add the dummy edge to the given view. + * They need to call exactly one of the following methods for each callback: + *
    + *
  • + * {@link yfiles.graph.IAddDummyEdgeCallback#addAsSeparateEdge} + * Call this to add a separate dummy edge for the given master edge to the view. Pass the return value of that method to the caller. + *
  • + *
  • + * {@link yfiles.graph.IAddDummyEdgeCallback#addToExistingDummy} + * Call this to reuse a dummy edge that is already part of the view as a representative for the master edge. + * Pass the return value of that method to the caller. + *
  • + *
  • + * {@link yfiles.graph.IAddDummyEdgeCallback#excludeDummyEdge} + * Call this in order not to add a dummy edge for the master edge to the view at all. + * Pass null to the caller. + *
  • + *
+ * @see {@link yfiles.graph.IDummyEdgeConverter#addDummyEdge} + * @see {@link yfiles.graph.IDummyEdgeConverter} + * @see {@link yfiles.graph.FoldingManager#dummyEdgeConverter} + */ + export interface IAddDummyEdgeCallback extends Object{ + /** + * Tells the {@link yfiles.graph.IFoldedGraph} view implementation to add the edge provided to the {@link yfiles.graph.IDummyEdgeConverter#addDummyEdge} + * method as a separate dummy edge to the view at the given ports. + * This tells the view that there is currently no {@link yfiles.graph.IAddDummyEdgeCallback#getExistingDummyEdges existing dummy edge} in the view + * to which the master edge should be added to. Instead the view should add a separate dummy edge that represents the master edge. + * Use the result of this method call as the return value for the {@link yfiles.graph.IDummyEdgeConverter#addDummyEdge} call. + * Note that the returned dummy edge should not be modified by this code, instead the {@link yfiles.graph.IDummyEdgeConverter#createDummyEdgeAppearance} + * and {@link yfiles.graph.IDummyEdgeConverter#changeDummyEdgeAppearance} callbacks need to be used to change the appearance of the dummy edge. + * Existing ports at the provided source and target nodes may be specified to further influence the dummy edge creation. + * @param {yfiles.graph.IPort} sourcePort The source port at the source node in the view to use or null if an extra + * {@link yfiles.graph.IFoldedGraph#isDummy dummy} port should be added for the edge to connect to at the source. + * @param {yfiles.graph.IPort} targetPort The target port at the target node in the view to use or null if an extra + * {@link yfiles.graph.IFoldedGraph#isDummy dummy} port should be added for the edge to connect to at the target. + * @return {yfiles.graph.IEdge} + * The dummy edge that has been created in the view. Don't change the properties of the edge directly. + * @see {@link yfiles.graph.IDummyEdgeConverter} + * @see {@link yfiles.graph.IFoldedGraph#getRepresentative} + * @see Specified by {@link yfiles.graph.IAddDummyEdgeCallback#addAsSeparateEdge}. + */ + addAsSeparateEdge(sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):yfiles.graph.IEdge; + /** + * Tells the {@link yfiles.graph.IFoldedGraph} view implementation to logically add the edge provided to the {@link yfiles.graph.IDummyEdgeConverter#addDummyEdge} + * method to a dummy edge that already exists in the view. + * This tells the view that there is already an {@link yfiles.graph.IAddDummyEdgeCallback#getExistingDummyEdges existing dummy edge} in the view + * to which the master edge should be added logically added to. The given dummyEdge will have the master + * edge added to its collection of {@link yfiles.graph.IFoldedGraph#getMasterEdges master edges}. + * Note that the returned dummy edge should not be modified by this code, instead the {@link yfiles.graph.IDummyEdgeConverter#changeDummyEdgeAppearance} + * callback needs to be used to change the appearance of the dummy edge. + * Implementations can use the {@link yfiles.graph.IAddDummyEdgeCallback#getExistingDummyEdges} method to retrieve the current set of existing dummy edges + * that interconnect the same source and target nodes. The range of valid parameters is constrained to this collection. + * @return {yfiles.graph.IEdge} The dummy edge that represents the edge in the view, which is the same as the dummyEdge parameter. + * Don't change the properties of the edge directly. + * @param {yfiles.graph.IEdge} dummyEdge One of the {@link yfiles.graph.IAddDummyEdgeCallback#getExistingDummyEdges existing dummy edges} from the view which + * has been chosen to represent the master edge in this view as a dummy. + * @see {@link yfiles.graph.IDummyEdgeConverter} + * @see {@link yfiles.graph.IAddDummyEdgeCallback#getExistingDummyEdges} + * @see Specified by {@link yfiles.graph.IAddDummyEdgeCallback#addToExistingDummy}. + */ + addToExistingDummy(dummyEdge:yfiles.graph.IEdge):yfiles.graph.IEdge; + /** + * Tells the {@link yfiles.graph.IFoldedGraph} view implementation not to add a dummy for the edge provided + * to the {@link yfiles.graph.IDummyEdgeConverter#addDummyEdge} + * method in this view. + * This tells the view that there should not be a representation of the master edge in this view. + * If this method is called, null should be returned as the result of a {@link yfiles.graph.IDummyEdgeConverter#addDummyEdge} + * call, which is the same as the return value of this method. So it is possible to just pass the return value on to the caller. + * @return {yfiles.graph.IEdge} + * This method will always return null. This is for symmetry reasons to be easily exchangeable with the + * other methods. + * @see {@link yfiles.graph.IDummyEdgeConverter} + * @see Specified by {@link yfiles.graph.IAddDummyEdgeCallback#excludeDummyEdge}. + */ + excludeDummyEdge():yfiles.graph.IEdge; + /** + * Helper methods that can be used by the implementation of the {@link yfiles.graph.IDummyEdgeConverter#addDummyEdge} method + * to determine the dummy edges that are currently part of the view and interconnect the same nodes as the + * dummy edge would, if it was included in the view. + * This method will yield all {@link yfiles.graph.IFoldedGraph#isDummy dummy edges} that interconnect the same + * source and target node as that the dummy edge would, if it was included in this view. + * One of the items in the returned collection can be passed to the {@link yfiles.graph.IAddDummyEdgeCallback#addToExistingDummy} method. + * @param {boolean} ignoreDirection Whether the direction of the edges should be ignored so that + * reverse edges are included in the enumeration, too. + * @return {yfiles.collections.IEnumerable.} An collection of currently existing dummy edges in the view that interconnects the same source and target node. + * @see Specified by {@link yfiles.graph.IAddDummyEdgeCallback#getExistingDummyEdges}. + */ + getExistingDummyEdges(ignoreDirection:boolean):yfiles.collections.IEnumerable; + } + var IAddDummyEdgeCallback:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface used to model edges in an {@link yfiles.graph.IGraph} implementation. + * This interface provides read-only access to the properties of an edge. + * In order to modify the state of an instance use the various methods provided by the + * {@link yfiles.graph.IGraph} this instance belongs to. + * An edge connects to two ports and may consist of a number of bends. + * Also it can have zero or more labels. + * This interface combines the functionality of {@link yfiles.graph.IPortOwner} to get access to + * the ports that edges can optionally have, {@link yfiles.graph.ILabeledItem} to get access to the labels, and, + * like all items in an IGraph, edges support the + * {@link yfiles.support.ILookup#lookup} method inherited from the {@link yfiles.model.IModelItem} interface + * that can be used to query additional aspects of each instance. + *
+ * Related Information in the Developers Guide: + *

+ * The graph model with all relevant types and their relationships is presented in detail + * in the section Graph Structure. + *

+ *

+ * Using the look-up mechanism is explained in the section + * Look-up Mechanism. + *

+ */ + export interface IEdge extends Object,yfiles.graph.IPortOwner,yfiles.graph.ILabeledItem,yfiles.model.IModelItem{ + /** + * Provides access to a collection of {@link yfiles.graph.IBend bends} that + * describe the geometry of this edge. + * This gives access to a read-only live view of the bends, i.e. the collection + * can change over time, as well as the bends contained in it. If a snapshot of the + * current state is needed, one needs to copy the collection. + * In order to modify the bend collection of an edge, use the {@link yfiles.graph.IGraph#addBend various methods} + * in {@link yfiles.graph.IGraph}. + * @see Specified by {@link yfiles.graph.IEdge#bends}. + */ + bends:yfiles.model.IListEnumerable; + /** + * Gets the source port instance this edge is connected to. + * Although the notion of source and target port is used for directed + * edges, it is still up to the client to decide whether the edge should + * be treated as such. + * @see Specified by {@link yfiles.graph.IEdge#sourcePort}. + */ + sourcePort:yfiles.graph.IPort; + /** + * Gets the target port instance this edge is connected to. + * Although the notion of source and target port is used for directed + * edges, it is still up to the client to decide whether the edge should + * be treated as such. + * @see Specified by {@link yfiles.graph.IEdge#targetPort}. + */ + targetPort:yfiles.graph.IPort; + /** + * Returns the style that is responsible for the visual representation + * of this edge in a {@link yfiles.canvas.CanvasControl}. + * In order to set the style on an instance, use the {@link yfiles.graph.IGraph#setEdgeStyle} + * method. + * Note that the style instance associated with an edge instance may be shared + * between multiple edge instances and that the modification of this style will + * result in a change of the appearance of all edges that are associated with the same style instance. + * @see Specified by {@link yfiles.graph.IEdge#style}. + */ + style:yfiles.drawing.IEdgeStyle; + /** + * Gets the source node for the given edge or null. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#getSourceNode}. + * @return {yfiles.graph.INode} The source node or null. + */ + getSourceNode():yfiles.graph.INode; + /** + * Gets the target node for the given edge or null. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#getTargetNode}. + * @return {yfiles.graph.INode} The target node or null. + */ + getTargetNode():yfiles.graph.INode; + /** + * Returns whether an {@link yfiles.graph.IEdge edge} is a self loop. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#isSelfloop}. + * @return {boolean} true, if the edge is a self loop + */ + isSelfloop():boolean; + /** + * Yields the opposites port owner of an {@link yfiles.graph.IEdge}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#oppositePortOwner}. + * @param {yfiles.graph.IPortOwner} owner The owner of the port that the {@link yfiles.graph.IEdge} is connected to. + * @return {yfiles.graph.IPortOwner} The owner of the opposite port. + * @throws {yfiles.system.ArgumentOutOfRangeException} If owner is neither the source or target of the edge. + */ + oppositePortOwner(owner:yfiles.graph.IPortOwner):yfiles.graph.IPortOwner; + /** + * Yields the opposites port of an {@link yfiles.graph.IEdge}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#opposite}. + * @param {yfiles.graph.IPort} port The port that the {@link yfiles.graph.IEdge} is connected to. + * @return {yfiles.graph.IPort} The opposite port. + * @throws {yfiles.system.ArgumentOutOfRangeException} If port is neither the source or target of the edge. + */ + opposite(port:yfiles.graph.IPort):yfiles.graph.IPort; + } + var IEdge:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + } + export module graphml{ + /** + * Constant class for reference handling related constants. + */ + export interface ReferenceConstants extends Object{ + } + var ReferenceConstants:{ + $class:yfiles.lang.Class; + /** + * The name of the GraphML attribute for a default section. + * This field has the constant value "sharedData" + */ + SHARED_DATA_KEY_NAME:string; + /** + * SharedData tag. + * This field has the constant value "SharedData" + */ + SHARED_DATA_TAG_NAME:string; + /** + * Tag name for shared references that need an external enclosing tag. + * This field has the constant value "GraphMLReference" + */ + GRAPHML_REFERENCE_TAG_NAME:string; + }; + /** + * Event arguments for calls to the {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} and + * {@link yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener OverrideResolveReference} events. + * @see {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} + * @see {@link yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener OverrideResolveReference} + */ + export interface ResolveReferenceEventArgs extends yfiles.system.EventArgs{ + /** + * The reference id that should evaluated by the event handler. + */ + referenceId:string; + /** + * The reference value that is encapsulated by this instance. + * Setting this property automatically sets {@link yfiles.graphml.ResolveReferenceEventArgs#handled} to true. + * @see {@link yfiles.graphml.ResolveReferenceEventArgs#handled} + */ + value:Object; + /** + * Returns whether the last event handler invocation has actually handled + * the event. + * This property is set implicitly by {@link yfiles.graphml.ResolveReferenceEventArgs#value}. + * @see {@link yfiles.graphml.ResolveReferenceEventArgs#value} + */ + handled:boolean; + /** + * The current parse context that can be used by the event handler for additional information. + */ + context:yfiles.graphml.IParseContext; + } + var ResolveReferenceEventArgs:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of {@link yfiles.graphml.ResolveReferenceEventArgs}. + * The {@link yfiles.graphml.ResolveReferenceEventArgs#handled} property is set to false, the + * {@link yfiles.graphml.ResolveReferenceEventArgs#value} property is set to null + * @param {yfiles.graphml.IParseContext} context The current parse context that can be used by the event handler for additional information. + * @param {string} referenceId The reference id that should evaluated by the event handler. + */ + new (context:yfiles.graphml.IParseContext,referenceId:string):yfiles.graphml.ResolveReferenceEventArgs; + }; + /** + * Event arguments for calls to the {@link yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener QueryReferenceId} or {@link yfiles.graphml.GraphMLWriter#addQueryReferenceIdListener QueryReferenceId} events. + * Event handling code should inspect the {@link yfiles.graphml.QueryReferenceIdEventArgs#value} property and decide whether to set + * the {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId} and/or {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceType} property in order to {@link yfiles.graphml.QueryReferenceIdEventArgs#handled handle} the event. + * @see {@link yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener QueryReferenceId} + * @see {@link yfiles.graphml.GraphMLWriter#addQueryReferenceIdListener QueryReferenceId} + */ + export interface QueryReferenceIdEventArgs extends yfiles.system.EventArgs{ + /** + * The reference id that should be evaluated by the event handler. + * Setting this property to a non-{@link yfiles.system.StringExtensions#isNullOrEmpty null string} automatically sets {@link yfiles.graphml.QueryReferenceIdEventArgs#handled} to true. + * @see {@link yfiles.graphml.QueryReferenceIdEventArgs#handled} + */ + referenceId:string; + /** + * Determines the type of the reference being queried. + * Setting this property automatically sets {@link yfiles.graphml.QueryReferenceIdEventArgs#handled} to true. + * By default this property is {@link yfiles.graphml.GraphMLReferenceType#EXTERNAL} so {@link yfiles.graphml.QueryReferenceIdEventArgs#value}s that + * are given a {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId} are treated as external references that are not + * serialized to the GraphML. Setting this property to {@link yfiles.graphml.GraphMLReferenceType#INTERNAL} and specifying + * a {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId} will make the reference mechanism use the provided reference + * but will cause it to serialize the value to the GraphML, nevertheless. + * @see {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId} + * @see {@link yfiles.graphml.QueryReferenceIdEventArgs#handled} + */ + referenceType:yfiles.graphml.GraphMLReferenceType; + /** + * The reference value that is encapsulated by this instance. + */ + value:Object; + /** + * Returns whether the last event handler invocation has actually handled + * the event. + * This property is set implicitly by {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId}. + * @see {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId} + */ + handled:boolean; + /** + * The current write context that can be used by the event handler for additional information. + */ + context:yfiles.graphml.IWriteContext; + } + var QueryReferenceIdEventArgs:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + * The {@link yfiles.graphml.QueryReferenceIdEventArgs#handled} property is set to false, the {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId} is set to null. + * @param {yfiles.graphml.IWriteContext} context The current write context that can be used by the event handler for additional information. + * @param {Object} value The referenced object instance. + */ + new (context:yfiles.graphml.IWriteContext,value:Object):yfiles.graphml.QueryReferenceIdEventArgs; + }; + /** + * Utility class that is used to describe a specific association between a CLR namespace and a module. + * @see {@link yfiles.graphml.IXamlTypeMapper} + */ + export interface ClrNamespaceDescriptor extends Object{ + /** + * Returns the assembly name associated with {@link yfiles.graphml.ClrNamespaceDescriptor#clrNamespace}. + */ + assemblyName:string; + /** + * Returns the CLR namespace associated with {@link yfiles.graphml.ClrNamespaceDescriptor#assemblyName}. + */ + clrNamespace:string; + /** + * Overridden for memberwise equality. + * @param {yfiles.graphml.ClrNamespaceDescriptor} obj + * @return {boolean} true iff both objects are memberwise equal. + */ + equalsWithClrNamespaceDescriptor(obj:yfiles.graphml.ClrNamespaceDescriptor):boolean; + /** + * Overridden for memberwise equality. + * @param {Object} obj + * @return {boolean} true iff both objects are memberwise equal. + */ + equals(obj:Object):boolean; + /** + * Overridden for memberwise equality. + * @return {number} The HashCode. + */ + hashCode():number; + } + var ClrNamespaceDescriptor:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of {@link yfiles.graphml.ClrNamespaceDescriptor}. + * @param {string} assemblyName The module. + * @param {string} clrNamespace The CLR namespace. + */ + new (assemblyName:string,clrNamespace:string):yfiles.graphml.ClrNamespaceDescriptor; + }; + /** + * Wraps a property together with default values and meta data. + */ + export interface Property extends Object{ + /** + * Returns true iff the property has a public getter. + */ + canRead:boolean; + /** + * Returns true iff the property has a public setter. + */ + canWrite:boolean; + /** + * Gets the serialization visibility. + * Value: The serialization visibility. + */ + serializationVisibility:yfiles.system.DesignerSerializationVisibility; + /** + * Gets the serializer attribute. + * Value: The GraphML serializer attribute. + */ + graphMLSerializerAttribute:yfiles.graphml.GraphMLSerializerAttribute; + /** + * Gets the GraphMLAttribute. + * Value: The graph ML attribute. + */ + graphMLAttribute:yfiles.graphml.GraphMLAttribute; + /** + * Gets a value indicating whether this instance is the one defined in the {@link yfiles.system.ContentPropertyAttribute}. + * Value: + * true if this instance is the one defined in the {@link yfiles.system.ContentPropertyAttribute}; otherwise, false. + */ + isContentProperty:boolean; + /** + * Gets the property info. + * Value: The property info. + */ + propertyInfo:yfiles.system.PropertyInfo; + /** + * Gets the type of the property. + * Value: The type of the property. + */ + propertyType:yfiles.lang.Class; + /** + * Gets the type of the owner. + * Value: The type of the owner. + */ + ownerType:yfiles.lang.Class; + /** + * Gets the owner instance. + * Value: The owner instance. + */ + ownerInstance:Object; + /** + * Gets the default value. + * Value: The default value. + */ + defaultValue:Object; + /** + * Gets a value indicating whether this instance has a default value. + * Value: + * true if this instance has a default value; otherwise, false. + */ + hasDefaultValue:boolean; + /** + * Gets or sets the value. + * Value: The value. + */ + value:Object; + /** + * Gets or sets the name. + * Value: The name. + */ + name:string; + } + var Property:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.Property} class. + */ + new (propertyInfo:yfiles.system.PropertyInfo,ownerInstance:Object):yfiles.graphml.Property; + }; + /** + * {@link yfiles.graphml.ISerializer} implementation that produces XAML conforming output + * from the target object's reflection data. + * By default, the resulting XAML output follows the rules for normal XAML + * output. In addition, serialization can be fine tuned by applying {@link yfiles.graphml.GraphMLAttribute} to the + * target object's class or some of its members. + *

+ * Note that usually the type should be excluded from obfuscation, or its name should be declared with {@link yfiles.graphml.GraphMLAttribute#name}. + * The same holds for specific members. + *

+ * @see {@link yfiles.graphml.GraphMLAttribute} + */ + export interface XamlSerializer extends Object,yfiles.graphml.ISerializer{ + /** + * Serialize the given object to a {@link yfiles.graphml.IXmlWriter}. + * This implementation already provides the toplevel XML element with tag name {@link yfiles.graphml.XamlSerializer#getTagName}. + * This method should not be overridden by custom implementations, override + * {@link yfiles.graphml.XamlSerializer#serializeContent} instead. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {Object} subject The actual object + * @see Specified by {@link yfiles.graphml.ISerializer#serialize}. + */ + serialize(context:yfiles.graphml.IWriteContext,subject:Object):void; + /** + * Actually writes out the value of subject and all its properties. + */ + serializeContent(context:yfiles.graphml.IWriteContext,subject:Object,writer:yfiles.graphml.IXmlWriter):void; + /** + * Returns the target XML namespace of the toplevel element. + * If the type has a {@link yfiles.graphml.GraphMLAttribute} declared, the target namespace is taken from there. Otherwise, + * the target namespace is determined as for normal XAML serialization. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {Object} subject The target object that should be serialized. + * @return {string} The target namespace URI of the toplevel element + * @see {@link yfiles.graphml.GraphMLAttribute} + * @see {@link yfiles.system.XmlnsDefinitionAttribute} + */ + getXmlNamespace(context:yfiles.graphml.IWriteContext,subject:Object):string; + /** + * Returns the name of the toplevel element. + * If the type has a {@link yfiles.graphml.GraphMLAttribute} declared, the name is taken from there. Otherwise, + * the element name is determined as for normal XAML serialization. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {Object} subject The target object that should be serialized. + * @return {string} The name of the toplevel element + * @see {@link yfiles.graphml.GraphMLAttribute} + * @see {@link yfiles.system.XmlnsDefinitionAttribute} + */ + getTagName(context:yfiles.graphml.IWriteContext,subject:Object):string; + /** + * Returns a list of all properties that should be serialized. + * This implementation returns all public properties that are read/write, as well + * as all properties that are explicitly declared with a {@link yfiles.graphml.GraphMLAttribute}. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {Object} subject The object that should be serialized. + * @return {yfiles.collections.IList.} A list of all properties that should be serialized + * @see {@link yfiles.graphml.XamlSerializer#shouldSerialize} + */ + getProperties(context:yfiles.graphml.IWriteContext,subject:Object):yfiles.collections.IList; + /** + * Returns true if a property has a default value and therefore should not be written at all. + * This implementation just checks if the current property value is equal to an optional + * {@link yfiles.system.DefaultValueAttribute#value} + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {yfiles.graphml.Property} info The {@link yfiles.graphml.Property} that represents the property. + * @return {boolean} true if the property has a default value. + * @see {@link yfiles.system.DefaultValueAttribute} + */ + hasDefaultValue(context:yfiles.graphml.IWriteContext,info:yfiles.graphml.Property):boolean; + /** + * Returns true if property property should be serialized. + * This implementation returns true if the property is explicitly declared with a {@link yfiles.graphml.GraphMLAttribute} + * or if it's a public read/write property that has not a default value, or + * if it's a collection property marked with {@link yfiles.system.DesignerSerializationVisibility#CONTENT}. + * In addition, it returns false if + * the property is marked with {@link yfiles.system.DesignerSerializationVisibility#HIDDEN} + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {yfiles.graphml.Property} property The {@link yfiles.graphml.Property} that represents the property. + * @return {boolean} true if the property should be serialized. + * @see {@link yfiles.graphml.XamlSerializer#hasDefaultValue} + */ + shouldSerialize(context:yfiles.graphml.IWriteContext,property:yfiles.graphml.Property):boolean; + /** + * Returns true if a property is a collection property that needs to be handled specially according to the XAML rules. + * This implementation returns true if property is either an array, is assignable + * to {@link yfiles.objectcollections.IList}, {@link yfiles.collections.IList}, {@link yfiles.objectcollections.IDictionary} or {@link yfiles.collections.IDictionary}. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {yfiles.graphml.Property} property The {@link yfiles.graphml.Property} that represents the property. + * @return {boolean} true if the property is a collection property. + */ + isCollectionProperty(context:yfiles.graphml.IWriteContext,property:yfiles.graphml.Property):boolean; + /** + * Gets the tag name for a member property. + * This implementation returns enclosingtag.propertyName + * @param {yfiles.graphml.Property} property The {@link yfiles.graphml.Property} that represents the property. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @return {string} The tag name for a member property property + */ + getMemberTagName(context:yfiles.graphml.IWriteContext,property:yfiles.graphml.Property):string; + /** + * Gets the XML attribute name for a member property. + * This implementation returns info.Name + * @param {yfiles.graphml.Property} property The {@link yfiles.graphml.Property} that represents the property. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @return {string} The XML attribute name for a member property property + */ + getMemberAttributeName(context:yfiles.graphml.IWriteContext,property:yfiles.graphml.Property):string; + /** + * Writes an XML element for a property. + * This method writes the enclosing tag (if necessary) and the content. + * @param {yfiles.graphml.Property} property The {@link yfiles.graphml.Property} that represents the property. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {yfiles.graphml.IXmlWriter} writer The output writer. + * @see {@link yfiles.graphml.XamlSerializer#shouldWriteMemberAsAttribute} + * @see {@link yfiles.graphml.XamlSerializer#shouldWriteEnclosingTag} + * @see {@link yfiles.graphml.XamlSerializer#getMemberTagName} + * @see {@link yfiles.graphml.XamlSerializer#writeMemberTagContent} + * @throws {yfiles.graphml.SerializationNotSupportedException} SerializationNotSupportedException. + */ + writeMemberTag(context:yfiles.graphml.IWriteContext,property:yfiles.graphml.Property,writer:yfiles.graphml.IXmlWriter):void; + /** + * Creates a {@link yfiles.graphml.IWriteContext} for nested property writes. + * This is needed to overwrite/reset some serialization properties on the current context. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @return {yfiles.graphml.IWriteContext} A {@link yfiles.graphml.IWriteContext} for nested property writes + */ + createMemberContentContext(context:yfiles.graphml.IWriteContext):yfiles.graphml.IWriteContext; + /** + * Determines whether an explicit enclosing tag should be written for a property. + * This is mainly meant for legacy code and special use cases, such as the handling of + * {@link yfiles.system.ContentPropertyAttribute}. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {yfiles.graphml.Property} property The {@link yfiles.graphml.Property} that represents the property. + * @return {boolean} true iff the member should be written with an enclosing property tag. + * @see {@link yfiles.graphml.GraphMLAttribute#writeEnclosingTag} + */ + shouldWriteEnclosingTag(context:yfiles.graphml.IWriteContext,property:yfiles.graphml.Property):boolean; + /** + * Determines whether property property should be written as attribute value or as complete + * element. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {yfiles.graphml.Property} property The {@link yfiles.system.PropertyInfo} that represents the property. + * @return {boolean} true iff the member should be written as an XML attribute value. + * @see {@link yfiles.graphml.GraphMLAttribute#writeAsAttribute} + */ + shouldWriteMemberAsAttribute(context:yfiles.graphml.IWriteContext,property:yfiles.graphml.Property):boolean; + /** + * Writes property property as an attribute value. + * @param {yfiles.graphml.Property} property The {@link yfiles.graphml.Property} that represents the property. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {yfiles.graphml.IXmlWriter} writer The output writer. + * @see {@link yfiles.graphml.XamlSerializer#getMemberAttributeName} + * @throws {yfiles.graphml.SerializationNotSupportedException} SerializationNotSupportedException. + */ + writeMemberAttribute(context:yfiles.graphml.IWriteContext,property:yfiles.graphml.Property,writer:yfiles.graphml.IXmlWriter):void; + /** + * Write an attribute value of undefined. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {yfiles.graphml.IXmlWriter} writer The output writer. + * @param {string} name The name of the attribute + */ + writeUndefinedAttributeValue(context:yfiles.graphml.IWriteContext,writer:yfiles.graphml.IXmlWriter,name:string):void; + /** + * Write an element that represents null. + * @param {yfiles.graphml.IWriteContext} context The current write context + */ + writeUndefinedElementValue(context:yfiles.graphml.IWriteContext):void; + /** + * Write an attribute value of null. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {yfiles.graphml.IXmlWriter} writer The output writer. + * @param {string} name The name of the attribute + */ + writeNullAttributeValue(context:yfiles.graphml.IWriteContext,writer:yfiles.graphml.IXmlWriter,name:string):void; + /** + * Write an element that represents null. + * @param {yfiles.graphml.IWriteContext} context The current write context + */ + writeNullElementValue(context:yfiles.graphml.IWriteContext):void; + /** + * Gets a {@link yfiles.system.TypeConverter} for the given parameters. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {yfiles.graphml.Property} descriptor The {@link yfiles.graphml.Property} that represents the property. + * @return {yfiles.system.TypeConverter} A {@link yfiles.system.ValueSerializer} for the given parameters + */ + getTypeConverter(context:yfiles.graphml.IWriteContext,descriptor:yfiles.graphml.Property):yfiles.system.TypeConverter; + /** + * Writes the XML element content for a property. + * This method writes only the content. It is called typically from within {@link yfiles.graphml.XamlSerializer#writeMemberTag} + * @param {yfiles.graphml.Property} property The {@link yfiles.graphml.Property} that represents the property. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @see {@link yfiles.graphml.XamlSerializer#writeMemberTag} + * @see {@link yfiles.graphml.XamlSerializer#serializeMember} + */ + writeMemberTagContent(context:yfiles.graphml.IWriteContext,property:yfiles.graphml.Property):void; + /** + * Write the property value in element syntax. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {yfiles.graphml.Property} property The {@link yfiles.graphml.Property} that represents the property. + * @throws {yfiles.graphml.SerializationNotSupportedException} Unable to create explicit Serializer instance + */ + serializeMember(context:yfiles.graphml.IWriteContext,property:yfiles.graphml.Property):void; + } + var XamlSerializer:{ + $class:yfiles.lang.Class; + }; + /** + * Custom attributes that allows to specify {@link yfiles.graphml.ISerializer} implementations for own + * data types. + * The GraphML framework evaluates this attribute when searching for an {@link yfiles.graphml.ISerializer} + * implementation for a custom data type. When this attribute is specified and no overriding implementation is + * provided via {@link yfiles.support.ILookup#lookup} for a concrete instance, the framework + * tries to: + *
    + *
  • Retrieve a shared serializer instance via a static property with name Instance
  • + *
  • If not successful, create a new instance of the type specified in the constructor of the attribute. + * In this case, the serializer class needs to provide a parameterless (default) constructor. + *
  • + *
+ * It is advised that all {@link yfiles.graphml.ISerializer} implementations implement the singleton + * pattern, thus allowing to share instances. + */ + export interface GraphMLSerializerAttribute extends yfiles.lang.Attribute{ + /** + * Get the type of the serialize that has been provided when creating the attribute. + */ + serializerType:yfiles.lang.Class; + } + var GraphMLSerializerAttribute:{ + $class:yfiles.lang.Class; + /** + * Create new attribute. + * @param {yfiles.lang.Class} serializerType The type of the serializer to use. The type must either + * provide a static Instance property to retrieve a shared instance at runtime or + * define a parameterless default constructor. + */ + new (serializerType:yfiles.lang.Class):yfiles.graphml.GraphMLSerializerAttribute; + }; + /** + * Abstract base class for implementations of the {@link yfiles.graphml.ISerializer} interface. + * This class implements {@link yfiles.graphml.ISerializer#serialize} in a way that allows to use + * {@link yfiles.graphml.ISerializer#serialize} directly as callback for the {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization} + * event, so no special handling for reference counting and other GraphML management issues is needed. + */ + export interface AbstractSerializer extends Object,yfiles.graphml.ISerializer{ + /** + * Default implementation of {@link yfiles.graphml.ISerializer#serialize}. + * This method implements {@link yfiles.graphml.ISerializer#serialize} in a way that allows it to be used + * directly as callback for the {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization} + * event, so no special handling for reference counting and other GraphML management issues is needed. + *

+ * The actual work of writing the content (if necessary) is delegated to {@link yfiles.graphml.AbstractSerializer#serializeCore} + *

+ * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {Object} item The item to serialize. + * @see Specified by {@link yfiles.graphml.ISerializer#serialize}. + */ + serialize(context:yfiles.graphml.IWriteContext,item:Object):void; + /** + * This method handles the actual writing of item itself. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {Object} item The item to serialize. + */ + serializeCore(context:yfiles.graphml.IWriteContext,item:Object):void; + } + var AbstractSerializer:{ + $class:yfiles.lang.Class; + }; + /** + * Implementation of {@link yfiles.graphml.IXmlWriter} that does nothing. + * The main use of this class is to serve as dummy class for the first step of two-pass writing. + */ + export interface NullXmlWriter extends yfiles.graphml.AbstractXmlWriter{ + /** + * Begin the output process. + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeStartDocument}. + */ + writeStartDocument():yfiles.graphml.IXmlWriter; + /** + * Close the document. + * This is typically used to actually flush the document to an output stream + * @see Specified by {@link yfiles.graphml.IXmlWriter#flushDocument}. + */ + flushDocument():void; + /** + * Write a text node. + * The string value of s will be correctly escaped + * @param {string} s The string that gets written as XML text + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeString}. + */ + writeString(s:string):yfiles.graphml.IXmlWriter; + /** + * Write a XML comment node. + * @param {string} comment The content of the comment + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeComment}. + */ + writeComment(comment:string):yfiles.graphml.IXmlWriter; + /** + * Close the output. + * Attempts to write after this method has been called will + * have undefined results. + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeEndDocument}. + */ + writeEndDocument():void; + /** + * The core method that actually writes the starting element. + * @param {string} prefix The prefix or null. + * @param {string} localName The name of the element. + * @param {string} namespace The namespace URI of the element. + */ + writeStartElementCore(prefix:string,s:string,ns:string):void; + /** + * The core method that actually writes an attribute. + * @param {string} prefix The prefix or null. + * @param {string} localName The name of the element. + * @param {string} namespace The namespace URI of the element. + * @param {string} value The value of the attribute. + */ + writeAttributeCore(prefix:string,localName:string,ns:string,value:string):void; + /** + * The core method that actually writes the end element. + */ + writeEndElementCore():void; + /** + * Write a document fragment. + * @param {Document} fragment + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeDocumentFragment}. + */ + writeDocumentFragment(fragment:Document):yfiles.graphml.IXmlWriter; + /** + * Write a xml processing instruction. + * @param {string} target The target of the PI + * @param {string} data The data of the PI + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeProcessingInstruction}. + */ + writeProcessingInstruction(target:string,data:string):yfiles.graphml.IXmlWriter; + /** + * Write a CDATA section. + * @param {string} content The content of the CDATA section + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeCData}. + */ + writeCData(content:string):yfiles.graphml.IXmlWriter; + closeCurrentElement(addEndTag:boolean):void; + } + var NullXmlWriter:{ + $class:yfiles.lang.Class; + new ():yfiles.graphml.NullXmlWriter; + }; + /** + * Event argument implementation that is used by the {@link yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener QueryOutputHandlers} + * event. + * These event arguments can be used to {@link yfiles.graphml.QueryOutputHandlersEventArgs#addOutputHandler add more} {@link yfiles.graphml.IOutputHandler} + * implementations to the {@link yfiles.graphml.GraphMLWriter} dynamically at the time of writing. + * @see {@link yfiles.graphml.GraphMLIOHandler} + */ + export interface QueryOutputHandlersEventArgs extends yfiles.system.EventArgs{ + /** + * Adds the given output handler to the set of registered output handlers for the given scope. + * @param {yfiles.graphml.IOutputHandler} handler The handler to add. + * @param {yfiles.graphml.KeyScope} scope The scope to use for the handler. + */ + addOutputHandler(handler:yfiles.graphml.IOutputHandler,scope:yfiles.graphml.KeyScope):void; + /** + * Gets the context for which the handlers are queried. + * Value: The context of the query. + */ + context:yfiles.graphml.IWriteContext; + } + var QueryOutputHandlersEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.QueryOutputHandlersEventArgs} class. + * @param {yfiles.graphml.IWriteContext} context The context to assign to the {@link yfiles.graphml.QueryOutputHandlersEventArgs#context} property. + * @param {yfiles.collections.IList.>} handlers The list of handlers to which the {@link yfiles.graphml.QueryOutputHandlersEventArgs#addOutputHandler} method will + * add the added instances. + */ + new (context:yfiles.graphml.IWriteContext,handlers:yfiles.collections.IList>):yfiles.graphml.QueryOutputHandlersEventArgs; + }; + /** + * Interface for classes that provide custom id's for core GraphML elements. + */ + export interface IGraphElementIdProvider extends Object{ + /** + * Get an ID for the specified graph object. + * @param {yfiles.graph.IGraph} graph The current graph object + * @param {yfiles.graphml.IWriteContext} context The current write context, for further information to the provider + * @return {string} an ID for the specified graph object + * @see Specified by {@link yfiles.graphml.IGraphElementIdProvider#getGraphId}. + */ + getGraphId(graph:yfiles.graph.IGraph,context:yfiles.graphml.IWriteContext):string; + /** + * Get an ID for the specified node object. + * @param {yfiles.graph.INode} node The current graph object + * @param {yfiles.graphml.IWriteContext} context The current write context, for further information to the provider + * @return {string} an ID for the specified graph object + * @see Specified by {@link yfiles.graphml.IGraphElementIdProvider#getNodeId}. + */ + getNodeId(node:yfiles.graph.INode,context:yfiles.graphml.IWriteContext):string; + /** + * Get an ID for the specified edge object. + * @param {yfiles.graph.IEdge} edge The current graph object + * @param {yfiles.graphml.IWriteContext} context The current write context, for further information to the provider + * @return {string} an ID for the specified edge object + * @see Specified by {@link yfiles.graphml.IGraphElementIdProvider#getEdgeId}. + */ + getEdgeId(edge:yfiles.graph.IEdge,context:yfiles.graphml.IWriteContext):string; + /** + * Get an ID for the specified port object. + * @param {yfiles.graph.IPort} port The current port object + * @param {yfiles.graphml.IWriteContext} context The current write context, for further information to the provider + * @return {string} an ID for the specified port object + * @see Specified by {@link yfiles.graphml.IGraphElementIdProvider#getPortId}. + */ + getPortId(port:yfiles.graph.IPort,context:yfiles.graphml.IWriteContext):string; + } + var IGraphElementIdProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Core writer class for GraphML. + * This class allows for low-level customization of the writing process. Usually, it is used by {@link yfiles.graphml.GraphMLIOHandler}'s + * write method which calls GraphMLWriter.write. It should rarely be necessary to use this class directly. + * @see {@link yfiles.graphml.GraphMLIOHandler} + */ + export interface GraphMLWriter extends Object{ + /** + * Subscribe to this event to provide custom serialization handling for XML content. + * The current item is provided by {@link yfiles.graphml.HandleSerializationEventArgs#item}. + * @see {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization} + */ + addHandleSerializationListener(value:(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs)=> void):void; + /** + * Subscribe to this event to provide custom serialization handling for XML content. + * The current item is provided by {@link yfiles.graphml.HandleSerializationEventArgs#item}. + * @see {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization} + */ + removeHandleSerializationListener(value:(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs)=> void):void; + /** + * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IOutputHandler} instance(s) for + * a given GraphML attribute key definition. + * If you want to register an {@link yfiles.graphml.IOutputHandler} for this GraphML attribute, + * you can add the handler with {@link yfiles.graphml.QueryOutputHandlersEventArgs#addOutputHandler}. + * @see {@link yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener QueryOutputHandlers} + */ + addQueryOutputHandlersListener(value:(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs)=> void):void; + /** + * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IOutputHandler} instance(s) for + * a given GraphML attribute key definition. + * If you want to register an {@link yfiles.graphml.IOutputHandler} for this GraphML attribute, + * you can add the handler with {@link yfiles.graphml.QueryOutputHandlersEventArgs#addOutputHandler}. + * @see {@link yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener QueryOutputHandlers} + */ + removeQueryOutputHandlersListener(value:(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs)=> void):void; + /** + * This event can be used to provide names of external references for objects. + * These reference targets are not serialized to the GraphML file. + * @see {@link yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener QueryReferenceId} + */ + addQueryReferenceIdListener(value:(sender:Object,e:yfiles.graphml.QueryReferenceIdEventArgs)=> void):void; + /** + * This event can be used to provide names of external references for objects. + * These reference targets are not serialized to the GraphML file. + * @see {@link yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener QueryReferenceId} + */ + removeQueryReferenceIdListener(value:(sender:Object,e:yfiles.graphml.QueryReferenceIdEventArgs)=> void):void; + /** + * Register default event handlers for the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} event. + * This implementation does not register any default event handlers + * @see {@link yfiles.graphml.GraphMLIOHandler#configureSerializationHandlers} + */ + registerDefaultSerializers():void; + /** + * Register default event handlers for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event. + * This implementation does not register any default event handlers + * @see {@link yfiles.graphml.GraphMLIOHandler#configureOutputHandlers} + */ + registerDefaultOutputHandlers():void; + /** + * Fires the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} event. + * @param {yfiles.graphml.HandleSerializationEventArgs} args The arguments that get passed to the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} event. + * @see {@link yfiles.graphml.GraphMLIOHandler#onHandleSerialization} + */ + onHandleSerialization(args:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Fires the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event. + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} args The arguments that get passed to the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event. + * @see {@link yfiles.graphml.GraphMLIOHandler#onQueryOutputHandlers} + */ + onQueryOutputHandlers(args:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Fires the {@link yfiles.graphml.GraphMLWriter#addQueryReferenceIdListener QueryReferenceId} event. + * @param {yfiles.graphml.QueryReferenceIdEventArgs} args The arguments that get passed to the {@link yfiles.graphml.GraphMLWriter#addQueryReferenceIdListener QueryReferenceId} event. + * @see {@link yfiles.graphml.GraphMLIOHandler#onQueryReferenceId} + */ + onQueryReferenceId(args:yfiles.graphml.QueryReferenceIdEventArgs):void; + /** + * Dynamically retrieve all {@link yfiles.graphml.IOutputHandler} that should be used for the current write process. + * Typically, this method is called only indirectly by the write process. + * This implementation calls {@link yfiles.graphml.GraphMLWriter#onQueryOutputHandlers}, which in + * turn raises the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @return {yfiles.collections.IDictionary.>} A dictionary with {@link yfiles.graphml.KeyScope}s as keys and a list of {@link yfiles.graphml.IOutputHandler IOutputHandlers} + * for each scope as values. + */ + getOutputHandlers(context:yfiles.graphml.IWriteContext):yfiles.collections.IDictionary>; + /** + * Serialize item. + * Typically, this method is called only indirectly by calls to {@link yfiles.graphml.IWriteContext#serialize} or + * {@link yfiles.graphml.WriteContextExtensions#serialize}. This implementation calls {@link yfiles.graphml.GraphMLWriter#onHandleSerialization}, which in + * turn raises the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} event. + * @param {yfiles.graphml.IWriteContext} context The current parse context. + * @param {T} item The object that should be serialized. + * @see {@link yfiles.graphml.IWriteContext#serialize} + * @see {@link yfiles.graphml.WriteContextExtensions#serialize} + * @see {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} + * @throws {yfiles.graphml.SerializationNotSupportedException} SerializationNotSupportedException if item cannot be serialized. + */ + serialize(targetType:yfiles.lang.Class,context:yfiles.graphml.IWriteContext,item:T):void; + /** + * Set a serialization property that allows to fine tune the write process. + * @param {yfiles.support.TypedKey.} key The key for the property. + * @param {T} value The property value. + * @see {@link yfiles.graphml.IWriteContext#getSerializationProperty} + */ + setSerializationProperty(key:yfiles.support.TypedKey,value:T):void; + /** + * Remove a serialization property that has been set by {@link yfiles.graphml.GraphMLWriter#setSerializationProperty}. + * @param {yfiles.support.TypedKey.} key The key for the property. + * @see {@link yfiles.graphml.IWriteContext#getSerializationProperty} + */ + removeSerializationProperty(key:yfiles.support.TypedKey):void; + /** + * Retrieve a serialization property that has been set by {@link yfiles.graphml.GraphMLWriter#setSerializationProperty}. + * The return value is automatically converted to type T. + * @param {yfiles.support.TypedKey.} key The key for the property. + * @see {@link yfiles.graphml.IWriteContext#getSerializationProperty} + */ + getSerializationProperty(tType:yfiles.lang.Class,key:yfiles.support.TypedKey):T; + /** + * Register an implementation of T for use with {@link yfiles.graphml.GraphMLWriter#lookup}. + * @param {T} instance The implementation of T for lookup retrieval. + */ + setLookup(tType:yfiles.lang.Class,instance:T):void; + /** + * Remove an implementation of T that has been set with {@link yfiles.graphml.GraphMLWriter#setLookup}. + */ + removeLookup(tType:yfiles.lang.Class):void; + /** + * Dynamically retrieve an instance of type. + * @param {yfiles.lang.Class} type The type for which an implementation is needed. + * @return {Object} An implementation of type, or null. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Create the initial {@link yfiles.graphml.IWriteContext} instance. + * @param {yfiles.graph.IGraph} graph The graph that is written. + * @param {yfiles.graphml.IXmlWriter} writer The core {@link yfiles.graphml.IXmlWriter} instance that does the actual writing of XML content. + * @return {yfiles.graphml.IWriteContext} An {@link yfiles.graphml.IWriteContext} instance that is suitable for graph. + */ + createWriteContext(graph:yfiles.graph.IGraph,writer:yfiles.graphml.IXmlWriter):yfiles.graphml.IWriteContext; + /** + * This property allows to access the events in the internal {@link yfiles.graphml.IWriteEvents} implementation. + * You can subscribe to any of the events in the returned {@link yfiles.graphml.IWriteEvents} instance to react to + * various steps in the writing process + */ + writeEvents:yfiles.graphml.IWriteEvents; + /** + * Write the GraphML representation of graph, using writer for the actual XML generation. + * Typically, this method is called indirectly from + * {@link yfiles.graphml.GraphMLIOHandler#write}. + * @param {yfiles.graph.IGraph} graph The graph instance that is populated. + * @param {yfiles.graphml.IXmlWriter} writer The writer that actually writes the XML content. + * @see {@link yfiles.graphml.GraphMLIOHandler#write} + */ + write(graph:yfiles.graph.IGraph,writer:yfiles.graphml.IXmlWriter):void; + /** + * Raises the {@link yfiles.graphml.GraphMLWriter#addWritingListener Writing} event. + * This method is called just before the writing starts and before {@link yfiles.graphml.IWriteEvents#addDocumentWritingListener DocumentWriting} + * is called for the first time. + * @param {yfiles.graphml.WriteEventArgs} args The {@link yfiles.graphml.WriteEventArgs} instance containing the event data. + * @see {@link yfiles.graphml.GraphMLWriter#addWritingListener Writing} + */ + onWriting(args:yfiles.graphml.WriteEventArgs):void; + /** + * Occurs when the writing of a document is just about to begin. + * This event can be used to register to the fine-grained events available in + * the {@link yfiles.graphml.WriteEventArgs#context}'s {@link yfiles.graphml.IWriteContext#writeEvents} and + * to configure the writing process on a per write case. + * @see {@link yfiles.graphml.GraphMLWriter#onWriting} + */ + addWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs when the writing of a document is just about to begin. + * This event can be used to register to the fine-grained events available in + * the {@link yfiles.graphml.WriteEventArgs#context}'s {@link yfiles.graphml.IWriteContext#writeEvents} and + * to configure the writing process on a per write case. + * @see {@link yfiles.graphml.GraphMLWriter#onWriting} + */ + removeWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + } + export module GraphMLWriter{ + /** + * {@link yfiles.graphml.IOutputHandler} implementation that is responsible for writing shared resources + * to GraphML. + * This class is used to write the XML representation of the referenced objects. The actual references + * themselves are not written by this handler. + * @see {@link yfiles.graphml.GraphMLReferenceExtension} + * @see {@link yfiles.graphml.GraphMLIOHandler#writeSharedReferences} + */ + export interface ReferencesOutputHandler extends Object,yfiles.graphml.IOutputHandler{ + /** + * Get or set a list of {@link yfiles.graphml.IReferenceHandle}s that should be written by this handler. + */ + internalReferences:yfiles.collections.IEnumerable; + /** + * Fixed to {@link yfiles.graphml.WritePrecedence#BEFORE_CHILDREN}. + * @see Specified by {@link yfiles.graphml.IOutputHandler#precedence}. + */ + precedence:yfiles.graphml.WritePrecedence; + /** + * Gets the XML attributes that should be added to the key definition in the GraphML key element. + * Value: The key definition attributes. + * @see Specified by {@link yfiles.graphml.IOutputHandler#keyDefinitionAttributes}. + */ + keyDefinitionAttributes:yfiles.collections.IEnumerable; + /** + * Gets the XML attributes that should be added to the data element. + * Value: The attributes for the data element. + * @see Specified by {@link yfiles.graphml.IOutputHandler#dataTagAttributes}. + */ + dataTagAttributes:yfiles.collections.IEnumerable; + /** + * Determines whether in the current context, the value is the default value and therefore + * no data element needs to be written. + * @param {yfiles.graphml.IWriteContext} ctx The context. + * @return {boolean} + * true if for the current context the default value applies and therefore no data element needs to be written. + * @see Specified by {@link yfiles.graphml.IOutputHandler#isDefaultValue}. + */ + isDefaultValue(ctx:yfiles.graphml.IWriteContext):boolean; + /** + * Actually writes the value for the current context. + * At the time this method is called, the surrounding + * 'data' element has already been written. + * @param {yfiles.graphml.IWriteContext} ctx The context. + * @see Specified by {@link yfiles.graphml.IOutputHandler#writeValue}. + */ + writeValue(ctx:yfiles.graphml.IWriteContext):void; + /** + * Writes the contents of the key definition. + * At the time this method is called, the surrounding + * 'key' element has already been written. However no 'default' element is written by the framework. + * @param {yfiles.graphml.IWriteContext} ctx The context. + * @see Specified by {@link yfiles.graphml.IOutputHandler#writeKeyDefinitionContent}. + */ + writeKeyDefinitionContent(ctx:yfiles.graphml.IWriteContext):void; + } + } + var GraphMLWriter:{ + $class:yfiles.lang.Class; + new ():yfiles.graphml.GraphMLWriter; + ReferencesOutputHandler:{ + $class:yfiles.lang.Class; + /** + * Create a new instance with no internal references initially. + */ + new ():yfiles.graphml.GraphMLWriter; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface GraphMLReferenceExtension extends yfiles.system.MarkupExtension{ + /** + * The key to the resource that will be used to lookup the value. + */ + resourceKey:string; + /** + * Note that this method will only work as expected if used within the GraphML parser. + * @param {yfiles.support.ILookup} serviceProvider The service provider instance. + * @return {Object} The instance or null. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var GraphMLReferenceExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.graphml.GraphMLReferenceExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + WithResourceKey:{ + new (resourceKey:string):yfiles.graphml.GraphMLReferenceExtension; + }; + }; + /** + * Exception that will be thrown by the {@link yfiles.graphml.IWriteContext#serialize} method + * and the like to indicate that the deserialization failed. + */ + export interface SerializationNotSupportedException extends yfiles.system.IOException{ + } + var SerializationNotSupportedException:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.SerializationNotSupportedException} class. + */ + new ():yfiles.graphml.SerializationNotSupportedException; + /** + * Initializes a new instance of the {@link yfiles.graphml.SerializationNotSupportedException} class with the given message. + * @param {string} message The message. + */ + WithMessage:{ + new (message:string):yfiles.graphml.SerializationNotSupportedException; + }; + /** + * Initializes a new instance of the {@link yfiles.graphml.SerializationNotSupportedException} class + * using the given message and inner exception. + * @param {string} message The message. + * @param {yfiles.lang.Exception} inner The inner exception. + */ + WithMessageAndInnerException:{ + new (message:string,inner:yfiles.lang.Exception):yfiles.graphml.SerializationNotSupportedException; + }; + }; + /** + * Extension methods for {@link yfiles.graphml.IWriteContext}. + */ + export interface WriteContextExtensions extends Object{ + } + var WriteContextExtensions:{ + $class:yfiles.lang.Class; + /** + * Serialize the item. + * This method calls {@link yfiles.graphml.IWriteContext#serialize} with context as first argument and + * should be used in virtually all cases. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {T} item The object that should be serialized. + * @see {@link yfiles.graphml.IWriteContext#serialize} + * @throws {yfiles.graphml.SerializationNotSupportedException} + */ + serialize(targetType:yfiles.lang.Class,context:yfiles.graphml.IWriteContext,item:T):void; + /** + * Serializes the specified item using the provided type information. + * item should be assignable to type t. + * This method simply delegates to {@link yfiles.graphml.IWriteContext#serialize}, using the + * correct type parameter. + * @param {yfiles.graphml.IWriteContext} context The context to write the item in. + * @param {Object} item The item to serialize. + * @param {yfiles.lang.Class} t The type the item is known to be of at deserialization time. + */ + serializeWithItemAndType(context:yfiles.graphml.IWriteContext,item:Object,t:yfiles.lang.Class):void; + /** + * Serialize an replacement object replacement instead of the original originalItem. + * Calling this method allows to remember the original object instance, even if the object is really written through + * a {@link yfiles.system.MarkupExtension} or similar replacement mechanisms. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {Object} originalItem The original object that should be serialized. + * @param {T} replacement The replacement object that will actually be serialized instead. + * @see {@link yfiles.graphml.IWriteContext#serialize} + * @throws {yfiles.graphml.SerializationNotSupportedException} + */ + serializeReplacement(targetType:yfiles.lang.Class,context:yfiles.graphml.IWriteContext,originalItem:Object,replacement:T):void; + /** + * Typesafe alternative for {@link yfiles.graphml.IWriteContext#currentObject}. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @return {T} {@link yfiles.graphml.IWriteContext#currentObject} as an instance of T. + * @see {@link yfiles.graphml.IWriteContext#currentObject} + */ + getCurrent(context:yfiles.graphml.IWriteContext):T; + }; + /** + * An implementation that can read (a subset of) XAML formatted XML content. + */ + export interface XamlReader extends Object{ + /** + * Deserializes the specified node in the context to an instance. + * @param {yfiles.graphml.IParseContext} context The context. + * @param {Node} domNode The DOM node. + * @return {Object} The instance that is described in the XML. + */ + deserialize(context:yfiles.graphml.IParseContext,domNode:Node):Object; + /** + * Parses and applies the attribute and nested properties of node to instance. + * instance is already created by the XAML parsing framework. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {Element} node The toplevel XML node. + * @param {Object} instance The current target object. + */ + parseProperties(context:yfiles.graphml.IParseContext,node:Element,instance:Object):void; + /** + * Parses and applies all child node content of node to instance. + * Child nodes may be either in property element syntax or describe the value + * of a property marked with a {@link yfiles.system.ContentPropertyAttribute}. + * @param {yfiles.graphml.IParseContext} context The context. + * @param {Element} node Then node to parse. + * @param {Object} instance The instance to assign the values to. + */ + parseChildNodes(context:yfiles.graphml.IParseContext,node:Element,instance:Object):void; + /** + * Gets the {@link Object} for the property marked as {@link yfiles.system.ContentPropertyAttribute ContentProperty}, + * or null if no such property exists. + * @param {Object} instance The target object. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @return {yfiles.system.PropertyInfo} The {@link yfiles.system.ContentPropertyAttribute ContentProperty}, or null + * if no such property exists. + */ + getContentPropertyForInstance(context:yfiles.graphml.IParseContext,instance:Object):yfiles.system.PropertyInfo; + /** + * Gets the {@link Object} for the property marked as {@link yfiles.system.ContentPropertyAttribute ContentProperty}, + * or null if no such property exists. + * @param {yfiles.lang.Class} type The type of the object + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @return {yfiles.system.PropertyInfo} The {@link yfiles.system.ContentPropertyAttribute ContentProperty}, or null + * if no such property exists. + */ + getContentPropertyForType(context:yfiles.graphml.IParseContext,type:yfiles.lang.Class):yfiles.system.PropertyInfo; + /** + * Returns true iff info is a collection property. + * Currently, only properties with a type derived from + * {@link yfiles.objectcollections.IList}, {@link yfiles.objectcollections.IDictionary}, {@link yfiles.objectcollections.IList}, and {@link yfiles.collections.IDictionary} are supported. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {Object} instance The target instance. + * @param {yfiles.system.PropertyInfo} info The property descriptor. + * @return {boolean} true iff info is a collection property. + */ + isCollectionProperty(context:yfiles.graphml.IParseContext,instance:Object,info:yfiles.system.PropertyInfo):boolean; + /** + * Parses and applies singleContentNode to a non-collection typed property. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {Node} singleContentNode A single XML node that describes a non-collection typed property. + * @param {Object} instance The target instance. + * @param {yfiles.system.PropertyInfo} propertyDescriptor A non-collection typed property. + */ + parseSingleChildProperty(context:yfiles.graphml.IParseContext,singleContentNode:Node,instance:Object,propertyDescriptor:yfiles.system.PropertyInfo):void; + /** + * Parses and applies collectionContent to a collection typed property. + * propertyDescriptor must point to an already existing instance of a collection type which has to be + * provided by instance (e.g. through a {@link yfiles.system.MarkupExtension}). + *

Currently, only properties with a type derived from {@link yfiles.objectcollections.IList}, {@link yfiles.collections.ICollection}, + * {@link yfiles.objectcollections.IDictionary}, and {@link yfiles.collections.IDictionary} are supported.

+ * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {yfiles.collections.IEnumerable.} collectionContent A list of child content that is inserted in the collection as single elements. + * @param {Object} instance The target instance. + * @param {yfiles.system.PropertyInfo} propertyDescriptor A non-collection typed property. + * @see {@link yfiles.graphml.XamlReader#isCollectionProperty} + * @see {@link yfiles.graphml.XamlReader#assignListValues} + * @see {@link yfiles.graphml.XamlReader#assignCollectionValues} + */ + parseCollectionProperty(context:yfiles.graphml.IParseContext,collectionContent:yfiles.collections.IEnumerable,instance:Object,propertyDescriptor:yfiles.system.PropertyInfo):void; + /** + * Parses and assigns the single element values in collectionContent to list. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {yfiles.collections.IEnumerable.} collectionContent List of XML nodes forming the collection content. + * @param {yfiles.objectcollections.IList} list The target list. + * @see {@link yfiles.graphml.XamlReader#assignCollectionValues} + */ + assignListValues(context:yfiles.graphml.IParseContext,collectionContent:yfiles.collections.IEnumerable,list:yfiles.objectcollections.IList):void; + /** + * Parses and assigns the single element values in collectionContent to collection. + * @param {yfiles.collections.ICollection.} collection The target collection. + * @param {yfiles.collections.IEnumerable.} collectionContent List of XML nodes forming the collection content. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @see {@link yfiles.graphml.XamlReader#assignListValues} + */ + assignCollectionValues(context:yfiles.graphml.IParseContext,collectionContent:yfiles.collections.IEnumerable,collection:yfiles.collections.ICollection):void; + /** + * Parses and assigns the single element values in collectionContent to the dictionary. + * @param {yfiles.collections.IDictionary.} dictionary The target dictionary. + * @param {yfiles.collections.IEnumerable.} collectionContent List of XML nodes forming the collection content. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @see {@link yfiles.graphml.XamlReader#assignCollectionValues} + */ + assignDictionaryValuesGeneric(context:yfiles.graphml.IParseContext,collectionContent:yfiles.collections.IEnumerable,dictionary:yfiles.collections.IDictionary):void; + /** + * Parses and assigns the single element values in collectionContent to the dictionary. + * @param {yfiles.objectcollections.IDictionary} dictionary The target dictionary. + * @param {yfiles.collections.IEnumerable.} collectionContent List of XML nodes forming the collection content. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @see {@link yfiles.graphml.XamlReader#assignCollectionValues} + */ + assignDictionaryValues(context:yfiles.graphml.IParseContext,collectionContent:yfiles.collections.IEnumerable,dictionary:yfiles.objectcollections.IDictionary):void; + /** + * Parses and applies all attribute values of node to instance. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {Element} node The toplevel XML node. + * @param {Object} instance The target instance + */ + parseXmlAttributes(context:yfiles.graphml.IParseContext,node:Element,instance:Object):void; + /** + * Parses and applies the single attribute value attribute to instance. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {Attr} attribute The XML attribute to parse. + * @param {Object} instance The target instance + */ + parseXmlAttribute(context:yfiles.graphml.IParseContext,attribute:Attr,instance:Object):void; + } + var XamlReader:{ + $class:yfiles.lang.Class; + }; + /** + * Interface for mapping prefixes to namespaces and vice versa. + */ + export interface IXmlPrefixMapper extends Object{ + /** + * Gets the prefix of namespace. + * @param {string} ns The namespace. + * @return {string} The prefix to use. + * @see Specified by {@link yfiles.graphml.IXmlPrefixMapper#getPrefixOfNamespace}. + */ + getPrefixOfNamespace(ns:string):string; + /** + * Gets the namespace for the given prefix. + * @param {string} prefix The prefix. + * @return {string} The namespace. + * @see Specified by {@link yfiles.graphml.IXmlPrefixMapper#getNamespaceOfPrefix}. + */ + getNamespaceOfPrefix(prefix:string):string; + } + var IXmlPrefixMapper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class handles the deserialization of XAML content in GraphML. + * This implementation delegates to {@link yfiles.graphml.XamlReader}. + */ + export interface XamlDeserializer extends Object{ + } + var XamlDeserializer:{ + $class:yfiles.lang.Class; + /** + * Callback for the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. + * @param {Object} source The source of the event. + * @param {yfiles.graphml.HandleDeserializationEventArgs} args The event arguments. + * @see {@link yfiles.graphml.HandleDeserializationEventArgs} + */ + handleDeserialization(source:Object,args:yfiles.graphml.HandleDeserializationEventArgs):void; + }; + /** + * This class handles the deserialization of pure text node content. + */ + export interface TextNodeDeserializer extends Object{ + } + var TextNodeDeserializer:{ + $class:yfiles.lang.Class; + /** + * Callback for the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. + * @param {Object} source The source of the event. + * @param {yfiles.graphml.HandleDeserializationEventArgs} args The event arguments. + * @see {@link yfiles.graphml.HandleDeserializationEventArgs} + */ + handleDeserialization(source:Object,args:yfiles.graphml.HandleDeserializationEventArgs):void; + }; + /** + * Abstract base class for a generic {@link yfiles.system.MarkupExtension} + * that can be used to write XAML markup. + * Method {@link yfiles.graphml.GenericMarkupExtension#convertFrom} can be used to initialize this instance before writing. + */ + export interface GenericMarkupExtension extends yfiles.system.MarkupExtension{ + /** + * Initializes the state of this instance from the given object. + * @param {T} t The object. + */ + convertFrom(t:T):void; + } + var GenericMarkupExtension:{ + $class:yfiles.lang.Class; + new ():yfiles.graphml.GenericMarkupExtension; + }; + /** + * Common interface for all classes that can serialize an object. + * It is advised that implementers use abstract + * implementation classes like {@link yfiles.graphml.AbstractSerializer} + * instead as base classes. + */ + export interface ISerializer extends Object{ + /** + * Serialize the given style to a {@link yfiles.graphml.IXmlWriter}. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {Object} subject The actual object + * @see Specified by {@link yfiles.graphml.ISerializer#serialize}. + */ + serialize(context:yfiles.graphml.IWriteContext,subject:Object):void; + } + var ISerializer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Special implementation of {@link yfiles.graphml.GraphMLValueSerializerContext} that should be used in a GraphML parse context. + */ + export interface GraphMLParseValueSerializerContext extends yfiles.graphml.GraphMLValueSerializerContext{ + /** + * Returns the wrapped {@link yfiles.graphml.IParseContext} for this serviceType, otherwise + * null. + * @param {yfiles.lang.Class} serviceType The serviceType + * @return {Object} the wrapped {@link yfiles.graphml.IParseContext} for this serviceType, otherwise + * null + * @see Overrides {@link yfiles.graphml.GraphMLValueSerializerContext#lookup} + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(serviceType:yfiles.lang.Class):Object; + } + var GraphMLParseValueSerializerContext:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that wraps parseContext. + * @param {yfiles.graphml.IParseContext} parseContext The current write context + */ + new (parseContext:yfiles.graphml.IParseContext):yfiles.graphml.GraphMLParseValueSerializerContext; + }; + /** + * Special implementation of {@link yfiles.graphml.GraphMLValueSerializerContext} that should be used in a GraphML write context. + */ + export interface GraphMLWriteValueSerializerContext extends yfiles.graphml.GraphMLValueSerializerContext{ + /** + * Returns the wrapped {@link yfiles.graphml.IWriteContext} for this serviceType, otherwise + * null. + * @param {yfiles.lang.Class} serviceType The serviceType + * @return {Object} the wrapped {@link yfiles.graphml.IWriteContext} for this serviceType, otherwise + * null + * @see Overrides {@link yfiles.graphml.GraphMLValueSerializerContext#lookup} + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(serviceType:yfiles.lang.Class):Object; + } + var GraphMLWriteValueSerializerContext:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that wraps writeContext. + * @param {yfiles.graphml.IWriteContext} writeContext The current write context + */ + new (writeContext:yfiles.graphml.IWriteContext):yfiles.graphml.GraphMLWriteValueSerializerContext; + }; + /** + * Special implementation of {@link yfiles.system.IValueSerializerContext} that should be used in a GraphML context. + */ + export interface GraphMLValueSerializerContext extends Object,yfiles.system.IValueSerializerContext{ + /** + * Does nothing. + * @return {boolean} Returns true + * @see Specified by {@link yfiles.system.ITypeDescriptorContext#onComponentChanging}. + */ + onComponentChanging():boolean; + /** + * Does nothing. + * @see Specified by {@link yfiles.system.ITypeDescriptorContext#onComponentChanged}. + */ + onComponentChanged():void; + /** + * Returns null. + * @return Returns null + * @see Specified by {@link yfiles.system.ITypeDescriptorContext#container}. + */ + container:Object; + instance:Object; + propertyDescriptor:Object; + /** + * The parent object of {@link yfiles.graphml.GraphMLValueSerializerContext#instance}, if such an object exists currently. + */ + owner:Object; + /** + * Gets the value serializer for a specific type. + * @param {yfiles.lang.Class} type The type to obtain a serializer for. + * @return {yfiles.system.ValueSerializer} A serializer or null. + * @see Specified by {@link yfiles.system.IValueSerializerContext#getValueSerializerFor}. + */ + getValueSerializerFor(type:yfiles.lang.Class):yfiles.system.ValueSerializer; + /** + * Gets the value serializer for a specific {@link yfiles.system.PropertyInfo}. + * @param {yfiles.system.PropertyInfo} p The descriptor of the property. + * @return {yfiles.system.ValueSerializer} A serializer or null. + * @see Specified by {@link yfiles.system.IValueSerializerContext#getValueSerializerForPropertyInfo}. + */ + getValueSerializerForPropertyInfo(descriptor:yfiles.system.PropertyInfo):yfiles.system.ValueSerializer; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(serviceType:yfiles.lang.Class):Object; + } + var GraphMLValueSerializerContext:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.GraphMLValueSerializerContext} class. + */ + new ():yfiles.graphml.GraphMLValueSerializerContext; + }; + /** + * Interface for classes that can provide custom {@link yfiles.system.ValueSerializer} implementations for GraphML serialization. + */ + export interface IValueSerializerProvider extends Object{ + /** + * Get a {@link yfiles.system.ValueSerializer} implementation that can convert the current value of descriptor + * for the target object subject. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {yfiles.system.PropertyInfo} descriptor Describes the property + * @param {Object} subject The target object + * @param {yfiles.system.IValueSerializerContext} serializerContext Context for the ValueSerializer + * @return {yfiles.system.ValueSerializer} A {@link yfiles.system.ValueSerializer} instance that can convert the current value of descriptor + * for the target object subject, or null + * if no such converter exists. + * @see Specified by {@link yfiles.graphml.IValueSerializerProvider#getValueSerializerForWriting}. + */ + getValueSerializerForWriting(context:yfiles.graphml.IWriteContext,descriptor:yfiles.system.PropertyInfo,subject:Object,serializerContext:yfiles.system.IValueSerializerContext):yfiles.system.ValueSerializer; + /** + * Get a {@link yfiles.system.ValueSerializer} implementation that can convert the current value of descriptor + * for the target object subject. + * @param {yfiles.graphml.IParseContext} context The current parse context + * @param {yfiles.system.PropertyInfo} descriptor Describes the property + * @param {Object} subject The target object + * @param {yfiles.lang.Class} destinationType The type to the serializer should support as destination. + * @param {yfiles.system.IValueSerializerContext} serializerContext Context for the ValueSerializer + * @return {yfiles.system.ValueSerializer} A {@link yfiles.system.ValueSerializer} instance that can convert the current value of descriptor + * for the target object subject, or null + * if no such converter exists. + * @see Specified by {@link yfiles.graphml.IValueSerializerProvider#getValueSerializerForParsing}. + */ + getValueSerializerForParsing(context:yfiles.graphml.IParseContext,descriptor:yfiles.system.PropertyInfo,subject:Object,destinationType:yfiles.lang.Class,serializerContext:yfiles.system.IValueSerializerContext):yfiles.system.ValueSerializer; + } + var IValueSerializerProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Utility class that facilitates writing of markup extensions as attributes. + */ + export interface IXamlNamespaceMapper extends Object{ + /** + * Returns the XAML namespace URI that belongs to type t. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {yfiles.lang.Class} t The type for which an XML namespace mapping is searched. + * @return {string} the XAML namespace URI that belongs to type t + * @see Specified by {@link yfiles.graphml.IXamlNamespaceMapper#getXamlNamespace}. + */ + getXamlNamespace(context:yfiles.graphml.IWriteContext,t:yfiles.lang.Class):string; + /** + * Returns the XAML namespace prefix that maps to type nsUri. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {string} nsUri The type for which an XML namespace mapping is searched. + * @return {string} the XAML namespace prefix that belongs to type nsUri, or null + * if no such mapping exists. + * @see Specified by {@link yfiles.graphml.IXamlNamespaceMapper#getXamlNamespacePrefix}. + */ + getXamlNamespacePrefix(context:yfiles.graphml.IWriteContext,nsUri:string):string; + /** + * Overrides or specifies a namespace mapping for a specific type. + * Specifying this mapping overrides all weaker rules for namespace determination of type, i.e. + * calls to {@link yfiles.graphml.IXamlNamespaceMapper#getXamlNamespace} for type will always return ns. + * @param {string} ns The xml namespace that should be used for this type. + * @param {yfiles.lang.Class} type The type to map. + * @see Specified by {@link yfiles.graphml.IXamlNamespaceMapper#addMappingForType}. + */ + addMappingForType(ns:string,type:yfiles.lang.Class):void; + /** + * Overrides or specifies a namespace mapping for a CLR namespace in a given assembly. + * Specifying this mapping overrides all weaker rules for namespace determination of clrNS. + * @param {string} xmlNs The xml namespace that should be used for this type. + * @param {string} clrNS The CLR namespace to map. + * @param {yfiles.lang.Assembly} assembly The assembly to map. + * @see Specified by {@link yfiles.graphml.IXamlNamespaceMapper#addMappingForNamespace}. + */ + addMappingForNamespace(xmlNs:string,clrNS:string,assembly:yfiles.lang.Assembly):void; + /** + * Overrides or specifies a namespace mapping for a CLR namespace in a given assembly. + * Specifying this mapping overrides all weaker rules for namespace determination of clrNS. + * @param {string} xmlNs The xml namespace that should be used for this type. + * @param {string} prefix The namespace prefix + * @param {string} clrNS The CLR namespace to map. + * @param {yfiles.lang.Assembly} assembly The assembly to map. + * @see Specified by {@link yfiles.graphml.IXamlNamespaceMapper#addMappingForNamespaceWithPrefix}. + */ + addMappingForNamespaceWithPrefix(xmlNs:string,prefix:string,clrNS:string,assembly:yfiles.lang.Assembly):void; + } + var IXamlNamespaceMapper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Utility class for determining type information from XML elements. + */ + export interface IXamlTypeMapper extends Object{ + /** + * This event can be used to resolve xml namespaces to {@link yfiles.graphml.ClrNamespaceDescriptor}s. + * It can be used to dynamically resolve xml namespaces where no mapping has been added before. + * @see {@link yfiles.graphml.ResolveXmlNamespaceEventArgs} + */ + addResolveXmlNamespaceListener(value:(sender:Object,e:yfiles.graphml.ResolveXmlNamespaceEventArgs)=> void):void; + /** + * This event can be used to resolve xml namespaces to {@link yfiles.graphml.ClrNamespaceDescriptor}s. + * It can be used to dynamically resolve xml namespaces where no mapping has been added before. + * @see {@link yfiles.graphml.ResolveXmlNamespaceEventArgs} + */ + removeResolveXmlNamespaceListener(value:(sender:Object,e:yfiles.graphml.ResolveXmlNamespaceEventArgs)=> void):void; + /** + * Returns a {@link yfiles.lang.Class} that matches the given xmlNamespace and tagName of an XML element. + * Both xmlNamespace and tagName must follow the usual + * XAML naming rules. + * @param {string} xmlNamespace The XML namespace that must be mapped to a CLR namespace. + * @param {string} tagName The XML element name that must describe a valid type in this CLR namespace. + * @return {yfiles.lang.Class} The first matching type, if any. + * @see Specified by {@link yfiles.graphml.IXamlTypeMapper#getTypeWithXmlNamespaceAndTagName}. + */ + getTypeWithXmlNamespaceAndTagName(xmlNamespace:string,tagName:string):yfiles.lang.Class; + /** + * Manually map xmlNamespace to a CLR namespace clrNamespace in assembly. + * This mapping applies only to namespaces in assembly. + * @param {string} xmlNamespace The XML namespace to map. + * @param {string} clrNamespace The CLR namespace + * @param {yfiles.lang.Assembly} assembly The assembly that contains clrNamespace + * @see Specified by {@link yfiles.graphml.IXamlTypeMapper#addMappingForNamespace}. + */ + addMappingForNamespace(xmlNamespace:string,clrNamespace:string,assembly:yfiles.lang.Assembly):void; + /** + * Manually map a specific combination of XML xamlNamespace and + * xamlTagName to type t. + * This overrides all mappings that result from s, calls to {@link yfiles.graphml.IXamlTypeMapper#addMappingForNamespace} + * or implicit (clr-namespace style) declarations. + * @param {string} xamlNamespace The XML namespace to map + * @param {string} xamlTagName The XML tag name to map + * @param {yfiles.lang.Class} t The Type to map + * @see Specified by {@link yfiles.graphml.IXamlTypeMapper#addMappingForType}. + */ + addMappingForType(xamlNamespace:string,xamlTagName:string,t:yfiles.lang.Class):void; + } + var IXamlTypeMapper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for classes that can provide custom {@link yfiles.system.TypeConverter} implementations for GraphML serialization. + */ + export interface ITypeConverterProvider extends Object{ + /** + * Get a {@link yfiles.system.TypeConverter} implementation that can convert the current value of descriptor to + * destinationType for the target object subject. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {yfiles.system.PropertyInfo} descriptor Describes the property + * @param {Object} subject The target object + * @param {yfiles.lang.Class} destinationType The destination type of the conversion. + * @param {yfiles.system.ITypeDescriptorContext} descriptorContext Context for the TypeConverter + * @return {yfiles.system.TypeConverter} A {@link yfiles.system.TypeConverter} instance that can convert the current value of descriptor to + * destinationType for the target object subject, or null + * if no such converter exists. + * @see Specified by {@link yfiles.graphml.ITypeConverterProvider#getTypeConverterForWriting}. + */ + getTypeConverterForWriting(context:yfiles.graphml.IWriteContext,descriptor:yfiles.system.PropertyInfo,subject:Object,destinationType:yfiles.lang.Class,descriptorContext:yfiles.system.ITypeDescriptorContext):yfiles.system.TypeConverter; + /** + * Get a {@link yfiles.system.TypeConverter} implementation that can convert the current value of descriptor to + * destinationType for the target object subject in the given context. + * @param {yfiles.graphml.IParseContext} context The current parse context + * @param {yfiles.system.PropertyInfo} descriptor Describes the property + * @param {Object} subject The target object + * @param {yfiles.lang.Class} destinationType The destination type of the conversion. + * @param {yfiles.system.ITypeDescriptorContext} descriptorContext Context for the TypeConverter + * @return {yfiles.system.TypeConverter} A {@link yfiles.system.TypeConverter} instance that can convert the current value of descriptor to + * destinationType for the target object subject, or null + * if no such converter exists. + * @see Specified by {@link yfiles.graphml.ITypeConverterProvider#getTypeConverterForParsing}. + */ + getTypeConverterForParsing(context:yfiles.graphml.IParseContext,descriptor:yfiles.system.PropertyInfo,subject:Object,destinationType:yfiles.lang.Class,descriptorContext:yfiles.system.ITypeDescriptorContext):yfiles.system.TypeConverter; + } + var ITypeConverterProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by the XAML parser to parse inline extension markup. + */ + export interface IInlineMarkupExtensionParser extends Object{ + /** + * Parses an extension from the string in the given context. + * @param {string} extensionString The extension string. + * @param {yfiles.graphml.IParseContext} context The context. + * @return {yfiles.system.MarkupExtension} The extension. + * @see Specified by {@link yfiles.graphml.IInlineMarkupExtensionParser#parseExtension}. + */ + parseExtension(extensionString:string,context:yfiles.graphml.IParseContext):yfiles.system.MarkupExtension; + /** + * Determines whether this instance can parse the specified extension string for the given context. + * @param {string} extensionString The extension string. + * @param {yfiles.graphml.IParseContext} context The context. + * @return {boolean} + * true if this instance can parse the specified extension string; otherwise, false. + * @see Specified by {@link yfiles.graphml.IInlineMarkupExtensionParser#canParse}. + */ + canParse(extensionString:string,context:yfiles.graphml.IParseContext):boolean; + } + var IInlineMarkupExtensionParser:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Utility class that can write the inline (attribute) representation of a {@link yfiles.system.MarkupExtension}. + */ + export interface IInlineMarkupWriter extends Object{ + /** + * Returns the inline (attribute) representation of extension. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {yfiles.system.MarkupExtension} extension The markup extension that should be written. + * @return {string} The inline (attribute) representation of extension + * @see Specified by {@link yfiles.graphml.IInlineMarkupWriter#getExtensionAsString}. + */ + getExtensionAsString(context:yfiles.graphml.IWriteContext,extension:yfiles.system.MarkupExtension):string; + /** + * Returns whether this implementation can write the markup extension extension. + * @param {yfiles.graphml.IWriteContext} context The current write context + * @param {yfiles.system.MarkupExtension} extension The markup extension that should be written. + * @return {boolean} true iff this implementation can write extension + * @see Specified by {@link yfiles.graphml.IInlineMarkupWriter#canHandle}. + */ + canHandle(context:yfiles.graphml.IWriteContext,extension:yfiles.system.MarkupExtension):boolean; + } + var IInlineMarkupWriter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Exception that gets thrown if an XML namespace declaration does violate the XAML naming conventions. + */ + export interface InvalidXamlNamespaceDeclarationException extends yfiles.system.InvalidOperationException{ + } + var InvalidXamlNamespaceDeclarationException:{ + $class:yfiles.lang.Class; + /** + * Create a new instance of {@link yfiles.graphml.InvalidXamlNamespaceDeclarationException}. + */ + new ():yfiles.graphml.InvalidXamlNamespaceDeclarationException; + /** + * Create a new instance of {@link yfiles.graphml.InvalidXamlNamespaceDeclarationException} with a specific error message. + */ + WithMessage:{ + new (message:string):yfiles.graphml.InvalidXamlNamespaceDeclarationException; + }; + }; + /** + * Custom attribute to control specific aspects of GraphML deserialization. + * The specialized {@link yfiles.graphml.XamlSerializer} will evaluate this attribute to override + * its built in serialization rules. The main use cases for this attribute are to override object reference sharing, configure + * consistent member naming and handle legacy serialization. + * @see {@link yfiles.graphml.XamlSerializer} + */ + export interface GraphMLAttribute extends yfiles.lang.Attribute{ + /** + * Gets or sets the name of the type or member where this attribute is used. + * This will be used as the XML element or XML attribute name. + */ + name:string; + /** + * Gets or sets the XML namespace URI for the type or member where this attribute is used. + * This will be used as the XML namespace URI for the XML element or XML attribute. + */ + xmlNamespace:string; + /** + * Gets or sets whether an enclosing tag for the property itself is written. + * If true, the resulting XML will look like + *

+      * <ParentObjectName.Name>
+      *    <PropertyTypeName>
+      *       content
+      *    </PropertyTypeName>
+      * </ParentObjectName.Name>
+      * 
+ * Default value is true. + *

+ * This property is ignored if the attribute targets a type declaration. + *

+ */ + writeEnclosingTag:boolean; + /** + * Gets or sets whether the member should be written as an XML element or as an XML attribute. + * Default value is {@link yfiles.graphml.XamlAttributeWriteMode#AUTO}. + *

+ * This property is ignored if the attribute targets a type declaration. + *

+ * @see {@link yfiles.graphml.XamlAttributeWriteMode} + */ + writeAsAttribute:yfiles.graphml.XamlAttributeWriteMode; + /** + * Gets or sets whether this property can be GraphML serialized. + *

This property is only evaluated for attribute usage on properties.

+ *

+ * Default value is {@link yfiles.graphml.GraphMLSerializationMode GraphMLSerializationMode.Auto}, meaning that the framework + * will determine itself whether or not to write this type or property. + *

+ */ + serializable:yfiles.graphml.GraphMLSerializationMode; + /** + * Gets or sets a custom {@link yfiles.system.TypeConverter} for attribute serialization. + * For {@link yfiles.graphml.XamlSerializer}, the property value must implement {@link yfiles.system.TypeConverter}. + *

This property allows to specify a custom {@link yfiles.system.TypeConverter} only for GraphML serialization, i.e. without + * specifying a global {@link yfiles.system.TypeConverterAttribute}.

+ * @see {@link yfiles.graphml.XamlSerializer} + * @see {@link yfiles.system.TypeConverter} + */ + customTypeConverter:yfiles.lang.Class; + /** + * Gets or sets whether the object reference identity of the property values should be kept intact. + * Default value is {@link yfiles.graphml.GraphMLSharingMode#AUTO}. + *

+ * This property is ignored if the attribute targets a type declaration. + *

+ */ + shareable:yfiles.graphml.GraphMLSharingMode; + } + var GraphMLAttribute:{ + $class:yfiles.lang.Class; + new ():yfiles.graphml.GraphMLAttribute; + }; + export enum KeyType{ + /** + * Identifier for attribute of type int. + */ + INT, + /** + * Identifier for attribute of type long. + */ + LONG, + /** + * Identifier for attribute of type float. + */ + FLOAT, + /** + * Identifier for attribute of type double. + */ + DOUBLE, + /** + * Identifier for attribute of type string that denotes + * simple string content as opposed to {@link yfiles.graphml.KeyType#COMPLEX}. + */ + STRING, + /** + * Identifier for attribute of type boolean. + */ + BOOLEAN, + /** + * Identifier for arbitrary complex xml content. + */ + COMPLEX + } + export enum KeyScope{ + /** + * Unscoped for key definition. + */ + ALL, + /** + * Node-Scope for key definition. + */ + NODE, + /** + * Edge-Scope for key definition. + */ + EDGE, + /** + * Graph-Scope for key definition. + */ + GRAPH, + /** + * Port-Scope for key definition. + */ + PORT, + /** + * Graphml-Scope for key definition. + */ + GRAPHML + } + export interface IGraphMLIOHandler extends Object{ + /** + * Writes the given graph object to the output writer creating a GraphML file. + * @param {yfiles.graph.IGraph} graph + * The Graph object that is to be written to a GraphML file. + * @param {yfiles.system.StringWriter} os + * The text writer where the output is written. + * @throws {yfiles.system.ArgumentNullException} graph is null. + * @throws {yfiles.system.ArgumentNullException} os is null. + * @see Specified by {@link yfiles.graphml.IGraphMLIOHandler#write}. + */ + write(graph:yfiles.graph.IGraph,os:yfiles.system.StringWriter):void; + /** + * Read GraphML from an existing XML document. + * @param {yfiles.graph.IGraph} graph + * The Graph object that is to be populated with nodes and edges as read from + * the document. + * @param {Document} doc The XML document. Note: If + * you are using Internet Explorer 9 and {@link XMLHttpRequest}s to retrieve the + * document, you may not use the value from the {@link XMLHttpRequest#responseXML} + * property. Please parse {@link XMLHttpRequest#responseText} instead and use the + * result. + * For further reference see . + * @throws {yfiles.system.ArgumentNullException} doc is null. + * @throws {yfiles.system.ArgumentNullException} graph is null. + * @see Specified by {@link yfiles.graphml.IGraphMLIOHandler#readFromDocument}. + */ + readFromDocument(graph:yfiles.graph.IGraph,doc:Document):void; + /** + * Reads a GraphML file from the given URL and populates the Graph + * object. + *

+ * Note that this is an asynchronous method that returns immediately. You can use the {@link yfiles.graphml.IGraphMLIOHandler#readFromURLWithCallback} overload + * to be notified when the actual parsing has completed. + *

+ * @param {yfiles.graph.IGraph} graph + * The Graph object that is to be populated with nodes and edges as read from + * the URL. + * @param {string} url + * The URL of the file to be read. + * @throws {yfiles.system.ArgumentNullException} filename is null. + * @throws {yfiles.system.ArgumentNullException} graph is null. + * @see Specified by {@link yfiles.graphml.IGraphMLIOHandler#readFromURL}. + */ + readFromURL(graph:yfiles.graph.IGraph,url:string):void; + /** + * Reads a GraphML file from the given URL and populates the Graph + * object. + *

+ * Note that this is an asynchronous method that returns immediately. You can use the finishedCallback + * to be notified when the actual parsing has completed. + *

+ * @param {yfiles.graph.IGraph} graph + * The Graph object that is to be populated with nodes and edges as read from + * the URL. + * @param {string} url + * The URL of the file to be read. + * @param {function(Object, yfiles.system.EventArgs)} finishedCallback Optional callback that is called when parsing is complete. + * @throws {yfiles.system.ArgumentNullException} filename is null. + * @throws {yfiles.system.ArgumentNullException} graph is null. + * @see Specified by {@link yfiles.graphml.IGraphMLIOHandler#readFromURLWithCallback}. + */ + readFromURLWithCallback(graph:yfiles.graph.IGraph,url:string,finishedCallback:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Writes the given graph object to a string. + * @param {yfiles.graph.IGraph} graph + * The Graph object that is to be written to a string. + * @return {string} + * A string containing the GraphML data. + * @see Specified by {@link yfiles.graphml.IGraphMLIOHandler#writeToString}. + */ + writeToString(graph:yfiles.graph.IGraph):string; + /** + * Convenience method that imports the graph + * from an XML data provided in a string data. + * @param {yfiles.graph.IGraph} graph + * The Graph object that is to be populated with nodes and edges as read from + * the GraphML data. + * @param {string} data A string that contains GraphML data. + * @see Specified by {@link yfiles.graphml.IGraphMLIOHandler#readFromGraphMLText}. + */ + readFromGraphMLText(graph:yfiles.graph.IGraph,data:string):void; + } + var IGraphMLIOHandler:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Class that provides constants for core GraphML elements and attributes. + */ + export interface GraphMLXmlConstants extends Object{ + } + var GraphMLXmlConstants:{ + $class:yfiles.lang.Class; + /** + * Description element tag name. + * This field has the constant value "desc" + */ + DESCRIPTION_ELEMENT_NAME:string; + /** + * Default element tag name. + * This field has the constant value "default" + */ + DEFAULT_ELEMENT_NAME:string; + /** + * Source attribute for edge. + * This field has the constant value "source" + */ + SOURCE_ATTRIBUTE_NAME:string; + /** + * Target attribute for edge. + * This field has the constant value "target" + */ + TARGET_ATTRIBUTE_NAME:string; + /** + * Source port attribute. + * This field has the constant value "sourceport" + */ + SOURCE_PORT_ATTRIBUTE_NAME:string; + /** + * Target port attribute. + * This field has the constant value "targetport" + */ + TARGET_PORT_ATTRIBUTE_NAME:string; + /** + * Constant for the "attr.type" attribute. + */ + ATTR_TYPE_ATTRIBUTE_NAME:string; + /** + * Constant for the "attr.name" attribute. + */ + ATTR_NAME_ATTRIBUTE_NAME:string; + /** + * Constant for the "yfiles:attr.uri" attribute. + */ + ATTR_URI_ATTRIBUTE_NAME:string; + /** + * Scope attribute for key definitions. + * This field has the constant value "for" + */ + KEY_SCOPE_ATTRIBUTE_NAME:string; + }; + /** + * Defines common key constants to identify important {@link yfiles.graphml.CreationProperties}. + * @see {@link yfiles.graphml.GraphElementFactory} + */ + export interface CreationPropertyKeys extends Object{ + } + var CreationPropertyKeys:{ + $class:yfiles.lang.Class; + /** + * Creation property key that tags group node information. + * @see {@link yfiles.graphml.GraphElementFactory#createNode} + */ + IS_GROUP_NODE:string; + /** + * Creation property key that tags label information. + * @see {@link yfiles.graphml.GraphElementFactory} + */ + LABELS:string; + /** + * Creation property key that tags node layout information. + * @see {@link yfiles.graphml.GraphElementFactory#createNode} + */ + LAYOUT:string; + /** + * Creation property key that tags style information. + * @see {@link yfiles.graphml.GraphElementFactory} + */ + STYLE:string; + /** + * Creation property key that tags tag object information. + * @see {@link yfiles.graphml.GraphElementFactory} + */ + TAG:string; + /** + * Creation property key that tags bend information. + * @see {@link yfiles.graphml.GraphElementFactory#createEdge} + */ + BENDS:string; + /** + * Creation property key that tags port location information. + * @see {@link yfiles.graphml.GraphElementFactory#addPort} + */ + PORT_LOCATION_MODEL_PARAMETER:string; + }; + /** + * The basic implementation of the {@link yfiles.graphml.IGraphElementFactory} + * interface for use with the default {@link yfiles.graph.IGraph}s. + * This instance can deal with {@link yfiles.graph.IGroupedGraph}s + * and uses the {@link yfiles.graphml.CreationProperties} from the + * {@link yfiles.graphml.IParseContext} to create the items with the correct + * initial values if they have been put into the creation properties + * by {@link yfiles.graphml.IInputHandler} implementations that have been + * invoked before the creation of the items. + */ + export interface GraphElementFactory extends Object,yfiles.graphml.IGraphElementFactory{ + /** + * Creates a node for the given context. + * This instance will try to obtain the {@link yfiles.graphml.CreationProperties} + * from the context's {@link yfiles.support.ILookup#lookup}. + * The following properties are queried from the properties if they have been found and used + * for creating the instance: + *
    + *
  • + * Property name (key) + * The value and its usage + *
  • + *
  • + * {@link yfiles.graphml.CreationPropertyKeys#LAYOUT} + * A {@link yfiles.geometry.RectD} that describes the {@link yfiles.graph.INode#layout} + *
  • + *
  • + * {@link yfiles.graphml.CreationPropertyKeys#STYLE} + * An {@link yfiles.drawing.INodeStyle} that describes the {@link yfiles.graph.INode#style} + *
  • + *
  • + * {@link yfiles.graphml.CreationPropertyKeys#TAG} + * An {@link Object} that describes the {@link yfiles.support.ITagOwner#tag} + *
  • + *
  • + * {@link yfiles.graphml.CreationPropertyKeys#LABELS} + * An {@link yfiles.objectcollections.IEnumerable} that yields {@link yfiles.graph.ILabel} instances to + * use as {@link yfiles.graph.ILabeledItem#labels}. + *
  • + *
  • + * {@link yfiles.graphml.CreationPropertyKeys#IS_GROUP_NODE} + * A {@link Boolean} that determines whether the node should be created + * as a {@link yfiles.graph.IGroupedGraph#createGroupNodeWithParentBoundsStyleAndTag group node}. + * + *
  • + *
+ * @param {yfiles.graphml.IParseContext} context The context from which the graph, the {@link yfiles.graphml.CreationProperties}, and the {@link yfiles.graphml.IParseContext#objectStack} + * can be queried. + * @return {yfiles.graph.INode} A newly created node + * @see Specified by {@link yfiles.graphml.IGraphElementFactory#createNode}. + */ + createNode(context:yfiles.graphml.IParseContext):yfiles.graph.INode; + /** + * Creates an edge for the given context and the provided source and target nodes or ports. + * This instance will try to obtain the {@link yfiles.graphml.CreationProperties} + * from the context's {@link yfiles.support.ILookup#lookup}. + * The following properties are queried from the properties if they have been found and used + * for creating the instance: + *
    + *
  • + * Property name (key) + * The value and its usage + *
  • + *
  • + * {@link yfiles.graphml.CreationPropertyKeys#STYLE} + * An {@link yfiles.drawing.IEdgeStyle} that describes the {@link yfiles.graph.IEdge#style} + *
  • + *
  • + * {@link yfiles.graphml.CreationPropertyKeys#TAG} + * An {@link Object} that describes the {@link yfiles.support.ITagOwner#tag} + *
  • + *
  • + * {@link yfiles.graphml.CreationPropertyKeys#LABELS} + * An {@link yfiles.objectcollections.IEnumerable} that yields {@link yfiles.graph.ILabel} instances to + * use as {@link yfiles.graph.ILabeledItem#labels}. + *
  • + *
  • + * {@link yfiles.graphml.CreationPropertyKeys#BENDS} + * An {@link yfiles.objectcollections.IEnumerable} that yields {@link yfiles.graph.IBend} instances to + * use as {@link yfiles.graph.IEdge#bends}. + *
  • + *
+ * @param {yfiles.graphml.IParseContext} context The context from which the graph, the {@link yfiles.graphml.CreationProperties}, and the {@link yfiles.graphml.IParseContext#objectStack} + * can be queried. + * @param {yfiles.graph.INode} sourceNode The source node for the edge. + * @param {yfiles.graph.IPort} sourcePort The source port for the edge, if specified, otherwise null. + * @param {yfiles.graph.INode} targetNode The target node for the edge. + * @param {yfiles.graph.IPort} targetPort The target port for the edge, if specified, otherwise null. + * @return {yfiles.graph.IEdge} A newly created edge. + * @see Specified by {@link yfiles.graphml.IGraphElementFactory#createEdge}. + */ + createEdge(context:yfiles.graphml.IParseContext,sourceNode:yfiles.graph.INode,sourcePort:yfiles.graph.IPort,targetNode:yfiles.graph.INode,targetPort:yfiles.graph.IPort):yfiles.graph.IEdge; + /** + * Adds a new port to the given {@link yfiles.graph.IPortOwner}. + * @param {yfiles.graphml.IParseContext} context The context from which the graph, the {@link yfiles.graphml.CreationProperties}, and the {@link yfiles.graphml.IParseContext#objectStack} + * can be queried. + * @param {yfiles.graph.IPortOwner} portOwner The owner of the port. + * @return {yfiles.graph.IPort} A newly created port. + * @see Specified by {@link yfiles.graphml.IGraphElementFactory#addPort}. + */ + addPort(context:yfiles.graphml.IParseContext,portOwner:yfiles.graph.IPortOwner):yfiles.graph.IPort; + } + var GraphElementFactory:{ + $class:yfiles.lang.Class; + }; + /** + * Class for reading/writing graphs from/to GraphML format. + * For more information about the GraphML file format please refer to the + * GraphML Primer. + */ + export interface GraphMLIOHandler extends Object,yfiles.graphml.IGraphMLIOHandler{ + /** + * true if schema descriptions should be written. + * Value: Default is true + */ + writeXMLSchema:boolean; + /** + * Whether to support object sharing on output. + * If enabled, multiple object references will be correctly represented in the output document, + * otherwise, each object reference will be serialized independently.

+ * Note: Reading of shared references is always supported

+ * Value: Default value is true + */ + writeSharedReferences:boolean; + /** + * Whether to clear an existing graph instance before reading. + * If set totrue, an existing graph instance will be cleared + * before the graph is read into this instance, otherwise the loaded + * graph will be merged into the existing one. + * Value: Default value is true + */ + clearGraphBeforeRead:boolean; + /** + * This event gets fired before inline references are evaluated. + * Subscribe to this event to customize resolving of GraphML object references. This event is fired before + * the framework tries to resolve internal references and can therefore be used to override internal references, for example. + * @see {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} + */ + addOverrideResolveReferenceListener(value:(sender:Object,e:yfiles.graphml.ResolveReferenceEventArgs)=> void):void; + /** + * This event gets fired before inline references are evaluated. + * Subscribe to this event to customize resolving of GraphML object references. This event is fired before + * the framework tries to resolve internal references and can therefore be used to override internal references, for example. + * @see {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} + */ + removeOverrideResolveReferenceListener(value:(sender:Object,e:yfiles.graphml.ResolveReferenceEventArgs)=> void):void; + /** + * This event gets fired after references are evaluated. + * Subscribe to this event to customize resolving of GraphML object references. This event is fired when + * the framework could not resolve an object reference by an internal one. + * @see {@link yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener OverrideResolveReference} + */ + addResolveReferenceListener(value:(sender:Object,e:yfiles.graphml.ResolveReferenceEventArgs)=> void):void; + /** + * This event gets fired after references are evaluated. + * Subscribe to this event to customize resolving of GraphML object references. This event is fired when + * the framework could not resolve an object reference by an internal one. + * @see {@link yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener OverrideResolveReference} + */ + removeResolveReferenceListener(value:(sender:Object,e:yfiles.graphml.ResolveReferenceEventArgs)=> void):void; + /** + * This event can be used to provide names of external or internal references for objects. + * The reference targets are not serialized to the GraphML file if they are set to {@link yfiles.graphml.GraphMLReferenceType#EXTERNAL}. + * To resolve these references when parsing, you typically have + * to subscribe to the {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} event. + * @see {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId} + * @see {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceType} + */ + addQueryReferenceIdListener(value:(sender:Object,e:yfiles.graphml.QueryReferenceIdEventArgs)=> void):void; + /** + * This event can be used to provide names of external or internal references for objects. + * The reference targets are not serialized to the GraphML file if they are set to {@link yfiles.graphml.GraphMLReferenceType#EXTERNAL}. + * To resolve these references when parsing, you typically have + * to subscribe to the {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} event. + * @see {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceId} + * @see {@link yfiles.graphml.QueryReferenceIdEventArgs#referenceType} + */ + removeQueryReferenceIdListener(value:(sender:Object,e:yfiles.graphml.QueryReferenceIdEventArgs)=> void):void; + /** + * This event can be used to resolve xml namespaces to {@link yfiles.graphml.ClrNamespaceDescriptor}s. + * It can be used to dynamically resolve xml namespaces where no mapping has been added before. + * @see {@link yfiles.graphml.ResolveXmlNamespaceEventArgs} + */ + addResolveXmlNamespaceListener(value:(sender:Object,e:yfiles.graphml.ResolveXmlNamespaceEventArgs)=> void):void; + /** + * This event can be used to resolve xml namespaces to {@link yfiles.graphml.ClrNamespaceDescriptor}s. + * It can be used to dynamically resolve xml namespaces where no mapping has been added before. + * @see {@link yfiles.graphml.ResolveXmlNamespaceEventArgs} + */ + removeResolveXmlNamespaceListener(value:(sender:Object,e:yfiles.graphml.ResolveXmlNamespaceEventArgs)=> void):void; + /** + * Fires the {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} event. + * @param {yfiles.graphml.ResolveReferenceEventArgs} args The arguments that get passed to the {@link yfiles.graphml.GraphMLIOHandler#addResolveReferenceListener ResolveReference} event. + */ + onResolveReference(args:yfiles.graphml.ResolveReferenceEventArgs):void; + /** + * Fires the {@link yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener OverrideResolveReference} event. + * @param {yfiles.graphml.ResolveReferenceEventArgs} args The arguments that get passed to the {@link yfiles.graphml.GraphMLIOHandler#addOverrideResolveReferenceListener OverrideResolveReference} event. + */ + onOverrideResolveReference(args:yfiles.graphml.ResolveReferenceEventArgs):void; + /** + * Fires the {@link yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener QueryReferenceId} event. + * @param {yfiles.graphml.QueryReferenceIdEventArgs} args The arguments that get passed to the {@link yfiles.graphml.GraphMLIOHandler#addQueryReferenceIdListener QueryReferenceId} event. + * @see {@link yfiles.graphml.GraphMLWriter#onQueryReferenceId} + * @throws {yfiles.system.ArgumentNullException} args is null. + */ + onQueryReferenceId(args:yfiles.graphml.QueryReferenceIdEventArgs):void; + /** + * Fires the {@link yfiles.graphml.GraphMLIOHandler#addResolveXmlNamespaceListener ResolveXmlNamespace} event. + * @param {Object} sender The sender of the event. + * @param {yfiles.graphml.ResolveXmlNamespaceEventArgs} args The arguments that get passed to the {@link yfiles.graphml.GraphMLIOHandler#addResolveXmlNamespaceListener ResolveXmlNamespace} event. + * @see {@link yfiles.graphml.IXamlTypeMapper#addResolveXmlNamespaceListener ResolveXmlNamespace} + * @throws {yfiles.system.ArgumentNullException} args is null. + */ + onResolveXmlNamespace(sender:Object,args:yfiles.graphml.ResolveXmlNamespaceEventArgs):void; + /** + * Adds a namespace to the header of a GraphML file. + * @param {string} namespaceURI The namespace URI + * @param {string} shortName The namespace prefix + */ + addNamespace(namespaceURI:string,shortName:string):void; + /** + * Adds a schema location to the header of a GraphML file. + * @param {string} schemaNamespace The namespace URI for this schema location + * @param {string} schemaLocation The schema location + */ + addSchemaLocation(schemaNamespace:string,schemaLocation:string):void; + /** + * Writes the given graph object to the output writer creating a GraphML file. + * @param {yfiles.graph.IGraph} graph + * The Graph object that is to be written to a GraphML file. + * @param {yfiles.system.StringWriter} os + * The text writer where the output is written. + * @throws {yfiles.system.ArgumentNullException} graph is null. + * @throws {yfiles.system.ArgumentNullException} os is null. + * @see Specified by {@link yfiles.graphml.IGraphMLIOHandler#write}. + */ + write(graph:yfiles.graph.IGraph,os:yfiles.system.StringWriter):void; + /** + * Writes the given graph object to a GraphML file with a given filename. + * @param {yfiles.graph.IGraph} graph + * The Graph object that is to be written to a GraphML file. + * @return {string} + * A string containing the GraphML data. + * @see Specified by {@link yfiles.graphml.IGraphMLIOHandler#writeToString}. + */ + writeToString(graph:yfiles.graph.IGraph):string; + /** + * Register a {@link yfiles.model.IMapper} instance for + * use as an output data source. + * This methods creates and configures the necessary handler + * itself + * @param {string} name The name of the attribute + * @param {yfiles.model.IMapper.} mapper the mapper that serves as data source + */ + addOutputMapper(modelItemType:yfiles.lang.Class,valueType:yfiles.lang.Class,name:string,mapper:yfiles.model.IMapper):void; + /** + * Register a {@link yfiles.model.IMapper} instance for + * use as an output data source. + * This methods creates and configures the necessary handler + * itself + * @param {string} name The name of the attribute + * @param {string} uri The URI to add to the key definition to disambiguate keys. + * @param {yfiles.model.IMapper.} mapper the mapper that serves as data source + */ + addOutputMapperWithURI(modelItemType:yfiles.lang.Class,valueType:yfiles.lang.Class,name:string,uri:string,mapper:yfiles.model.IMapper):void; + /** + * Register a {@link yfiles.model.IMapper} instance for + * use as an output data source. This method uses a custom {@link system.EventHandler1} + * for the actual serialization. + * This methods creates and configures the necessary handler + * itself. + * @param {string} name The name of the attribute + * @param {yfiles.model.IMapper.} mapper the mapper that serves as data source + * @param {function(Object, yfiles.graphml.HandleSerializationEventArgs)} serializationCallback custom serialization callback. + * @param {yfiles.graphml.KeyType} declaredKeyType The key type to write in the declaration. + */ + addOutputMapperWithSerializationCallbackAndKeyType(modelItemType:yfiles.lang.Class,valueType:yfiles.lang.Class,name:string,mapper:yfiles.model.IMapper,serializationCallback:(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs)=> void,declaredKeyType:yfiles.graphml.KeyType):void; + /** + * Register a {@link yfiles.model.IMapper} instance for + * use as an output data source. This method uses a custom {@link system.EventHandler1} + * for the actual serialization. + * This methods creates and configures the necessary handler + * itself. + * @param {string} name The name of the attribute + * @param {yfiles.model.IMapper.} mapper the mapper that serves as data source + * @param {string} uri The URI to add to the key definition to disambiguate keys. + * @param {function(Object, yfiles.graphml.HandleSerializationEventArgs)} serializationCallback custom serialization callback. + * @param {yfiles.graphml.KeyType} declaredKeyType The key type to write in the declaration. + */ + addOutputMapperWithURISerializationCallbackAndKeyType(modelItemType:yfiles.lang.Class,valueType:yfiles.lang.Class,name:string,uri:string,mapper:yfiles.model.IMapper,serializationCallback:(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs)=> void,declaredKeyType:yfiles.graphml.KeyType):void; + /** + * Use a registered {@link yfiles.model.IMapper} instance as source for the given GraphML attribute. + * The type arguments of the mapper are determined automatically. + * @param {string} name The tag name of the mapper in the {@link yfiles.graph.IMapperRegistry}. + * This will also be used as the GraphML attribute name. + */ + addRegistryOutputMapper(modelItemType:yfiles.lang.Class,valueType:yfiles.lang.Class,name:string):void; + /** + * Use a registered {@link yfiles.model.IMapper} instance as source for the given GraphML attribute. + * The type arguments of the mapper are determined automatically. + * @param {string} name The GraphML name of the attribute + * @param {Object} tag The tag name of the mapper in the {@link yfiles.graph.IMapperRegistry} + */ + addRegistryOutputMapperWithTagUntyped(name:string,tag:Object):void; + /** + * Use a registered {@link yfiles.model.IMapper} instance as source for the given GraphML attribute. + * @param {string} name The GraphML name of the attribute + * @param {Object} registryTag The tag name of the mapper in the {@link yfiles.graph.IMapperRegistry} + */ + addRegistryOutputMapperWithTag(modelItemType:yfiles.lang.Class,valueType:yfiles.lang.Class,name:string,registryTag:Object):void; + /** + * Use a registered {@link yfiles.model.IMapper} instance as source for the given GraphML attribute. + * @param {string} name The GraphML name of the attribute + * @param {string} uri The URI to add to the key definition to disambiguate keys. + * @param {Object} registryTag The tag name of the mapper in the {@link yfiles.graph.IMapperRegistry} + */ + addRegistryOutputMapperWithURIAndTag(modelItemType:yfiles.lang.Class,valueType:yfiles.lang.Class,name:string,uri:string,registryTag:Object):void; + /** + * Use a registered {@link yfiles.model.IMapper} instance as source for the given GraphML attribute. + * @param {string} name The GraphML name of the attribute + * @param {string} uri The URI to add to the key definition to disambiguate keys. + * @param {Object} registryTag The tag name of the mapper in the {@link yfiles.graph.IMapperRegistry} + * @param {function(Object, yfiles.graphml.HandleSerializationEventArgs)} serializationCallback custom serialization callback. + * @param {yfiles.graphml.KeyType} declaredKeyType The key type to write in the declaration. + */ + addRegistryOutputMapperWithNameUriTagSerializationCallbackAndType(modelItemType:yfiles.lang.Class,valueType:yfiles.lang.Class,name:string,uri:string,registryTag:Object,serializationCallback:(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs)=> void,declaredKeyType:yfiles.graphml.KeyType):void; + /** + * Create and configure a new {@link yfiles.graphml.GraphMLWriter} that is used for writing graph. + * This method is called for each write process. + * @param {yfiles.graph.IGraph} graph The graph that will be written. + * @return {yfiles.graphml.GraphMLWriter} A new {@link yfiles.graphml.GraphMLWriter} instance that is configured for graph. + */ + createGraphMLWriter(graph:yfiles.graph.IGraph):yfiles.graphml.GraphMLWriter; + /** + * Raises the {@link yfiles.graphml.GraphMLIOHandler#addWritingListener Writing} event. + * This method is called just before the writing starts and before {@link yfiles.graphml.IWriteEvents#addDocumentWritingListener DocumentWriting} + * is called. + * @param {yfiles.graphml.WriteEventArgs} args The {@link yfiles.graphml.WriteEventArgs} instance containing the event data. + * @see {@link yfiles.graphml.GraphMLIOHandler#addWritingListener Writing} + */ + onWriting(args:yfiles.graphml.WriteEventArgs):void; + /** + * Occurs when the writing of a document is just about to begin. + * This event can be used to register to the fine-grained events available in + * the {@link yfiles.graphml.WriteEventArgs#context}'s {@link yfiles.graphml.IWriteContext#writeEvents} and + * to configure the writing process on a per write case. + * @see {@link yfiles.graphml.GraphMLIOHandler#onWriting} + * @see {@link yfiles.graphml.GraphMLWriter#addWritingListener Writing} + */ + addWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs when the writing of a document is just about to begin. + * This event can be used to register to the fine-grained events available in + * the {@link yfiles.graphml.WriteEventArgs#context}'s {@link yfiles.graphml.IWriteContext#writeEvents} and + * to configure the writing process on a per write case. + * @see {@link yfiles.graphml.GraphMLIOHandler#onWriting} + * @see {@link yfiles.graphml.GraphMLWriter#addWritingListener Writing} + */ + removeWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Gets the mapper for the overrides of the serialization properties. + * Using this mapper {@link yfiles.graphml.IWriteContext#getSerializationProperty serialization properties} + * can be specified. + * @see {@link yfiles.graphml.GraphMLIOHandler#configureSerializationPropertyOverrides} + */ + serializationPropertyOverrides:yfiles.support.TypedKeyMapper; + /** + * Gets the mapper for the overrides of the deserialization properties. + * Using this mapper {@link yfiles.graphml.IParseContext#getDeserializationProperty deserialization properties} + * can be specified. + * @see {@link yfiles.graphml.GraphMLIOHandler#configureDeserializationPropertyOverrides} + */ + deserializationPropertyOverrides:yfiles.support.TypedKeyMapper; + /** + * Configures the default value serializers and returns them in a {@link yfiles.graphml.IValueSerializerProvider}. + * @return {yfiles.graphml.IValueSerializerProvider} An implementation of the {@link yfiles.graphml.IValueSerializerProvider} interface. + */ + configureDefaultValueSerializers():yfiles.graphml.IValueSerializerProvider; + /** + * Configures the default type converters and returns them in a {@link yfiles.graphml.ITypeConverterProvider}. + * @return {yfiles.graphml.ITypeConverterProvider} An implementation of the {@link yfiles.graphml.ITypeConverterProvider} interface. + */ + configureDefaultTypeConverters():yfiles.graphml.ITypeConverterProvider; + /** + * Configure the lookup map of writer. + * This method is called for each write process. + * @param {yfiles.graph.IGraph} graph The graph that will be written. + * @param {yfiles.graphml.GraphMLWriter} writer The writer to configure. + * @see {@link yfiles.graphml.GraphMLWriter#setLookup} + */ + configureWriterLookup(graph:yfiles.graph.IGraph,writer:yfiles.graphml.GraphMLWriter):void; + /** + * Configure important serialization properties from properties of {@link yfiles.graphml.GraphMLIOHandler}. + * This method is called for each write process. + * @param {yfiles.graph.IGraph} graph The graph to write. + * @param {yfiles.graphml.GraphMLWriter} writer The writer to configure. + * @see {@link yfiles.graphml.GraphMLWriter#setSerializationProperty} + */ + configureSerializationProperties(graph:yfiles.graph.IGraph,writer:yfiles.graphml.GraphMLWriter):void; + /** + * Configures the {@link yfiles.graphml.GraphMLIOHandler#serializationPropertyOverrides serialization property overrides} for the given writer. + * This method is called for each write process. + * @param {yfiles.graphml.GraphMLWriter} writer The writer to set the serialization properties. + */ + configureSerializationPropertyOverrides(writer:yfiles.graphml.GraphMLWriter):void; + /** + * Configures the {@link yfiles.graphml.GraphMLIOHandler#deserializationPropertyOverrides deserialization property overrides} for the given parser. + * This method is called for each parse process. + * @param {yfiles.graphml.GraphMLParser} parser The parser to set the deserialization properties. + */ + configureDeserializationPropertyOverrides(parser:yfiles.graphml.GraphMLParser):void; + /** + * Configure mappings from CLR to XML namespaces. + *

+ * This implementation scans all loaded assemblies for {@link yfiles.system.XmlnsDefinitionAttribute}s and configures + * writer with a suitable instance of {@link yfiles.graphml.IXamlNamespaceMapper}. + *

+ *

+ * This method is called for each write process. + *

+ * @param {yfiles.graph.IGraph} graph The graph to write. + * @param {yfiles.graphml.GraphMLWriter} writer The writer to configure. + */ + createXamlNamespaceMapper(graph:yfiles.graph.IGraph,writer:yfiles.graphml.GraphMLWriter):yfiles.graphml.IXamlNamespaceMapper; + /** + * Factory method that creates and configures a suitable {@link yfiles.graphml.IXmlWriter} implementation that + * can write the graph to the given {@link yfiles.system.StringWriter} with the given settings. + * This method is called for each write process. The {@link yfiles.graphml.IXmlWriter} implementation is used by default for + * all low-level write operations. + * @param {yfiles.system.StringWriter} os The serialization destination + * @return {yfiles.graphml.IXmlWriter} A suitable {@link yfiles.graphml.IXmlWriter} instance for the serialization + * @see {@link yfiles.graphml.IWriteContext#writer} + */ + createXMLWriter(os:yfiles.system.StringWriter):yfiles.graphml.IXmlWriter; + /** + * Configure writer. + *

+ * This method is called for each write process. + *

+ *

This implementation does nothing.

+ * @param {yfiles.graphml.IXmlWriter} writer The writer to configure. + */ + configureXMLWriter(writer:yfiles.graphml.IXmlWriter):void; + /** + * Configures writer to use the schema locations set with {@link yfiles.graphml.GraphMLIOHandler#addSchemaLocation}. + * This method is called for each write process. + * @param {yfiles.graphml.GraphMLWriter} writer The writer to configure. + */ + configureSchemaLocations(writer:yfiles.graphml.GraphMLWriter):void; + /** + * Configures writer to use the namespace declarations set with {@link yfiles.graphml.GraphMLIOHandler#addNamespace}. + *

+ * In addition to the namespace declarations provided with {@link yfiles.graphml.GraphMLIOHandler#addNamespace}, the default {@link yfiles.graphml.GraphMLWriter} implementation + * also automatically places all namespace declarations that have occurred + *

+ *

+ * This method is called for each write process. + *

+ * @param {yfiles.graphml.GraphMLWriter} writer The writer to configure. + */ + configureNamespaces(writer:yfiles.graphml.GraphMLWriter):void; + /** + * Configures default event handlers for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event. + *

This implementation configures several output handlers for the standard yFiles WPF GraphML attributes (styles, folding state, + * labels, geometry). + *

+ *

+ * This method is called for each write process. + *

+ * @param {yfiles.graph.IGraph} graph The graph that will be written. + * @param {yfiles.graphml.GraphMLWriter} writer The writer that should be configured. + */ + configureOutputHandlers(graph:yfiles.graph.IGraph,writer:yfiles.graphml.GraphMLWriter):void; + /** + * Predefined output handler that writes node styles. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} e + */ + registerNodeStyleOutputHandler(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Predefined output handler that writes the settings of a graph. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event + * @see {@link yfiles.graphml.SerializationProperties#WRITE_GRAPH_SETTINGS} + */ + registerGraphSettingsOutputHandler(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Predefined output handler that writes {@link yfiles.support.ITagOwner} tags. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} e + */ + registerTagOutputHandler(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Predefined output handler that writes node layouts. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} e + */ + registerNodeLayoutOutputHandler(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Predefined output handler that writes node labels. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} e + */ + registerNodeLabelsOutputHandler(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Predefined output handler that writes edge labels. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} e + */ + registerEdgeLabelsOutputHandler(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Predefined output handler that writes edge styles. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} e + */ + registerEdgeStyleOutputHandler(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Predefined output handler that writes edge bends. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} e + */ + registerEdgeBendsOutputHandler(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Predefined output handler that writes port styles. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} e + */ + registerPortStyleOutputHandler(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Predefined output handler that writes port locations. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} e + */ + registerPortLocationOutputHandler(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Configures the predefined handlers for the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} event. + *

+ * This method is called for each write process. + *

+ * @param {yfiles.graph.IGraph} graph The graph that will be written. + * @param {yfiles.graphml.GraphMLWriter} writer The writer to configure. + */ + configureSerializationHandlers(graph:yfiles.graph.IGraph,writer:yfiles.graphml.GraphMLWriter):void; + /** + * Handle the serialization of plain JavaScript object that can be serialized to JSON. + * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff + * {@link yfiles.graphml.HandleSerializationEventArgs#item} can be converted to JSON data. This serializer is only called from element + * property syntax and is registered by default. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} e The event handler arguments. + */ + handleJSONSerialization(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of instances that can be serialized through a {@link yfiles.system.ValueSerializer}. + * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff + * {@link yfiles.graphml.HandleSerializationEventArgs#item} can be converted to a string with a {@link yfiles.system.ValueSerializer}. This serializer is only called from element + * property syntax and is registered by default. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} e The event handler arguments. + */ + handleTextConvertibleSerialization(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of {@link yfiles.graphml.IReferenceHandle} instances. + * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff + * {@link yfiles.graphml.HandleSerializationEventArgs#item} is a {@link yfiles.graphml.IReferenceHandle} instance. This handler is registered by default + * and should not be removed if {@link yfiles.graphml.GraphMLIOHandler#writeSharedReferences} is enabled. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} e The event handler arguments. + */ + handleReferenceHandleSerialization(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of {@link yfiles.objectcollections.IEnumerable} instances. + * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff + * {@link yfiles.graphml.HandleSerializationEventArgs#item} is an {@link yfiles.objectcollections.IEnumerable} instance. This handler is registered by default. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} e The event handler arguments. + */ + handleListSerialization(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of arrays. + * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff + * {@link yfiles.graphml.HandleSerializationEventArgs#item} is an array. This handler is registered by default. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} e The event handler arguments. + */ + handleArraySerialization(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of Types. + * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff + * {@link yfiles.graphml.HandleSerializationEventArgs#item} is an array. This handler is registered by default. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} e The event handler arguments. + */ + handleTypeSerialization(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of TypeExtensions. + * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff + * {@link yfiles.graphml.HandleSerializationEventArgs#item} is an array. This handler is registered by default. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} e The event handler arguments. + */ + handleTypeExtensionSerialization(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of {@link yfiles.system.MarkupExtension} convertible instances. + * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff + * {@link yfiles.graphml.HandleSerializationEventArgs#item} can be converted to a {@link yfiles.system.MarkupExtension} instance. This handler is registered by default. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} e The event handler arguments. + */ + handleMarkupExtensionBasedSerialization(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of complex objects that are not handled by other callbacks. + * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff + * {@link yfiles.graphml.HandleSerializationEventArgs#item} is not a null reference. + * This handler is registered by default and uses {@link yfiles.graphml.XamlSerializer} to create XAML output. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} e The event handler arguments. + */ + handleXamlSerialization(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of null references. + * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff + * {@link yfiles.graphml.HandleSerializationEventArgs#item} is a null reference. This handler is registered by default + * and is only used to write null references in XML element syntax. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} e The event handler arguments. + */ + handleNullSerialization(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of undefined references. + * This sets {@link yfiles.graphml.HandleSerializationEventArgs#handled} to true iff + * {@link yfiles.graphml.HandleSerializationEventArgs#item} is a undefined reference. This handler is registered by default + * and is only used to write undefined references in XML element syntax. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} e The event handler arguments. + */ + handleUndefinedSerialization(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Event handler for the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} event. + * This event handler is used to propagate the {@link yfiles.graphml.GraphMLWriter#addHandleSerializationListener HandleSerialization} event to subscribers of + * {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization}. This implementation just calls {@link yfiles.graphml.GraphMLIOHandler#onHandleSerialization}, which in turn + * raises the {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization} event. + * @param {Object} sender + * @param {yfiles.graphml.HandleSerializationEventArgs} e + */ + onGraphMLWriterHandleSerialization(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Event handler for the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event. + * This event handler is used to propagate the {@link yfiles.graphml.GraphMLWriter#addQueryOutputHandlersListener QueryOutputHandlers} event to subscribers of + * {@link yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener QueryOutputHandlers}. This implementation just calls {@link yfiles.graphml.GraphMLIOHandler#onQueryOutputHandlers}, which in turn + * raises the {@link yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener QueryOutputHandlers} event. + * @param {Object} sender + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} e + */ + onGraphMLWriterQueryOutputHandlers(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Subscribe to this event to provide custom serialization handling for XML content. + * The current item is provided by {@link yfiles.graphml.HandleSerializationEventArgs#item}. + */ + addHandleSerializationListener(value:(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs)=> void):void; + /** + * Subscribe to this event to provide custom serialization handling for XML content. + * The current item is provided by {@link yfiles.graphml.HandleSerializationEventArgs#item}. + */ + removeHandleSerializationListener(value:(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs)=> void):void; + /** + * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IOutputHandler} instance(s) for + * a given GraphML attribute key definition. + * If you want to register an {@link yfiles.graphml.IOutputHandler} for this GraphML attribute, + * you can add the handler with {@link yfiles.graphml.QueryOutputHandlersEventArgs#addOutputHandler}. + */ + addQueryOutputHandlersListener(value:(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs)=> void):void; + /** + * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IOutputHandler} instance(s) for + * a given GraphML attribute key definition. + * If you want to register an {@link yfiles.graphml.IOutputHandler} for this GraphML attribute, + * you can add the handler with {@link yfiles.graphml.QueryOutputHandlersEventArgs#addOutputHandler}. + */ + removeQueryOutputHandlersListener(value:(sender:Object,e:yfiles.graphml.QueryOutputHandlersEventArgs)=> void):void; + /** + * Raises the {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization} event. + * @param {yfiles.graphml.HandleSerializationEventArgs} args The arguments for the {@link yfiles.graphml.GraphMLIOHandler#addHandleSerializationListener HandleSerialization} event. + */ + onHandleSerialization(args:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Raises the {@link yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener QueryOutputHandlers} event. + * @param {yfiles.graphml.QueryOutputHandlersEventArgs} args The arguments for the {@link yfiles.graphml.GraphMLIOHandler#addQueryOutputHandlersListener QueryOutputHandlers} event. + */ + onQueryOutputHandlers(args:yfiles.graphml.QueryOutputHandlersEventArgs):void; + /** + * Read GraphML from an existing XML document. + * @param {yfiles.graph.IGraph} graph + * The Graph object that is to be populated with nodes and edges as read from + * the document. + * @param {Document} doc The XML document. Note: If + * you are using Internet Explorer 9 and {@link XMLHttpRequest}s to retrieve the + * document, you may not use the value from the {@link XMLHttpRequest#responseXML} + * property. Please parse {@link XMLHttpRequest#responseText} instead and use the + * result. + * For further reference see . + * @throws {yfiles.system.ArgumentNullException} doc is null. + * @throws {yfiles.system.ArgumentNullException} graph is null. + * @see Specified by {@link yfiles.graphml.IGraphMLIOHandler#readFromDocument}. + */ + readFromDocument(graph:yfiles.graph.IGraph,doc:Document):void; + /** + * Reads a GraphML file from the given URL and populates the Graph + * object. + *

+ * Note that this is an asynchronous method that returns immediately. You can use the {@link yfiles.graphml.GraphMLIOHandler#readFromURLWithCallback} overload + * to be notified when the actual parsing has completed. + *

+ * @param {yfiles.graph.IGraph} graph + * The Graph object that is to be populated with nodes and edges as read from + * reader. + * @param reader + * The input stream that holds the GraphML file to be read. + * @see {@link Document#load} + * @throws {yfiles.system.ArgumentNullException} url is null. + * @throws {yfiles.system.ArgumentNullException} graph is null. + * @see Specified by {@link yfiles.graphml.IGraphMLIOHandler#readFromURL}. + */ + readFromURL(graph:yfiles.graph.IGraph,url:string):void; + /** + * Reads a GraphML file from the given GraphML file and populates the Graph + * object. + *

+ * Note that this is an asynchronous method that returns immediately. You can use the finishedCallback + * to be notified when the actual parsing has completed. + *

+ * @param {yfiles.graph.IGraph} graph + * The Graph object that is to be populated with nodes and edges as read from + * the GraphML file. + * @param filename + * The name of the file to be read. + * @param {function(Object, yfiles.system.EventArgs)} finishedCallback Optional callback that is called when parsing is complete. + * @see {@link Document#load} + * @throws {yfiles.system.ArgumentNullException} url is null. + * @throws {yfiles.system.ArgumentNullException} graph is null. + * @see Specified by {@link yfiles.graphml.IGraphMLIOHandler#readFromURLWithCallback}. + */ + readFromURLWithCallback(graph:yfiles.graph.IGraph,url:string,finishedCallback:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Convenience method that imports the graph + * from an XML data provided in a string data. + * @param {yfiles.graph.IGraph} graph + * The Graph object that is to be populated with nodes and edges as read from + * the GraphML data. + * @param {string} data A string that contains GraphML data. + * @see Specified by {@link yfiles.graphml.IGraphMLIOHandler#readFromGraphMLText}. + */ + readFromGraphMLText(graph:yfiles.graph.IGraph,data:string):void; + /** + * Register a {@link yfiles.model.IMapper} instance for + * use as an input data target. + * This methods creates and configures the necessary handler + * itself. + * @param {string} name The name of the attribute + * @param {yfiles.model.IMapper.} mapper the mapper that serves as data source + */ + addInputMapperWithName(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string,mapper:yfiles.model.IMapper):void; + /** + * Register a {@link yfiles.model.IMapper} instance for + * use as an input data target. + * This methods creates and configures the necessary handler + * itself. + * @param {function(Element):boolean} keyDefinitionPredicate The predicate function that will determine whether to create an {@link yfiles.graphml.IInputHandler} + * for the given key definition. + * @param {yfiles.model.IMapper.} mapper the mapper that serves as data source + */ + addInputMapperWithPredicate(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,keyDefinitionPredicate:(obj:Element)=>boolean,mapper:yfiles.model.IMapper):void; + /** + * Register a {@link yfiles.model.IMapper} instance for + * use as an input data target. This method uses a custom {@link system.EventHandler1} + * for the actual deserialization. + * This methods creates and configures the necessary handler + * itself. + * @param {string} name The name of the attribute + * @param {yfiles.graphml.KeyType} type The GraphML key type. + * @param {yfiles.model.IMapper.} mapper the mapper that serves as data source + * @param {function(Object, yfiles.graphml.HandleDeserializationEventArgs)} deserializationCallback custom deserialization callback. + */ + addInputMapperWithNameKeyTypeAndDeserializationCallback(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string,type:yfiles.graphml.KeyType,mapper:yfiles.model.IMapper,deserializationCallback:(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs)=> void):void; + /** + * Register a {@link yfiles.model.IMapper} instance for + * use as an input data target. This method uses a custom {@link system.EventHandler1} + * for the actual deserialization. + * This methods creates and configures the necessary handler + * itself. + * @param {function(Element):boolean} keyDefinitionPredicate The predicate function that will determine whether to create an {@link yfiles.graphml.IInputHandler} + * for the given key definition. + * @param {yfiles.model.IMapper.} mapper the mapper that serves as data source + * @param {function(Object, yfiles.graphml.HandleDeserializationEventArgs)} deserializationCallback custom deserialization callback. + */ + addInputMapperWithPredicateAndDeserializationCallback(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,keyDefinitionPredicate:(obj:Element)=>boolean,mapper:yfiles.model.IMapper,deserializationCallback:(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs)=> void):void; + /** + * Create a {@link yfiles.support.Future} instance that wraps an {@link yfiles.model.IMapper} for + * use as an input data target. + * The return value will only contain a value if a matching GraphML attribute has been read, + * which can be queried with {@link yfiles.support.Future#hasValue} + * This methods creates and configures the necessary handler + * itself. + * @param {string} name The name of the attribute + * @return {yfiles.support.Future.>} A {@link yfiles.support.Future} instance that wraps an {@link yfiles.model.IMapper} that actually holds the data. + */ + addInputMapperFutureWithName(KeyType:yfiles.lang.Class,DataType:yfiles.lang.Class,name:string):yfiles.support.Future>; + /** + * Create a {@link yfiles.support.Future} instance that wraps an {@link yfiles.model.IMapper} for + * use as an input data target. + * The return value will only contain a value if a matching GraphML attribute has been read, + * which can be queried with {@link yfiles.support.Future#hasValue} + * This methods creates and configures the necessary handler + * itself. + * @param {string} name The name of the attribute + * @param {yfiles.graphml.KeyType} type The desired {@link yfiles.graphml.KeyType} of the attribute. + * @return {yfiles.support.Future.>} A {@link yfiles.support.Future} instance that wraps an {@link yfiles.model.IMapper} that actually holds the data. + */ + addInputMapperFutureWithNameAndKeyType(KeyType:yfiles.lang.Class,DataType:yfiles.lang.Class,name:string,type:yfiles.graphml.KeyType):yfiles.support.Future>; + /** + * Create a {@link yfiles.support.Future} instance that wraps an {@link yfiles.model.IMapper} for + * use as an input data target. + * The return value will only contain a value if a matching GraphML attribute has been read, + * which can be queried with {@link yfiles.support.Future#hasValue} + * This methods creates and configures the necessary handler + * itself. + * @param {function(Element):boolean} keyDefinitionPredicate The predicate function that will determine whether to create an {@link yfiles.graphml.IInputHandler} + * for the given key definition. + * @return {yfiles.support.Future.>} A {@link yfiles.support.Future} instance that wraps an {@link yfiles.model.IMapper} that actually holds the data. + */ + addInputMapperFutureWithPredicate(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,keyDefinitionPredicate:(obj:Element)=>boolean):yfiles.support.Future>; + /** + * Create a {@link yfiles.support.Future} instance that wraps an {@link yfiles.model.IMapper} for + * use as an input data target. + * The return value will only contain a value if a matching GraphML attribute has been read, + * which can be queried with {@link yfiles.support.Future#hasValue} + * This methods creates and configures the necessary handler + * itself. + * @param {function(Object, yfiles.graphml.HandleDeserializationEventArgs)} deserializationCallback custom deserialization callback. + * @param {function(Element):boolean} keyDefinitionPredicate The predicate function that will determine whether to create an {@link yfiles.graphml.IInputHandler} + * for the given key definition. + * @return {yfiles.support.Future.>} A {@link yfiles.support.Future} instance that wraps an {@link yfiles.model.IMapper} that actually holds the data. + */ + addInputMapperFutureWithPredicateAndDeserializationCallback(KeyType:yfiles.lang.Class,DataType:yfiles.lang.Class,keyDefinitionPredicate:(obj:Element)=>boolean,deserializationCallback:(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs)=> void):yfiles.support.Future>; + /** + * Create a {@link yfiles.support.Future} instance that wraps an {@link yfiles.graphml.IInputHandler} that is dynamically created by factory. + * The return value will only contain a value if a matching GraphML attribute has been read, + * which can be queried with {@link yfiles.support.Future#hasValue}. The validity is determined by keyDefinitionPredicate. + * This methods creates and configures the necessary handler + * itself. + * @param {function(Element):boolean} keyDefinitionPredicate The predicate that matches the key definition. + * @param {yfiles.graphml.IGenericInputHandlerFactory} factory A factory to create {@link yfiles.graphml.IInputHandler} instances. + * @return {yfiles.support.Future.} A {@link yfiles.support.Future} instance that wraps an {@link yfiles.graphml.IInputHandler} that actually parses the data. + */ + addInputHandlerFactoryWithPredicate(keyDefinitionPredicate:(obj:Element)=>boolean,factory:yfiles.graphml.IGenericInputHandlerFactory):yfiles.support.Future; + /** + * Create a {@link yfiles.support.Future} instance that wraps an {@link yfiles.graphml.IInputHandler} + * that is dynamically created by factory. + * The return value will only contain a value if a matching GraphML attribute has been read, + * which can be queried with {@link yfiles.support.Future#hasValue}. + * The attribute must be registered under the attribute name name. + * This methods creates and configures the necessary handler + * itself. + * @param {string} name The name of the GraphML attribute. + * @param {yfiles.graphml.IGenericInputHandlerFactory} factory A factory to create {@link yfiles.graphml.IInputHandler} instances. + * @return {yfiles.support.Future.} A {@link yfiles.support.Future} instance that wraps an {@link yfiles.graphml.IInputHandler} that actually parses the data. + */ + addInputHandlerFactoryWithName(name:string,factory:yfiles.graphml.IGenericInputHandlerFactory):yfiles.support.Future; + /** + * Create a {@link yfiles.support.Future} instance that wraps an {@link yfiles.graphml.IInputHandler} + * that is dynamically created by factory. + * The return value will only contain a value if a matching GraphML attribute has been read, + * which can be queried with {@link yfiles.support.Future#hasValue}. + * The attribute must be registered under the attribute name name with a scope of scope. + * This methods creates and configures the necessary handler + * itself. + * @param {string} name The name of the GraphML attribute. + * @param {yfiles.graphml.KeyScope} scope The scope of the attribute. + * @param {yfiles.graphml.IGenericInputHandlerFactory} factory A factory to create {@link yfiles.graphml.IInputHandler} instances. + * @return {yfiles.support.Future.} A {@link yfiles.support.Future} instance that wraps an {@link yfiles.graphml.IInputHandler} that actually parses the data. + */ + addInputHandlerFactoryWithNameAndScope(name:string,scope:yfiles.graphml.KeyScope,factory:yfiles.graphml.IGenericInputHandlerFactory):yfiles.support.Future; + /** + * Create a {@link yfiles.support.Future} instance that wraps an {@link yfiles.graphml.IInputHandler} that stores the data in an + * {@link yfiles.model.IMapper} that will be {@link yfiles.graphml.GraphMLIOHandler#createMapper created} in the graph's {@link yfiles.graph.IMapperRegistry}. + * The return value will only contain a value if a matching GraphML attribute has been read, + * which can be queried with {@link yfiles.support.Future#hasValue}. + * The attribute must be registered under the attribute name name. + * This methods creates and configures the necessary handler + * itself and {@link yfiles.graphml.GraphMLIOHandler#createMapper creates} an {@link yfiles.model.IMapper} in the {@link yfiles.graph.IMapperRegistry} with name name. + * @param {string} name The name of the GraphML attribute and the key in the {@link yfiles.graph.IMapperRegistry}. + * @return {yfiles.support.Future.>} A {@link yfiles.support.Future} instance that wraps an {@link yfiles.model.IMapper} that actually holds the data. + */ + addRegistryInputMapper(KeyType:yfiles.lang.Class,DataType:yfiles.lang.Class,name:string):yfiles.support.Future>; + /** + * Create a {@link yfiles.support.Future} instance that wraps an {@link yfiles.graphml.IInputHandler} that stores the data in an + * {@link yfiles.model.IMapper} that will be {@link yfiles.graphml.GraphMLIOHandler#createMapper created} in the graph's {@link yfiles.graph.IMapperRegistry}. + * The return value will only contain a value if a matching GraphML attribute has been read, + * which can be queried with {@link yfiles.support.Future#hasValue}. + * The attribute must be registered under the attribute name name. + * This methods creates and configures the necessary handler + * itself and {@link yfiles.graphml.GraphMLIOHandler#createMapper creates} an {@link yfiles.model.IMapper} in the {@link yfiles.graph.IMapperRegistry} with name name. + * @param {string} name The name of the GraphML attribute and the key in the {@link yfiles.graph.IMapperRegistry}. + * @param {yfiles.graphml.KeyType} type The GraphML key type. + * @param {function(Object, yfiles.graphml.HandleDeserializationEventArgs)} deserializationCallback The custom deserialization callback, can be null which will result in default deserialization. + * @return {yfiles.support.Future.>} A {@link yfiles.support.Future} instance that wraps an {@link yfiles.model.IMapper} that actually holds the data. + */ + addRegistryInputMapperWithKeyTypeAndDeserializationCallback(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string,type:yfiles.graphml.KeyType,deserializationCallback:(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs)=> void):yfiles.support.Future>; + /** + * Create a {@link yfiles.support.Future} instance that wraps an {@link yfiles.graphml.IInputHandler} that stores the data in an + * {@link yfiles.model.IMapper} that will be {@link yfiles.graphml.GraphMLIOHandler#createMapper created} in the graph's {@link yfiles.graph.IMapperRegistry}. + * The return value will only contain a value if a matching GraphML attribute has been read, + * which can be queried with {@link yfiles.support.Future#hasValue}. + * This methods creates and configures the necessary handler + * itself and {@link yfiles.graphml.GraphMLIOHandler#createMapper creates} an {@link yfiles.model.IMapper} in the {@link yfiles.graph.IMapperRegistry} with name name. + * @param {Object} name The name of the GraphML attribute and the key in the {@link yfiles.graph.IMapperRegistry}. + * @param {function(Element):boolean} keyDefinitionPredicate A predicate to determine whether the key definition is valid. + * @param {function(Object, yfiles.graphml.HandleDeserializationEventArgs)} deserializationCallback The custom deserialization callback, can be null which will result in default deserialization. + * @return {yfiles.support.Future.>} A {@link yfiles.support.Future} instance that wraps an {@link yfiles.model.IMapper} that actually holds the data. + */ + addRegistryInputMapperWithPredicateAndDeserializationCallback(KeyType:yfiles.lang.Class,DataType:yfiles.lang.Class,name:Object,keyDefinitionPredicate:(obj:Element)=>boolean,deserializationCallback:(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs)=> void):yfiles.support.Future>; + /** + * Callback used by {@link yfiles.graphml.GraphMLIOHandler#addRegistryInputMapper} and its overloads to creates the mapper instance. + * This method creates the mapper instance, unless there is an existing mapper in the target graph with a matching type. + * In this case the existing mapper is returned. In all other cases a new mapper will be created using + * {@link yfiles.graph.MapperRegistryExtensions#addMapper} + * and returned. + * @param {Object} registryTag The tag for the mapper in the registry. + * @param {yfiles.graphml.IParseContext} parseContext The current parse context to obtain the graph from. + * @return {yfiles.model.IMapper.} The mapper instance to use. + */ + createMapper(keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,registryTag:Object,parseContext:yfiles.graphml.IParseContext):yfiles.model.IMapper; + /** + * Create an {@link yfiles.graphml.IGraphElementFactory} instance that creates the graph elements for the graph instance. + *

+ * This method is called for each parse process. + *

+ * @param {yfiles.graphml.GraphMLParser} parser The parser to use. + * @param {yfiles.graph.IGraph} graph The graph that is populated. + * @return {yfiles.graphml.IGraphElementFactory} An {@link yfiles.graphml.IGraphElementFactory} instance that is configured for the given parameters. + */ + createGraphElementFactory(parser:yfiles.graphml.GraphMLParser,graph:yfiles.graph.IGraph):yfiles.graphml.IGraphElementFactory; + /** + * Create a suitable instance of {@link yfiles.graphml.GraphMLParser} that can handle the given graph. + *

+ * This method is called for each parse process. + *

+ * @param {yfiles.graph.IGraph} graph The graph that should be filled by this instance + * @return {yfiles.graphml.GraphMLParser} a suitable instance of {@link yfiles.graphml.GraphMLParser} that can handle the given graph + */ + createGraphMLParser(graph:yfiles.graph.IGraph):yfiles.graphml.GraphMLParser; + /** + * Raises the {@link yfiles.graphml.GraphMLIOHandler#addParsedListener Parsed} event. + * This method is called when the document has been parsed and after {@link yfiles.graphml.IParseEvents#addDocumentParsedListener DocumentParsed} + * is called. + * @param {yfiles.graphml.ParseEventArgs} args The {@link yfiles.graphml.ParseEventArgs} instance containing the event data. + * @see {@link yfiles.graphml.GraphMLIOHandler#addParsedListener Parsed} + */ + onParsed(args:yfiles.graphml.ParseEventArgs):void; + /** + * Occurs when the the document has been parsed. + * @see {@link yfiles.graphml.GraphMLIOHandler#onParsed} + * @see {@link yfiles.graphml.GraphMLParser#addParsedListener Parsed} + */ + addParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when the the document has been parsed. + * @see {@link yfiles.graphml.GraphMLIOHandler#onParsed} + * @see {@link yfiles.graphml.GraphMLParser#addParsedListener Parsed} + */ + removeParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Raises the {@link yfiles.graphml.GraphMLIOHandler#addParsingListener Parsing} event. + * This method is called just before the parsing starts and before {@link yfiles.graphml.IParseEvents#addDocumentParsingListener DocumentParsing} + * is called. + * @param {yfiles.graphml.ParseEventArgs} args The {@link yfiles.graphml.ParseEventArgs} instance containing the event data. + * @see {@link yfiles.graphml.GraphMLIOHandler#addParsingListener Parsing} + */ + onParsing(args:yfiles.graphml.ParseEventArgs):void; + /** + * Occurs when the parsing of a document is just about to begin. + * This event can be used to register to the fine-grained events available in + * the {@link yfiles.graphml.ParseEventArgs#context}'s {@link yfiles.graphml.IParseContext#parseEvents} and + * to configure the parsing process on a per parse case. + * @see {@link yfiles.graphml.GraphMLIOHandler#onParsing} + * @see {@link yfiles.graphml.GraphMLParser#addParsingListener Parsing} + */ + addParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when the parsing of a document is just about to begin. + * This event can be used to register to the fine-grained events available in + * the {@link yfiles.graphml.ParseEventArgs#context}'s {@link yfiles.graphml.IParseContext#parseEvents} and + * to configure the parsing process on a per parse case. + * @see {@link yfiles.graphml.GraphMLIOHandler#onParsing} + * @see {@link yfiles.graphml.GraphMLParser#addParsingListener Parsing} + */ + removeParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Configures the lookup of the given parser. + *

+ * This method is called for each parse process. + *

+ * @param {yfiles.graphml.GraphMLParser} parser The parser to configure. + */ + configureParserLookup(parser:yfiles.graphml.GraphMLParser):void; + /** + * Create a default implementation if {@link yfiles.graphml.IXamlTypeMapper} that allows to map + * type specifications in XAML to CLR types. + *

+ * This method is called for each parse process. + *

+ * @return {yfiles.graphml.IXamlTypeMapper} A suitable implementation of {@link yfiles.graphml.IXamlTypeMapper} + */ + createXamlTypeMapper(parser:yfiles.graphml.GraphMLParser):yfiles.graphml.IXamlTypeMapper; + /** + * Configures default event handlers for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event. + *

This implementation configures several input handlers for the standard yFiles WPF GraphML attributes (styles, folding state, + * labels, geometry).

+ *

+ * This method is called for each parse process. + *

+ * @param {yfiles.graphml.GraphMLParser} parser The parser that should be configured. + */ + configureInputHandlers(parser:yfiles.graphml.GraphMLParser):void; + /** + * Predefined input handler that reads node layouts. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryInputHandlersEventArgs} e + */ + registerNodeLayoutInputHandler(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Predefined input handler that reads node labels. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryInputHandlersEventArgs} e + */ + registerNodeLabelsInputHandler(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Predefined input handler that reads {@link yfiles.graph.IGraph} graph default settings. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event + */ + registerGraphSettingsInputHandler(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Predefined input handler that reads edge bends. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryInputHandlersEventArgs} e + */ + registerEdgeBendsInputHandler(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Predefined input handler that reads {@link yfiles.support.ITagOwner} tags. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryInputHandlersEventArgs} e + */ + registerTagInputHandler(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Predefined input handler that reads node styles. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryInputHandlersEventArgs} e + */ + registerNodeStyleInputHandler(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Predefined input handler that reads edge styles. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryInputHandlersEventArgs} e + */ + registerEdgeStyleInputHandler(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Predefined input handler that reads port styles. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryInputHandlersEventArgs} e + */ + registerPortStyleInputHandler(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Predefined input handler that reads port locations. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryInputHandlersEventArgs} e + */ + registerPortLocationInputHandler(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Predefined input handler that reads edge labels. + * This handler is by default registered for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event + * @param {Object} sender + * @param {yfiles.graphml.QueryInputHandlersEventArgs} e + */ + registerEdgeLabelsInputHandler(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Configure the predefined handlers for the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. + *

Except for text content, primitive types and s, this implementation delegates + * all work to {@link yfiles.graphml.XamlDeserializer}

+ *

+ * This method is called for each parse process. + *

+ * @param {yfiles.graph.IGraph} graph The graph that will be parsed. + * @param {yfiles.graphml.GraphMLParser} parser The parser to configure. + * @see {@link yfiles.graphml.GraphMLIOHandler#handlePrimitivesDeserialization} + * @see {@link yfiles.graphml.XamlDeserializer#handleDeserialization} + * @see {@link yfiles.graphml.TextNodeDeserializer#handleDeserialization} + */ + configureDeserializationHandlers(graph:yfiles.graph.IGraph,parser:yfiles.graphml.GraphMLParser):void; + /** + * Event handler for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event. + * This event handler is used to propagate the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event to subscribers of + * {@link yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener QueryInputHandlers}. This implementation just calls {@link yfiles.graphml.GraphMLIOHandler#onQueryInputHandlers}, which in turn + * raises the {@link yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener QueryInputHandlers} event. + * @param {Object} sender + * @param {yfiles.graphml.QueryInputHandlersEventArgs} e + */ + onGraphMLParserQueryInputHandlers(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Event handler for the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. + * This event handler is used to propagate the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event to subscribers of + * {@link yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener HandleDeserialization}. This implementation just calls {@link yfiles.graphml.GraphMLIOHandler#onHandleDeserialization}, which in turn + * raises the {@link yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener HandleDeserialization} event. + * @param {Object} sender + * @param {yfiles.graphml.HandleDeserializationEventArgs} e + */ + onGraphMLParserHandleDeserialization(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs):void; + /** + * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IInputHandler} instance(s) for + * a given GraphML attribute key definition. + * The current key definition is provided by {@link yfiles.graphml.QueryInputHandlersEventArgs#keyDefinition}. If you + * want to register an {@link yfiles.graphml.IInputHandler} for this GraphML attribute, + * you can add the handler with {@link yfiles.graphml.QueryInputHandlersEventArgs#addInputHandler} method. + * Implementations should also consider the {@link yfiles.graphml.QueryInputHandlersEventArgs#handled} property. + * @see {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} + */ + addQueryInputHandlersListener(value:(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs)=> void):void; + /** + * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IInputHandler} instance(s) for + * a given GraphML attribute key definition. + * The current key definition is provided by {@link yfiles.graphml.QueryInputHandlersEventArgs#keyDefinition}. If you + * want to register an {@link yfiles.graphml.IInputHandler} for this GraphML attribute, + * you can add the handler with {@link yfiles.graphml.QueryInputHandlersEventArgs#addInputHandler} method. + * Implementations should also consider the {@link yfiles.graphml.QueryInputHandlersEventArgs#handled} property. + * @see {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} + */ + removeQueryInputHandlersListener(value:(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs)=> void):void; + /** + * Subscribe to this event to provide custom deserialization handling for XML content. + * The current XML content is provided by {@link yfiles.graphml.HandleDeserializationEventArgs#xmlNode}. If you want to return + * deserialized content, set the value of the {@link yfiles.graphml.HandleDeserializationEventArgs#result} property. + * @see {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} + */ + addHandleDeserializationListener(value:(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs)=> void):void; + /** + * Subscribe to this event to provide custom deserialization handling for XML content. + * The current XML content is provided by {@link yfiles.graphml.HandleDeserializationEventArgs#xmlNode}. If you want to return + * deserialized content, set the value of the {@link yfiles.graphml.HandleDeserializationEventArgs#result} property. + * @see {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} + */ + removeHandleDeserializationListener(value:(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs)=> void):void; + /** + * Raises the {@link yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener QueryInputHandlers} event. + * @param {yfiles.graphml.QueryInputHandlersEventArgs} args The arguments for the {@link yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener QueryInputHandlers} event. + */ + onQueryInputHandlers(args:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Raises the {@link yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener HandleDeserialization} event. + * @param {yfiles.graphml.HandleDeserializationEventArgs} args The arguments for the {@link yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener HandleDeserialization} event. + */ + onHandleDeserialization(args:yfiles.graphml.HandleDeserializationEventArgs):void; + /** + * Handle the serialization of primitive types, enums and strings. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} e The event handler arguments. + */ + handlePrimitivesSerialization(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of wrapped enums. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleSerializationEventArgs} e The event handler arguments. + */ + handleEnumSerialization(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs):void; + /** + * Handle the serialization of primitive types, enums and strings. + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleDeserializationEventArgs} e The event handler arguments. + */ + handlePrimitivesDeserialization(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs):void; + /** + * Handle the serialization of types that extend . + * @param {Object} sender The origin of the event. + * @param {yfiles.graphml.HandleDeserializationEventArgs} e The event handler arguments. + */ + handleJSONDeserialization(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs):void; + } + var GraphMLIOHandler:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of GraphMLIOHandler. + */ + new ():yfiles.graphml.GraphMLIOHandler; + /** + * Get the {@link yfiles.graphml.KeyScope} from an GraphML keyDefinition element. + * If no for attribute is present, this method returns {@link yfiles.graphml.KeyScope#ALL}. + * @param {Element} keyDefinition The GraphML key definition to parse. + * @return {yfiles.graphml.KeyScope} The {@link yfiles.graphml.KeyScope} from keyDefinition. + */ + getKeyScope(keyDefinition:Element):yfiles.graphml.KeyScope; + /** + * Get the {@link yfiles.graphml.KeyType} from an GraphML keyDefinition element. + * If no for attribute is present, this method returns {@link yfiles.graphml.KeyType#COMPLEX}. + * @param {Element} keyDefinition The GraphML key definition to parse. + * @return {yfiles.graphml.KeyType} The {@link yfiles.graphml.KeyType} from keyDefinition. + */ + getKeyType(keyDefinition:Element):yfiles.graphml.KeyType; + /** + * Get the attribute name from an GraphML keyDefinition element. + * If no attr.name attribute is present, this method returns {@link String#EMPTY}. + * @param {Element} keyDefinition The GraphML key definition to parse. + * @return {string} The attribute name from keyDefinition. + */ + getKeyName(keyDefinition:Element):string; + /** + * Get the attribute URI from an GraphML keyDefinition element. + * If no attr.uri attribute is present, this method returns {@link String#EMPTY}. + * @param {Element} keyDefinition The GraphML key definition to parse. + * @return {string} The attribute URI from keyDefinition. + */ + getKeyUri(keyDefinition:Element):string; + }; + /** + * Constant class that provides names for the standard yFiles for HTML GraphML attributes. + * These key names are used as values for the attr.name attribute in GraphML key definitions. + * @see {@link yfiles.graphml.ReferenceConstants} + */ + export interface StandardAttributeNames extends Object{ + } + var StandardAttributeNames:{ + $class:yfiles.lang.Class; + /** + * GraphML attribute for node geometry. + */ + NODE_GEOMETRY_KEY_NAME:string; + /** + * GraphML attribute for node style. + */ + NODE_STYLE_KEY_NAME:string; + /** + * GraphML attribute for graph settings (node, edge, defaults, etc.). + */ + GRAPH_SETTINGS_KEY_NAME:string; + /** + * GraphML attribute for {@link yfiles.support.ITagOwner#tag}. + */ + ITEM_TAG_KEY_NAME:string; + /** + * GraphML attribute for node labels. + */ + NODE_LABELS_KEY_NAME:string; + /** + * GraphML attribute for edge style. + */ + EDGE_STYLE_KEY_NAME:string; + /** + * GraphML attribute for port style. + */ + PORT_STYLE_KEY_NAME:string; + /** + * GraphML attribute for edge labels. + */ + EDGE_LABELS_KEY_NAME:string; + /** + * GraphML attribute for edge geometry. + */ + EDGE_GEOMETRY_KEY_NAME:string; + /** + * GraphML attribute for edge geometry. + */ + EDGE_REFERENCE_KEY_NAME:string; + /** + * GraphML attribute for port location. + */ + PORT_LOCATION_KEY_NAME:string; + }; + /** + * Class that provides constants for common namespace declarations and schema locations. + */ + export interface NamespaceConstants extends Object{ + } + var NamespaceConstants:{ + $class:yfiles.lang.Class; + /** + * The default namespace URI for the yFiles extensions to graphml that are specific to yFiles for HTML. + * This field has the constant value "http://www.yworks.com/xml/yfiles-for-html/1.0/xaml" + * @see {@link yfiles.canvas.XamlConstants#YFILES_FOR_HTML_XAML_NS} + */ + YFILES_FOR_HTML_XAML_NS:string; + /** + * The XML namespace prefix for yFiles elements specific to yFiles for HTML. + * This field has the constant value "ysl" + * @see {@link yfiles.canvas.XamlConstants#YFILES_FOR_HTML_XAML_PREFIX} + */ + YFILES_FOR_HTML_XAML_PREFIX:string; + /** + * The namespace URI for common yFiles extensions to GraphML. + * This field has the constant value "http://www.yworks.com/xml/yfiles-common/2.0" + * @see {@link yfiles.canvas.XamlConstants#YFILES_COMMON_NS} + */ + YFILES_COMMON_NS:string; + /** + * The default namespace prefix for {@link yfiles.graphml.NamespaceConstants#YFILES_COMMON_NS}. + * This field has the constant value "yfiles" + * @see {@link yfiles.graphml.NamespaceConstants#YFILES_COMMON_NS} + */ + YFILES_COMMON_PREFIX:string; + /** + * The namespace URI for common yFiles extensions to GraphML. + * This field has the constant value "http://www.yworks.com/xml/yfiles-common/markup/2.0" + * @see {@link yfiles.canvas.XamlConstants#YFILES_COMMON_MARKUP_NS} + */ + YFILES_COMMON_MARKUP_NS:string; + /** + * The default namespace prefix for {@link yfiles.graphml.NamespaceConstants#YFILES_COMMON_MARKUP_NS}. + * This field has the constant value "x" + * @see {@link yfiles.graphml.NamespaceConstants#YFILES_COMMON_MARKUP_NS} + */ + YFILES_COMMON_MARKUP_PREFIX:string; + /** + * The default namespace URI for the GraphML core namespace. + * This field has the constant value "http://graphml.graphdrawing.org/xmlns" + */ + GRAPHML_CORE_NS:string; + /** + * The schema location for yFiles for HTML enhanced GraphML. + * This field has the constant value "http://www.yworks.com/xml/schema/graphml.html/1.0/ygraphml.xsd" + */ + YFILES_SCHEMA_LOCATION:string; + }; + /** + * An implementation of the {@link yfiles.graphml.IGraphElementFactory} + * interface that decorates a given instance to add the {@link yfiles.graph.FoldingManager folding capabilities} + * on top of it. + */ + export interface FoldingManagerGraphElementFactory extends Object,yfiles.graphml.IGraphElementFactory{ + /** + * Creates the node using the core factory that has been provided to the constructor. + * This instance will try to obtain the {@link yfiles.graphml.CreationProperties} + * from the context's {@link yfiles.support.ILookup#lookup}. + * The following properties are queried from the properties if they have been found and used + * for initializing the {@link yfiles.graph.FoldingManager folding manager} related properties: + *
    + *
  • + * "folding/NodeViewState" + * An {@link yfiles.collections.IDictionary} for {@link yfiles.graph.DummyNodeId} and {@link yfiles.graph.INode} + * that describes the alternative view states of the node. + *
  • + *
  • + * "folding/Expanded" + * A {@link Boolean} that determines whether the group node should be {@link yfiles.graph.IFoldedGraph#isExpanded expanded} + * initially in the default view. + *
  • + *
+ * @see Specified by {@link yfiles.graphml.IGraphElementFactory#createNode}. + */ + createNode(context:yfiles.graphml.IParseContext):yfiles.graph.INode; + /** + * Creates the edge using the core factory that has been provided to the constructor. + * This instance will try to obtain the {@link yfiles.graphml.CreationProperties} + * from the context's {@link yfiles.support.ILookup#lookup}. + * The following properties are queried from the properties if they have been found and used + * for initializing the {@link yfiles.graph.FoldingManager folding manager} related properties: + *
    + *
  • + * Property name (key) + * The value and its usage + *
  • + *
  • + * "folding/EdgeViewState"/> + * An {@link yfiles.collections.IList} of {@link yfiles.collections.KeyValuePair}s for {@link yfiles.graph.DummyEdgeId} and {@link yfiles.graphml.EdgeViewState} + * that describes the alternative view states of the edge. + *
  • + *
+ * @see Specified by {@link yfiles.graphml.IGraphElementFactory#createEdge}. + */ + createEdge(context:yfiles.graphml.IParseContext,sourceNode:yfiles.graph.INode,sourcePort:yfiles.graph.IPort,targetNode:yfiles.graph.INode,targetPort:yfiles.graph.IPort):yfiles.graph.IEdge; + /** + * Creates the port using the core factory that has been provided to the constructor. + * This instance will try to obtain the {@link yfiles.graphml.CreationProperties} + * from the context's {@link yfiles.support.ILookup#lookup}. + * The following properties are queried from the properties if they have been found and used + * for initializing the {@link yfiles.graph.FoldingManager folding manager} related properties: + *
    + *
  • + * Property name (key) + * The value and its usage + *
  • + *
  • + * "folding/PortViewState" + * An {@link yfiles.collections.IDictionary} for {@link yfiles.graph.DummyNodePortId} and {@link yfiles.graph.IPort} + * that describes the alternative view states of the node. + *
  • + *
+ * @see Specified by {@link yfiles.graphml.IGraphElementFactory#addPort}. + */ + addPort(context:yfiles.graphml.IParseContext,portOwner:yfiles.graph.IPortOwner):yfiles.graph.IPort; + } + var FoldingManagerGraphElementFactory:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.FoldingManagerGraphElementFactory} class. + * @param {yfiles.graphml.IGraphElementFactory} coreFactory The core factory to delegate the actual creation to. + */ + new (coreFactory:yfiles.graphml.IGraphElementFactory):yfiles.graphml.FoldingManagerGraphElementFactory; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface NodeViewState extends Object{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + layout:yfiles.geometry.RectD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + labels:yfiles.objectcollections.IList; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + style:yfiles.drawing.INodeStyle; + } + var NodeViewState:{ + $class:yfiles.lang.Class; + new ():yfiles.graphml.NodeViewState; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface EdgeViewState extends Object{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + labels:yfiles.objectcollections.IList; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + style:yfiles.drawing.IEdgeStyle; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + bends:yfiles.objectcollections.IList; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + sourcePort:yfiles.graph.IPort; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + targetPort:yfiles.graph.IPort; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + tag:Object; + } + var EdgeViewState:{ + $class:yfiles.lang.Class; + new ():yfiles.graphml.EdgeViewState; + }; + /** + * This is the event argument that is used by the {@link yfiles.graphml.IWriteEvents} interface + * that can be queried from the {@link yfiles.graphml.IWriteContext#writeEvents} property. + * This class holds a reference to the {@link yfiles.graphml.WriteEventArgs#context write context} and the + * {@link yfiles.graphml.WriteEventArgs#item} that is currently being written. + */ + export interface WriteEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the context that is being used for writing. + * Value: The context. + */ + context:yfiles.graphml.IWriteContext; + /** + * Gets the item that is currently being written or null if nothing is applicable. + * Value: The item being written. + */ + item:Object; + } + var WriteEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.WriteEventArgs} class. + * @param {yfiles.graphml.IWriteContext} context The context to assign to {@link yfiles.graphml.WriteEventArgs#context}. + * @param {Object} item The item to assign to {@link yfiles.graphml.WriteEventArgs#item}. + */ + new (context:yfiles.graphml.IWriteContext,item:Object):yfiles.graphml.WriteEventArgs; + }; + /** + * Interface that allows a mark and identify shared resources. + * @see {@link yfiles.graphml.IReferenceHandler} + */ + export interface IReferenceHandle extends Object{ + /** + * The type of a resource (external or internal). + * @see Specified by {@link yfiles.graphml.IReferenceHandle#referenceType}. + */ + referenceType:yfiles.graphml.GraphMLReferenceType; + /** + * The resource that is encapsulated by the handle. + * @see Specified by {@link yfiles.graphml.IReferenceHandle#subject}. + */ + subject:Object; + /** + * The id that identifies the resource in the GraphML document. + * Note that this value is ignored for internal references. + * @see Specified by {@link yfiles.graphml.IReferenceHandle#id}. + */ + id:string; + } + var IReferenceHandle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface defines methods to write and configure shared sections in the + * resulting GraphML output. + * This interface provides infrastructure for both external and internal (i.e. stored in the GraphML document) references. + *

Usually, it is not necessary to use this interface directly from client code.

+ */ + export interface IReferenceHandler extends Object{ + /** + * Register a shared resource. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {Object} subject The resource to register. + * @return {boolean} true iff the resource needs to be serialized; otherwise the resource is either a duplicate resource + * or is declared externally and does not need any additional handling. + * @see Specified by {@link yfiles.graphml.IReferenceHandler#registerResource}. + */ + registerResource(context:yfiles.graphml.IWriteContext,subject:Object):boolean; + /** + * Unregister a shared resource. + * This allows to explicitly mark a resource as unshared even if it is referenced multiple times in the object graph. + * If a resource has already been registered with {@link yfiles.graphml.IReferenceHandler#registerResource}, it will be unmarked. In addition, subsequent + * calls to {@link yfiles.graphml.IReferenceHandler#registerResource} for the same reference won't mark the resource as shared again. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {Object} subject The resource to register. + * @see {@link yfiles.graphml.IReferenceHandler#registerResource} + * @see {@link yfiles.graphml.GraphMLAttribute#shareable} + * @see Specified by {@link yfiles.graphml.IReferenceHandler#markAsUnshared}. + */ + markAsUnshared(context:yfiles.graphml.IWriteContext,subject:Object):void; + /** + * Query whether subject has already been registered as an internal resource before. The resource is not + * registered by this call. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {Object} subject The resource to register. + * @return {boolean} true iff subject has not been registered as internal resource before. + * @see {@link yfiles.graphml.IReferenceHandler#registerResource} + * @see Specified by {@link yfiles.graphml.IReferenceHandler#isNewInternalResource}. + */ + isNewInternalResource(context:yfiles.graphml.IWriteContext,subject:Object):boolean; + /** + * Return a collection of all registered reference handles that should be written to the GraphML shared data section. + * @see {@link yfiles.graphml.GraphMLIOHandler#QueryReferenceId} + * @see {@link yfiles.graphml.GraphMLWriter#QueryReferenceId} + * @see Specified by {@link yfiles.graphml.IReferenceHandler#internalHandles}. + */ + internalHandles:yfiles.collections.IEnumerable; + /** + * Gets the reference handle for a given subject. + * @param {Object} subject The subject. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @return {yfiles.graphml.IReferenceHandle} A handle for the resource subject, or null if the resource + * is not registered. + * @see {@link yfiles.graphml.IReferenceHandle} + * @see {@link yfiles.graphml.IReferenceHandle#subject} + * @see Specified by {@link yfiles.graphml.IReferenceHandler#getHandle}. + */ + getHandle(context:yfiles.graphml.IWriteContext,subject:Object):yfiles.graphml.IReferenceHandle; + } + var IReferenceHandler:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Constant class for common serialization properties. + * @see {@link yfiles.graphml.IWriteContext#getSerializationProperty} + */ + export interface SerializationProperties extends Object{ + } + var SerializationProperties:{ + $class:yfiles.lang.Class; + /** + * Property key to control user tag serialization. + * If this property is set to true in the write context, + * user tags are not serialized. Default for this property is false + */ + DISABLE_USER_TAGS:yfiles.support.TypedKey; + /** + * Property key to control user tag serialization of table {@link yfiles.graph.IStripe stripes}. + * If this property is set to true in the write context, + * user tags for tables stripes are not serialized. Default value for this property is false. + * If {@link yfiles.graphml.SerializationProperties#DISABLE_USER_TAGS} is set to false then stripe user tags will not be written so setting both properties is not necessary. + */ + DISABLE_STRIPE_USER_TAGS:yfiles.support.TypedKey; + /** + * Property key to control the serialization of the {@link yfiles.graph.IGraph}'s default settings. + * If this property is set to true in the write context, + * the graph defaults are serialized. Default for this property is false + */ + WRITE_GRAPH_SETTINGS:yfiles.support.TypedKey; + /** + * Property key to omit deserialization of the {@link yfiles.graph.IGraph}'s default settings. + * If this property is set to true in the parse context, + * the graph defaults are not parsed and applied. Default for this property is false + */ + DISABLE_GRAPH_SETTINGS:yfiles.support.TypedKey; + /** + * Property key to control caching for external references. + * If this property is set to false in the write context, + * the writer will not cache remember external reference ids provided via , i.e. the event will be raised + * whenever an instance of the external object is encountered during the write process. This allows to provide different values for the same object, depending on the current context. + * Default for this property is true + */ + CACHE_EXTERNAL_REFERENCES:yfiles.support.TypedKey; + /** + * Property key to control how undefined values are serialized. + * The default for this property is {@link yfiles.graphml.UndefinedHandling#EXPLICIT}. + */ + UNDEFINED_HANDLING:yfiles.support.TypedKey; + /** + * The current {@link yfiles.graphml.KeyScope} in which an {@link yfiles.graphml.IOutputHandler}, , + * or custom serialization code is called. + */ + CURRENT_KEY_SCOPE:yfiles.support.TypedKey; + /** + * The edge that is currently being represented by the dummy edge that is written instead. + * If this value is set, then the edge currently being serialized represents the given edge in reality. + */ + REPRESENTED_EDGE:yfiles.support.TypedKey; + /** + * Enforce writing of an enclosing tag for string (and possibly other primitive) values in list and top level context. + */ + FORCE_ENCLOSING_TAG:yfiles.support.TypedKey; + /** + * Enforce writing of a specific version of the folding related tags. + * The value should be a {@link yfiles.system.Decimal} with either of the following values: + * 1.0 - for the version prefixed with http://www.yworks.com/xml/yfiles-common/2.0/folding. + * 1.1 - for the version prefixed with http://www.yworks.com/xml/yfiles-common/2.0/folding/1.1. + * If no value is specified the latest and greatest version will be used by default. + */ + FOLDING_VERSION:yfiles.support.TypedKey; + /** + * Write the default node style in the <default> element of the key definition. + * A {@link Boolean} value indicates whether the default should be written. + */ + WRITE_NODE_STYLE_DEFAULT:yfiles.support.TypedKey; + /** + * Write the default edge style in the <default> element of the key definition. + * A {@link Boolean} value indicates whether the default should be written. + */ + WRITE_EDGE_STYLE_DEFAULT:yfiles.support.TypedKey; + /** + * Write the default port style in the <default> element of the key definition. + * A {@link Boolean} value indicates whether the default should be written. + */ + WRITE_PORT_STYLE_DEFAULT:yfiles.support.TypedKey; + /** + * Property key to specify whether the stripe defaults of a table should be written. + * If set to true the {@link yfiles.graph.ITable#columnDefaults} and {@link yfiles.graph.ITable#rowDefaults} will be written. + * Default value is true. + */ + WRITE_STRIPE_DEFAULTS:yfiles.support.TypedKey; + /** + * Provides a {@link system.Predicate} that determines if the preferred size of a label should be written. + * If this property is not set, the label size is always written. + */ + WRITE_LABEL_SIZE_PREDICATE:yfiles.support.TypedKey<(v:yfiles.graph.ILabel)=>boolean>; + /** + * The current {@link String} base URI which is used for the GraphML file being parsed or written. + * If set, this can be used to resolve or create relative paths. + */ + BASE_URI:yfiles.support.TypedKey; + /** + * Whether to rewrite relative URIs relative to the current document location. + * If set, relative URIs for images and other resources are rewritten relative to {@link yfiles.graphml.SerializationProperties#BASE_URI}. If this property is false, or if {@link yfiles.graphml.SerializationProperties#BASE_URI} is not set (either explicitly or implicitly) or the + * resource URI is not relative, the resource URI will not be rewritten. + *

+ * Default value is true. + *

+ */ + REWRITE_RELATIVE_RESOURCE_URIS:yfiles.support.TypedKey; + /** + * If set to true errors during XAML deserialization will be ignored and instead null will be returned. + */ + IGNORE_XAML_DESERIALIZATION_ERRORS:yfiles.support.TypedKey; + CONVERT_PROPERTY_CASE:yfiles.support.TypedKey; + }; + /** + * GraphML support attribute that can be used to make it possible to identify instances of the attributed types as + * static fields or properties. + * When a type is annotated with this attribute, all types in the {@link yfiles.graphml.SingletonSerializationAttribute#containerTypes} array are searched + * for public static fields or properties that have the annotated type. The GraphML writer will write these members as + * as static extensions instead of the usual serialization. + * Using the following annotation + *

+    * 'ContainedType': new yfiles.ClassDefinition(function() {
+    *       return {            
+    *          '$meta': function() {
+    *           return [yfiles.graphml.SingletonSerializationAttribute().init({"containerTypes" : [ContainingType.$class]})];
+    *        }
+    * 
+ * has the effect that all references to field ContainedTypeSingleton will be written + * as static extensions, e.g. + *

+    * {x:Static myNSDeclarationPrefix:ContainingType.ContainedTypeSingleton}
+    * 
+ * @see {@link yfiles.graphml.SingletonSerializationAttribute#containerTypes} + */ + export interface SingletonSerializationAttribute extends yfiles.lang.Attribute{ + /** + * Types that should be searched for static field or property members of the annotated type. + */ + containerTypes:yfiles.lang.Class[]; + } + var SingletonSerializationAttribute:{ + $class:yfiles.lang.Class; + new ():yfiles.graphml.SingletonSerializationAttribute; + }; + export enum GraphMLReferenceType{ + /** + * Specifies an internal resource, i.e. the serialized form of the resource is stored + * in the GraphML document itself. + */ + INTERNAL, + /** + * Specifies an external resource, i.e. the resource description is not stored + * in the GraphML document itself. + */ + EXTERNAL + } + export enum GraphMLSharingMode{ + /** + * Specifies that the share mode of a member should be determined automatically according + * to the current property value. + */ + AUTO, + /** + * Never share the object. + */ + NEVER, + /** + * Always share the object. + */ + ALWAYS + } + export enum GraphMLSerializationMode{ + /** + * The framework decides itself whether a property is to be written. + */ + AUTO, + /** + * Never write the property. + */ + NEVER, + /** + * Always write the property. + * This can be used to override default value handling of the + * XAML serializer and force writing of read-only properties. + */ + ALWAYS + } + export enum UndefinedHandling{ + /** + * Explicitly read and write undefined values. + */ + EXPLICIT, + /** + * Throw an exception when undefined values are encountered. + */ + THROW, + /** + * Treat undefined values like null values. + */ + AS_NULL, + /** + * Treat undefined values as default values. + * Default values are never written. + */ + AS_DEFAULT + } + export enum XamlAttributeWriteMode{ + /** + * Specifies that the write mode of a member should be determined automatically according + * to the current property value and the presence of {@link yfiles.system.TypeConverter}s, {@link yfiles.system.ValueSerializer}s and the like. + * Usually, an implementation would write the member as attribute if the content can somehow be (directly or indirectly) + * converted to a valid XML attribute content (i.e. a simple string) + */ + AUTO, + /** + * Never write as a XML attribute, even if a possible conversion exists. + */ + NEVER, + /** + * Always write as XML attribute. + * This can be used for special cases where the default implementation does not detect a valid conversion, but some part + * of the (de)serialization is handled manually. + */ + ALWAYS + } + /** + * This is the event argument that is used by the {@link yfiles.graphml.IParseEvents} interface + * that can be queried from the {@link yfiles.graphml.IParseContext#parseEvents} property. + * This class holds a reference to the {@link yfiles.graphml.ParseEventArgs#context parse context} and the + * {@link yfiles.graphml.ParseEventArgs#element} that is currently being parsed. + */ + export interface ParseEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the context that is being used for parsing. + * Value: The context. + */ + context:yfiles.graphml.IParseContext; + /** + * Gets the XML element that is currently parsed. + * Value: XML element that is currently parsed. + */ + element:Element; + } + var ParseEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.ParseEventArgs} class. + * @param {yfiles.graphml.IParseContext} context The context to assign to {@link yfiles.graphml.ParseEventArgs#context}. + * @param {Element} element The XML element to assign to {@link yfiles.graphml.ParseEventArgs#element}. + */ + new (context:yfiles.graphml.IParseContext,element:Element):yfiles.graphml.ParseEventArgs; + }; + /** + * The event arguments used by {@link yfiles.graphml.GraphMLIOHandler#HandleSerialization} and {@link yfiles.graphml.GraphMLWriter#HandleSerialization} + * to let registered serialization code perform the serialization of items. + * If the event handler determines that it can serialize the {@link yfiles.graphml.HandleSerializationEventArgs#item}, it should use the {@link yfiles.graphml.HandleSerializationEventArgs#writer} + * for output and mark the event as {@link yfiles.graphml.HandleSerializationEventArgs#handled} so that other code will not perform serialization, too. + */ + export interface HandleSerializationEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the item that should be serialized. + * Value: The item. + */ + item:Object; + /** + * Declares the type in the inheritance of the {@link yfiles.graphml.HandleSerializationEventArgs#item} that should be used for serialization. + * Value: The type of the serialization or null if the type should be inferred from the {@link yfiles.graphml.HandleSerializationEventArgs#item}. + */ + sourceType:yfiles.lang.Class; + /** + * Gets or sets a value indicating whether this {@link yfiles.graphml.HandleSerializationEventArgs} is handled. + * Setting this property to true indicates to the event source that the {@link yfiles.graphml.HandleSerializationEventArgs#item} + * has been successfully serialized using the {@link yfiles.graphml.HandleSerializationEventArgs#writer} and no other code needs to handle the + * serialization request, anymore. + * Value: true if this event has been handled; otherwise, false. + */ + handled:boolean; + /** + * Gets the context to be used for writing. + * Value: The context. + */ + context:yfiles.graphml.IWriteContext; + /** + * Replaces the {@link yfiles.graphml.HandleSerializationEventArgs#item} using a substitute for serialization. + * This method can be used to replace the {@link yfiles.graphml.HandleSerializationEventArgs#item} and {@link yfiles.graphml.HandleSerializationEventArgs#sourceType} property + * so that the serialization chain can be traversed with a substituted item. + * If this method has been called the {@link yfiles.graphml.HandleSerializationEventArgs#handled} property should not be set to true. + * @param {Object} item The substitute to assign to the {@link yfiles.graphml.HandleSerializationEventArgs#item} property. + * @param {yfiles.lang.Class} serializationType The serialization type to assign to the {@link yfiles.graphml.HandleSerializationEventArgs#sourceType} property. + */ + replaceItem(item:Object,serializationType:yfiles.lang.Class):void; + /** + * Gets the writer for writing the xml output. + * Value: The writer that writes the GraphML xml. + */ + writer:yfiles.graphml.IXmlWriter; + } + var HandleSerializationEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.HandleSerializationEventArgs} class using the provided context to write + * the item. + * This constructor initializes the {@link yfiles.graphml.HandleSerializationEventArgs#sourceType} to null. + * @param {yfiles.graphml.IWriteContext} context The context to use for writing. + * @param {Object} item The item to to serialize. + */ + new (context:yfiles.graphml.IWriteContext,item:Object):yfiles.graphml.HandleSerializationEventArgs; + /** + * Initializes a new instance of the {@link yfiles.graphml.HandleSerializationEventArgs} class using the provided context to write + * the item using the given type for serialization. + * @param {yfiles.graphml.IWriteContext} context The context to use for writing. + * @param {Object} item The item to to serialize. + * @param {yfiles.lang.Class} serializationType The type that should be used for serialization, which needs to be a super type or interface of the + * item or null. + */ + WithSerializationType:{ + new (context:yfiles.graphml.IWriteContext,item:Object,serializationType:yfiles.lang.Class):yfiles.graphml.HandleSerializationEventArgs; + }; + }; + /** + * A class for use in the {@link yfiles.graphml.IOutputHandler} interface + * that encapsulates an XML attribute. + */ + export interface GraphMLXmlAttribute extends yfiles.lang.Struct{ + /** + * Gets the local name of the attribute. + * Value: The local name. + */ + localName:string; + /** + * Gets the namespace for the attribute to use or null. + * Value: The namespace to use. + */ + namespace1:string; + /** + * Gets the value of the attribute. + * Value: The value. + */ + value:string; + } + var GraphMLXmlAttribute:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.GraphMLXmlAttribute} class. + * @param {string} localName The local name. + * @param {string} xmlNamespace The namespace. + * @param {string} value The value. + */ + new (localName:string,xmlNamespace:string,value:string):yfiles.graphml.GraphMLXmlAttribute; + }; + /** + * Interface that defines the context of a GraphML parsing context. + * All state data that is needed for the parsing of a concrete input should go here, + * allowing all handlers and deserializers to be implemented stateless. + */ + export interface IParseContext extends Object,yfiles.support.ILookup{ + /** + * Returns the current nesting of created graphs and graph elements. + * The list contains the user objects which correspond to the + * GraphML elements which are ancestors of the current node in the + * DOM tree. + * Value: A read-only view on the current nesting + * @see Specified by {@link yfiles.graphml.IParseContext#objectStack}. + */ + objectStack:yfiles.model.IListEnumerable; + /** + * Returns the most current (i.e. the last element) + * within the container hierarchy as it is returned + * by {@link yfiles.graphml.IParseContext#objectStack} + * @see Specified by {@link yfiles.graphml.IParseContext#currentObject}. + */ + currentObject:Object; + /** + * Returns an implementation of {@link yfiles.graphml.IParseEvents} that allows to subscribe to various + * events in the parse process. + * @see Specified by {@link yfiles.graphml.IParseContext#parseEvents}. + */ + parseEvents:yfiles.graphml.IParseEvents; + /** + * Returns the currently active graph object. + * @see Specified by {@link yfiles.graphml.IParseContext#graph}. + */ + graph:yfiles.graph.IGraph; + /** + * Get a property value that specifies information about how to handle specific cases. + * @param {yfiles.support.TypedKey.} key The identifier for the property + * @return {T} The property value, or null if no such property exists. + * @see Specified by {@link yfiles.graphml.IParseContext#getDeserializationProperty}. + */ + getDeserializationProperty(tType:yfiles.lang.Class,key:yfiles.support.TypedKey):T; + /** + * Deserialize the object representation in targetNode. + * Client code should usually use the extension method {@link yfiles.graphml.ParseContextExtensions#deserialize} instead + * to ensure the the correct context instance is used. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {Node} targetNode The XML node that should be deserialized. + * @return {T} The deserialized object from targetNode or an {@link yfiles.graphml.DeserializationNotSupportedException} + * if targetNode could not be deserialized. + * @see {@link yfiles.graphml.ParseContextExtensions#deserialize} + * @see Specified by {@link yfiles.graphml.IParseContext#deserialize}. + */ + deserialize(targetType:yfiles.lang.Class,context:yfiles.graphml.IParseContext,targetNode:Node):T; + /** + * Deserialize the object representation in targetNode. + * This is a bridge method that delegates to {@link yfiles.graphml.ParseContextExtensions#deserialize}. + * @param {Node} targetNode The XML node that should be deserialized. + * @return {T} an instance of T or null. + * @see {@link yfiles.graphml.IParseContext#deserialize} + */ + deserializeWithTargetNode(targetType:yfiles.lang.Class,targetNode:Node):T; + /** + * Typesafe alternative for {@link yfiles.graphml.IParseContext#currentObject}. + * This is a bridge method that delegates to {@link yfiles.graphml.ParseContextExtensions#getCurrent}. + * @return {T} {@link yfiles.graphml.IParseContext#currentObject} as an instance of T. + * @see {@link yfiles.graphml.IParseContext#currentObject} + */ + getCurrent():T; + } + var IParseContext:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Extension methods for {@link yfiles.graphml.IParseContext}. + */ + export interface ParseContextExtensions extends Object{ + } + var ParseContextExtensions:{ + $class:yfiles.lang.Class; + /** + * Deserialize the object representation in targetNode. + * This method calls {@link yfiles.graphml.IParseContext#deserialize} with context as first argument and + * should be used in virtually all cases. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {Node} targetNode The XML node that should be deserialized. + * @return {T} an instance of T or null. + * @see {@link yfiles.graphml.IParseContext#deserialize} + */ + deserialize(targetType:yfiles.lang.Class,context:yfiles.graphml.IParseContext,targetNode:Node):T; + /** + * Typesafe alternative for {@link yfiles.graphml.IParseContext#currentObject}. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @return {T} {@link yfiles.graphml.IParseContext#currentObject} as an instance of T. + * @see {@link yfiles.graphml.IParseContext#currentObject} + */ + getCurrent(context:yfiles.graphml.IParseContext):T; + }; + /** + * The interface of the event trigger class that is used + * by the {@link yfiles.graphml.IParseContext#parseEvents} property. + * This interface defines the available events that client code can register to + * during the parsing of {@link yfiles.graphml.GraphMLParser GraphML}. + * @see {@link yfiles.graphml.ParseEventArgs} + * @see {@link yfiles.graphml.GraphMLParser} + */ + export interface IParseEvents extends Object{ + /** + * Occurs when the document is about to be parsed. + * This event is triggered when the document element has been encountered. + */ + addDocumentParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when the document is about to be parsed. + * This event is triggered when the document element has been encountered. + */ + removeDocumentParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when the document has been parsed. + * This event is triggered when the document has been fully parsed. + */ + addDocumentParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when the document has been parsed. + * This event is triggered when the document has been fully parsed. + */ + removeDocumentParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when a node element is about to be parsed. + * This event is triggered when a GraphML 'node' element has been encountered. + */ + addNodeParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when a node element is about to be parsed. + * This event is triggered when a GraphML 'node' element has been encountered. + */ + removeNodeParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs after a node element has been fully parsed. + * This event is triggered when a GraphML 'node' closing tag has been handled. + */ + addNodeParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs after a node element has been fully parsed. + * This event is triggered when a GraphML 'node' closing tag has been handled. + */ + removeNodeParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when an edge element is about to be parsed. + * This event is triggered when a GraphML 'edge' element has been encountered. + */ + addEdgeParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when an edge element is about to be parsed. + * This event is triggered when a GraphML 'edge' element has been encountered. + */ + removeEdgeParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs after a edge element has been fully parsed. + * This event is triggered when a GraphML 'edge' closing tag has been handled. + */ + addEdgeParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs after a edge element has been fully parsed. + * This event is triggered when a GraphML 'edge' closing tag has been handled. + */ + removeEdgeParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when a port element is about to be parsed. + * This event is triggered when a GraphML 'port' element has been encountered. + */ + addPortParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when a port element is about to be parsed. + * This event is triggered when a GraphML 'port' element has been encountered. + */ + removePortParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs after a port element has been fully parsed. + * This event is triggered when a GraphML 'port' closing tag has been handled. + */ + addPortParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs after a port element has been fully parsed. + * This event is triggered when a GraphML 'port' closing tag has been handled. + */ + removePortParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when a graph element is about to be parsed. + * This event is triggered when a GraphML 'graph' element has been encountered. + */ + addGraphParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when a graph element is about to be parsed. + * This event is triggered when a GraphML 'graph' element has been encountered. + */ + removeGraphParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs after a graph element has been fully parsed. + * This event is triggered when a GraphML 'graph' closing tag has been handled. + */ + addGraphParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs after a graph element has been fully parsed. + * This event is triggered when a GraphML 'graph' closing tag has been handled. + */ + removeGraphParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when the graphml element is about to be parsed. + * This event is triggered when a GraphML 'graphml' root-element has been encountered. + */ + addGraphMLParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when the graphml element is about to be parsed. + * This event is triggered when a GraphML 'graphml' root-element has been encountered. + */ + removeGraphMLParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs after the graphml element has been fully parsed. + * This event is triggered when a GraphML 'graphml' closing tag has been handled. + */ + addGraphMLParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs after the graphml element has been fully parsed. + * This event is triggered when a GraphML 'graphml' closing tag has been handled. + */ + removeGraphMLParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when a data element is about to be parsed. + * This event is triggered when a GraphML 'data' element has been encountered. + */ + addDataParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when a data element is about to be parsed. + * This event is triggered when a GraphML 'data' element has been encountered. + */ + removeDataParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs after a data element has been fully parsed. + * This event is triggered when a GraphML 'data' element has been handled. + */ + addDataParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs after a data element has been fully parsed. + * This event is triggered when a GraphML 'data' element has been handled. + */ + removeDataParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when a key element is about to be parsed. + * This event is triggered when a GraphML 'key' element has been encountered. + */ + addKeyParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when a key element is about to be parsed. + * This event is triggered when a GraphML 'key' element has been encountered. + */ + removeKeyParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs after a key element has been fully parsed. + * This event is triggered when a GraphML 'key' element has been handled. + */ + addKeyParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs after a key element has been fully parsed. + * This event is triggered when a GraphML 'key' element has been handled. + */ + removeKeyParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + } + var IParseEvents:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface used by the {@link yfiles.graphml.GraphMLIOHandler} + * for writing data to the GraphML. + */ + export interface IOutputHandler extends Object{ + /** + * Gets the write precedence that is associated with this instance. + * Registered output handlers are written either before or after the (optional) child content of the governing GraphML + * element. + * Value: The write precedence for this instance. + * @see {@link yfiles.graphml.WritePrecedence} + * @see Specified by {@link yfiles.graphml.IOutputHandler#precedence}. + */ + precedence:yfiles.graphml.WritePrecedence; + /** + * Gets the XML attributes that should be added to the key definition in the GraphML key element. + * Value: The key definition attributes. + * @see Specified by {@link yfiles.graphml.IOutputHandler#keyDefinitionAttributes}. + */ + keyDefinitionAttributes:yfiles.collections.IEnumerable; + /** + * Gets the XML attributes that should be added to the data element. + * Value: The attributes for the data element. + * @see Specified by {@link yfiles.graphml.IOutputHandler#dataTagAttributes}. + */ + dataTagAttributes:yfiles.collections.IEnumerable; + /** + * Determines whether in the current context, the value is the default value and therefore + * no data element needs to be written. + * @param {yfiles.graphml.IWriteContext} ctx The context. + * @return {boolean} + * true if for the current context the default value applies and therefore no data element needs to be written. + * @see Specified by {@link yfiles.graphml.IOutputHandler#isDefaultValue}. + */ + isDefaultValue(ctx:yfiles.graphml.IWriteContext):boolean; + /** + * Actually writes the value for the current context. + * At the time this method is called, the surrounding + * 'data' element has already been written. + * @param {yfiles.graphml.IWriteContext} ctx The context. + * @see Specified by {@link yfiles.graphml.IOutputHandler#writeValue}. + */ + writeValue(ctx:yfiles.graphml.IWriteContext):void; + /** + * Writes the contents of the key definition. + * At the time this method is called, the surrounding + * 'key' element has already been written. However no 'default' element is written by the framework. + * @param {yfiles.graphml.IWriteContext} ctx The context. + * @see Specified by {@link yfiles.graphml.IOutputHandler#writeKeyDefinitionContent}. + */ + writeKeyDefinitionContent(ctx:yfiles.graphml.IWriteContext):void; + } + var IOutputHandler:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Abstraction of XML output classes that provide a consistent way to write + * XML elements to some output. + */ + export interface IXmlWriter extends Object{ + /** + * Write a XML comment node. + * @param {string} comment The content of the comment + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeComment}. + */ + writeComment(comment:string):yfiles.graphml.IXmlWriter; + /** + * Close the output. + * Attempts to write after this method has been called will + * have undefined results. + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeEndDocument}. + */ + writeEndDocument():void; + /** + * Begin a new XML element with given parameters. + * All subsequent output is attached to this element until + * {@link yfiles.graphml.IXmlWriter#writeEndElement} has been called or a new + * element has been started. + * @param {string} prefix The namespace prefix to use for this element + * @param {string} localName The local name of this element + * @param {string} ns The namespace of this element + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix}. + */ + writeStartElementWithPrefix(prefix:string,localName:string,ns:string):yfiles.graphml.IXmlWriter; + /** + * Begin a new XML element with given parameters. + * All subsequent output is attached to this element until + * {@link yfiles.graphml.IXmlWriter#writeEndElement} has been called or a new + * element has been started. + *

+ * This acts like {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix}, but + * uses the default prefix for the namespace

+ * @param {string} localName The local name of this element + * @param {string} ns The namespace of this element + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeStartElement}. + */ + writeStartElement(localName:string,ns:string):yfiles.graphml.IXmlWriter; + /** + * Write a XML attribute node. + * The attribute is attached to the closest open XML element that has + * been started with {@link yfiles.graphml.IXmlWriter#writeStartElement} or + * {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix}. + * Note that namespace declarations should not be written directly as attributes. + * Instead the {@link yfiles.graphml.IXmlWriter#namespaceManager} should be used. + * @param {string} prefix The namespace prefix of the attribute + * @param {string} localName The local name of the attribute + * @param {string} ns The namespace URI of this attribute + * @param {string} value The value of this attribute + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace}. + */ + writeAttributeWithNamespace(prefix:string,localName:string,ns:string,value:string):yfiles.graphml.IXmlWriter; + /** + * Write a document fragment. + * @param {Document} fragment + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeDocumentFragment}. + */ + writeDocumentFragment(fragment:Document):yfiles.graphml.IXmlWriter; + /** + * Write a xml processing instruction. + * @param {string} target The target of the PI + * @param {string} data The data of the PI + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeProcessingInstruction}. + */ + writeProcessingInstruction(target:string,data:string):yfiles.graphml.IXmlWriter; + /** + * Write a CDATA section. + * @param {string} content The content of the CDATA section + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeCData}. + */ + writeCData(content:string):yfiles.graphml.IXmlWriter; + /** + * Close a XML element previously opened with {@link yfiles.graphml.IXmlWriter#writeStartElement} or + * {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix}. + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeEndElement}. + */ + writeEndElement():yfiles.graphml.IXmlWriter; + /** + * Begin the output process. + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeStartDocument}. + */ + writeStartDocument():yfiles.graphml.IXmlWriter; + /** + * Close the document. + * This is typically used to actually flush the document to an output stream + * @see Specified by {@link yfiles.graphml.IXmlWriter#flushDocument}. + */ + flushDocument():void; + /** + * Gets the namespace manager associated with this writer. + * Value: The namespace manager. + * @see Specified by {@link yfiles.graphml.IXmlWriter#namespaceManager}. + */ + namespaceManager:yfiles.graphml.IXmlNamespaceManager; + /** + * Write a text node. + * The string value of s will be correctly escaped + * @param {string} s The string that gets written as XML text + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeString}. + */ + writeString(s:string):yfiles.graphml.IXmlWriter; + /** + * Write an XML attribute with the given parameters. The attribute is not bound to a XML namespace. + * This is a bridge method that delegates to {@link yfiles.graphml.XmlWriterExtensions#writeAttribute}. + * @param {string} localName The name of the attribute. + * @param {string} value The value of the attribute. + * @return {yfiles.graphml.IXmlWriter} The writer instance writer for writer chaining. + */ + writeAttribute(localName:string,value:string):yfiles.graphml.IXmlWriter; + /** + * Write an XML attribute from the given attribute struct. + * This is a bridge method that delegates to {@link yfiles.graphml.XmlWriterExtensions#writeAttributeStruct}. + * @param {yfiles.graphml.GraphMLXmlAttribute} attribute Encapsulates the current attribute values. + * @return {yfiles.graphml.IXmlWriter} The writer instance writer for writer chaining. + */ + writeAttributeStruct(attribute:yfiles.graphml.GraphMLXmlAttribute):yfiles.graphml.IXmlWriter; + } + var IXmlWriter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Helper class to facilitate namespace handling together with {@link yfiles.graphml.IXmlWriter} instances. + */ + export interface IXmlNamespaceManager extends Object{ + /** + * Register a local namespace/prefix mapping. + * @param {string} nsUri The namespace URI + * @param {string} prefix The preferred namespace prefix or + * if any prefix may be used. + * @return {string} The prefix that finally has been used for the namespace URI. + * @see Specified by {@link yfiles.graphml.IXmlNamespaceManager#registerLocalMapping}. + */ + registerLocalMapping(nsUri:string,prefix:string):string; + /** + * Pushes a current declaration scope. + * @see Specified by {@link yfiles.graphml.IXmlNamespaceManager#pushScope}. + */ + pushScope():void; + /** + * Pops a current declaration scope. + * @see Specified by {@link yfiles.graphml.IXmlNamespaceManager#popScope}. + */ + popScope():void; + /** + * Seals the current declaration scope. + * No further namespace mappings may be added to a sealed scope. + * @see Specified by {@link yfiles.graphml.IXmlNamespaceManager#sealScope}. + */ + sealScope():void; + /** + * Return a list of all namespace declarations that should be declared at the document's root element. + * @see Specified by {@link yfiles.graphml.IXmlNamespaceManager#globalNamespaces}. + */ + globalNamespaces:yfiles.collections.IDictionary; + } + var IXmlNamespaceManager:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Defines extension methods for interface {@link yfiles.graphml.IXmlWriter}. + */ + export interface XmlWriterExtensions extends Object{ + } + var XmlWriterExtensions:{ + $class:yfiles.lang.Class; + /** + * Write an XML attribute with the given parameters. The attribute is not bound to a XML namespace. + * @param {yfiles.graphml.IXmlWriter} writer The XML writer to use. + * @param {string} localName The name of the attribute. + * @param {string} value The value of the attribute. + * @return {yfiles.graphml.IXmlWriter} The writer instance writer for writer chaining. + */ + writeAttribute(writer:yfiles.graphml.IXmlWriter,localName:string,value:string):yfiles.graphml.IXmlWriter; + /** + * Write an XML attribute from the given attribute struct. + * @param {yfiles.graphml.IXmlWriter} writer The XML writer to use. + * @param {yfiles.graphml.GraphMLXmlAttribute} attribute Encapsulates the current attribute values. + * @return {yfiles.graphml.IXmlWriter} The writer instance writer for writer chaining. + */ + writeAttributeStruct(writer:yfiles.graphml.IXmlWriter,attribute:yfiles.graphml.GraphMLXmlAttribute):yfiles.graphml.IXmlWriter; + }; + export enum WritePrecedence{ + /** + * The handler writes its content before the child nodes of the governing GraphML element. + */ + BEFORE_CHILDREN, + /** + * Default precedence, the order in relation to child content is unspecified. + */ + DEFAULT, + /** + * The handler writes its content after the child nodes of the governing GraphML element. + */ + AFTER_CHILDREN + } + /** + * Interface that provides the context of a GraphML write process. + * All state data that is needed for the writing of a concrete graph instance should go here, + * allowing all handlers and deserializers to be implemented stateless. + */ + export interface IWriteContext extends Object,yfiles.support.ILookup{ + /** + * Returns the current nesting of graphs and graph elements. + * The list contains the user objects which correspond to the + * GraphML elements. + * Value: A read-only view on the current nesting + * @see Specified by {@link yfiles.graphml.IWriteContext#objectStack}. + */ + objectStack:yfiles.model.IListEnumerable; + /** + * Returns the most current (i.e. the last element) + * within the container hierarchy as it is returned + * by {@link yfiles.graphml.IWriteContext#objectStack} + * @see Specified by {@link yfiles.graphml.IWriteContext#currentObject}. + */ + currentObject:Object; + /** + * Returns an implementation of {@link yfiles.graphml.IWriteEvents} that allows to subscribe to various + * events in the write process. + * @see Specified by {@link yfiles.graphml.IWriteContext#writeEvents}. + */ + writeEvents:yfiles.graphml.IWriteEvents; + /** + * Returns the current {@link yfiles.graphml.IXmlWriter} implementation. + * @see Specified by {@link yfiles.graphml.IWriteContext#writer}. + */ + writer:yfiles.graphml.IXmlWriter; + /** + * Returns the currently active graph object. + * @see Specified by {@link yfiles.graphml.IWriteContext#graph}. + */ + graph:yfiles.graph.IGraph; + /** + * Get a property value that specifies information about how to handle specific cases. + * @param {yfiles.support.TypedKey.} key The identifier for the property + * @return {T} The property value, or null if no such property exists + * @see Specified by {@link yfiles.graphml.IWriteContext#getSerializationProperty}. + */ + getSerializationProperty(tType:yfiles.lang.Class,key:yfiles.support.TypedKey):T; + /** + * Serialize item to an XML representation. + * Client code should usually use the extension method {@link yfiles.graphml.IWriteContext#serializeWithItem} instead + * to ensure the the correct context instance is used. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {T} item The object that should be serialized. + * @see {@link yfiles.graphml.IWriteContext#serializeWithItem} + * @see Specified by {@link yfiles.graphml.IWriteContext#serialize}. + */ + serialize(targetType:yfiles.lang.Class,context:yfiles.graphml.IWriteContext,item:T):void; + /** + * Serialize the item. + * This is a bridge method that delegates to {@link yfiles.graphml.WriteContextExtensions#serialize}. + * @param {T} item The object that should be serialized. + * @see {@link yfiles.graphml.IWriteContext#serialize} + * @throws {yfiles.graphml.SerializationNotSupportedException} + */ + serializeWithItem(targetType:yfiles.lang.Class,item:T):void; + /** + * Serializes the specified item using the provided type information. + * This is a bridge method that delegates to {@link yfiles.graphml.WriteContextExtensions#serializeWithItemAndType}. + * @param {Object} item The item to serialize. + * @param {yfiles.lang.Class} t The type the item is known to be of at deserialization time. + */ + serializeWithItemAndType(item:Object,t:yfiles.lang.Class):void; + /** + * Serialize an replacement object replacement instead of the original originalItem. + * This is a bridge method that delegates to {@link yfiles.graphml.WriteContextExtensions#serializeReplacement}. + * @param {Object} originalItem The original object that should be serialized. + * @param {T} replacement The replacement object that will actually be serialized instead. + * @see {@link yfiles.graphml.IWriteContext#serialize} + * @throws {yfiles.graphml.SerializationNotSupportedException} + */ + serializeReplacement(targetType:yfiles.lang.Class,originalItem:Object,replacement:T):void; + /** + * Typesafe alternative for {@link yfiles.graphml.IWriteContext#currentObject}. + * This is a bridge method that delegates to {@link yfiles.graphml.WriteContextExtensions#getCurrent}. + * @return {T} {@link yfiles.graphml.IWriteContext#currentObject} as an instance of T. + * @see {@link yfiles.graphml.IWriteContext#currentObject} + */ + getCurrent():T; + } + var IWriteContext:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface of the event trigger class that is used + * by the {@link yfiles.graphml.IWriteContext#writeEvents} property. + * This interface defines the available events that client code can register to + * during the writing of {@link yfiles.graphml.GraphMLWriter GraphML}. + * @see {@link yfiles.graphml.WriteEventArgs} + * @see {@link yfiles.graphml.GraphMLWriter} + */ + export interface IWriteEvents extends Object{ + /** + * Occurs just after the {@link yfiles.graphml.IXmlWriter#writeStartDocument} has been called. + */ + addDocumentWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just after the {@link yfiles.graphml.IXmlWriter#writeStartDocument} has been called. + */ + removeDocumentWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndDocument} will be called. + */ + addDocumentWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndDocument} will be called. + */ + removeDocumentWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} method + * for writing a GraphMl 'node' element has been called. + * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace} methods to add + * custom attributes to the XML element or write a first + * custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} + */ + addNodeWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} method + * for writing a GraphMl 'node' element has been called. + * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace} methods to add + * custom attributes to the XML element or write a first + * custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} + */ + removeNodeWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} for the GraphML 'node' element + * will be called. + * This can be used to append more custom elements to the node element. + */ + addNodeWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} for the GraphML 'node' element + * will be called. + * This can be used to append more custom elements to the node element. + */ + removeNodeWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} method + * for writing a GraphMl 'edge' element has been called. + * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace} methods to add + * custom attributes to the XML element or write a first + * custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} + */ + addEdgeWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} method + * for writing a GraphMl 'edge' element has been called. + * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace} methods to add + * custom attributes to the XML element or write a first + * custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} + */ + removeEdgeWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} for the GraphML 'edge' element + * will be called. + * This can be used to append more custom elements to the edge element. + */ + addEdgeWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} for the GraphML 'edge' element + * will be called. + * This can be used to append more custom elements to the edge element. + */ + removeEdgeWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} method + * for writing a GraphMl 'port' element has been called. + * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace} methods to add + * custom attributes to the XML element or write a first + * custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} + */ + addPortWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} method + * for writing a GraphMl 'port' element has been called. + * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace} methods to add + * custom attributes to the XML element or write a first + * custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} + */ + removePortWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} for the GraphML 'port' element + * will be called. + * This can be used to append more custom elements to the port element. + */ + addPortWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} for the GraphML 'port' element + * will be called. + * This can be used to append more custom elements to the port element. + */ + removePortWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} method + * for writing a GraphMl 'graph' element has been called. + * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace} methods to add + * custom attributes to the XML element or write a first + * custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} + */ + addGraphWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} method + * for writing a GraphMl 'graph' element has been called. + * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace} methods to add + * custom attributes to the XML element or write a first + * custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} + */ + removeGraphWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} for the GraphML 'graph' element + * will be called. + * This can be used to append more custom elements to the graph element. + */ + addGraphWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} for the GraphML 'graph' element + * will be called. + * This can be used to append more custom elements to the graph element. + */ + removeGraphWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} method + * for writing a GraphMl 'graphml' element has been called. + * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace} methods to add + * custom attributes to the XML element or write a first + * custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} + */ + addGraphMLWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} method + * for writing a GraphMl 'graphml' element has been called. + * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace} methods to add + * custom attributes to the XML element or write a first + * custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} + */ + removeGraphMLWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} for the GraphML 'graphml' element + * will be called. + * This can be used to append more custom elements to the graphml element. + */ + addGraphMLWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} for the GraphML 'graphml' element + * will be called. + * This can be used to append more custom elements to the graphml element. + */ + removeGraphMLWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} method + * for writing a GraphMl 'data' element has been called. + * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace} methods to add + * custom attributes to the XML element or write a first + * custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} + */ + addDataWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} method + * for writing a GraphMl 'data' element has been called. + * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace} methods to add + * custom attributes to the XML element or write a first + * custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} + */ + removeDataWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} for the GraphML 'data' element + * will be called. + * This can be used to append more custom elements to the data element. + */ + addDataWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} for the GraphML 'data' element + * will be called. + * This can be used to append more custom elements to the data element. + */ + removeDataWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} method + * for writing a GraphMl 'key' element has been called. + * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace} methods to add + * custom attributes to the XML element or write a first + * custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} + */ + addKeyWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs right after the {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} method + * for writing a GraphMl 'key' element has been called. + * At that state, callees can use the {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace} methods to add + * custom attributes to the XML element or write a first + * custom inner element using {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix} + */ + removeKeyWritingListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} for the GraphML 'key' element + * will be called. + * This can be used to append more custom elements to the key element. + */ + addKeyWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.graphml.IXmlWriter#writeEndElement} for the GraphML 'key' element + * will be called. + * This can be used to append more custom elements to the key element. + */ + removeKeyWrittenListener(value:(sender:Object,e:yfiles.graphml.WriteEventArgs)=> void):void; + } + var IWriteEvents:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for factory classes for {@link yfiles.graphml.IInputHandler} creation. + */ + export interface IGenericInputHandlerFactory extends Object{ + /** + * Create an {@link yfiles.graphml.IInputHandler} instance based on the given args. + * @param {yfiles.graphml.QueryInputHandlersEventArgs} args The event argument that is used like in {@link yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener QueryInputHandlers} + * @return {yfiles.graphml.IInputHandler} The specific input handler to use. + * @see Specified by {@link yfiles.graphml.IGenericInputHandlerFactory#createInputHandler}. + */ + createInputHandler(tKey:yfiles.lang.Class,tValue:yfiles.lang.Class,args:yfiles.graphml.QueryInputHandlersEventArgs):yfiles.graphml.IInputHandler; + } + var IGenericInputHandlerFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Specialized {@link yfiles.system.EventArgs} that are used for dynamic {@link yfiles.graphml.IInputHandler} registration. + * @see {@link yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener QueryInputHandlers} + * @see {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} + */ + export interface QueryInputHandlersEventArgs extends yfiles.system.EventArgs{ + /** + * Register an {@link yfiles.graphml.IInputHandler} instance for the current {@link yfiles.graphml.QueryInputHandlersEventArgs#keyDefinition}. + * Calling this method automatically sets {@link yfiles.graphml.QueryInputHandlersEventArgs#handled} to true. + * @param {yfiles.graphml.IInputHandler} handler + */ + addInputHandler(handler:yfiles.graphml.IInputHandler):void; + /** + * The key definition of the GraphML attribute. + * This XML element should be queried to determine if an {@link yfiles.graphml.IInputHandler} should be registered + * with {@link yfiles.graphml.QueryInputHandlersEventArgs#addInputHandler} + */ + keyDefinition:Element; + /** + * Set or query whether the current GraphML attribute has been processed. + * This is automatically set by calling {@link yfiles.graphml.QueryInputHandlersEventArgs#addInputHandler}, so it should be seldom necessary to set this + * property manually. + */ + handled:boolean; + /** + * The {@link yfiles.graphml.IParseContext} instance that can queried for further information. + */ + context:yfiles.graphml.IParseContext; + } + var QueryInputHandlersEventArgs:{ + $class:yfiles.lang.Class; + /** + * Create a new instance. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {Element} keyDefinition The current key definition + * @param {yfiles.collections.IList.} handlers Stores the registered {@link yfiles.graphml.IInputHandler} instances. + */ + new (context:yfiles.graphml.IParseContext,keyDefinition:Element,handlers:yfiles.collections.IList):yfiles.graphml.QueryInputHandlersEventArgs; + }; + /** + * An abstract implementation of the {@link yfiles.graphml.AbstractOutputHandler} class + * that uses an {@link yfiles.model.IMapper} to retrieve the values to output for each item. + */ + export interface AbstractMapperOutputHandler extends yfiles.graphml.AbstractOutputHandler{ + /** + * Gets or sets the mapper metadata to serialize to the key definition. + * Value: The mapper metadata. + */ + mapperMetadata:yfiles.graph.IMapperMetadata; + /** + * Writes the contents of the key definition. + * This method will additionally write the {@link yfiles.graphml.AbstractMapperOutputHandler#mapperMetadata} to the key definition content, + * if any has been set. + * @param {yfiles.graphml.IWriteContext} ctx The context. + * @see Overrides {@link yfiles.graphml.AbstractOutputHandler#writeKeyDefinitionContent} + * @see Specified by {@link yfiles.graphml.IOutputHandler#writeKeyDefinitionContent}. + */ + writeKeyDefinitionContent(ctx:yfiles.graphml.IWriteContext):void; + /** + * Gets or sets the mapper to use for querying the data for each item. + * Value: The mapper. + */ + mapper:yfiles.model.IMapper; + /** + * Callback method that obtains the data for the given key. + * @param {yfiles.graphml.IWriteContext} context The context. + * @param {TKey} key The key. + * @return {TData} + * The data that is associated with the key using the {@link yfiles.graphml.AbstractMapperOutputHandler#mapper}. + * @see Overrides {@link yfiles.graphml.AbstractOutputHandler#getValue} + */ + getValue(context:yfiles.graphml.IWriteContext,key:TKey):TData; + } + var AbstractMapperOutputHandler:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.AbstractMapperOutputHandler} class + * using the given name and inferring the scope and the type from the class parameters. + * @param {string} name The name to use for the key attributes. + */ + new (keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,name:string):yfiles.graphml.AbstractMapperOutputHandler; + /** + * Initializes a new instance of the {@link yfiles.graphml.AbstractMapperOutputHandler} class + * using the provided key scope, the name, and the key type. + * @param {yfiles.graphml.KeyScope} scope The scope for the key definition attributes. + * @param {string} name The name for the key definition attributes. + * @param {yfiles.graphml.KeyType} type The type for the key definition attributes. + */ + WithScopeAndType:{ + new (keyType:yfiles.lang.Class,dataType:yfiles.lang.Class,scope:yfiles.graphml.KeyScope,name:string,type:yfiles.graphml.KeyType):yfiles.graphml.AbstractMapperOutputHandler; + }; + }; + /** + * This class defines a handler for key/data elements. + */ + export interface IInputHandler extends Object{ + /** + * Gets the parse precedence that is associated with this instance. + * Value: The parse precedence for this instance. + * @see Specified by {@link yfiles.graphml.IInputHandler#precedence}. + */ + precedence:yfiles.graphml.ParsePrecedence; + /** + * This method is invoked each time a data element with matching key + * is processed. + * @param {yfiles.graphml.IParseContext} context the current parse context. + * @param {Node} node the DOM node representing the data element. + * @see Specified by {@link yfiles.graphml.IInputHandler#parseData}. + */ + parseData(context:yfiles.graphml.IParseContext,node:Node):void; + /** + * This method is invoked when no data tag is defined, and the default value + * should be applied. + * @param {yfiles.graphml.IParseContext} context the current parse context. + * @see Specified by {@link yfiles.graphml.IInputHandler#applyDefault}. + */ + applyDefault(context:yfiles.graphml.IParseContext):void; + } + var IInputHandler:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum ParsePrecedence{ + /** + * The data is parsed as early as possible. + */ + FIRST, + /** + * The data is parsed before its owner GraphML element. + */ + BEFORE_OWNER, + /** + * The data is parsed after its owner GraphML element, but before any non-data child content. + */ + BEFORE_CHILDREN, + /** + * Default parse priority. + */ + DEFAULT, + /** + * The data is parsed after any non-data child content, but before parsing the owner GraphML element is finished. + */ + AFTER_CHILDREN, + /** + * The data is parsed directly after parsing the owner GraphML element is finished. + */ + AFTER_OWNER, + /** + * The data is parsed as late as possible. + */ + LAST + } + /** + * The event arguments used by {@link yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener HandleDeserialization} and {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} + * to let registered deserialization code perform the deserialization. + * If the event handler determines that it can deserialize the {@link yfiles.graphml.HandleDeserializationEventArgs#xmlNode}, it should place the result into + * the {@link yfiles.graphml.HandleDeserializationEventArgs#result} property and thus mark the event as {@link yfiles.graphml.HandleDeserializationEventArgs#handled}. + */ + export interface HandleDeserializationEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the type of the resulting instance that is required by the requesting deserializer or null + * if the target type is not known in advance. + * Value: The type of the result. + * @see {@link yfiles.graphml.IParseContext#deserialize} + */ + targetType:yfiles.lang.Class; + /** + * Holds the result of the deserialization, which is null initially. + * Setting this property will automatically set the {@link yfiles.graphml.HandleDeserializationEventArgs#handled} property to + * true. + * @throws {yfiles.system.ArgumentOutOfRangeException} If the value is not assignable to {@link yfiles.graphml.HandleDeserializationEventArgs#targetType} + */ + result:Object; + /** + * Gets or sets a value indicating whether this {@link yfiles.graphml.HandleDeserializationEventArgs} is handled. + * Setting this property to true indicates to the event source that the {@link yfiles.graphml.HandleDeserializationEventArgs#result} + * has been assigned and that the event should not be propagated to further listeners. + * Value: true if this event has been handled; otherwise, false. + */ + handled:boolean; + /** + * Gets the context in which the {@link yfiles.graphml.HandleDeserializationEventArgs#xmlNode} shall be deserialized. + * Value: The context. + */ + context:yfiles.graphml.IParseContext; + /** + * Gets the XML node that contains the data to deserialize. + * Value: The XML node. + */ + xmlNode:Node; + } + var HandleDeserializationEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.HandleDeserializationEventArgs} class. + * This initializes the {@link yfiles.graphml.HandleDeserializationEventArgs#targetType} using null. + * @param {yfiles.graphml.IParseContext} context The context in which serialization should take place. + * @param {Node} xmlNode The XML element that contains the data to deserialize. + */ + new (context:yfiles.graphml.IParseContext,xmlNode:Node):yfiles.graphml.HandleDeserializationEventArgs; + /** + * Initializes a new instance of the {@link yfiles.graphml.HandleDeserializationEventArgs} class. + * @param {yfiles.graphml.IParseContext} context The context in which serialization should take place. + * @param {Node} xmlNode The XML element that contains the data to deserialize. + * @param {yfiles.lang.Class} targetType The required {@link yfiles.graphml.HandleDeserializationEventArgs#targetType target type} of the {@link yfiles.graphml.HandleDeserializationEventArgs#result}. + */ + WithTargetType:{ + new (context:yfiles.graphml.IParseContext,xmlNode:Node,targetType:yfiles.lang.Class):yfiles.graphml.HandleDeserializationEventArgs; + }; + }; + /** + * The interface variant of the {@link yfiles.graphml.HandleDeserializationEventArgs} callback. + * @see {@link yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener HandleDeserialization} + */ + export interface IDeserializer extends Object{ + /** + * Deserializes the data that is associated with the given xml node in the given context. + * @param {yfiles.graphml.IParseContext} context The context in which the deserialization needs to be performed. + * @param {Node} node The node that contains the data to deserialize. + * @return {Object} The object that has been created for the xml data. + * @see Specified by {@link yfiles.graphml.IDeserializer#deserialize}. + */ + deserialize(context:yfiles.graphml.IParseContext,node:Node):Object; + } + var IDeserializer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The event arguments used by {@link yfiles.graphml.IXamlTypeMapper} implementations + * to resolve xml namespaces to {@link yfiles.graphml.ClrNamespaceDescriptor}s. + * If the event handler determines that it can resolve the xml namespace to one or several + * {@link yfiles.graphml.ClrNamespaceDescriptor}s, it should {@link yfiles.graphml.ResolveXmlNamespaceEventArgs#addClrNamespaceDescriptor add} + * them and thus mark the event as {@link yfiles.graphml.ResolveXmlNamespaceEventArgs#handled}. + */ + export interface ResolveXmlNamespaceEventArgs extends yfiles.system.EventArgs{ + /** + * The xml namespace that shall be resolved to {@link yfiles.graphml.ClrNamespaceDescriptor}s. + */ + xmlNamespace:string; + /** + * Registers a {@link yfiles.graphml.ClrNamespaceDescriptor} instance for the current {@link yfiles.graphml.ResolveXmlNamespaceEventArgs#xmlNamespace}. + * Calling this method automatically sets {@link yfiles.graphml.ResolveXmlNamespaceEventArgs#handled} to true. + * @param {yfiles.graphml.ClrNamespaceDescriptor} descriptor The descriptor to add. + */ + addClrNamespaceDescriptor(descriptor:yfiles.graphml.ClrNamespaceDescriptor):void; + /** + * Gets or sets a value indicating whether this {@link yfiles.graphml.ResolveXmlNamespaceEventArgs} is handled. + * Setting this property to true indicates to the event source that {@link yfiles.graphml.ClrNamespaceDescriptor}s + * have been {@link yfiles.graphml.ResolveXmlNamespaceEventArgs#addClrNamespaceDescriptor added} and that the event should not be propagated to further listeners. + * Value: true if this event has been handled; otherwise, false. + */ + handled:boolean; + } + var ResolveXmlNamespaceEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.ResolveXmlNamespaceEventArgs} class. + * @param {string} xmlNamespace The xml namespace to resolve. + * @param {yfiles.collections.IList.} descriptors The list the resolved namespace descriptors shall be added to. + */ + new (xmlNamespace:string,descriptors:yfiles.collections.IList):yfiles.graphml.ResolveXmlNamespaceEventArgs; + }; + /** + * An {@link yfiles.graphml.IInputHandler} implementation that uses an {@link yfiles.model.IMapper} + * instance to associate the values with the keys. + * This implementation can be provided an {@link yfiles.graphml.HandleDeserializationEventArgs}-handler + * to perform the deserialization. + */ + export interface ComplexMapperInputHandler extends yfiles.graphml.AbstractMapperInputHandler{ + /** + * Controls the behavior of {@link yfiles.graphml.ComplexMapperInputHandler#getDeserializationXmlNode} to return either the 'data'/'default' + * element itself or its content. + * The default value is false, meaning that {@link yfiles.graphml.ComplexMapperInputHandler#getDeserializationXmlNode} should return + * the content of the 'data'/'default' node. + * @see {@link yfiles.graphml.ComplexMapperInputHandler#getDeserializationXmlNode} + */ + useParentElementForDeserialization:boolean; + /** + * Gets or sets the deserializer. + * Value: The deserializer. + */ + deserializer:(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs)=> void; + /** + * Gets or sets the target deserialization type for the {@link yfiles.graphml.HandleDeserializationEventArgs#targetType} + * property. + * Value: The target type of the deserialization. + */ + deserializerTargetType:yfiles.lang.Class; + /** + * Parses the data using either the {@link yfiles.graphml.ComplexMapperInputHandler#deserializer} or the {@link yfiles.graphml.IParseContext#deserialize} + * call. + * @param {yfiles.graphml.IParseContext} context The context. + * @param {Node} node The node that contains the data. This is either the GraphML 'data' element or the + * 'default' element. + * @return {TValue} The parsed data. + * @see {@link yfiles.graphml.ComplexMapperInputHandler#getDeserializationXmlNode} + * @throws {yfiles.graphml.DeserializationNotSupportedException} DeserializationNotSupportedException if {@link yfiles.graphml.ComplexMapperInputHandler#deserializer} + * could not handle the node. + * @see Overrides {@link yfiles.graphml.AbstractInputHandler#parseDataCore} + */ + parseDataCore(context:yfiles.graphml.IParseContext,node:Node):TValue; + /** + * Gets the node to pass to {@link yfiles.graphml.ComplexMapperInputHandler#deserializer} or {@link yfiles.graphml.IParseContext#deserialize} + * respectively, given the 'data' or 'default' element from the GraphML. + * This method is called by {@link yfiles.graphml.ComplexMapperInputHandler#parseDataCore} to determine the node to pass to the deserialization mechanism. + *

+ * This implementation returns node iff {@link yfiles.graphml.ComplexMapperInputHandler#useParentElementForDeserialization} is true + * (i.e. the 'data' or 'default' node itself), otherwise the first child of the node that is not + * a comment or processing instruction. + *

+ * @param {yfiles.graphml.IParseContext} context The context within which the node is parsed. + * @param {Node} node The 'data' or 'default' node. + * @return {Node} The node that should be deserialized. + * @see {@link yfiles.graphml.ComplexMapperInputHandler#useParentElementForDeserialization} + */ + getDeserializationXmlNode(context:yfiles.graphml.IParseContext,node:Node):Node; + } + var ComplexMapperInputHandler:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.ComplexMapperInputHandler} class + * that uses the {@link yfiles.graphml.IParseContext} for deserialization. + */ + new (keyType3:yfiles.lang.Class,valueType:yfiles.lang.Class):yfiles.graphml.ComplexMapperInputHandler; + /** + * Initializes a new instance of the {@link yfiles.graphml.ComplexMapperInputHandler} class + * that uses the event handler for deserialization. + * @see {@link yfiles.graphml.ComplexMapperInputHandler#deserializer} + */ + WithDeserializer:{ + new (keyType3:yfiles.lang.Class,valueType:yfiles.lang.Class,deserializer:(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs)=> void):yfiles.graphml.ComplexMapperInputHandler; + }; + /** + * Initializes a new instance of the {@link yfiles.graphml.ComplexMapperInputHandler} class + * that uses the event handler for deserialization and suggests the provided target type for the deserializer. + * @see {@link yfiles.graphml.ComplexMapperInputHandler#deserializerTargetType} + * @see {@link yfiles.graphml.ComplexMapperInputHandler#deserializer} + */ + WithDeserializerAndTargetType:{ + new (keyType3:yfiles.lang.Class,valueType:yfiles.lang.Class,deserializer:(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs)=> void,deserializerTargetType:yfiles.lang.Class):yfiles.graphml.ComplexMapperInputHandler; + }; + }; + /** + * Simple implementation of {@link yfiles.graphml.IGraphElementIdAcceptor} and {@link yfiles.graphml.IGraphElementIdProvider} that stores all ids in {@link yfiles.model.IMapper} instances. + */ + export interface GraphElementIdAcceptor extends Object,yfiles.graphml.IGraphElementIdAcceptor,yfiles.graphml.IGraphElementResolver{ + /** + * Return a mapping between all GraphML ids for <graph> elements and the corresponding {@link yfiles.graph.IGraph} instances. + */ + graphIds:yfiles.collections.IDictionary; + /** + * Return a mapping between all GraphML ids for <node> elements and the corresponding {@link yfiles.graph.INode} instances. + */ + nodeIds:yfiles.collections.IDictionary; + /** + * Return a mapping between all GraphML ids for <edge> elements and the corresponding {@link yfiles.graph.IEdge} instances. + */ + edgeIds:yfiles.collections.IDictionary; + /** + * Return a mapping between all GraphML ids for <port> elements and the corresponding {@link yfiles.graph.IPort} instances. + */ + portIds:yfiles.collections.IDictionary; + /** + * Store the value of the id attribute for the given graph. + * @param {yfiles.graph.IGraph} graph The current graph element + * @param {string} id The id of the graph's XML representation + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @see Specified by {@link yfiles.graphml.IGraphElementIdAcceptor#storeGraphId}. + */ + storeGraphId(graph:yfiles.graph.IGraph,id:string,context:yfiles.graphml.IParseContext):void; + /** + * Store the value of the id attribute for the given node. + * @param {yfiles.graph.INode} node The current node element + * @param {string} id The id of the node's XML representation + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @see Specified by {@link yfiles.graphml.IGraphElementIdAcceptor#storeNodeId}. + */ + storeNodeId(node:yfiles.graph.INode,id:string,context:yfiles.graphml.IParseContext):void; + /** + * Store the value of the id attribute for the given edge. + * @param {yfiles.graph.IEdge} edge The current edge element + * @param {string} id The id of the edge's XML representation + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @see Specified by {@link yfiles.graphml.IGraphElementIdAcceptor#storeEdgeId}. + */ + storeEdgeId(edge:yfiles.graph.IEdge,id:string,context:yfiles.graphml.IParseContext):void; + /** + * Store the value of the id attribute for the given port. + * @param {yfiles.graph.IPort} port The current port element + * @param {string} id The id of the port's XML representation + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @see Specified by {@link yfiles.graphml.IGraphElementIdAcceptor#storePortId}. + */ + storePortId(port:yfiles.graph.IPort,id:string,context:yfiles.graphml.IParseContext):void; + /** + * Factory method to create a default implementation of {@link yfiles.graphml.IGraphElementIdProvider} that + * delegates to fallback and uses the values stored by this {@link yfiles.graphml.GraphElementIdAcceptor} instance, if possible. + * @param {yfiles.graphml.IGraphElementIdProvider} fallback The fallback. + * @return {yfiles.graphml.IGraphElementIdProvider} + */ + createIdProvider(fallback:yfiles.graphml.IGraphElementIdProvider):yfiles.graphml.IGraphElementIdProvider; + /** + * Resolve the GraphML id to an {@link yfiles.graph.INode} instance. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {string} id The id that should be resolved. + * @return {yfiles.graph.INode} The {@link yfiles.graph.INode} that is defined by this GraphML id, or null + * if no such node exists yet. + * @see Specified by {@link yfiles.graphml.IGraphElementResolver#resolveNode}. + */ + resolveNode(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.INode; + /** + * Resolve the GraphML id to an {@link yfiles.graph.IGraph} instance. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {string} id The id that should be resolved. + * @return {yfiles.graph.IGraph} The {@link yfiles.graph.IGraph} that is defined by this GraphML id, or null + * if no such graph exists yet. + * @see Specified by {@link yfiles.graphml.IGraphElementResolver#resolveGraph}. + */ + resolveGraph(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.IGraph; + /** + * Resolve the GraphML id to an {@link yfiles.graph.IPort} instance. The port owner is specified by the ownerId + * attribute. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {string} ownerId The GraphML id of the port owner. + * @param {string} id The id that should be resolved. + * @return {yfiles.graph.IPort} The {@link yfiles.graph.IPort} that is defined by the GraphML ids, or null + * if no such port exists yet. + * @see Specified by {@link yfiles.graphml.IGraphElementResolver#resolvePort}. + */ + resolvePort(context:yfiles.graphml.IParseContext,ownerId:string,id:string):yfiles.graph.IPort; + /** + * Resolve the GraphML id to an {@link yfiles.graph.IEdge} instance. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {string} id The id that should be resolved. + * @return {yfiles.graph.IEdge} The {@link yfiles.graph.IEdge} that is defined by this GraphML id, or null + * if no such edge exists yet. + * @see Specified by {@link yfiles.graphml.IGraphElementResolver#resolveEdge}. + */ + resolveEdge(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.IEdge; + } + var GraphElementIdAcceptor:{ + $class:yfiles.lang.Class; + new ():yfiles.graphml.GraphElementIdAcceptor; + }; + /** + * This is the interface for a factory that is used for creating the constituents of an {@link yfiles.graph.IGraph} + * that are encountered during the parsing of {@link yfiles.graphml.GraphMLParser GraphML}. + * @see {@link yfiles.graphml.GraphMLIOHandler#createGraphElementFactory} + */ + export interface IGraphElementFactory extends Object{ + /** + * Creates a node for the given context. + * @param {yfiles.graphml.IParseContext} context The context from which the graph, the {@link yfiles.graphml.CreationProperties}, and the {@link yfiles.graphml.IParseContext#objectStack} + * can be queried. + * @return {yfiles.graph.INode} A newly created node + * @see Specified by {@link yfiles.graphml.IGraphElementFactory#createNode}. + */ + createNode(context:yfiles.graphml.IParseContext):yfiles.graph.INode; + /** + * Creates an edge for the given context and the provided source and target nodes or ports. + * @param {yfiles.graphml.IParseContext} context The context from which the graph, the {@link yfiles.graphml.CreationProperties}, and the {@link yfiles.graphml.IParseContext#objectStack} + * can be queried. + * @param {yfiles.graph.INode} sourceNode The source node for the edge. + * @param {yfiles.graph.IPort} sourcePort The source port for the edge, if specified, otherwise null. + * @param {yfiles.graph.INode} targetNode The target node for the edge. + * @param {yfiles.graph.IPort} targetPort The target port for the edge, if specified, otherwise null. + * @return {yfiles.graph.IEdge} A newly created edge. + * @see Specified by {@link yfiles.graphml.IGraphElementFactory#createEdge}. + */ + createEdge(context:yfiles.graphml.IParseContext,sourceNode:yfiles.graph.INode,sourcePort:yfiles.graph.IPort,targetNode:yfiles.graph.INode,targetPort:yfiles.graph.IPort):yfiles.graph.IEdge; + /** + * Adds a new port to the given {@link yfiles.graph.IPortOwner}. + * @param {yfiles.graphml.IParseContext} context The context from which the graph, the {@link yfiles.graphml.CreationProperties}, and the {@link yfiles.graphml.IParseContext#objectStack} + * can be queried. + * @param {yfiles.graph.IPortOwner} portOwner The owner of the port. + * @return {yfiles.graph.IPort} A newly created port. + * @see Specified by {@link yfiles.graphml.IGraphElementFactory#addPort}. + */ + addPort(context:yfiles.graphml.IParseContext,portOwner:yfiles.graph.IPortOwner):yfiles.graph.IPort; + } + var IGraphElementFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for classes can resolve graph elements based on their GraphML id attribute(s). + */ + export interface IGraphElementResolver extends Object{ + /** + * Resolve the GraphML id to an {@link yfiles.graph.INode} instance. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {string} id The id that should be resolved. + * @return {yfiles.graph.INode} The {@link yfiles.graph.INode} that is defined by this GraphML id, or null + * if no such node exists yet. + * @see Specified by {@link yfiles.graphml.IGraphElementResolver#resolveNode}. + */ + resolveNode(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.INode; + /** + * Resolve the GraphML id to an {@link yfiles.graph.IGraph} instance. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {string} id The id that should be resolved. + * @return {yfiles.graph.IGraph} The {@link yfiles.graph.IGraph} that is defined by this GraphML id, or null + * if no such graph exists yet. + * @see Specified by {@link yfiles.graphml.IGraphElementResolver#resolveGraph}. + */ + resolveGraph(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.IGraph; + /** + * Resolve the GraphML id to an {@link yfiles.graph.IPort} instance. The port owner is specified by the ownerId + * attribute. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {string} ownerId The GraphML id of the port owner. + * @param {string} id The id that should be resolved. + * @return {yfiles.graph.IPort} The {@link yfiles.graph.IPort} that is defined by the GraphML ids, or null + * if no such port exists yet. + * @see Specified by {@link yfiles.graphml.IGraphElementResolver#resolvePort}. + */ + resolvePort(context:yfiles.graphml.IParseContext,ownerId:string,id:string):yfiles.graph.IPort; + /** + * Resolve the GraphML id to an {@link yfiles.graph.IEdge} instance. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {string} id The id that should be resolved. + * @return {yfiles.graph.IEdge} The {@link yfiles.graph.IEdge} that is defined by this GraphML id, or null + * if no such edge exists yet. + * @see Specified by {@link yfiles.graphml.IGraphElementResolver#resolveEdge}. + */ + resolveEdge(context:yfiles.graphml.IParseContext,id:string):yfiles.graph.IEdge; + } + var IGraphElementResolver:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for classes that can store the GraphML id attribute of GraphML core elements. + */ + export interface IGraphElementIdAcceptor extends Object{ + /** + * Store the value of the id attribute for the given graph. + * @param {yfiles.graph.IGraph} graph The current graph element + * @param {string} id The id of the graph's XML representation + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @see Specified by {@link yfiles.graphml.IGraphElementIdAcceptor#storeGraphId}. + */ + storeGraphId(graph:yfiles.graph.IGraph,id:string,context:yfiles.graphml.IParseContext):void; + /** + * Store the value of the id attribute for the given node. + * @param {yfiles.graph.INode} node The current node element + * @param {string} id The id of the node's XML representation + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @see Specified by {@link yfiles.graphml.IGraphElementIdAcceptor#storeNodeId}. + */ + storeNodeId(node:yfiles.graph.INode,id:string,context:yfiles.graphml.IParseContext):void; + /** + * Store the value of the id attribute for the given edge. + * @param {yfiles.graph.IEdge} edge The current edge element + * @param {string} id The id of the edge's XML representation + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @see Specified by {@link yfiles.graphml.IGraphElementIdAcceptor#storeEdgeId}. + */ + storeEdgeId(edge:yfiles.graph.IEdge,id:string,context:yfiles.graphml.IParseContext):void; + /** + * Store the value of the id attribute for the given port. + * @param {yfiles.graph.IPort} port The current port element + * @param {string} id The id of the port's XML representation + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @see Specified by {@link yfiles.graphml.IGraphElementIdAcceptor#storePortId}. + */ + storePortId(port:yfiles.graph.IPort,id:string,context:yfiles.graphml.IParseContext):void; + } + var IGraphElementIdAcceptor:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An implementation of {@link yfiles.graphml.IParseContext} that delegates most calls to + * a {@link yfiles.graphml.ChildParseContext#parentContext}, but adds the capability to locally add + * {@link yfiles.graphml.ChildParseContext#lookup} results and {@link yfiles.graphml.ChildParseContext#getDeserializationProperty deserialization properties}. + * Whenever it is necessary to locally modify some context properties, a new instance of this class should be created that wraps an existing one. + * @see {@link yfiles.graphml.ChildParseContext#setDeserializationProperty} + * @see {@link yfiles.graphml.ChildParseContext#setLookup} + */ + export interface ChildParseContext extends Object,yfiles.graphml.IParseContext{ + /** + * Gets the parent context. + * Value: The parent context. + */ + parentContext:yfiles.graphml.IParseContext; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Adds another lookup result to the local lookup override. + * @param {T} value The value to provide for queries to T. + * @see {@link yfiles.graphml.ChildParseContext#removeLookup} + */ + setLookup(tType:yfiles.lang.Class,value:T):void; + /** + * Removes a local lookup override that has been added using {@link yfiles.graphml.ChildParseContext#setLookup}. + */ + removeLookup(tType:yfiles.lang.Class):void; + /** + * Returns the current nesting of created graphs and graph elements. + * The list contains the user objects which correspond to the + * GraphML elements which are ancestors of the current node in the + * DOM tree. + * Value: A read-only view on the current nesting + * @see Specified by {@link yfiles.graphml.IParseContext#objectStack}. + */ + objectStack:yfiles.model.IListEnumerable; + /** + * Returns the most current (i.e. the last element) + * within the container hierarchy as it is returned + * by {@link yfiles.graphml.IParseContext#objectStack} + * @see Specified by {@link yfiles.graphml.IParseContext#currentObject}. + */ + currentObject:Object; + /** + * Returns an implementation of {@link yfiles.graphml.IParseEvents} that allows to subscribe to various + * events in the parse process. + * @see Specified by {@link yfiles.graphml.IParseContext#parseEvents}. + */ + parseEvents:yfiles.graphml.IParseEvents; + /** + * Returns the currently active graph object. + * @see Specified by {@link yfiles.graphml.IParseContext#graph}. + */ + graph:yfiles.graph.IGraph; + /** + * Get a property value that specifies information about how to handle specific cases. + * @param {yfiles.support.TypedKey.} key The identifier for the property + * @return {T} The property value, or null if no such property exists. + * @see Specified by {@link yfiles.graphml.IParseContext#getDeserializationProperty}. + */ + getDeserializationProperty(tType:yfiles.lang.Class,key:yfiles.support.TypedKey):T; + /** + * Sets the local deserialization property for the given key to the value. + * @param {yfiles.support.TypedKey.} key The key to override. + * @param {T} value The value. + */ + setDeserializationProperty(key:yfiles.support.TypedKey,value:T):void; + /** + * Removes a previously locally {@link yfiles.graphml.ChildParseContext#setDeserializationProperty set} deserialization property. + * @param {yfiles.support.TypedKey.} key The key for which the local property override should be removed. + */ + removeDeserializationProperty(key:yfiles.support.TypedKey):void; + /** + * Deserialize the object representation in targetNode. + * Client code should usually use the extension method {@link yfiles.graphml.ParseContextExtensions#deserialize} instead + * to ensure the the correct context instance is used. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {Node} targetNode The XML node that should be deserialized. + * @return {T} The deserialized object from targetNode or an {@link yfiles.graphml.DeserializationNotSupportedException} + * if targetNode could not be deserialized. + * @see {@link yfiles.graphml.ParseContextExtensions#deserialize} + * @see Specified by {@link yfiles.graphml.IParseContext#deserialize}. + */ + deserialize(targetType:yfiles.lang.Class,context:yfiles.graphml.IParseContext,targetNode:Node):T; + } + var ChildParseContext:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.ChildParseContext} class + * that delegates to the provided context and adds the currentObject + * to the {@link yfiles.graphml.ChildParseContext#objectStack}. + * @param {yfiles.graphml.IParseContext} parentContext The parent context. + * @param {Object} currentObject The current object to add to the {@link yfiles.graphml.ChildParseContext#objectStack} and assign + * to {@link yfiles.graphml.ChildParseContext#currentObject}. + */ + new (parentContext:yfiles.graphml.IParseContext,currentObject:Object):yfiles.graphml.ChildParseContext; + /** + * Initializes a new instance of the {@link yfiles.graphml.ChildParseContext} class + * that delegates to the provided context. + * @param {yfiles.graphml.IParseContext} parentContext The parent context. + */ + WithParentContext:{ + new (parentContext:yfiles.graphml.IParseContext):yfiles.graphml.ChildParseContext; + }; + }; + /** + * Core parser class for GraphML. + * This class allows for low-level customization of the parsing process. Usually, it is used by one of {@link yfiles.graphml.GraphMLIOHandler}'s + * readFrom methods which calls one of the various GraphMLParser.parseFrom method variants. It should rarely be necessary to use this class directly. + * @see {@link yfiles.graphml.GraphMLIOHandler} + */ + export interface GraphMLParser extends Object{ + /** + * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IInputHandler} instance(s) for + * a given GraphML attribute key definition. + * The current key definition is provided by {@link yfiles.graphml.QueryInputHandlersEventArgs#keyDefinition}. If you + * want to register an {@link yfiles.graphml.IInputHandler} for this GraphML attribute, + * you can add the handler with {@link yfiles.graphml.QueryInputHandlersEventArgs#addInputHandler}. + * @see {@link yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener QueryInputHandlers} + */ + addQueryInputHandlersListener(value:(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs)=> void):void; + /** + * Subscribe to this event to dynamically register one or more {@link yfiles.graphml.IInputHandler} instance(s) for + * a given GraphML attribute key definition. + * The current key definition is provided by {@link yfiles.graphml.QueryInputHandlersEventArgs#keyDefinition}. If you + * want to register an {@link yfiles.graphml.IInputHandler} for this GraphML attribute, + * you can add the handler with {@link yfiles.graphml.QueryInputHandlersEventArgs#addInputHandler}. + * @see {@link yfiles.graphml.GraphMLIOHandler#addQueryInputHandlersListener QueryInputHandlers} + */ + removeQueryInputHandlersListener(value:(sender:Object,e:yfiles.graphml.QueryInputHandlersEventArgs)=> void):void; + /** + * Subscribe to this event to provide custom deserialization handling for XML content. + * The current XML content is provided by {@link yfiles.graphml.HandleDeserializationEventArgs#xmlNode}. If you want to return + * deserialized content, set the value of the {@link yfiles.graphml.HandleDeserializationEventArgs#result} property. + * @see {@link yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener HandleDeserialization} + */ + addHandleDeserializationListener(value:(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs)=> void):void; + /** + * Subscribe to this event to provide custom deserialization handling for XML content. + * The current XML content is provided by {@link yfiles.graphml.HandleDeserializationEventArgs#xmlNode}. If you want to return + * deserialized content, set the value of the {@link yfiles.graphml.HandleDeserializationEventArgs#result} property. + * @see {@link yfiles.graphml.GraphMLIOHandler#addHandleDeserializationListener HandleDeserialization} + */ + removeHandleDeserializationListener(value:(sender:Object,e:yfiles.graphml.HandleDeserializationEventArgs)=> void):void; + /** + * Register default event handlers for the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. + * This implementation does not register any default event handlers + * @see {@link yfiles.graphml.GraphMLIOHandler#configureDeserializationHandlers} + */ + registerDefaultDeserializers():void; + /** + * Register default event handlers for the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event. + * This implementation does not register any default event handlers + * @see {@link yfiles.graphml.GraphMLIOHandler#configureInputHandlers} + */ + registerDefaultInputHandlers():void; + /** + * Fires the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event. + * @param {yfiles.graphml.QueryInputHandlersEventArgs} args The arguments that get passed to the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event. + * @see {@link yfiles.graphml.GraphMLIOHandler#onQueryInputHandlers} + */ + onQueryInputHandlers(args:yfiles.graphml.QueryInputHandlersEventArgs):void; + /** + * Fires the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. + * @param {yfiles.graphml.HandleDeserializationEventArgs} args The arguments that get passed to the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. + * @see {@link yfiles.graphml.GraphMLIOHandler#onHandleDeserialization} + */ + onHandleDeserialization(args:yfiles.graphml.HandleDeserializationEventArgs):void; + /** + * Deserialize the content of element. + * Typically, this method is called only indirectly by calls to {@link yfiles.graphml.IParseContext#deserialize} or + * {@link yfiles.graphml.ParseContextExtensions#deserialize}. This implementation calls {@link yfiles.graphml.GraphMLParser#onHandleDeserialization}, which in + * turn raises the {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} event. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {Node} element The XML content that should be deserialized. + * @return {T} An instance of T that is represented by element. + * @see {@link yfiles.graphml.IParseContext#deserialize} + * @see {@link yfiles.graphml.ParseContextExtensions#deserialize} + * @see {@link yfiles.graphml.GraphMLParser#addHandleDeserializationListener HandleDeserialization} + */ + deserialize(targetType:yfiles.lang.Class,context:yfiles.graphml.IParseContext,element:Node):T; + /** + * Dynamically retrieve all {@link yfiles.graphml.IInputHandler} instances that process a GraphML attribute with + * key definition keyDefinition. + * Typically, this method is called only indirectly by the parse process. + * This implementation calls {@link yfiles.graphml.GraphMLParser#onQueryInputHandlers}, which in + * turn raises the {@link yfiles.graphml.GraphMLParser#addQueryInputHandlersListener QueryInputHandlers} event. + * @param {yfiles.graphml.IParseContext} context The current parse context. + * @param {Element} keyDefinition The key definition element of the GraphML attribute. + * @return {yfiles.collections.IList.} A list of {@link yfiles.graphml.IInputHandler IInputHandlers} that claim to be responsible for handling + * the given GraphML attribute. + */ + getInputHandlers(context:yfiles.graphml.IParseContext,keyDefinition:Element):yfiles.collections.IList; + /** + * Parse the XML document document into an graph instance, using elementFactory + * to create the elements. + * Typically, this method is called indirectly from + * {@link yfiles.graphml.GraphMLIOHandler#readFromDocument}. + * @param {Document} document The XML document instance to parse. Note: If + * you are using Internet Explorer 9 and {@link XMLHttpRequest}s to retrieve the + * document, you may not use the value from the {@link XMLHttpRequest#responseXML} + * property. Please parse {@link XMLHttpRequest#responseText} instead and use the + * result. + * For further reference see . + * @param {yfiles.graphml.IGraphElementFactory} elementFactory The {@link yfiles.graphml.IGraphElementFactory} instance that is used to create the elements. + * @see {@link yfiles.graphml.GraphMLIOHandler#readFromDocument} + */ + parseFromDocument(document:Document,graph:yfiles.graph.IGraph,elementFactory:yfiles.graphml.IGraphElementFactory):void; + /** + * Parse the input url into an graph instance, using elementFactory + * to create the elements. + * Typically, this method is called indirectly from + * {@link yfiles.graphml.GraphMLIOHandler#readFromURLWithCallback}. + * @param {string} url The URL to the input to parse. + * @param {yfiles.graph.IGraph} graph The graph instance that is populated. + * @param {yfiles.graphml.IGraphElementFactory} elementFactory The {@link yfiles.graphml.IGraphElementFactory} instance that is used to create the elements. + * @see {@link yfiles.graphml.GraphMLIOHandler#readFromURLWithCallback} + */ + parseFromURL(url:string,graph:yfiles.graph.IGraph,elementFactory:yfiles.graphml.IGraphElementFactory):void; + /** + * Create the initial {@link yfiles.graphml.IParseContext} instance. + * @param {yfiles.graph.IGraph} graph The graph that is parsed. + * @return {yfiles.graphml.IParseContext} An {@link yfiles.graphml.IParseContext} instance that is suitable for graph. + */ + createParseContext(graph:yfiles.graph.IGraph):yfiles.graphml.IParseContext; + /** + * Set a deserialization property that allows to fine tune the parsing process. + * @param {yfiles.support.TypedKey.} key The key for the property. + * @param {T} value The property value. + * @see {@link yfiles.graphml.IParseContext#getDeserializationProperty} + */ + setDeserializationProperty(key:yfiles.support.TypedKey,value:T):void; + /** + * Remove a deserialization property that has been set by {@link yfiles.graphml.GraphMLParser#setDeserializationProperty}. + * @param {yfiles.support.TypedKey.} key The key for the property. + * @see {@link yfiles.graphml.IParseContext#getDeserializationProperty} + */ + removeDeserializationProperty(key:yfiles.support.TypedKey):void; + /** + * Retrieve a deserialization property that has been set by {@link yfiles.graphml.GraphMLParser#setDeserializationProperty}. + * The return value is automatically converted to type T. + * @param {yfiles.support.TypedKey.} key The key for the property. + * @see {@link yfiles.graphml.IParseContext#getDeserializationProperty} + */ + getDeserializationProperty(tType:yfiles.lang.Class,key:yfiles.support.TypedKey):T; + /** + * Register an implementation of T for use with {@link yfiles.graphml.GraphMLParser#lookup}. + * @param {T} instance The implementation of T for lookup retrieval. + */ + setLookup(tType:yfiles.lang.Class,instance:T):void; + /** + * Remove an implementation of T that has been set with {@link yfiles.graphml.GraphMLParser#setLookup}. + */ + removeLookup(tType:yfiles.lang.Class):void; + /** + * Dynamically retrieve an instance of type. + * @param {yfiles.lang.Class} type The type for which an implementation is needed. + * @return {Object} An implementation of type, or null. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Raises the {@link yfiles.graphml.GraphMLParser#addParsedListener Parsed} event. + * This method is called when the document has been parsed and after {@link yfiles.graphml.IParseEvents#addDocumentParsedListener DocumentParsed} + * is called. + * @param {yfiles.graphml.ParseEventArgs} args The {@link yfiles.graphml.ParseEventArgs} instance containing the event data. + * @see {@link yfiles.graphml.GraphMLParser#addParsingListener Parsing} + */ + onParsed(args:yfiles.graphml.ParseEventArgs):void; + /** + * Occurs when the the document has been parsed. + * @see {@link yfiles.graphml.GraphMLParser#onParsed} + */ + addParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when the the document has been parsed. + * @see {@link yfiles.graphml.GraphMLParser#onParsed} + */ + removeParsedListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Raises the {@link yfiles.graphml.GraphMLParser#addParsingListener Parsing} event. + * This method is called just before the parsing starts and before {@link yfiles.graphml.IParseEvents#addDocumentParsingListener DocumentParsing} + * is called. + * @param {yfiles.graphml.ParseEventArgs} args The {@link yfiles.graphml.ParseEventArgs} instance containing the event data. + * @see {@link yfiles.graphml.GraphMLParser#addParsingListener Parsing} + */ + onParsing(args:yfiles.graphml.ParseEventArgs):void; + /** + * Occurs when the parsing of the document is just about to begin. + * This event can be used to register to the fine-grained events available in + * the {@link yfiles.graphml.ParseEventArgs#context}'s {@link yfiles.graphml.IParseContext#parseEvents} and + * the configure the parsing process on a per parse case. + * @see {@link yfiles.graphml.GraphMLParser#onParsing} + */ + addParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + /** + * Occurs when the parsing of the document is just about to begin. + * This event can be used to register to the fine-grained events available in + * the {@link yfiles.graphml.ParseEventArgs#context}'s {@link yfiles.graphml.IParseContext#parseEvents} and + * the configure the parsing process on a per parse case. + * @see {@link yfiles.graphml.GraphMLParser#onParsing} + */ + removeParsingListener(value:(sender:Object,e:yfiles.graphml.ParseEventArgs)=> void):void; + } + var GraphMLParser:{ + $class:yfiles.lang.Class; + new ():yfiles.graphml.GraphMLParser; + }; + /** + * An abstract {@link yfiles.model.IMapper}-based implementation of an {@link yfiles.graphml.IInputHandler}. + */ + export interface AbstractMapperInputHandler extends yfiles.graphml.AbstractInputHandler{ + /** + * Gets or sets the mapper to use for storing the data. + * Value: The mapper. + */ + mapper:yfiles.model.IMapper; + /** + * Gets or sets a value indicating whether values that are applied via the {@link yfiles.graphml.AbstractInputHandler#applyDefault}. + * mechanism and are equal to the value that is already present in the mapper will + * explicitly be overridden in the mapper. + * Value: + * true if default values should be overridden in the mapper; otherwise, false. + * By default this is set to false. + */ + overrideDefaultValue:boolean; + /** + * This method uses the {@link yfiles.graphml.AbstractMapperInputHandler#mapper} to associate the data with the + * key. + * @param {yfiles.graphml.IParseContext} context The context. + * @param {TKey} key The key. + * @param {TData} data The data. + * @see Overrides {@link yfiles.graphml.AbstractInputHandler#setValue} + */ + setValue(context:yfiles.graphml.IParseContext,key:TKey,data:TData):void; + /** + * Overridden to take the {@link yfiles.graphml.AbstractMapperInputHandler#overrideDefaultValue} property + * into account. + * @see {@link yfiles.graphml.AbstractMapperInputHandler#overrideDefaultValue} + * @see {@link yfiles.graphml.AbstractInputHandler#applyDefault} + * @param {yfiles.graphml.IParseContext} context The context for the parse operation. + * @see Overrides {@link yfiles.graphml.AbstractInputHandler#applyDefault} + * @see Specified by {@link yfiles.graphml.IInputHandler#applyDefault}. + */ + applyDefault(context:yfiles.graphml.IParseContext):void; + } + var AbstractMapperInputHandler:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.AbstractMapperInputHandler} class. + * The {@link yfiles.graphml.IInputHandler#precedence} has an initial value + * of {@link yfiles.graphml.ParsePrecedence#DEFAULT}. + */ + new (keyType1:yfiles.lang.Class):yfiles.graphml.AbstractMapperInputHandler; + /** + * Initializes a new instance of the {@link yfiles.graphml.AbstractMapperInputHandler} class. + * The {@link yfiles.graphml.IInputHandler#precedence} gets the initial value of + * precedence + * @param {yfiles.graphml.ParsePrecedence} precedence The precedence to assign to the {@link yfiles.graphml.AbstractInputHandler#precedence}. + */ + WithPrecedence:{ + new (keyType1:yfiles.lang.Class,precedence:yfiles.graphml.ParsePrecedence):yfiles.graphml.AbstractMapperInputHandler; + }; + }; + /** + * Simple tagging subclass of {@link yfiles.model.DictionaryMapper} + * that is typed for {@link Object} keys and values. + * This class is used by the {@link yfiles.graphml.GraphMLParser} to store + * properties of an item before it has been created. An instance of this class + * can be found in the {@link yfiles.support.ILookup#lookup} of the {@link yfiles.graphml.IParseContext} + * during the parsing of an item. Custom parsers may populate the dictionary with various properties + * that can then be used by the {@link yfiles.graphml.IGraphElementFactory} during the creation of the item. + * @see {@link yfiles.graphml.IGraphElementFactory} + * @see {@link yfiles.graphml.GraphMLParser} + */ + export interface CreationProperties extends yfiles.model.DictionaryMapper{ + } + var CreationProperties:{ + $class:yfiles.lang.Class; + new ():yfiles.graphml.CreationProperties; + }; + /** + * Implementation of {@link yfiles.graphml.IXmlWriter} that writes directly to an {@link yfiles.system.StringWriter}. + * This writer does not support random access on the output document. + */ + export interface DirectXmlWriter extends yfiles.graphml.AbstractXmlWriter{ + /** + * Begin the output process. + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeStartDocument}. + */ + writeStartDocument():yfiles.graphml.IXmlWriter; + /** + * Close the document. + * This is typically used to actually flush the document to an output stream + * @see Specified by {@link yfiles.graphml.IXmlWriter#flushDocument}. + */ + flushDocument():void; + /** + * Write a text node. + * The string value of s will be correctly escaped + * @param {string} s The string that gets written as XML text + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeString}. + */ + writeString(s:string):yfiles.graphml.IXmlWriter; + /** + * Write a XML comment node. + * @param {string} comment The content of the comment + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeComment}. + */ + writeComment(comment:string):yfiles.graphml.IXmlWriter; + /** + * Close the output. + * Attempts to write after this method has been called will + * have undefined results. + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeEndDocument}. + */ + writeEndDocument():void; + /** + * The core method that actually writes the starting element. + * @param {string} prefix The prefix or null. + * @param {string} localName The name of the element. + * @param {string} namespace The namespace URI of the element. + */ + writeStartElementCore(prefix:string,localName:string,ns:string):void; + closeCurrentElement(addEndTag:boolean):void; + /** + * The core method that actually writes an attribute. + * @param {string} prefix The prefix or null. + * @param {string} localName The name of the element. + * @param {string} namespace The namespace URI of the element. + * @param {string} value The value of the attribute. + */ + writeAttributeCore(prefix:string,localName:string,ns:string,value:string):void; + /** + * The core method that actually writes the end element. + */ + writeEndElementCore():void; + /** + * Write a document fragment. + * @param {Document} fragment + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeDocumentFragment}. + */ + writeDocumentFragment(fragment:Document):yfiles.graphml.IXmlWriter; + /** + * Write a xml processing instruction. + * @param {string} target The target of the PI + * @param {string} data The data of the PI + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeProcessingInstruction}. + */ + writeProcessingInstruction(target:string,data:string):yfiles.graphml.IXmlWriter; + /** + * Write a CDATA section. + * @param {string} content The content of the CDATA section + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeCData}. + */ + writeCData(content:string):yfiles.graphml.IXmlWriter; + } + var DirectXmlWriter:{ + $class:yfiles.lang.Class; + /** + * Create a new instance that writes on a {@link yfiles.system.StringWriter}. + * The document encoding is fixed by the tw encoding + * @param {yfiles.system.StringWriter} tw The output stream + */ + new (tw:yfiles.system.StringWriter):yfiles.graphml.DirectXmlWriter; + }; + /** + * An abstract convenience implementation of the {@link yfiles.graphml.IInputHandler} + * interface. + */ + export interface AbstractInputHandler extends Object,yfiles.graphml.IInputHandler{ + /** + * Gets or sets a value indicating whether the default value in the key definition should be parsed. + * Value: true if the default value should be parsed; otherwise, false. The default is true. + */ + parseDefaultValue:boolean; + /** + * Gets or sets the default value that will be applied to the keys where the data attribute is missing. + * Value: The default value. + */ + defaultValue:TData; + /** + * Gets or sets a value indicating whether the default value exists in the key definition. + * If this property is set to true, the {@link yfiles.graphml.AbstractInputHandler#applyDefault} method + * will call the {@link yfiles.graphml.AbstractInputHandler#setValue} method using the {@link yfiles.graphml.AbstractInputHandler#defaultValue} as the value parameter. + * Value: true if the default value exists; otherwise, false. + */ + defaultExists:boolean; + /** + * Gets or sets the parse precedence that is associated with this handler. + * Value: The parse precedence. + * @see Specified by {@link yfiles.graphml.IInputHandler#precedence}. + */ + precedence:yfiles.graphml.ParsePrecedence; + /** + * This method is invoked each time a data element with matching key + * is processed. + * If the {@link yfiles.graphml.IParseContext#currentObject} is of the same type + * as this TKey and the scope is valid, + * this method delegates the actual parsing to {@link yfiles.graphml.AbstractInputHandler#parseDataCore} and {@link yfiles.graphml.AbstractInputHandler#setValue} + * @param {yfiles.graphml.IParseContext} context the current parse context. + * @param {Node} node the DOM node representing the data element. + * @see Specified by {@link yfiles.graphml.IInputHandler#parseData}. + */ + parseData(context:yfiles.graphml.IParseContext,node:Node):void; + /** + * Allows to restrict the scopes where the handler is used. + * By default the collection contains the {@link yfiles.graphml.KeyScope#ALL}. + */ + validScopes:yfiles.collections.ICollection; + /** + * Initializes this instance from the GraphML key definition. + * This implementation looks for the GraphML default element and delegates to {@link yfiles.graphml.AbstractInputHandler#parseDataCore} + * if a default is found to store the {@link yfiles.graphml.AbstractInputHandler#defaultValue} and set the {@link yfiles.graphml.AbstractInputHandler#defaultExists} property. + * @param {yfiles.graphml.IParseContext} context The context. + * @param {Element} definition The definition. + */ + initializeFromKeyDefinition(context:yfiles.graphml.IParseContext,definition:Element):void; + /** + * Abstract method callback that actually parses the data. + * @param {yfiles.graphml.IParseContext} context The context. + * @param {Node} node The node that contains the data. This is either the GraphML 'data' element or the 'default' element. + * @return {TData} The parsed data. + */ + parseDataCore(context:yfiles.graphml.IParseContext,node:Node):TData; + /** + * Abstract method callback that actually stores the value with the keys. + * @param {yfiles.graphml.IParseContext} context The context. + * @param {TKey} key The key. + * @param {TData} data The data. + */ + setValue(context:yfiles.graphml.IParseContext,key:TKey,data:TData):void; + /** + * This method is invoked when no data tag is defined, and the default value + * should be applied. + * This implementation delegates to {@link yfiles.graphml.AbstractInputHandler#setValue} + * if {@link yfiles.graphml.AbstractInputHandler#defaultExists a default exists} using the {@link yfiles.graphml.AbstractInputHandler#defaultValue}. + * @param {yfiles.graphml.IParseContext} context the current parse context. + * @see Specified by {@link yfiles.graphml.IInputHandler#applyDefault}. + */ + applyDefault(context:yfiles.graphml.IParseContext):void; + } + var AbstractInputHandler:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.AbstractInputHandler} class. + * The {@link yfiles.graphml.AbstractInputHandler#precedence} has an initial value + * of {@link yfiles.graphml.ParsePrecedence#DEFAULT}. + */ + new (keyType:yfiles.lang.Class):yfiles.graphml.AbstractInputHandler; + /** + * Initializes a new instance of the {@link yfiles.graphml.AbstractInputHandler} class. + * The {@link yfiles.graphml.AbstractInputHandler#precedence} gets the initial value + * assigned to precedence + * @param {yfiles.graphml.ParsePrecedence} precedence The precedence to assign to the {@link yfiles.graphml.AbstractInputHandler#precedence} property. + */ + WithPrecedence:{ + new (keyType:yfiles.lang.Class,precedence:yfiles.graphml.ParsePrecedence):yfiles.graphml.AbstractInputHandler; + }; + }; + /** + * Exception that will be thrown by the {@link yfiles.graphml.IParseContext#deserialize} method + * and the like to indicate that the deserialization failed. + */ + export interface DeserializationNotSupportedException extends yfiles.system.IOException{ + } + var DeserializationNotSupportedException:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.DeserializationNotSupportedException} class. + */ + new ():yfiles.graphml.DeserializationNotSupportedException; + /** + * Initializes a new instance of the {@link yfiles.graphml.DeserializationNotSupportedException} class with the given message. + * @param {string} message The message. + */ + WithMessage:{ + new (message:string):yfiles.graphml.DeserializationNotSupportedException; + }; + /** + * Initializes a new instance of the {@link yfiles.graphml.DeserializationNotSupportedException} class + * with the given message and inner exception. + * @param {string} message The message. + * @param {yfiles.lang.Exception} inner The inner exception. + */ + WithMessageAndInnerException:{ + new (message:string,inner:yfiles.lang.Exception):yfiles.graphml.DeserializationNotSupportedException; + }; + }; + /** + * Abstract base implementation of {@link yfiles.graphml.IXmlWriter} that provides common methods for namespace and schema setup. + */ + export interface AbstractXmlWriter extends Object,yfiles.graphml.IXmlWriter{ + /** + * Factory method that creates the namespace manager for this instance. + * @return {yfiles.graphml.IXmlNamespaceManager} A new manager instance. + */ + createNamespaceManager():yfiles.graphml.IXmlNamespaceManager; + /** + * Begin the output process. + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeStartDocument}. + */ + writeStartDocument():yfiles.graphml.IXmlWriter; + /** + * Close the document. + * This is typically used to actually flush the document to an output stream + * @see Specified by {@link yfiles.graphml.IXmlWriter#flushDocument}. + */ + flushDocument():void; + /** + * Gets the namespace manager associated with this writer. + * Value: The namespace manager. + * @see Specified by {@link yfiles.graphml.IXmlWriter#namespaceManager}. + */ + namespaceManager:yfiles.graphml.IXmlNamespaceManager; + /** + * Write a text node. + * The string value of s will be correctly escaped + * @param {string} s The string that gets written as XML text + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeString}. + */ + writeString(s:string):yfiles.graphml.IXmlWriter; + /** + * Write a XML comment node. + * @param {string} comment The content of the comment + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeComment}. + */ + writeComment(comment:string):yfiles.graphml.IXmlWriter; + /** + * Close the output. + * Attempts to write after this method has been called will + * have undefined results. + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeEndDocument}. + */ + writeEndDocument():void; + /** + * Begin a new XML element with given parameters. + * All subsequent output is attached to this element until + * {@link yfiles.graphml.IXmlWriter#writeEndElement} has been called or a new + * element has been started. + *

+ * This acts like {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix}, but + * uses the default prefix for the namespace

+ * @param {string} localName The local name of this element + * @param {string} ns The namespace of this element + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeStartElement}. + */ + writeStartElement(localName:string,ns:string):yfiles.graphml.IXmlWriter; + /** + * Begin a new XML element with given parameters. + * All subsequent output is attached to this element until + * {@link yfiles.graphml.IXmlWriter#writeEndElement} has been called or a new + * element has been started. + * @param {string} prefix The namespace prefix to use for this element + * @param {string} localName The local name of this element + * @param {string} ns The namespace of this element + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix}. + */ + writeStartElementWithPrefix(prefix:string,localName:string,ns:string):yfiles.graphml.IXmlWriter; + /** + * The core method that actually writes the starting element. + * @param {string} prefix The prefix or null. + * @param {string} localName The name of the element. + * @param {string} namespace The namespace URI of the element. + */ + writeStartElementCore(prefix:string,localName:string,a:string):void; + closeCurrentElement(addEndTag:boolean):void; + /** + * The core method that actually writes an attribute. + * @param {string} prefix The prefix or null. + * @param {string} localName The name of the element. + * @param {string} namespace The namespace URI of the element. + * @param {string} value The value of the attribute. + */ + writeAttributeCore(prefix:string,localName:string,a:string,value:string):void; + /** + * Write a XML attribute node. + * The attribute is attached to the closest open XML element that has + * been started with {@link yfiles.graphml.IXmlWriter#writeStartElement} or + * {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix}. + * Note that namespace declarations should not be written directly as attributes. + * Instead the {@link yfiles.graphml.IXmlWriter#namespaceManager} should be used. + * @param {string} prefix The namespace prefix of the attribute + * @param {string} localName The local name of the attribute + * @param {string} ns The namespace URI of this attribute + * @param {string} value The value of this attribute + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeAttributeWithNamespace}. + */ + writeAttributeWithNamespace(prefix:string,localName:string,ns:string,value:string):yfiles.graphml.IXmlWriter; + /** + * Write namespace declaration without checking for clashes. + * @param {string} prefix The prefix that shall be used for the namespace or null + * if a default namespace shall be declared. + * @param {string} nsUri The namespace URI. + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + */ + writeNamespaceDeclaration(prefix:string,nsUri:string):yfiles.graphml.IXmlWriter; + /** + * Write a document fragment. + * @param {Document} fragment + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeDocumentFragment}. + */ + writeDocumentFragment(fragment:Document):yfiles.graphml.IXmlWriter; + /** + * Write a xml processing instruction. + * @param {string} target The target of the PI + * @param {string} data The data of the PI + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeProcessingInstruction}. + */ + writeProcessingInstruction(target:string,data:string):yfiles.graphml.IXmlWriter; + /** + * Write a CDATA section. + * @param {string} content The content of the CDATA section + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeCData}. + */ + writeCData(content:string):yfiles.graphml.IXmlWriter; + /** + * The core method that actually writes the end element. + */ + writeEndElementCore():void; + /** + * Close a XML element previously opened with {@link yfiles.graphml.IXmlWriter#writeStartElement} or + * {@link yfiles.graphml.IXmlWriter#writeStartElementWithPrefix}. + * @return {yfiles.graphml.IXmlWriter} The writer instance for further chaining + * @see Specified by {@link yfiles.graphml.IXmlWriter#writeEndElement}. + */ + writeEndElement():yfiles.graphml.IXmlWriter; + } + export module AbstractXmlWriter{ + export interface XmlNamespaceManager extends Object,yfiles.graphml.IXmlNamespaceManager{ + getPrefixOfNamespace(ns:string):string; + getPrefixOfNamespaceInScope(ns:string):string; + getNamespaceOfPrefix(prefix:string):string; + getNamespaceOfPrefixInScope(prefix:string):string; + getOrCreateUniqueMapping(ns:string):string; + registerLocalMapping(nsURI:string,prefix:string):string; + pushScope():void; + sealScope():void; + popScope():void; + globalNamespaces:yfiles.collections.IDictionary; + } + } + var AbstractXmlWriter:{ + $class:yfiles.lang.Class; + XmlNamespaceManager:{ + $class:yfiles.lang.Class; + new (writer:yfiles.graphml.AbstractXmlWriter):yfiles.graphml.AbstractXmlWriter; + }; + }; + /** + * An {@link yfiles.graphml.IWriteContext} implementation for use in the context of {@link yfiles.graphml.GraphMLWriter} + * that wraps a given instance and delegates most of the calls to it but allows for modifying + * {@link yfiles.graphml.ChildWriteContext#setLookup lookup} and {@link yfiles.graphml.ChildWriteContext#setSerializationProperty serialization properties}. + * Whenever it is necessary to locally modify some context properties, a new instance of this class should be created that wraps an existing one. + */ + export interface ChildWriteContext extends Object,yfiles.graphml.IWriteContext{ + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Adds another lookup result to the local lookup override. + * @param {T} value The value to provide for queries to T. + * @see {@link yfiles.graphml.ChildWriteContext#removeLookup} + */ + setLookup(tType:yfiles.lang.Class,value:T):void; + /** + * Removes a local lookup override that has been added using {@link yfiles.graphml.ChildWriteContext#setLookup}. + */ + removeLookup(tType:yfiles.lang.Class):void; + /** + * Returns the current nesting of graphs and graph elements. + * The list contains the user objects which correspond to the + * GraphML elements. + * Value: A read-only view on the current nesting + * @see Specified by {@link yfiles.graphml.IWriteContext#objectStack}. + */ + objectStack:yfiles.model.IListEnumerable; + /** + * Returns the most current (i.e. the last element) + * within the container hierarchy as it is returned + * by {@link yfiles.graphml.IWriteContext#objectStack} + * @see Specified by {@link yfiles.graphml.IWriteContext#currentObject}. + */ + currentObject:Object; + /** + * Returns an implementation of {@link yfiles.graphml.IWriteEvents} that allows to subscribe to various + * events in the write process. + * @see Specified by {@link yfiles.graphml.IWriteContext#writeEvents}. + */ + writeEvents:yfiles.graphml.IWriteEvents; + /** + * Gets the parent context to which most calls are delegated. + * Value: The parent context. + */ + parentContext:yfiles.graphml.IWriteContext; + /** + * Gets or sets the writer. + * If a null writer is set, this implementation will delegate to + * the {@link yfiles.graphml.ChildWriteContext#parentContext}'s {@link yfiles.graphml.IWriteContext#writer}. + * @see Specified by {@link yfiles.graphml.IWriteContext#writer}. + */ + writer:yfiles.graphml.IXmlWriter; + /** + * Returns the currently active graph object. + * @see Specified by {@link yfiles.graphml.IWriteContext#graph}. + */ + graph:yfiles.graph.IGraph; + /** + * Get a property value that specifies information about how to handle specific cases. + * @param {yfiles.support.TypedKey.} key The identifier for the property + * @return {T} The property value, or null if no such property exists + * @see Specified by {@link yfiles.graphml.IWriteContext#getSerializationProperty}. + */ + getSerializationProperty(tType:yfiles.lang.Class,key:yfiles.support.TypedKey):T; + /** + * Sets the local serialization property for the given key to the value. + * @param {yfiles.support.TypedKey.} key The key to override. + * @param {T} value The value. + */ + setSerializationProperty(key:yfiles.support.TypedKey,value:T):void; + /** + * Removes a previously locally {@link yfiles.graphml.ChildWriteContext#setSerializationProperty set} serialization property. + * @param {yfiles.support.TypedKey.} key The key for which the local property override should be removed. + */ + removeSerializationProperty(key:yfiles.support.TypedKey):void; + /** + * Serialize item to an XML representation. + * Client code should usually use the extension method {@link yfiles.graphml.IWriteContext#serializeWithItem} instead + * to ensure the the correct context instance is used. + * @param {yfiles.graphml.IWriteContext} context The current write context. + * @param {T} item The object that should be serialized. + * @see {@link yfiles.graphml.IWriteContext#serializeWithItem} + * @see Specified by {@link yfiles.graphml.IWriteContext#serialize}. + */ + serialize(targetType:yfiles.lang.Class,context:yfiles.graphml.IWriteContext,item:T):void; + } + var ChildWriteContext:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.ChildWriteContext} class that delegates to the provided context + * and has the {@link yfiles.graphml.ChildWriteContext#currentObject} set to the given value. + * @param {yfiles.graphml.IWriteContext} parentContext The parent context to delegate calls to. + * @param {Object} currentObject The current object to assign to {@link yfiles.graphml.ChildWriteContext#currentObject}. + */ + new (parentContext:yfiles.graphml.IWriteContext,currentObject:Object):yfiles.graphml.ChildWriteContext; + /** + * Initializes a new instance of the {@link yfiles.graphml.ChildWriteContext} class that delegates to the given parent context. + * @param {yfiles.graphml.IWriteContext} parentContext The parent context. + */ + WithParentContext:{ + new (parentContext:yfiles.graphml.IWriteContext):yfiles.graphml.ChildWriteContext; + }; + }; + /** + * An implementation of the {@link yfiles.graphml.AbstractOutputHandler} class, + * that can use a {@link yfiles.graphml.ComplexMapperOutputHandler#serializer} callback for the serialization + * or delegate to the {@link yfiles.graphml.IWriteContext#serialize} callback. + */ + export interface ComplexMapperOutputHandler extends yfiles.graphml.AbstractMapperOutputHandler{ + /** + * Gets or sets the serialization callback to use for serializing the value in {@link yfiles.graphml.ComplexMapperOutputHandler#writeValueCore}. + * Value: The serialization callback or null to indicate that the context should be used instead. + * @see {@link yfiles.graphml.ComplexMapperOutputHandler#sourceType} + */ + serializer:(sender:Object,e:yfiles.graphml.HandleSerializationEventArgs)=> void; + /** + * Gets or sets the source type of the serialization. + * Value: The desired type of the object that is serialized. + * This type will be used as the {@link yfiles.graphml.HandleSerializationEventArgs#sourceType}. + * @see {@link yfiles.graphml.ComplexMapperOutputHandler#serializer} + * @see {@link yfiles.graphml.HandleSerializationEventArgs} + */ + sourceType:yfiles.lang.Class; + /** + * Callback method that performs the actual writing of the data using either the {@link yfiles.graphml.ComplexMapperOutputHandler#serializer} + * or the {@link yfiles.graphml.IWriteContext#serialize} method. + * @param {yfiles.graphml.IWriteContext} context The context to use for writing. + * @param {TValue} data The data to write. + * @see Overrides {@link yfiles.graphml.AbstractOutputHandler#writeValueCore} + */ + writeValueCore(context:yfiles.graphml.IWriteContext,data:TValue):void; + } + var ComplexMapperOutputHandler:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.ComplexMapperOutputHandler} class + * using the provided name. + * @param {string} name The name to use for the key attributes. + */ + new (keyType1:yfiles.lang.Class,valueType:yfiles.lang.Class,name:string):yfiles.graphml.ComplexMapperOutputHandler; + /** + * Initializes a new instance of the {@link yfiles.graphml.ComplexMapperOutputHandler} class + * using the provided key attributes. + * @param {yfiles.graphml.KeyScope} scope The scope of the handler. + * @param {string} name The name to use for the definition. + * @param {yfiles.graphml.KeyType} type The type of the data. + */ + WithKeyScopeAndKeyType:{ + new (keyType1:yfiles.lang.Class,valueType:yfiles.lang.Class,scope:yfiles.graphml.KeyScope,name:string,type:yfiles.graphml.KeyType):yfiles.graphml.ComplexMapperOutputHandler; + }; + }; + /** + * Convenience abstract base implementation of the {@link yfiles.graphml.IOutputHandler} interface. + */ + export interface AbstractOutputHandler extends Object,yfiles.graphml.IOutputHandler{ + /** + * Adds the name to the key definition. + * @param {string} name The name of the key element. + */ + addNameToKeyDefinition(name:string):void; + /** + * Adds an optional URI to the key definition. + * By default, no URI is set. + * @param {string} uri The URI of the key element. + */ + addUriToKeyDefinition(uri:string):void; + /** + * Adds the key type to the key definition. + * @param {yfiles.graphml.KeyType} type The type of the key element. + */ + addTypeToKeyDefinition(type:yfiles.graphml.KeyType):void; + /** + * Adds the scope to the key definition. + * Note that the official GraphML schema does not support the {@link yfiles.graphml.KeyScope#GRAPHML} + * so this implementation will silently ignore this which will result in {@link yfiles.graphml.KeyScope#ALL} + * implicitly being defined. + * @param {yfiles.graphml.KeyScope} scope The scope of the key element. + */ + addScopeToKeyDefinition(scope:yfiles.graphml.KeyScope):void; + /** + * Gets or sets the default value. + * Setting this value also sets the {@link yfiles.graphml.AbstractOutputHandler#defaultExists} property. + * Value: The default value. + */ + defaultValue:TData; + /** + * Gets or sets a value indicating whether a default value has been assigned. + * Value: true if a default value has been assigned, otherwise false. + */ + defaultExists:boolean; + /** + * Gets or sets the write precedence for the handler. + * Value: The write precedence. + * @see Specified by {@link yfiles.graphml.IOutputHandler#precedence}. + */ + precedence:yfiles.graphml.WritePrecedence; + /** + * Gets the XML attributes that should be added to the key definition in the GraphML key element. + * Value: The key definition attributes. + * @see Specified by {@link yfiles.graphml.IOutputHandler#keyDefinitionAttributes}. + */ + keyDefinitionAttributes:yfiles.collections.IEnumerable; + /** + * Gets the XML attributes that should be added to the data element. + * Value: The attributes for the data element. + * @see Specified by {@link yfiles.graphml.IOutputHandler#dataTagAttributes}. + */ + dataTagAttributes:yfiles.collections.IEnumerable; + /** + * Determines whether in the current context, the value is the default value and therefore + * no data element needs to be written. + * This implementation will return false if no {@link yfiles.graphml.AbstractOutputHandler#defaultExists default has been set}. + * Otherwise it will use {@link yfiles.graphml.AbstractOutputHandler#getValue} and compare the result with the {@link yfiles.graphml.AbstractOutputHandler#defaultValue} + * to determine whether they are equal and therefore no data needs to be written. + * @param {yfiles.graphml.IWriteContext} ctx The context. + * @return {boolean} + * true if for the current context the default value applies and therefore no data element needs to be written. + * @see Specified by {@link yfiles.graphml.IOutputHandler#isDefaultValue}. + */ + isDefaultValue(ctx:yfiles.graphml.IWriteContext):boolean; + /** + * Allows to restrict the scopes where the handler is used, if the handler is registered to {@link yfiles.graphml.KeyScope#ALL}. + * By default the collection contains the {@link yfiles.graphml.KeyScope#ALL}. + */ + validScopes:yfiles.collections.ICollection; + /** + * Actually writes the value for the current context. + * This method will use {@link yfiles.graphml.AbstractOutputHandler#getValue} to obtain the data and + * delegate to {@link yfiles.graphml.AbstractOutputHandler#writeValueCore} to perform the actual serialization. + * @param {yfiles.graphml.IWriteContext} ctx The context. + * @see Specified by {@link yfiles.graphml.IOutputHandler#writeValue}. + */ + writeValue(ctx:yfiles.graphml.IWriteContext):void; + /** + * Writes the contents of the key definition. + * Depending on whether {@link yfiles.graphml.AbstractOutputHandler#writeKeyDefault} is enabled and {@link yfiles.graphml.AbstractOutputHandler#defaultExists} + * is true, this method will write the GraphML 'default' element and use {@link yfiles.graphml.AbstractOutputHandler#writeValueCore} + * to serialize the {@link yfiles.graphml.AbstractOutputHandler#defaultValue}. + * @param {yfiles.graphml.IWriteContext} ctx The context. + * @see Specified by {@link yfiles.graphml.IOutputHandler#writeKeyDefinitionContent}. + */ + writeKeyDefinitionContent(ctx:yfiles.graphml.IWriteContext):void; + /** + * Gets or sets a value indicating whether to write the key default. + * Value: true if the key default should be written; otherwise, false. + */ + writeKeyDefault:boolean; + /** + * Callback method that performs the actual writing of the data. + * @param {yfiles.graphml.IWriteContext} context The context. + * @param {TData} data The data. + */ + writeValueCore(context:yfiles.graphml.IWriteContext,data:TData):void; + /** + * Callback method that obtains the data for the given key. + * @param {yfiles.graphml.IWriteContext} context The context. + * @param {TKey} key The key. + * @return {TData} The data that is associated with the key. + */ + getValue(context:yfiles.graphml.IWriteContext,key:TKey):TData; + } + var AbstractOutputHandler:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.graphml.AbstractOutputHandler} class. + */ + AbstractOutputHandler:{ + new (keyType2:yfiles.lang.Class):yfiles.graphml.AbstractOutputHandler; + }; + /** + * Initializes a new instance of the {@link yfiles.graphml.AbstractOutputHandler} class + * using the provided scope, name, and type for the key definition. + * @param {yfiles.graphml.KeyScope} scope The scope, if this is {@link yfiles.graphml.KeyScope#GRAPHML}, the {@link yfiles.graphml.AbstractOutputHandler#validScopes} + * property is initialized to contain exactly that scope. + * @param {string} name The name to use for the key definition. + * @param {yfiles.graphml.KeyType} type The type to use for the key definition. + * @see {@link yfiles.graphml.AbstractOutputHandler#addUriToKeyDefinition} + */ + new (keyType2:yfiles.lang.Class,scope:yfiles.graphml.KeyScope,name:string,type:yfiles.graphml.KeyType):yfiles.graphml.AbstractOutputHandler; + }; + } + export module hierarchic{ + /** + * This class implements the second phase of the Sugiyama algorithm. + * It minimizes the crossings in the diagram by using either the + * barycentric or median heuristic. + */ + export interface ClassicLayerSequencer extends Object,yfiles.hierarchic.ILayerSequencer{ + /** + * Specifies whether or not the transposition heuristic should + * be used. + * Activating this heuristic can reduce the overall + * number of edge crossings. On the other hand its activation + * increases running time. + * By default the transposition rule is active. + */ + useTransposition:boolean; + /** + * The currently set weight heuristic. + * By default {@link yfiles.hierarchic.WeightHeuristic#BARYCENTER} is set. + */ + weightHeuristic:yfiles.hierarchic.WeightHeuristic; + /** + * Specifies whether or not to remove false crossings. + * A false crossing is a crossing + * between two edges that share a common terminal node. + * By default this feature is active. + */ + removeFalseCrossings:boolean; + /** + * The proposed maximal duration for the calculation of the sequence. + */ + maximalDuration:number; + /** + * The number of edge crossings that were + * produced by this sequencer the last time it was + * applied to a graph. + * Precondition: + * Method {@link yfiles.hierarchic.ClassicLayerSequencer#getLayers} + * must have been called before. + */ + recentCrossingNumber:number; + /** + * Tries to adopt/copy the settings of the given LayerSequencer to this sequencer. + */ + adoptValues(otherSequencer:yfiles.hierarchic.ILayerSequencer):void; + /** + * Calculates the sequence of nodes within each layer. + * @param {yfiles.layout.LayoutGraph} g the graph being acted upon + * @param {yfiles.algorithms.INodeMap} layerID + * provides for each node an integral number signifying the layer + * of that node. The first layer has the number 0. + * @param {number} maxLayer the number of different layers + * @return {yfiles.algorithms.NodeList[]} + * an array of length maxLayer containing node lists. Each node list + * contains the nodes of a corresponding layer. The order of the nodes + * within each node list represents the sequence of the nodes within their layer. + * @see Specified by {@link yfiles.hierarchic.ILayerSequencer#getLayers}. + */ + getLayers(g:yfiles.layout.LayoutGraph,layerMap:yfiles.algorithms.INodeMap,maxLayer:number):yfiles.algorithms.NodeList[]; + /** + * Specifies whether or not the layerer will preserve the groupings of + * nodes between each layer. + * Preserving groupings means nodes having the same integer group number will + * be placed directly next to each other within each layer. + *

+ * Defaults to false. + *

+ */ + usingGroups:boolean; + /** + * The number of randomized rounds this algorithm will try + * if there was no optimal solution. + */ + randomizationRounds:number; + } + var ClassicLayerSequencer:{ + $class:yfiles.lang.Class; + /** + * This is the key, which must be used to register the DataProvider + * which contains the mappings between nodes and group ids. + * Group ids + * are integer objects, containing unique group numbers or null, if the + * node belongs to no specific group. + */ + GROUP_DP_KEY:Object; + /** + * Instantiates a new layer sequencer. + */ + new ():yfiles.hierarchic.ClassicLayerSequencer; + }; + /** + * This class is a variant of the classic {@link yfiles.hierarchic.HierarchicLayouter} + * implementation. + * It serves as a facade to {@link yfiles.hierarchic.incremental.HierarchicLayouter}. + *

+ * Instances can be used to simply create hierarchic layouts from scratch or add + * new elements to the existing sketch drawing incrementally. + * In order to add elements incrementally to the current sketch or let the algorithm + * optimize certain elements in the current sketch, set its mode to + * {@link yfiles.hierarchic.LayoutMode#INCREMENTAL} and + * add a {@link yfiles.algorithms.IDataProvider} (e.g. use {@link yfiles.algorithms.Maps#createHashedDataMap}) using the + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter#INCREMENTAL_HINTS_DP_KEY} DataProvider key to the graph and associate the marks + * obtained from the {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory} with the elements to be + * added incrementally.

+ *

+ * Many settings of the layout can be controlled using the {@link yfiles.hierarchic.incremental.EdgeLayoutDescriptor} + * and {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor} instances. The ones that are used during the + * layout run can be obtained from {@link yfiles.hierarchic.IncrementalHierarchicLayouter#edgeLayoutDescriptor} and + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter#nodeLayoutDescriptor} respectively. + * If at the time of the invocation DataProvider instances are bound to the graph + * using either the {@link yfiles.hierarchic.incremental.HierarchicLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} or + * {@link yfiles.hierarchic.incremental.HierarchicLayouter#NODE_LAYOUT_DESCRIPTOR_DP_KEY} keys, they will be wrapped + * and whenever they do not provide values the ones set in this instance will be used as fall-back values. + *

+ *

+ * IncrementalHierarchicLayouter supports two approaches to connect edges on a specific side or even an exact location + * to a node. {@link yfiles.layout.PortConstraint}s define a single constraint for the ports of an edge. To realize more + * complex port restrictions, several {@link yfiles.layout.PortCandidate}s or {@link yfiles.layout.PortCandidateSet}s can be + * assigned to edges or + * nodes. If an edge with registered PortCandidates connects to nodes with PortCandidateSets, + * the layouter will try to match both collections to find an appropriate port. In case there is no matching port + * candidate, a PortCandidate specified for the edge is preferred. + * Since their simultaneous existence at the same node may be ambiguous, it is not recommended to use a combination of + * PortConstraints and PortCandidates in the same layout. + *

+ *

+ * Here is a sample layout output: + *

+ *

+ *

+ *

+ *

+ * The following example shows the result of an incremental layout with lots of port constraints + * (For clarity colored layers have been added to the diagram): + *

+ *

+ *

+ *

+ *

+ * The last example shows the result of a layout run that considered swim lanes. + * Nodes with the same label have been placed into the same swim lane. Swim lanes + * have been ordered in ascending order of the label names. + * (For clarity lines have been added to the diagram that depict the bounds of the + * swim lanes): + *

+ *

+ *

+ *

+ * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#INCREMENTAL_HINTS_DP_KEY} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#createIncrementalHintsFactory} + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter} + */ + export interface IncrementalHierarchicLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * The group layer alignment strategy used for recursive group layering. + *

+ * Default value is {@link yfiles.hierarchic.GroupAlignmentPolicy#CENTER}. + *

+ * @see {@link yfiles.hierarchic.GroupAlignmentPolicy#TOP} + * @see {@link yfiles.hierarchic.GroupAlignmentPolicy#CENTER} + * @see {@link yfiles.hierarchic.GroupAlignmentPolicy#BOTTOM} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#recursiveGroupLayering} + * @see {@link yfiles.hierarchic.GroupAlignmentPolicy#TOP} + * @see {@link yfiles.hierarchic.GroupAlignmentPolicy#CENTER} + * @see {@link yfiles.hierarchic.GroupAlignmentPolicy#BOTTOM} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#recursiveGroupLayering} + */ + groupAlignmentPolicy:yfiles.hierarchic.GroupAlignmentPolicy; + /** + * Specifies whether layer compaction for recursive group layering is active. + * If set to true, the recursive layering is compacted, i.e. node + * ranks are decreased if possible without reversing edge directions. + * This differs from non-recursive layering, where groups are ignored completely. + * The resulting layering tries to keep the layer span of a group node minimal, + * while minimizing the overall vertical space. + *

+ * By default, this feature is disabled. + *

+ *

+ * Note: + * This feature works best when a instance of + * {@link yfiles.hierarchic.TopologicalLayerer} is used for layer assignment. + * If this feature is enabled, an alignment policy that is set with + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter#groupAlignmentPolicy} is ignored. + *

+ * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#recursiveGroupLayering} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#recursiveGroupLayering} + */ + compactGroups:boolean; + /** + * The policy that is used to arrange connected components. + *

+ * Defaults to {@link yfiles.hierarchic.ComponentArrangementPolicy#TOPMOST}. + *

+ * @throws {yfiles.system.ArgumentException} + * if the specified policy does not match + * one component arrangement policy constants. + */ + componentArrangementPolicy:yfiles.hierarchic.ComponentArrangementPolicy; + /** + * The time limit (in milliseconds) set for the layout algorithm. + * Note that restricting the maximal duration may result in a worse layout quality. + * Furthermore, the actual runtime may exceed the maximal duration since the layout algorithm + * still has to find a valid solution. + * The layout algorithm takes also into consideration the specified time limits for {@link yfiles.hierarchic.incremental.ILayerer}, {@link yfiles.hierarchic.incremental.ISequencer} + * and {@link yfiles.hierarchic.incremental.INodePlacer} instances and will try to perform their corresponding processes based on these values. In the + * case where the layout algorithm's duration is smaller than the specified + * durations of these instances, the duration of the layout algorithm will be considered. + */ + maximalDuration:number; + /** + * Specifies whether groups are respected during the layering stage. + *

+ * If set to true (and {@link yfiles.hierarchic.IncrementalHierarchicLayouter#compactGroups group compaction} is not enabled), groups are layered recursively, i.e. + *

    + *
  • nodes in the same group always occupy adjacent layers
  • + *
  • layer intervals spanned by different group nodes are either disjoint or are nested
  • + *
+ * If this feature is disabled, group information is ignored for the layering step. + * If the graph is flat, this setting is ignored. + *

+ *

+ * By default, this feature is enabled. + *

+ */ + recursiveGroupLayering:boolean; + /** + * The equidistant spacing between the horizontal and vertical grid lines. + *

+ * By default no grid is specified (spacing is <= 0). + *

+ *

+ * Note that the grid feature doesn't work together with exact (layer/sequence) coordinate hints + * (see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory}). + *

+ */ + gridSpacing:number; + /** + * Specifies whether or not ComponentLayouter is enabled. + * By default it is disabled. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#componentLayouterEnabled} + */ + componentLayouterEnabled:boolean; + /** + * Whether or not backloop routing should be applied. + * Note that port constraints and port candidates are still considered. + */ + backloopRouting:boolean; + /** + * Determines whether or not selfloops should be routed like backloops when backloop routing is enabled. + * That means, if there aren't any port constraints the selfloop will start at the bottom of the node and end at the + * top of it. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#backloopRouting} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#backloopRouting} + */ + backloopRoutingForSelfloops:boolean; + /** + * Whether or not automatic edge grouping should be applied. + * The automatic edge grouping tries to group a high number of edges without + * changing the semantic of the graph, i.e., it groups edges either at a common source node or a common target node. + * Edge groupings often allow more compact layouts since grouped edges are routed in a bus-style manner. + * Note: Edges are only grouped at their source (target) node if they do not have a port constraint/port candidates at this node. + * Furthermore, edges cannot be grouped at a node with specified port candidates (see class {@link yfiles.layout.PortCandidateSet}). + * User specified edge groups are not considered. + */ + automaticEdgeGrouping:boolean; + /** + * Specifies whether or not edges should be routed orthogonally. + * Specifies value true + * signals that all resulting edge paths will be composed of vertical and horizontal segments, only. + * Default is false. + * Note that this is a convenience method delegates to + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter#edgeLayoutDescriptor}.{@link yfiles.hierarchic.incremental.EdgeLayoutDescriptor#orthogonallyRouted}. + */ + orthogonalRouting:boolean; + /** + * Specifies whether integrated edge labeling is enabled. + * This method is a convenience method that checks if the + * {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter label layouter} + * is of type {@link yfiles.layout.LabelLayoutTranslator} and + * {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} returns + * true. + * The default is false. + * @throws {yfiles.system.InvalidOperationException} + * if the current label layouter is not of type + * {@link yfiles.layout.LabelLayoutTranslator}. + * @throws {yfiles.system.InvalidOperationException} + * if the current label layouter is not of type + * {@link yfiles.layout.LabelLayoutTranslator}. + */ + integratedEdgeLabeling:boolean; + /** + * Specifies whether or not node labels are taken into account when calculating + * node positions (thereby preventing possible node/node label or + * node label/node label overlaps). + * Setter:This method is a convenience method that assures that the + * {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter label layouter} + * is of type {@link yfiles.layout.LabelLayoutTranslator} and + * {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} is set + * to true. + * Note that setting this option may overwrite the currently set label layouter. Hence, to combine this option with + * a generic edge labeling algorithm, the generic labeling has to be applied in an additional step after calculating the layout. + * Getter:This method is a convenience method checks whether the + * {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter label layouter} + * is of type {@link yfiles.layout.LabelLayoutTranslator} and + * {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} returns + * true. + * The default is false. + * @throws {yfiles.system.InvalidOperationException} + * if the current label layouter is not of type + * {@link yfiles.layout.LabelLayoutTranslator}. + * @throws {yfiles.system.InvalidOperationException} + * if the current label layouter is not of type + * {@link yfiles.layout.LabelLayoutTranslator}. + */ + considerNodeLabels:boolean; + /** + * The minimum distance between two adjacent layers. + * The default is 20.0d. + */ + minimumLayerDistance:number; + /** + * The minimum distance between two adjacent nodes in one layer. + * Setter:See {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor#minimumDistance} for related settings. + * Getter:The default is 30.0d. + */ + nodeToNodeDistance:number; + /** + * The minimum distance between two adjacent nodes in one layer. + * Setter:See {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor#minimumDistance} and + * {@link yfiles.hierarchic.incremental.EdgeLayoutDescriptor#minimumDistance} for related settings. + * Getter:The default is 15.0d. + */ + nodeToEdgeDistance:number; + /** + * The minimum distance between two adjacent edges in one layer. + * See {@link yfiles.hierarchic.incremental.EdgeLayoutDescriptor#minimumDistance} for related settings. + */ + edgeToEdgeDistance:number; + /** + * The{@link yfiles.hierarchic.incremental.DefaultDrawingDistanceCalculator} that is registered + * with the layout algorithm by default. + * @throws {yfiles.system.InvalidOperationException} + * if the current instance returned + * by {@link yfiles.hierarchic.incremental.HierarchicLayouter#drawingDistanceCalculator} + * is not an instance of DefaultDrawingDistanceCalculator. + */ + defaultDrawingDistanceCalculator:yfiles.hierarchic.incremental.DefaultDrawingDistanceCalculator; + /** + * Factory method that creates the internally used {@link yfiles.hierarchic.incremental.HierarchicLayouter} + * instance. + * @return {yfiles.hierarchic.incremental.HierarchicLayouter} new y.layout.hierarchic.incremental.HierarchicLayouter() + */ + createHierarchicLayouter():yfiles.hierarchic.incremental.HierarchicLayouter; + /** + * The internally used + * {@link yfiles.hierarchic.incremental.HierarchicLayouter} instance. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#createHierarchicLayouter} + */ + hierarchicLayouter:yfiles.hierarchic.incremental.HierarchicLayouter; + /** + * The currently set layering strategy for the + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter#fromScratchLayerer from scratch} layering. + * The layouter assigns the nodes to separate layers. The nodes within each layer will be + * placed on the same horizontal layer. + * The layers will be arranged vertically starting with the small-numbered layers. + * The rank of a node is the number of the layer it belongs to. + * An important layering strategy for the hierarchic layout style is called Hierarchical Layering. + * A hierarchical layering tries to assign nodes to layers in a way that as much as possible + * edges of the graph will point to the main layout direction, i.e. the start nodes of the edges will + * have a smaller rank than the corresponding end nodes. Also, a hierarchical layering + * will never put two connected nodes in the same layer. + * By default the layering strategy {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_OPTIMAL} is set. + * This method wraps the internal implementations into a {@link yfiles.hierarchic.incremental.MultiComponentLayerer} + * instance so that it is possible to specify the behavior of the algorithm if the + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter#componentLayouterEnabled component layouter} is disabled. + */ + fromScratchLayeringStrategy:yfiles.hierarchic.LayeringStrategy; + /** + * Determines whether this layouter can perform the core layout on the given + * graph. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Performs the actual layout using the currently set mode. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#configureCoreLayout} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#unconfigureCoreLayout} + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(g:yfiles.layout.LayoutGraph):void; + /** + * The{@link yfiles.layout.CanonicMultiStageLayouter#orientationLayouter orientation layouter}'s mirror mask. + */ + mirrorMask:number; + /** + * Called before the actual layout is performed. + * Overwrite this to manually reconfigure the instance. + * If {@link yfiles.layout.PortCandidateSet#NODE_DP_KEY} is registered with the layout graph and + * there is no {@link yfiles.hierarchic.incremental.HierarchicLayouter#portConstraintOptimizer} + * registered, {@link yfiles.hierarchic.incremental.PCListOptimizer} will be temporarily configured with the instance. + * @param {yfiles.layout.LayoutGraph} graph the graph to be laid out + * @param {yfiles.hierarchic.incremental.HierarchicLayouter} ihl the instance used for the core layout. + */ + configureCoreLayout(graph:yfiles.layout.LayoutGraph,ihl:yfiles.hierarchic.incremental.HierarchicLayouter):void; + /** + * Called after the actual layout is performed. + * Overwrite this to manually unconfigure the instance. + * If {@link yfiles.layout.PortCandidateSet#NODE_DP_KEY} is registered with the layout graph and + * {@link yfiles.hierarchic.incremental.PCListOptimizer} was registered with the instance during + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter#configureCoreLayout} + * it will be removed by this method. + * @param {yfiles.layout.LayoutGraph} graph the graph to be laid out + * @param {yfiles.hierarchic.incremental.HierarchicLayouter} ihl the instance used for the core layout. + */ + unconfigureCoreLayout(graph:yfiles.layout.LayoutGraph,ihl:yfiles.hierarchic.incremental.HierarchicLayouter):void; + /** + * Returns a {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory} instance that must be used + * to obtain marks that can be associated with elements in the graph that + * will be laid out incrementally. + * Use this factory and a {@link yfiles.algorithms.IDataProvider} that is bound to the graph + * using the {@link yfiles.hierarchic.IncrementalHierarchicLayouter#INCREMENTAL_HINTS_DP_KEY} DataProvider key to associate + * appropriate hints with the elements in the graph that should be laid out + * incrementally by the algorithm. + * @return {yfiles.hierarchic.incremental.IIncrementalHintsFactory} the factory + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createIncrementalHintsFactory} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#INCREMENTAL_HINTS_DP_KEY} + * @see {@link yfiles.algorithms.Graph#addDataProvider} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + * @see {@link yfiles.hierarchic.LayoutMode#INCREMENTAL} + */ + createIncrementalHintsFactory():yfiles.hierarchic.incremental.IIncrementalHintsFactory; + /** + * Returns a {@link yfiles.hierarchic.incremental.ISequenceConstraintFactory} + * instance that can be used to specify sequence constraints for the given + * graph. + * For these sequence constraints to have any effect, the + * {@link yfiles.hierarchic.incremental.ISequencer} used to determine the + * in-layer node order (sequence) has to support constraints. Both, + * {@link yfiles.hierarchic.incremental.DefaultLayerSequencer DefaultLayerSequencer} + * and the incremental sequencer used internally support sequence constraints. + *

+ * Note: + * SequenceConstraintFactory instances have to be + * {@link yfiles.hierarchic.incremental.ISequenceConstraintFactory#dispose disposed} + * after use. Disposing the factory will also remove all constraints + * previously specified for the factory's associated graph. + * Creating sequence constraints with a disposed factory will throw an IllegalStateException. + *

+ *

+ * Creating a new constraint factory for a graph will render all previously + * created factories (including any constraints specified) for that graph + * useless. Therefore a new constraint factory should only be created after + * previously used factories have been properly disposed. + *

+ * @param {yfiles.layout.LayoutGraph} graph + * @return {yfiles.hierarchic.incremental.ISequenceConstraintFactory} A SequenceConstraintFactory instance for use with the given graph. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#fromScratchSequencer} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#fixedElementsSequencer} + */ + createSequenceConstraintFactoryForLayoutGraph(graph:yfiles.layout.LayoutGraph):yfiles.hierarchic.incremental.ISequenceConstraintFactory; + /** + * Returns a {@link yfiles.hierarchic.incremental.ILayerConstraintFactory} + * instance that can be used to specify layer constraints for the given + * graph. + *

+ * Note: + * LayerConstraintFactory instances have to be + * {@link yfiles.hierarchic.incremental.ILayerConstraintFactory#dispose disposed} + * after use. Disposing the factory will also remove all constraints + * previously specified for the factory's associated graph. + * Creating layering constraints with a disposed factory will throw an IllegalStateException. + *

+ *

+ * Creating a new constraint factory for a graph will render all previously + * created factories (including any constraints specified) for that graph + * useless. Therefore a new constraint factory should only be created after + * previously used factories have been properly disposed. + *

+ * @param {yfiles.algorithms.Graph} graph the given graph. + * @return {yfiles.hierarchic.incremental.ILayerConstraintFactory} A LayerConstraintFactory instance for use with the given graph. + */ + createLayerConstraintFactory(graph:yfiles.algorithms.Graph):yfiles.hierarchic.incremental.ILayerConstraintFactory; + /** + * The{@link yfiles.hierarchic.incremental.ILayerer} instance that is used to obtain the layering + * for the nodes if the layouter is set to {@link yfiles.hierarchic.LayoutMode#FROM_SCRATCH}. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + * @throws {yfiles.system.ArgumentNullException} if the argument is null + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + */ + fromScratchLayerer:yfiles.hierarchic.incremental.ILayerer; + /** + * The{@link yfiles.hierarchic.incremental.ISequencer} instance that is used to calculate the node + * sequence if the layouter is set to {@link yfiles.hierarchic.LayoutMode#FROM_SCRATCH}. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + * @throws {yfiles.system.ArgumentNullException} if the argument is null + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#fromScratchLayerer} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + */ + fromScratchSequencer:yfiles.hierarchic.incremental.ISequencer; + /** + * The{@link yfiles.hierarchic.incremental.INodePlacer} instance that will be used to calculated the + * final node placement of the layout. + * @throws {yfiles.system.ArgumentNullException} if the argument is null + */ + nodePlacer:yfiles.hierarchic.incremental.INodePlacer; + /** + * The{@link yfiles.hierarchic.incremental.ILayerer} instance that is used to obtain the layering + * for those nodes that are not marked to be laid out incrementally + * if the layouter is set to {@link yfiles.hierarchic.LayoutMode#INCREMENTAL}. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + * @throws {yfiles.system.ArgumentNullException} if the argument is null + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + */ + fixedElementsLayerer:yfiles.hierarchic.incremental.ILayerer; + /** + * The{@link yfiles.hierarchic.incremental.ISequencer} instance that is used to calculated the sequence + * of the nodes that are not marked to be laid out incrementally + * if the layouter is set to {@link yfiles.hierarchic.LayoutMode#INCREMENTAL}. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + * @throws {yfiles.system.ArgumentNullException} if the argument is null + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + */ + fixedElementsSequencer:yfiles.hierarchic.incremental.ISequencer; + /** + * The layout mode this layouter is currently in. + * Depending on the mode the layout algorithm will use different + * {@link yfiles.hierarchic.incremental.ILayerer} and {@link yfiles.hierarchic.incremental.ISequencer} implementations. + * Currently supported modes are: + *
    + *
  • {@link yfiles.hierarchic.LayoutMode#INCREMENTAL}
  • + *
  • {@link yfiles.hierarchic.LayoutMode#FROM_SCRATCH}
  • + *
+ * Defaults to {@link yfiles.hierarchic.LayoutMode#FROM_SCRATCH}. + * @throws {yfiles.system.ArgumentException} if the mode is unknown + */ + layoutMode:yfiles.hierarchic.LayoutMode; + /** + * Factory method that creates the default EdgeLayoutDescriptor. + * @return {yfiles.hierarchic.incremental.EdgeLayoutDescriptor} a new EdgeLayoutDescriptor (new EdgeLayoutDescriptor()) + */ + createEdgeLayoutDescriptor():yfiles.hierarchic.incremental.EdgeLayoutDescriptor; + /** + * The EdgeLayoutDescriptor instance used for all those + * edges, that do not have a specific layout descriptor assigned. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#createEdgeLayoutDescriptor} + * @throws {yfiles.system.ArgumentNullException} if the argument is null + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + */ + edgeLayoutDescriptor:yfiles.hierarchic.incremental.EdgeLayoutDescriptor; + /** + * Factory method that creates the default NodeLayoutDescriptor. + * @return {yfiles.hierarchic.incremental.NodeLayoutDescriptor} a new NodeLayoutDescriptor (new NodeLayoutDescriptor()) + */ + createNodeLayoutDescriptor():yfiles.hierarchic.incremental.NodeLayoutDescriptor; + /** + * The NodeLayoutDescriptor instance used for all those + * nodes, that do not have a specific layout descriptor assigned. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#NODE_LAYOUT_DESCRIPTOR_DP_KEY} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#createNodeLayoutDescriptor} + * @throws {yfiles.system.ArgumentNullException} if the argument is null + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#NODE_LAYOUT_DESCRIPTOR_DP_KEY} + */ + nodeLayoutDescriptor:yfiles.hierarchic.incremental.NodeLayoutDescriptor; + } + var IncrementalHierarchicLayouter:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key used to store the priority (integer values) for "critical" edges. + * The layouter tries to vertically align each node pair that is connected by a critical edge (integer value > 0). + * This feature can for example be utilized to highlight different edge paths that are relevant for a user. Conflicts + * between different critical edges are always resolved in favor of the higher priority. + *

+ * Note: "critical" edges of aligned nodes are always placed at the center port. + * Hence, the edge distribution is no longer uniform. + *

+ *

+ * Note: "critical" edges do no affect the result of the crossing minimization + * ({@link yfiles.hierarchic.incremental.ISequencer}) phase. Hence, there may be crossings between two "critical" edges. + *

+ */ + CRITICAL_EDGE_DP_KEY:Object; + /** + * {@link yfiles.algorithms.IDataProvider} key used to store incremental layout hints + * that can be retrieved from the {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory} + * which itself can be obtained from the + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter#createIncrementalHintsFactory} method. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#INCREMENTAL_HINTS_DP_KEY} + */ + INCREMENTAL_HINTS_DP_KEY:Object; + /** + * Used for publishing the final layering information. + * If the {@link yfiles.algorithms.IDataProvider} associated to this key is also a + * {@link yfiles.algorithms.IDataAcceptor}, the integer layer id of each node is stored + * using the acceptor's {@link yfiles.algorithms.IDataAcceptor#setInt setInt} + * method. + * Otherwise, the provider's values should be of type + * {@link yfiles.hierarchic.incremental.IIntValueHolder} and the value holder's + * {@link yfiles.hierarchic.incremental.IIntValueHolder#value setValue} + * method is used to store the integer layer ids of each node. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#LAYER_VALUE_HOLDER_DP_KEY} + */ + LAYER_VALUE_HOLDER_DP_KEY:Object; + /** + * Used for publishing the final sequencing information. + * If the {@link yfiles.algorithms.IDataProvider} associated to this key is also a + * {@link yfiles.algorithms.IDataAcceptor}, the sequence order number of each node is + * stored using the acceptor's + * {@link yfiles.algorithms.IDataAcceptor#setInt setInt} method. + * Otherwise, the provider's values should be of type + * {@link yfiles.hierarchic.incremental.IIntValueHolder} and the value holder's + * {@link yfiles.hierarchic.incremental.IIntValueHolder#value setValue} + * method is used to store the sequence order number of each node. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#SEQUENCE_VALUE_HOLDER_DP_KEY} + */ + SEQUENCE_VALUE_HOLDER_DP_KEY:Object; + /** + * {@link yfiles.algorithms.IDataProvider} key used to store {@link yfiles.hierarchic.incremental.SwimLaneDescriptor} + * instances for each node in the graph. + * If this key is present during the layout. + * The layout algorithm will arrange nodes in swim lanes. The information about the + * swim lanes is finally written back into the descriptor instances. + * Instances can be shared among multiple nodes in the same lane, but don't have to be shared. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#SWIMLANE_DESCRIPTOR_DP_KEY} + */ + SWIMLANE_DESCRIPTOR_DP_KEY:Object; + /** + * Creates a new IncrementalHierarchicLayouter instance which is + * set to {@link yfiles.hierarchic.LayoutMode#FROM_SCRATCH} initially. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + */ + new ():yfiles.hierarchic.IncrementalHierarchicLayouter; + /** + * {@link yfiles.algorithms.IDataProvider} key to store the constraint graph for sequence constraints. + * DataProvider key to store the constraint graph. + * A v1 before v2 constraint is represented as an edge + * between the representatives of v1 and v2 + * in the constraint graph. + */ + SEQUENCE_CONSTRAINTS_MEMENTO_DP_KEY:Object; + }; + /** + * Abstract base class for the third phase of the Sugiyama algorithm. + * It assigns the coordinates to the nodes according to the defined + * ranks. + * It provides methods to assign the Y-Coordinates to the nodes. + */ + export interface AbstractDrawer extends Object,yfiles.hierarchic.IDrawer{ + /** + * The minimal distance between two nodes in the same layer. + */ + minimalNodeDistanceF:number; + /** + * The minimal distance between two layers. + */ + minimalLayerDistanceF:number; + /** + * The minimal distance between two edges in the same layer. + */ + minimalEdgeDistanceF:number; + /** + * The minimal distance between two edges sharing source/target in the same layer. + */ + minimalMultiEdgeDistanceF:number; + /** + * See {@link yfiles.hierarchic.AbstractDrawer#dummyMap}. + */ + dummyMapF:yfiles.algorithms.INodeMap; + /** + * The key to the data provider, which stores the length of the edges. + */ + edgeLengthKeyF:Object; + /** + * The graph bound to this drawer instance. + */ + graphF:yfiles.layout.LayoutGraph; + /** + * Stores the minimal distance between the right border of a node and + * the left border of its right hand side neighbor in a layer. + */ + distanceToNextNodeF:yfiles.algorithms.INodeMap; + /** + * The minimal distance between two edges in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalEdgeDistance}. + */ + minimalEdgeDistance:number; + /** + * The minimal distance between two edges sharing source/target in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalMultiEdgeDistance}. + */ + minimalMultiEdgeDistance:number; + /** + * The minimal distance between two nodes in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalNodeDistance}. + */ + minimalNodeDistance:number; + /** + * The minimal distance between two layers. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalLayerDistance}. + */ + minimalLayerDistance:number; + /** + * Gives the drawer the opportunity to distinguish between dummy nodes + * and real ones. + * dummy stores the original edge for each dummy node or + * null for real nodes. + * @see Specified by {@link yfiles.hierarchic.IDrawer#dummyMap}. + */ + dummyMap:yfiles.algorithms.INodeMap; + /** + * The key to the data provider, which stores the length of the edges. + * Remark: Edges, which are split in the first phase do no longer supply + * lengths. This should not be to critical as they span at least + * two layers and are so hopefully long enough. + */ + edgeLengthKey:Object; + /** + * Assign the y coordinates to the nodes respecting the minimal + * layer distance. + */ + assignYCoordsWithNodeList(graph:yfiles.layout.LayoutGraph,layerLists:yfiles.algorithms.NodeList[]):void; + /** + * Assign the y coordinates to the nodes respecting the minimal + * layer distance. + */ + assignYCoords(graph:yfiles.layout.LayoutGraph,layers:yfiles.algorithms.INodeCursor[]):void; + /** + * Binds the specified graph to this drawer and + * calls the abstract method + * {@link yfiles.hierarchic.AbstractDrawer#assignCoordinatesToNodes}. + * @see Specified by {@link yfiles.hierarchic.IDrawer#assignCoordinates}. + */ + assignCoordinates(g:yfiles.layout.LayoutGraph,layerLists:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.IDataProvider):void; + /** + * Overwrite this method to assign the final coordinates to the + * objects of he graph. + */ + assignCoordinatesToNodes(layerLists:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.IDataProvider):void; + /** + * Returns the border obeying left x-coordinate of the given node. + */ + getLeftX(v:yfiles.algorithms.Node):number; + /** + * Returns the border obeying right x-coordinate of the given node. + */ + getRightX(v:yfiles.algorithms.Node):number; + /** + * Returns the border obeying top y-coordinate of the given node. + */ + getTopY(v:yfiles.algorithms.Node):number; + /** + * Returns the border obeying bottom y-coordinate of the given node. + */ + getBottomY(v:yfiles.algorithms.Node):number; + /** + * Returns the border obeying full width of the given node. + */ + getFullWidth(v:yfiles.algorithms.Node):number; + /** + * Returns the border obeying full height of the given node. + */ + getFullHeight(v:yfiles.algorithms.Node):number; + /** + * Returns the width of the left border of the given node. + */ + getLeftBorder(v:yfiles.algorithms.Node):number; + /** + * Returns the width of the right border of the given node. + */ + getRightBorder(v:yfiles.algorithms.Node):number; + /** + * Returns the height of the top border of the given node. + */ + getTopBorder(v:yfiles.algorithms.Node):number; + /** + * Returns the height of the bottom border of the given node. + */ + getBottomBorder(v:yfiles.algorithms.Node):number; + /** + * Returns the width of the border-obeying left half of the node,. + */ + getLeftHalf(v:yfiles.algorithms.Node):number; + /** + * Returns the width of the border-obeying right half of the node,. + */ + getRightHalf(v:yfiles.algorithms.Node):number; + /** + * Returns the height of the border-obeying top half of the node,. + */ + getTopHalf(v:yfiles.algorithms.Node):number; + /** + * Returns the height of the border-obeying bottom half of the node,. + */ + getBottomHalf(v:yfiles.algorithms.Node):number; + /** + * Initializes the minimal distances between the right border of a node + * and the left border of its right hand side neighbor in a layer. + * @see {@link yfiles.hierarchic.AbstractDrawer#getDistanceToNextNode} + * @see {@link yfiles.hierarchic.AbstractDrawer#distanceToNextNodeF} + */ + initializeDistancesToNextNode(layerLists:yfiles.algorithms.NodeList[]):void; + /** + * Returns the minimal distance between the right border of the given node and + * the left border of its right hand side neighbor in the layer. + * Node minimal node distances are constructed by using + * the values provided by the data providers that are registered + * with the input graph + * under the keys {@link yfiles.hierarchic.DrawerKeys#NODE_DISTANCE}, {@link yfiles.hierarchic.DrawerKeys#NODE_BORDER_LEFT} + * and {@link yfiles.hierarchic.DrawerKeys#NODE_BORDER_RIGHT}. + */ + getDistanceToNextNode(v:yfiles.algorithms.Node):number; + /** + * Frees allocated resources after the drawer is finished. + */ + dispose():void; + } + var AbstractDrawer:{ + $class:yfiles.lang.Class; + }; + /** + * This class can be used to simply wrap another Drawer implementation. + * It will rearrange nodes within each layer so that they are aligned with + * respect to a given alignment point, that is provided on a per node basis, + * which is provided by a registered + * DataProvider instance that may provide doubles that + * are interpreted as relative + * coordinates to the center of the node. + */ + export interface AlignmentDrawer extends Object,yfiles.hierarchic.IDrawer{ + /** + * Modifies the given drawing by modifying the y-coordinates only. + */ + alignNodes(graph:yfiles.layout.LayoutGraph,lists:yfiles.algorithms.NodeList[]):void; + /** + * This method assigns the coordinates to the nodes. + * @see Specified by {@link yfiles.hierarchic.IDrawer#assignCoordinates}. + */ + assignCoordinates(g:yfiles.layout.LayoutGraph,layerLists:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.IDataProvider):void; + /** + * Gives the drawer the opportunity to distinguish between dummy nodes + * and real ones. + * dummy stores the original edge for each dummy node or + * null for real nodes. + * @see Specified by {@link yfiles.hierarchic.IDrawer#dummyMap}. + */ + dummyMap:yfiles.algorithms.INodeMap; + /** + * The minimal distance between two edges in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalEdgeDistance}. + */ + minimalEdgeDistance:number; + /** + * The minimal distance between two layers. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalLayerDistance}. + */ + minimalLayerDistance:number; + /** + * The minimal distance between two edges sharing source/target (aka multi-edges) in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalMultiEdgeDistance}. + */ + minimalMultiEdgeDistance:number; + /** + * The minimal distance between two nodes in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalNodeDistance}. + */ + minimalNodeDistance:number; + } + export module AlignmentDrawer{ + /** + * Simple utility class that can be registered with the graph to be laid out. + * Instances of this class will make all nodes top-aligned (for top to bottom layouts). + */ + export interface TopAlignmentDataProvider extends yfiles.algorithms.DataProviderAdapter{ + /** + * 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; + } + /** + * Simple utility class that can be registered with the graph to be laid out. + * Instances of this class will make all nodes left-aligned (for left to right layouts). + */ + export interface LeftAlignmentDataProvider extends yfiles.algorithms.DataProviderAdapter{ + /** + * 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; + } + /** + * Simple utility class that can be registered with the graph to be laid out. + * Instances of this class will make all nodes right-aligned (for left to right layouts). + */ + export interface RightAlignmentDataProvider extends yfiles.algorithms.DataProviderAdapter{ + /** + * 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; + } + /** + * Simple utility class that can be registered with the graph to be laid out. + * Instances of this class will make all nodes bottom-aligned (for top to bottom layouts). + */ + export interface BottomAlignmentDataProvider extends yfiles.algorithms.DataProviderAdapter{ + /** + * 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; + } + } + var AlignmentDrawer:{ + $class:yfiles.lang.Class; + /** + * The DataProvider key used for the DataProvider instance that provides for + * each node a double depicting the center anchored offset to the + * alignment point. + */ + NODE_ALIGNMENT_POINT_DP_KEY:Object; + /** + * Creates a new AlignmentDrawer using the given drawer as the actual drawer. + */ + new (inner:yfiles.hierarchic.IDrawer):yfiles.hierarchic.AlignmentDrawer; + TopAlignmentDataProvider:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.AlignmentDrawer; + }; + LeftAlignmentDataProvider:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.AlignmentDrawer; + }; + RightAlignmentDataProvider:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.AlignmentDrawer; + }; + BottomAlignmentDataProvider:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.AlignmentDrawer; + }; + }; + /** + * This layerer implementation assigns layers by analyzing already existing + * node coordinates. + * Nodes whose bounding boxes intersect a common y-coordinate + * are assigned to the same layer. + */ + export interface AsIsLayerer extends Object,yfiles.hierarchic.ILayerer,yfiles.hierarchic.incremental.ILayerer{ + /** + * The scaling factor that is used to scale the nodes' height. + * Nodes are being scaled from their center. + * This can be used for more fuzzy layering. + * The default is 1.0d which results in no scaling. + * @throws {yfiles.system.ArgumentException} + * if the specified value is less than + * 0. + */ + nodeScalingFactor:number; + /** + * The maximum size of a node that is used to calculate layer overlaps. + * This can be used for more fuzzy layering. + * The default is Double.MAX_VALUE which results in no + * restriction being set. + * @see {@link yfiles.hierarchic.AsIsLayerer#nodeScalingFactor} + * @see {@link yfiles.hierarchic.AsIsLayerer#nodeHalo} + * @see {@link yfiles.hierarchic.AsIsLayerer#nodeScalingFactor} + * @see {@link yfiles.hierarchic.AsIsLayerer#nodeHalo} + * @throws {yfiles.system.ArgumentException} + * if the specified value is less than + * 0. + */ + maximumNodeSize:number; + /** + * The minimum size of a node that is used to calculate layer overlaps. + * This can be used for more fuzzy layering. + * The default is 0.0d which results in no + * restriction being set. + * @see {@link yfiles.hierarchic.AsIsLayerer#nodeScalingFactor} + * @see {@link yfiles.hierarchic.AsIsLayerer#nodeHalo} + * @see {@link yfiles.hierarchic.AsIsLayerer#nodeScalingFactor} + * @see {@link yfiles.hierarchic.AsIsLayerer#nodeHalo} + * @throws {yfiles.system.ArgumentException} + * if the specified value is less than + * 0. + */ + minimumNodeSize:number; + /** + * The size of the halo around a node or the insets respectively that are + * used to calculate layer overlaps. + * Setter:This can be used for more fuzzy layering. + * Getter:The default is 0.0d which results in no modification + */ + nodeHalo:number; + /** + * This method assigns the nodes in the graph to layers. + * @param {yfiles.layout.LayoutGraph} g the graph for which the layers are determined. + * @param {yfiles.algorithms.INodeMap} layer here the layers are stored + * @param {yfiles.algorithms.EdgeList} reversedEdges here the edges are stored which had been reversed. + * @return {number} the number of layers + * @see Specified by {@link yfiles.hierarchic.ILayerer#assignNodeLayer}. + */ + assignNodeLayer(g:yfiles.layout.LayoutGraph,layerMap:yfiles.algorithms.INodeMap,reversedEdges:yfiles.algorithms.EdgeList):number; + /** + * Callback used to calculate the upper (min) value of a node. + */ + getMin(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):number; + /** + * Callback used to calculate the lower (max) value of a node. + */ + getMax(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):number; + /** + * This method assigns all nodes in the graph to layers and registers them + * in the {@link yfiles.hierarchic.incremental.ILayers} instance. + * In order to create new layers, the factory + * method {@link yfiles.hierarchic.incremental.ILayers#insert} must be used. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains the nodes that should be distributed + * into the layers + * @param {yfiles.hierarchic.incremental.ILayers} layers + * the object that will be filled with the results of the + * calculation + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * LayoutDataProvider that can be used to query information about + * the nodes - note that positional information + * (see {@link yfiles.hierarchic.incremental.INodeData#position} and {@link yfiles.hierarchic.incremental.INodeData#layer}) cannot + * be available at any time. + * @see {@link yfiles.hierarchic.incremental.ILayers#insert} + * @see {@link yfiles.hierarchic.incremental.ILayer#add} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerer#assignLayers}. + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + } + var AsIsLayerer:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.AsIsLayerer; + }; + /** + * This class can be used to improve the results of different drawers. + * It is designed as a wrapper to another drawer (especially SimplexDrawer). + * It will insert additional dummy nodes for each node that has an even number of + * incoming edges or outgoing edges. Dummy nodes will be inserted in the neighbor + * layer at the center of the other edges' opposite nodes. + */ + export interface MedianDrawerWrapper extends Object,yfiles.hierarchic.IDrawer{ + /** + * the delegate. + */ + drawerDelegate:yfiles.hierarchic.IDrawer; + /** + * the dummyMap. + */ + dummy:yfiles.algorithms.INodeMap; + /** + * This method assigns the coordinates to the nodes. + * @see Specified by {@link yfiles.hierarchic.IDrawer#assignCoordinates}. + */ + assignCoordinates(g:yfiles.layout.LayoutGraph,layerLists:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.IDataProvider):void; + /** + * Gives the drawer the opportunity to distinguish between dummy nodes + * and real ones. + * dummy stores the original edge for each dummy node or + * null for real nodes. + * @see Specified by {@link yfiles.hierarchic.IDrawer#dummyMap}. + */ + dummyMap:yfiles.algorithms.INodeMap; + /** + * The minimal distance between two edges in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalEdgeDistance}. + */ + minimalEdgeDistance:number; + /** + * The minimal distance between two layers. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalLayerDistance}. + */ + minimalLayerDistance:number; + /** + * The minimal distance between two edges sharing source/target (aka multi-edges) in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalMultiEdgeDistance}. + */ + minimalMultiEdgeDistance:number; + /** + * The minimal distance between two nodes in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalNodeDistance}. + */ + minimalNodeDistance:number; + /** + * Called as a hook before the actual drawing is performed by the delegate. + */ + preprocess(g:yfiles.layout.LayoutGraph,layerLists:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.INodeMap):void; + /** + * Called as a hook after the actual drawing is performed by the delegate. + */ + postprocess(g:yfiles.layout.LayoutGraph,layerLists:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.INodeMap):void; + /** + * The drawer to which the actual drawing will be delegated. + */ + delegate:yfiles.hierarchic.IDrawer; + } + var MedianDrawerWrapper:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of MedianDrawerWrapper using the delegate to + * perform the core work. + */ + new (drawerDelegate:yfiles.hierarchic.IDrawer):yfiles.hierarchic.MedianDrawerWrapper; + }; + /** + * This class implements the third phase of the hierarchic layout algorithm. + * Edges are represented as polylines with at most two bends. + * The algorithm has linear running time and is based on the article [BK01]: + * U. Brandes and B. Koepf, Fast and Simple Horizontal Coordinate Assignment, + * Proceedings of 9th Symposium of Graph Drawing, LNCS, 2001. + */ + export interface MedianLinearSegmentDrawer extends yfiles.hierarchic.AbstractDrawer{ + /** + * Performs coordinate assignment. + * @see Overrides {@link yfiles.hierarchic.AbstractDrawer#assignCoordinatesToNodes} + */ + assignCoordinatesToNodes(layerLists:yfiles.algorithms.NodeList[],_layerID:yfiles.algorithms.IDataProvider):void; + /** + * Initializes data structures for all runs. + */ + init(g:yfiles.algorithms.Graph,layerLists:yfiles.algorithms.NodeList[]):void; + /** + * Initializes data structures for one basic step. + * @param {number[]} x the array where the coordinates will be stored. + */ + reinit(g:yfiles.algorithms.Graph,x:number[]):void; + /** + * Calculates vertical alignment. + * This method corresponds to Algorithm 2 in [BK01]. + * @param {yfiles.layout.LayoutGraph} g the graph for which the layout is calculated. + * @param {yfiles.algorithms.NodeList[]} layerLists the list of layers. + */ + verticalAlignment(g:yfiles.layout.LayoutGraph,layerLists:yfiles.algorithms.NodeList[]):void; + /** + * Calculate coordinates. + * This method corresponds to Algorithm 3 in [BK01]. + * @param {yfiles.layout.LayoutGraph} g the graph for which the layout is calculated. + * @param {number[]} x the array where the result is stored. + */ + horizontalCompaction(g:yfiles.layout.LayoutGraph,x:number[],layerLists:yfiles.algorithms.NodeList[]):void; + /** + * Writes the calculated x values in the layout graph. + */ + propagateCoordinates(g:yfiles.layout.LayoutGraph):void; + /** + * Frees held resources. + * @see Overrides {@link yfiles.hierarchic.AbstractDrawer#dispose} + */ + dispose():void; + } + var MedianLinearSegmentDrawer:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.MedianLinearSegmentDrawer; + /** + * Mark type 1 conflicts. + * This method corresponds to Algorithm 1 in [BK01]. + * @param {yfiles.algorithms.NodeList[]} layerLists the list of layers. + * @param {yfiles.algorithms.IEdgeMap} conflictMark used to mark the conflicting edges. + * @param {yfiles.algorithms.INodeMap} dummyMap + * map which returns true for bends, + * false otherwise. + * @param {number[]} pos + * is indexed by the index method of node and returns the rank of + * a node inside the layer which contains the node. + */ + markConflicts(layerLists:yfiles.algorithms.NodeList[],conflictMark:yfiles.algorithms.IEdgeMap,dummyMap:yfiles.algorithms.INodeMap,pos:number[]):void; + }; + /** + * This class implements the third phase of the Sugiyama layout algorithm. + * Edges are represented as poly-lines with at most two bends. + */ + export interface LinearSegmentsDrawer extends yfiles.hierarchic.AbstractDrawer{ + /** + * Overwrite this method to assign the final coordinates to the + * objects of he graph. + */ + assignCoordinatesToNodes(layers:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.IDataProvider):void; + } + var LinearSegmentsDrawer:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.LinearSegmentsDrawer; + }; + /** + * Still experimental. + * @deprecated For internal use only. Might be changed or removed in the future. + */ + export interface LeanLayersLayerer extends Object,yfiles.hierarchic.ILayerer,yfiles.hierarchic.incremental.ILayerer{ + useEnhancedDistribution:boolean; + preferredLayerWidth:number; + startFromSketch:boolean; + /** + * This method assigns the nodes in the graph to layers. + * @param {yfiles.layout.LayoutGraph} g the graph for which the layers are determined. + * @param {yfiles.algorithms.INodeMap} layer here the layers are stored + * @param {yfiles.algorithms.EdgeList} reversedEdges here the edges are stored which had been reversed. + * @return {number} the number of layers + * @see Specified by {@link yfiles.hierarchic.ILayerer#assignNodeLayer}. + */ + assignNodeLayer(g:yfiles.layout.LayoutGraph,layer:yfiles.algorithms.INodeMap,reversedEdges:yfiles.algorithms.EdgeList):number; + assignNodeLayerForGivenLayers(graph:yfiles.layout.LayoutGraph,layerMap:yfiles.algorithms.INodeMap,reversedEdges:yfiles.algorithms.EdgeList,useGivenLayers:boolean):number; + /** + * This method assigns all nodes in the graph to layers and registers them + * in the {@link yfiles.hierarchic.incremental.ILayers} instance. + * In order to create new layers, the factory + * method {@link yfiles.hierarchic.incremental.ILayers#insert} must be used. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains the nodes that should be distributed + * into the layers + * @param {yfiles.hierarchic.incremental.ILayers} layers + * the object that will be filled with the results of the + * calculation + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * LayoutDataProvider that can be used to query information about + * the nodes - note that positional information + * (see {@link yfiles.hierarchic.incremental.INodeData#position} and {@link yfiles.hierarchic.incremental.INodeData#layer}) cannot + * be available at any time. + * @see {@link yfiles.hierarchic.incremental.ILayers#insert} + * @see {@link yfiles.hierarchic.incremental.ILayer#add} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerer#assignLayers}. + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + } + var LeanLayersLayerer:{ + $class:yfiles.lang.Class; + }; + /** + * This class implements the third phase of the Sugiyama layout algorithm + * as described in "Visualisierungstechniken fuer den Compilerbau" (Georg Sander) + * mixed with techniques as described in "A technique for drawing directed graphs" + * (Gansner et al). + */ + export interface PendularDrawer extends yfiles.hierarchic.AbstractDrawer{ + /** + * map that maps the right node for each node in a layer or null if it is the rightmost. + */ + right:yfiles.algorithms.INodeMap; + /** + * map that maps the left node for each node in a layer or null if it is the leftmost. + */ + left:yfiles.algorithms.INodeMap; + /** + * used to initialize internal structures such as NodeMap right and + * NodeMap left bendGridWidth and nodeGridWidth. + * Note that the NodeMaps do not yet contain any values unless you call initializePositions() + */ + initStructures():void; + /** + * This is the main loop of this layout algorithm. + * For now it does the following loop: + *
    + *
  • for each round do + *
      + *
    • top down phase, i.e. calling partitionLayer(layerList[i] , -1) + * and shakePartition(partition,-1) for each layer in top down order
    • + *
    • bottom up phase, i.e. calling partitionLayer(layerList[i] , -1) + * and shakePartition(partition,-1) for each layer in bottom up order
    • + *
    • criss cross phase, i.e. calling partitionLayer(layerList[i] , 0) + * and shakePartition(partition,0) for each layer in top down order
    • + *
    • performing minNode
    • + *
  • + *
  • minPath phase, i.e. calling findChains() and minPath(chains)
  • + *
+ * Subclasses that wish to override this function to implement different behaviour should + * implement a call to initStructures() and + * initializePositions(layerLists) before using the provided methods. + * After the work is done, they should call disposeStructures(g). + * @param {yfiles.algorithms.NodeList[]} layerLists + * a list of all the nodes for each layer, to determine + * their relative positions + * @see Overrides {@link yfiles.hierarchic.AbstractDrawer#assignCoordinatesToNodes} + */ + assignCoordinatesToNodes(layerLists:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.IDataProvider):void; + /** + * Cleans up previously allocated structures, that were constructed by a call to + * initStructures. + * @see {@link yfiles.hierarchic.PendularDrawer#initStructures} + */ + disposeStructures():void; + /** + * Performs the minPath phase. + * It tries to straighten the chains given by a list of NodeLists, by sequentially assigning the same + * x- coordinate to as many adjacent nodes of each chain as possible, not violating the constraints and + * not changing coordinates of nodes in the neighborhood of each segment + * @see {@link yfiles.hierarchic.PendularDrawer#findChains} + * @param {yfiles.algorithms.YList} segments a list of NodeList each containing a chain of nodes + * @return {boolean} true iff there was a change in any coordinate of the graph + */ + minPath(segments:yfiles.algorithms.YList):boolean; + /** + * Finds chains of nodes, i.e. + * maximum number of adjacent nodes (real ones and dummy nodes) have + * indegree and outdegree 1. + * @see {@link yfiles.hierarchic.PendularDrawer#minPath} + * @return {yfiles.algorithms.YList} a list of NodeLists containing each more than 1 nodes + */ + findChains():yfiles.algorithms.YList; + /** + * Helper method for use in minPath. + * It will assign the same x-coordinate to all the nodes + * given the first and the last cell in NodeList. + * Note that this method does not double-check whether the given + * range is valid for all nodes. + * @param {yfiles.algorithms.ListCell} firstCell + * this determines the first Node in a NodeList + * which should be assigned a new x-coordinate + * @param {yfiles.algorithms.ListCell} lastCell + * this determines the last Node in a NodeList + * (which must be same List as the one for firstCell) which should + * be assigned a new x-coordinate + * @param {number[]} range + * an interval providing information of the legal range, + * the Nodes x-coordinates could be set to. + * The values can can be smaller than (-Double.MAX_VALUE) for the left + * border and greater than Double.MAX_VALUE for the right one + * @see {@link yfiles.hierarchic.PendularDrawer#minPath} + * @return {boolean} + * true iff this method has done any change to the graphs + * coordinates + */ + straightenPath(firstCell:yfiles.algorithms.ListCell,lastCell:yfiles.algorithms.ListCell,range:number[]):boolean; + /** + * Helper method that determines whether a node is a so-called segment node. + * @param {yfiles.algorithms.Node} n the Node + * @return {boolean} + * true iff (inDegree == 1 && outDegree < 2) || + * (outDegree == 1 && inDegree < 2) + */ + isSegmentNode(n:yfiles.algorithms.Node):boolean; + /** + * Performs the minNode phase. + * It uses a queue, which is initially filled with all nodes in the + * layout graph. + * For each Node n that is popped off the queue it performs a call to + *
    + *
  • force = getPendulumForce(n, n.edges)
  • + *
  • force = verifyMovement(n,force)
  • + *
  • move(n, force)
  • + *
+ * If the node has changed its x-coordinate all its neighbors are requeued, + * if not already in the queue. + */ + minNode():void; + /** + * Shakes a given partition of a Layer, i.e. + * it calculates the forces for + * each part of the partition + * and applies them if possible. + * It uses the functionality of these methods: + *
    + *
  • getPendulumForce(NodeCursor, int direction)
  • + *
  • verifyMovement(Node, double force)
  • + *
  • move(NodeCursor, double force)
  • + *
+ * @see {@link yfiles.hierarchic.PendularDrawer#partitionLayer} + * @see {@link yfiles.hierarchic.PendularDrawer#getPendulumForce} + * @param {yfiles.algorithms.YList} partition + * a List of NodeLists each containing at least one node + * belonging to a single layer + * @param {number} direction + * -1 if nodes in higher layers should be used to calculate + * the forces, 1 if nodes in lower layers should be used, 0 if both + * surrounding layers should be used + */ + shakePartition(partition:yfiles.algorithms.YList,direction:number):void; + /** + * Partitions a layer given by its NodeList by calculating the forces + * according to the given direction. + * This one is intended for use with the shakePartition() method. + * @see {@link yfiles.hierarchic.PendularDrawer#getPendulumForce} + * @see {@link yfiles.hierarchic.PendularDrawer#touches} + * @see {@link yfiles.hierarchic.PendularDrawer#shakePartition} + * @param {yfiles.algorithms.NodeList} layer the layer which shall be partitioned + * @param {number} direction + * -1 if nodes in higher layers should be used to calculate + * the forces, 1 if nodes in lower layers + * should be used, 0 if both surrounding layers should be used + * @return {yfiles.algorithms.YList} + * a list of NodeLists each containing adjacent nodes in that layer, + * which can be treated as a single unit when moving + */ + partitionLayer(layer:yfiles.algorithms.NodeList,direction:number):yfiles.algorithms.YList; + layoutGraph:yfiles.layout.LayoutGraph; + /** + * Helper method which calculates the force that all nodes given by + * EdgeCursor apply to v. + * The force is calculated by the sum of the weighted differences of the + * x-coordinates. + * @see {@link yfiles.hierarchic.PendularDrawer#getEdgeWeight} + * @param {yfiles.algorithms.Node} v the node for which the force will be calculated + * @param {yfiles.algorithms.IEdgeCursor} ec + * the EdgeCursor which determines which edges should be + * considered in the calculation + * @return {number} + * a force, i.e. a signed value, which (if added to the x-coordinate + * of v) would minimize the force on v if applied. + */ + getPendulumForceForNode(v:yfiles.algorithms.Node,ec:yfiles.algorithms.IEdgeCursor):number; + /** + * Helper method which checks whether two adjacent nodes on a layer touch + * each other, i.e. + * their + * distance is smaller than getMinimalLayerDistance(v1, ...) + * @param {yfiles.algorithms.Node} v1 one node + * @param {yfiles.algorithms.Node} v2 another node + * @return {boolean} + * true iff their distance is smaller than + * getMinimalLayerDistance+EPSILON + * @see {@link yfiles.hierarchic.PendularDrawer#getMinimalLayerDistance} + */ + touches(v1:yfiles.algorithms.Node,v2:yfiles.algorithms.Node):boolean; + /** + * Assures that if distance was applied to the n's x-coordinate no given constraint gets broken. + * It makes extensive use of getMinimalLayerDistance(v1, ...) + * @param {yfiles.algorithms.Node} n the node to be moved + * @param {number} distance the distance which shall be verified + * @return {number} the distance which can be applied to n without breaking any constraint + * @see {@link yfiles.hierarchic.PendularDrawer#getMinimalLayerDistance} + */ + verifyMovement(n:yfiles.algorithms.Node,distance:number):number; + /** + * Helper method which calculates the force acting on all nodes given by the cursor. + * The force is calculated by the sum of the results of calls to getPendulumForce(Node, int) + * divided by the number of the nodes. + * @param {yfiles.algorithms.ICursor} cursor the nodes for which the force will be calculated + * @return {number} + * a force, i.e. a signed value, which, if applied to the nodes in cursor, would minimize + * the force acting on them. + * @param {number} direction + * -1 if nodes in higher layers should be used to calculate the forces, 1 if nodes + * in lower layers should be used, 0 if both surrounding layers should be used + */ + getPendulumForce(cursor:yfiles.algorithms.ICursor,direction:number):number; + /** + * Helper method which moves a given node by a given amount + * if the useGrid is set to true, this method will snap the new node position to the + * appropriate grid, i.e. + * it decides whether to use nodeGridWith or bendGridWith + * @param {yfiles.algorithms.Node} n the node + * @param {number} distance the distance that shall be added to the nodes x-coordinate + */ + moveNode(n:yfiles.algorithms.Node,distance:number):void; + /** + * Helper method which moves the nodes provided by the Cursor nodes by the given amount. + * This one in turn calls move(Node,double) to delegate its work. + * @see {@link yfiles.hierarchic.PendularDrawer#moveNode} + * @param {yfiles.algorithms.ICursor} nodes the nodes + * @param {number} distance the distance that shall be added to the nodes x-coordinate + */ + move(nodes:yfiles.algorithms.ICursor,distance:number):void; + /** + * Calculates the value of the function this algorithm should minimize. + * @return {number} a positive value. + */ + getZ():number; + /** + * Returns a non-negative value for each Edge e. + * In this implementation edges between two real nodes result in an edge weight of 1. + * Edges between one dummy and one real node result in an edge weight of + * segmentEndFactor * 1. + * Edges between two dummy nodes get an edge weight of segmentFactor * 1. + * One could implement edge weights by supplying an EdgeMap mapping a non-negative + * numeric value for each edge. + * @param {yfiles.algorithms.Edge} e the edge + * @return {number} a non-negative value + */ + getEdgeWeight(e:yfiles.algorithms.Edge):number; + /** + * Calculates the highest or lowest x-coordinate the Node n can be assigned to, without breaking + * the constraints. + * @param {yfiles.algorithms.Node} n the node + * @param {boolean} toLeft + * true if the minimum x-coordinate shall be calculated; + * false for the maximum x-coordinate + * @return {number} the maximum/minimum extent of the node's center x-coordinate + */ + getMaximumExtent(n:yfiles.algorithms.Node,toLeft:boolean):number; + /** + * Returns the minimum distance between two Nodes on the same layer according to + * getMinimalNodeDistance(), getMinimalEdgeDistance() and getMinimalMultiEdgeDistance(). + * @see {@link yfiles.hierarchic.AbstractDrawer#minimalMultiEdgeDistance} + * @see {@link yfiles.hierarchic.AbstractDrawer#minimalNodeDistance} + * @see {@link yfiles.hierarchic.AbstractDrawer#minimalEdgeDistance} + * @param {yfiles.algorithms.Node} n the node + * @param {boolean} toLeft + * true if the minimum x-coordinate shall be calculated; + * false for the maximum x-coordinate + * @return {number} the maximum/minimum extent of the node's center x-coordinate + */ + getMinimalLayerDistance(n:yfiles.algorithms.Node,toLeft:boolean):number; + /** + * Helper method which initializes the positions of the nodes in all layers. + * This method respects getMinimalLayerDistance(Node,boolean) + * and compacts the graph to the leftmost position (0) + * @param {yfiles.algorithms.NodeList[]} layerList an array of NodeLists each corresponding to a single layer + */ + initializePositions(layerList:yfiles.algorithms.NodeList[]):void; + } + var PendularDrawer:{ + $class:yfiles.lang.Class; + /** + * empty constructor, does nothing. + */ + new ():yfiles.hierarchic.PendularDrawer; + }; + /** + * This class is an implementation of the third phase of the + * Sugiyama algorithm, which represents edges by polylines. + */ + export interface PolylineDrawer extends yfiles.hierarchic.AbstractDrawer{ + /** + * Overwrite this method to assign the final coordinates to the + * objects of he graph. + */ + assignCoordinatesToNodes(layerLists:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.IDataProvider):void; + } + var PolylineDrawer:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.PolylineDrawer; + }; + /** + * This class can be used to wrap {@link yfiles.hierarchic.IDrawer} implementations. + * It modifies the {@link yfiles.hierarchic.DrawerKeys#NODE_BORDER_LEFT} and + * {@link yfiles.hierarchic.DrawerKeys#NODE_BORDER_RIGHT} DataProvider instances and delegates the + * actual drawing to the inner drawer. + * Actual space requirements are calculated in {@link yfiles.hierarchic.NodeLabelSpaceDrawer#getHaloSpace}. + * This implementation uses the maximum left and right label overlaps as the halo values. + * Note that this will only work with Drawer implementations that respect the values + * provided through the DataProviders, e.g. MedianLinearSegmentsDrawer and SimplexDrawer. + * + * This implementation uses {@link yfiles.layout.INodeLabelLayout}s and can therefor not be + * used with layout orientations other than top to bottom. + * + */ + export interface NodeLabelSpaceDrawer extends Object,yfiles.hierarchic.IDrawer{ + /** + * This method assigns the coordinates to the nodes. + * @see Specified by {@link yfiles.hierarchic.IDrawer#assignCoordinates}. + */ + assignCoordinates(g:yfiles.layout.LayoutGraph,layerLists:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.IDataProvider):void; + /** + * Calculates the horizontal space requirements for the given node. + * This implementation uses the maximum left and right label overlaps as the halo values. + * @param {yfiles.algorithms.Node} node The node to calculate the halo for. + * @param {boolean} left Whether to calculate the left (true) or right (false) halo. + * @return {number} The additional space needed by the given node at the given side. + */ + getHaloSpace(node:yfiles.algorithms.Node,left:boolean):number; + /** + * Gives the drawer the opportunity to distinguish between dummy nodes + * and real ones. + * dummy stores the original edge for each dummy node or + * null for real nodes. + * @see Specified by {@link yfiles.hierarchic.IDrawer#dummyMap}. + */ + dummyMap:yfiles.algorithms.INodeMap; + /** + * The minimal distance between two edges in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalEdgeDistance}. + */ + minimalEdgeDistance:number; + /** + * The minimal distance between two layers. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalLayerDistance}. + */ + minimalLayerDistance:number; + /** + * The minimal distance between two edges sharing source/target (aka multi-edges) in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalMultiEdgeDistance}. + */ + minimalMultiEdgeDistance:number; + /** + * The minimal distance between two nodes in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalNodeDistance}. + */ + minimalNodeDistance:number; + } + var NodeLabelSpaceDrawer:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of NodeLabelSpaceDrawer. + */ + new (inner:yfiles.hierarchic.IDrawer):yfiles.hierarchic.NodeLabelSpaceDrawer; + }; + /** + * Classes implementing this interface calculate the order of nodes within + * the different layers that the graph has been partitioned into. + */ + export interface ILayerSequencer extends Object{ + /** + * Calculates the sequence of nodes within each layer. + * @param {yfiles.layout.LayoutGraph} g the graph being acted upon + * @param {yfiles.algorithms.INodeMap} layerID + * provides for each node an integral number signifying the layer + * of that node. The first layer has the number 0. + * @param {number} maxLayer the number of different layers + * @return {yfiles.algorithms.NodeList[]} + * an array of length maxLayer containing node lists. Each node list + * contains the nodes of a corresponding layer. The order of the nodes + * within each node list represents the sequence of the nodes within their layer. + * @see Specified by {@link yfiles.hierarchic.ILayerSequencer#getLayers}. + */ + getLayers(g:yfiles.layout.LayoutGraph,layerID:yfiles.algorithms.INodeMap,maxLayer:number):yfiles.algorithms.NodeList[]; + } + var ILayerSequencer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This is the interface to the node layering phase of the hierarchic layouter. + * Implementations of this class must partition the nodes of the input graph + * in hierarchic layers. + * Implementing Classes: + * {@link yfiles.hierarchic.AsIsLayerer}, + * {@link yfiles.hierarchic.BFSLayerer}, + * {@link yfiles.hierarchic.ConstraintLayerer}, + * {@link yfiles.hierarchic.GivenLayersLayerer}, + * {@link yfiles.hierarchic.TopologicalLayerer}, + * {@link yfiles.hierarchic.WeightedLayerer} + */ + export interface ILayerer extends Object{ + /** + * This method assigns the nodes in the graph to layers. + * @param {yfiles.layout.LayoutGraph} g the graph for which the layers are determined. + * @param {yfiles.algorithms.INodeMap} layer here the layers are stored + * @param {yfiles.algorithms.EdgeList} reversedEdges here the edges are stored which had been reversed. + * @return {number} the number of layers + * @see Specified by {@link yfiles.hierarchic.ILayerer#assignNodeLayer}. + */ + assignNodeLayer(g:yfiles.layout.LayoutGraph,layer:yfiles.algorithms.INodeMap,reversedEdges:yfiles.algorithms.EdgeList):number; + } + var ILayerer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class assigns port coordinates to the edges of a graph. + */ + export interface PortAssignment extends Object{ + } + var PortAssignment:{ + $class:yfiles.lang.Class; + /** + * Assigns port coordinates to the edges. + * It is assumed that all incoming edges + * of a node connect at the top side of that node and that all outgoing edges + * of a node leave at the bottom side of that node. + * Port assignment will be such that the ports will be spread evenly + * at top and bottom sides of the nodes. Ports will be assigned such that + * no unnecessary edge crossings will be introduced. + * @param {yfiles.layout.LayoutGraph} g graph whose edges need port assignment + * @param {yfiles.algorithms.NodeList[]} layers the layering of g + * @param {yfiles.algorithms.IDataProvider} dummyMark + * provides boolean data about whether a node + * is a dummy node or not. + */ + assignPortsForLayers(g:yfiles.layout.LayoutGraph,layers:yfiles.algorithms.NodeList[],dummyMark:yfiles.algorithms.IDataProvider):void; + /** + * Assigns port coordinates to the edges. + * It is assumed that all incoming edges + * of a node connect at the top side of that node and that all outgoing edges + * of a node leave at the bottom side of that node. + * Port assignment will be such that the ports will be spread evenly + * at top and bottom sides of the nodes. Ports will be assigned according to + * the given Comparators. + * @param {yfiles.layout.LayoutGraph} g graph whose edges need port assignment + * @param {yfiles.algorithms.IDataProvider} dummyMark + * provides boolean data about whether a node + * is a dummy node or not. + * @param {yfiles.objectcollections.IComparer} inComp A Comparator that defines an ordering for edges. This comparator is used for ordering the edges entering a node. + * @param {yfiles.objectcollections.IComparer} outComp A Comparator that defines an ordering for edges. This comparator is used for ordering the edges leaving a node + */ + assignPorts(g:yfiles.layout.LayoutGraph,dummyMark:yfiles.algorithms.IDataProvider,inComp:yfiles.objectcollections.IComparer,outComp:yfiles.objectcollections.IComparer):void; + }; + /** + * This interface is a Cookie for the HierarchicLayouter's memento support. + */ + export interface IMementoSupport extends Object{ + /** + * Creates a memento which can be held by the user, before using the support, + * a valid memento Object has to be set using the corresponding setter method. + * @see Specified by {@link yfiles.hierarchic.IMementoSupport#createMemento}. + */ + createMemento():Object; + /** + * The currently active memento Object. + * @see Specified by {@link yfiles.hierarchic.IMementoSupport#memento}. + */ + memento:Object; + /** + * Sets the mode for each phase of the algorithm. + * true makes the + * algorithm use the + * values stored in the memento from a previous run, whereas false + * makes the algorithm store the information in the memento after the next run. + * @see Specified by {@link yfiles.hierarchic.IMementoSupport#setMementoMode}. + */ + setMementoMode(phase:yfiles.hierarchic.AlgorithmPhase,useMemento:boolean):void; + /** + * Retrieves the current mode previously set by setMementoMode(byte, boolean) + * for the given phase of the algorithm. + * @see Specified by {@link yfiles.hierarchic.IMementoSupport#getMementoMode}. + */ + getMementoMode(phase:yfiles.hierarchic.AlgorithmPhase):boolean; + } + var IMementoSupport:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for the third phase of the Sugiyama algorithm. + * It assigns the coordinates to the nodes according to the defined + * range. + */ + export interface IDrawer extends Object{ + /** + * This method assigns the coordinates to the nodes. + * @see Specified by {@link yfiles.hierarchic.IDrawer#assignCoordinates}. + */ + assignCoordinates(g:yfiles.layout.LayoutGraph,layerLists:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.IDataProvider):void; + /** + * Gives the drawer the opportunity to distinguish between dummy nodes + * and real ones. + * dummy stores the original edge for each dummy node or + * null for real nodes. + * @see Specified by {@link yfiles.hierarchic.IDrawer#dummyMap}. + */ + dummyMap:yfiles.algorithms.INodeMap; + /** + * The minimal distance between two nodes in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalNodeDistance}. + */ + minimalNodeDistance:number; + /** + * The minimal distance between two edges in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalEdgeDistance}. + */ + minimalEdgeDistance:number; + /** + * The minimal distance between two edges sharing source/target (aka multi-edges) in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalMultiEdgeDistance}. + */ + minimalMultiEdgeDistance:number; + /** + * The minimal distance between two layers. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalLayerDistance}. + */ + minimalLayerDistance:number; + } + var IDrawer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class implements a layout algorithm for drawing directed graphs + * in a hierarchic way. + * The algorithm places nodes in different horizontal layers, + * in such a way that most edges in the graph run from top + * to bottom. + * Here is a sample output of the algorithm using top to bottom + * orientation and {@link yfiles.hierarchic.LayoutStyle#PENDULUM} layout style. + *
+ * HierarchicLayouter can handle port constraints. + * See classes {@link yfiles.layout.PortConstraint} and {@link yfiles.layout.PortConstraintKeys} on how + * to setup port constraint information for this algorithm. + * HierarchicLayouter can consider edge label data when laying out a graph. + * That means that the layout of edge labels will be part of the resulting + * layout and the layout of nodes and edges is chosen in such a way that the + * edge labels do not conflict with the rest of the layout. + * See classes {@link yfiles.layout.LabelLayoutData}, + * {@link yfiles.layout.LabelLayoutKeys} and {@link yfiles.layout.LabelLayoutTranslator} on how + * to setup the integrated edge labeling algorithm. + */ + export interface HierarchicLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * The routing style being used. + * Possible values are + * {@link yfiles.hierarchic.RoutingStyle#POLYLINE} and {@link yfiles.hierarchic.RoutingStyle#ORTHOGONAL}. + * By default {@link yfiles.hierarchic.RoutingStyle#POLYLINE} is set. + */ + routingStyle:yfiles.hierarchic.RoutingStyle; + /** + * Specifies whether the algorithm tries to optimize PortConstraints, + * that are either {@link yfiles.layout.PortSide#ANY} or null. + *

+ * Default is false. + *

+ */ + optimizePortConstraints:boolean; + /** + * Specifies whether the algorithm tries to optimize the routing of + * same layer edges whose PortConstraints don't impose the routing. + * Default is true. + */ + optimizeSameLayerEdgeRouting:boolean; + /** + * The currently set layout style or -1 + * if the style cannot be + * determined. + * Possible values are + * {@link yfiles.hierarchic.LayoutStyle#POLYLINE}, {@link yfiles.hierarchic.LayoutStyle#LINEAR_SEGMENTS}, {@link yfiles.hierarchic.LayoutStyle#MEDIAN_SIMPLEX}, + * {@link yfiles.hierarchic.LayoutStyle#SIMPLEX}, {@link yfiles.hierarchic.LayoutStyle#PENDULUM}, + * and {@link yfiles.hierarchic.LayoutStyle#TREE}. + * The default is set to {@link yfiles.hierarchic.LayoutStyle#LINEAR_SEGMENTS} + */ + layoutStyle:yfiles.hierarchic.LayoutStyle; + /** + * The currently set layering strategy. + * This layouter assigns the nodes to separate layers. The nodes within each layer will be + * placed on the same horizontal line. + * The layers will be arranged vertically starting with the small-numbered layers. + * The rank of a node is the number of the layer it belongs to. + * An important layering strategy for the hierarchic layout style is called Hierarchical Layering. + * A hierarchical layering tries to assign nodes to layers in a way that as much as possible + * edges of the graph will point to the main layout direction, i.e. the start nodes of the edges will + * have a smaller rank than the corresponding end nodes. Also, a hierarchical layering + * will never put two connected nodes in the same layer. + * By default the layering strategy {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_TIGHT_TREE} is set. + */ + layeringStrategy:yfiles.hierarchic.LayeringStrategy; + /** + * The Layerer, which is responsible for the first phase + * of the algorithm. + */ + layerer:yfiles.hierarchic.ILayerer; + /** + * The LayerSequencer, which is responsible for the second phase + * of the algorithm. + */ + layerSequencer:yfiles.hierarchic.ILayerSequencer; + /** + * The Drawer, which is responsible for the third phase of + * the algorithm. + * The Drawer is responsible for the layout style of + * this layouter. + */ + drawer:yfiles.hierarchic.IDrawer; + /** + * The minimal distance between two nodes in the same layer. + */ + minimalNodeDistance:number; + /** + * The minimal distance between edges that run in parallel. + */ + minimalEdgeDistance:number; + /** + * The minimal distance between two layers. + */ + minimalLayerDistance:number; + /** + * The minimal length of first and last edge segments + * for edge routing. + * This will be used for orthogonal + * edge routing, self-loops, same layer edges and bus connectors. + */ + minimalFirstSegmentLength:number; + /** + * Specifies whether or not false crossings should be removed from the layout. + * A false crossing is a crossing between two edges that connect + * to the same upper or lower node. + */ + removeFalseCrossings:boolean; + /** + * A time limit for the algorithm in milliseconds. + */ + maximalDuration:number; + /** + * The limit, when bends are removed and a straight line is drawn + * instead. + */ + bendReductionThreshold:number; + /** + * Always returns true. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Layout the given graph. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(g:yfiles.layout.LayoutGraph):void; + /** + * Determines the order of the nodes within their layers. + */ + getLayerSequence(g:yfiles.layout.LayoutGraph,LayerKey:yfiles.algorithms.INodeMap,maxLayer:number):yfiles.algorithms.NodeList[]; + /** + * The cookie for the memento support of the hierarchic layout algorithm. + * If there was no memento support registered with this instance before, + * this call will instantiate the memento support, otherwise the existing + * instance will be returned. + */ + mementoSupport:yfiles.hierarchic.IMementoSupport; + /** + * Disposes the memento support if it is existent, i.e. + * if it has been queried + * before by getMementoSupport() + */ + disposeMementoSupport():void; + } + var HierarchicLayouter:{ + $class:yfiles.lang.Class; + /** + * Instantiates a new HierarchicLayouter. + */ + new ():yfiles.hierarchic.HierarchicLayouter; + }; + export interface DrawerKeys extends Object{ + } + var DrawerKeys:{ + $class:yfiles.lang.Class; + /** + * The key used to look up a data provider that, + * if present, must provide a double value for each node in + * the graph. + * The provided value is an additional overlap-free + * border added to the left side of the associated node. + * Drawer implementations may ignore the data provided. + */ + NODE_BORDER_LEFT:Object; + /** + * The key used to look up a data provider that, + * if present, must provide a double value for each node in + * the graph. + * The provided value is an additional overlap-free + * border added to the right side of the associated node. + * Drawer implementations may ignore the data provided. + */ + NODE_BORDER_RIGHT:Object; + /** + * The key used to look up a data provider that, + * if present, must provide a double value for each node in + * the graph. + * The provided value is an additional overlap-free + * border added to the top side of the associated node. + * Drawer implementations may ignore the data provided. + */ + NODE_BORDER_TOP:Object; + /** + * The key used to look up a data provider that, + * if present, must provide a double value for each node in + * the graph. + * The provided value is an additional overlap-free + * border added to the bottom side of the associated node. + * Drawer implementations may ignore the data provided. + */ + NODE_BORDER_BOTTOM:Object; + /** + * The key used to look up a data provider that, + * if present, must provide a double value for each node in + * the graph. + * The provided value specifies the minimum distance + * between the right border of the node and the left border of its right-hand + * neighbor in the layer. + * If a data provider with this key is registered with the input graph then the + * distance values set by the methods {@link yfiles.hierarchic.IDrawer#minimalNodeDistance}, + * {@link yfiles.hierarchic.IDrawer#minimalEdgeDistance} and {@link yfiles.hierarchic.IDrawer#minimalMultiEdgeDistance} + * will be ignored. + * + * Drawer implementations may ignore the data provided. + */ + NODE_DISTANCE:Object; + }; + /** + * This class implements the third phase of the hierarchic layout algorithm for trees. + * If the input graph is not a tree, + * an alternative drawer is invoked. + */ + export interface TreeDrawer extends yfiles.hierarchic.AbstractDrawer{ + /** + * The minimal distance between two edges in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalEdgeDistance}. + */ + minimalEdgeDistance:number; + /** + * The minimal distance between two edges sharing source/target (aka multi-edges) in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalMultiEdgeDistance}. + */ + minimalMultiEdgeDistance:number; + /** + * The minimal distance between two nodes in the same layer. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalNodeDistance}. + */ + minimalNodeDistance:number; + /** + * The minimal distance between two layers. + * @see Specified by {@link yfiles.hierarchic.IDrawer#minimalLayerDistance}. + */ + minimalLayerDistance:number; + /** + * The drawer, which is called when graph is not a tree. + */ + alternativeDrawer:yfiles.hierarchic.IDrawer; + /** + * Overwrite this method to assign the final coordinates to the + * objects of he graph. + */ + assignCoordinatesToNodes(layerLists:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.IDataProvider):void; + } + var TreeDrawer:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.TreeDrawer; + }; + /** + * This class implements the first phase of the Sugiyama algorithm. + * It uses topological sorting to assign layers to the nodes. + */ + export interface TopologicalLayerer extends Object,yfiles.hierarchic.ILayerer,yfiles.hierarchic.incremental.ILayerer{ + /** + * The currently active ranking policy within + * this layerer. + * By default {@link yfiles.hierarchic.RankingPolicy#NO_RERANKING} is set. + */ + rankingPolicy:yfiles.hierarchic.RankingPolicy; + /** + * This method assigns the nodes in the graph to layers. + * Postcondition: Forall (v,w) in E: layer(v) < layer(w) + * @param {yfiles.layout.LayoutGraph} g the graph for which the layers are determined. + * @param {yfiles.algorithms.INodeMap} layer here the layers are stored + * @param {yfiles.algorithms.EdgeList} reversedEdges here the edges are stored which had been reversed. + * @return {number} the number of layers + * @see Specified by {@link yfiles.hierarchic.ILayerer#assignNodeLayer}. + */ + assignNodeLayer(g:yfiles.layout.LayoutGraph,layer:yfiles.algorithms.INodeMap,reversedEdges:yfiles.algorithms.EdgeList):number; + /** + * This method assigns all nodes in the graph to layers and registers them + * in the {@link yfiles.hierarchic.incremental.ILayers} instance. + * In order to create new layers, the factory + * method {@link yfiles.hierarchic.incremental.ILayers#insert} must be used. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains the nodes that should be distributed + * into the layers + * @param {yfiles.hierarchic.incremental.ILayers} layers + * the object that will be filled with the results of the + * calculation + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * LayoutDataProvider that can be used to query information about + * the nodes - note that positional information + * (see {@link yfiles.hierarchic.incremental.INodeData#position} and {@link yfiles.hierarchic.incremental.INodeData#layer}) cannot + * be available at any time. + * @see {@link yfiles.hierarchic.incremental.ILayers#insert} + * @see {@link yfiles.hierarchic.incremental.ILayer#add} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerer#assignLayers}. + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + } + var TopologicalLayerer:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.TopologicalLayerer; + }; + /** + * Layerer that uses a breadth first search to assign layers to the nodes. + * The nodes of the first layer can be freely chosen (see {@link yfiles.hierarchic.BFSLayerer#CORE_NODES_DP_KEY}). + * The nodes belonging to a subsequent layer are determined as follows: + * Add all yet unassigned nodes to the new layer that are connected to nodes + * already assigned. + * As a consequence all connected nodes will be at most one layer apart. + * Also, edges between nodes that belong to the same layer are possible. + */ + export interface BFSLayerer extends Object,yfiles.hierarchic.ILayerer,yfiles.hierarchic.incremental.ILayerer{ + /** + * This method assigns the nodes in the graph to layers. + * Postcondition: Forall (v,w) in E: layer(v) < layer(w) + * @param {yfiles.layout.LayoutGraph} graph the graph for which the layers are determined. + * @param {yfiles.algorithms.INodeMap} layer here the layers are stored + * @param {yfiles.algorithms.EdgeList} reversedEdges here the edges are stored which had been reversed. + * @return {number} the number of layers + * @see Specified by {@link yfiles.hierarchic.ILayerer#assignNodeLayer}. + */ + assignNodeLayer(graph:yfiles.layout.LayoutGraph,layer:yfiles.algorithms.INodeMap,reversedEdges:yfiles.algorithms.EdgeList):number; + /** + * This method assigns all nodes in the graph to layers and registers them + * in the {@link yfiles.hierarchic.incremental.ILayers} instance. + * In order to create new layers, the factory + * method {@link yfiles.hierarchic.incremental.ILayers#insert} must be used. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains the nodes that should be distributed + * into the layers + * @param {yfiles.hierarchic.incremental.ILayers} layers + * the object that will be filled with the results of the + * calculation + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * LayoutDataProvider that can be used to query information about + * the nodes - note that positional information + * (see {@link yfiles.hierarchic.incremental.INodeData#position} and {@link yfiles.hierarchic.incremental.INodeData#layer}) cannot + * be available at any time. + * @see {@link yfiles.hierarchic.incremental.ILayers#insert} + * @see {@link yfiles.hierarchic.incremental.ILayer#add} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerer#assignLayers}. + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + } + var BFSLayerer:{ + $class:yfiles.lang.Class; + /** + * The data provider key used to look up the core nodes + * of the bfs layering. + * The BFSLayerer will try to retrieve a + * data provider from the graph to be layered with this key. + * The looked up data provider should provide boolean values + * for the nodes of that graph. The boolean value signals + * whether a node is to be placed in the first layer or not. + * If the are no nodes marked as core nodes then nodes with + * indegree 0 are considered to be core nodes. + */ + CORE_NODES_DP_KEY:Object; + new ():yfiles.hierarchic.BFSLayerer; + }; + /** + * This class implements the first phase of the hierarchic layouter. + * It first makes the directed graph acyclic. + * Then it assigns the layers such that edge weights are respected + * A weight defines a minimal distance between the two end points of + * an edge. + */ + export interface WeightedLayerer extends Object,yfiles.hierarchic.ILayerer,yfiles.hierarchic.incremental.ILayerer{ + /** + * Provides the edge weights. + */ + weight:yfiles.algorithms.IDataProvider; + /** + * The key to access the weights. + */ + key:Object; + /** + * true if the edges that need to be reversed are + * determined using an edge weight based heuristic + * and false if a Depth First Search based approach should be + * used. + * The weight based approach may result in fewer reversed edges + * (especially for cases with many multi edges) whereas the DFS based + * approach is likely to be faster. + *

+ * By default, the DFS based approach is used. + *

+ */ + weightedCycleRemoval:boolean; + /** + * The time limit (in milliseconds) set for the algorithm. + * Note that restricting the maximal duration may result in a worse layout quality. + * Furthermore, the real runtime may exceed the maximal duration since the algorithm + * still have to find a valid solution. + */ + maximalDuration:number; + /** + * This method assigns the nodes in the graph to layers. + * Postcondition: Forall (v,w) in E: layer(v) < layer(w) + * @param {yfiles.layout.LayoutGraph} g the graph for which the layers are determined. + * @param {yfiles.algorithms.INodeMap} layer here the layers are stored + * @param {yfiles.algorithms.EdgeList} reversedEdges here the edges are stored which had been reversed. + * @return {number} the number of layers + * @see Specified by {@link yfiles.hierarchic.ILayerer#assignNodeLayer}. + */ + assignNodeLayer(g:yfiles.layout.LayoutGraph,layer:yfiles.algorithms.INodeMap,reversedEdges:yfiles.algorithms.EdgeList):number; + /** + * This method assigns the nodes in the graph to layers. + * Postcondition: Forall (v,w) in E: layer(v) < layer(w) + * @param {yfiles.layout.LayoutGraph} g the graph for which the layers are determined. + * @param {yfiles.algorithms.INodeMap} layer here the layers are stored + * @param {yfiles.algorithms.EdgeList} reversedEdges here the edges are stored which had been reversed. + * @return {number} the number of layers + */ + assignNodeLayerWithDataProvider(g:yfiles.layout.LayoutGraph,layer:yfiles.algorithms.INodeMap,reversedEdges:yfiles.algorithms.EdgeList,w:yfiles.algorithms.IDataProvider):number; + /** + * Returns the edge weight of the specified edge for use with the weight + * based cycle removal heuristic. + *

+ * By default, all edges are considered to have weight 1.0. + *

+ * @param {yfiles.algorithms.Edge} edge the edge whose weight is returned. + * @return {number} the edge weight of the specified edge. + * @see {@link yfiles.hierarchic.WeightedLayerer#weightedCycleRemoval} + * @see {@link yfiles.hierarchic.WeightedLayerer#weightedCycleRemoval} + */ + getWeight(edge:yfiles.algorithms.Edge):number; + /** + * This method assigns the nodes in the graph to layers. + * Postcondition: Forall (v,w) in E: layer(v) < layer(w) + * @param {yfiles.algorithms.Graph} g the graph for which the layers are determined. + * @param {yfiles.algorithms.INodeMap} layer here the layers are stored + * @param {yfiles.algorithms.EdgeList} reversedEdges here the edges are stored which had been reversed. + * @return {number} the number of layers + */ + assignNodeLayerForAlgorithmsGraph(g:yfiles.algorithms.Graph,layer:yfiles.algorithms.INodeMap,reversedEdges:yfiles.algorithms.EdgeList,w:yfiles.algorithms.IDataProvider):number; + /** + * Uses dfs to remove cycles from the graph. + */ + makeDFSAcyclic(g:yfiles.layout.LayoutGraph,reversedEdges:yfiles.algorithms.EdgeList):void; + /** + * Uses dfs to remove cycles from the graph. + */ + makeDFSAcyclicForAlgorithmsGraph(g:yfiles.algorithms.Graph,reversedEdges:yfiles.algorithms.EdgeList):void; + /** + * Assigns the layers to the nodes. + */ + assignLayersToMap(g:yfiles.algorithms.Graph,layer:yfiles.algorithms.INodeMap):number; + /** + * Assign the layers to the nodes. + */ + assignLayersFast(g:yfiles.algorithms.Graph,layer:yfiles.algorithms.INodeMap):number; + /** + * Pushes the nodes down, drawings seems then to be nicer. + */ + downShiftNodes(g:yfiles.algorithms.Graph,LayerKey:yfiles.algorithms.INodeMap,maxLayer:number):void; + /** + * This method assigns all nodes in the graph to layers and registers them + * in the {@link yfiles.hierarchic.incremental.ILayers} instance. + * In order to create new layers, the factory + * method {@link yfiles.hierarchic.incremental.ILayers#insert} must be used. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains the nodes that should be distributed + * into the layers + * @param {yfiles.hierarchic.incremental.ILayers} layers + * the object that will be filled with the results of the + * calculation + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * LayoutDataProvider that can be used to query information about + * the nodes - note that positional information + * (see {@link yfiles.hierarchic.incremental.INodeData#position} and {@link yfiles.hierarchic.incremental.INodeData#layer}) cannot + * be available at any time. + * @see {@link yfiles.hierarchic.incremental.ILayers#insert} + * @see {@link yfiles.hierarchic.incremental.ILayer#add} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerer#assignLayers}. + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + } + var WeightedLayerer:{ + $class:yfiles.lang.Class; + /** + * Creates a new weighted layerer. + */ + new ():yfiles.hierarchic.WeightedLayerer; + /** + * Creates a new weighted layerer. + * @param {Object} k the key to access the weights. + */ + ForKey:{ + new (k:Object):yfiles.hierarchic.WeightedLayerer; + }; + }; + /** + * Drawer based on rank-assignment. + * The drawer works only with integer values and rounds double values to + * integers. + */ + export interface SimplexDrawer extends yfiles.hierarchic.AbstractDrawer{ + /** + * The straightening factor. + * Higher values will result in longer straight line routings. + */ + straighteningFactor:number; + /** + * The time limit (in milliseconds) set for the algorithm. + * Note that restricting the maximal duration may result in a worse layout quality. + * Furthermore, the real runtime may exceed the maximal duration since the algorithm + * still have to find a valid solution. + */ + maximalDuration:number; + /** + * Assigns the coordinates to the nodes based on simplex-rank assignment. + * @param {yfiles.algorithms.NodeList[]} layerLists The nodes in each layer. + * @param {yfiles.algorithms.IDataProvider} layerID Provides the layer ID for nodes. + * @see Overrides {@link yfiles.hierarchic.AbstractDrawer#assignCoordinatesToNodes} + */ + assignCoordinatesToNodes(layerLists:yfiles.algorithms.NodeList[],layerID:yfiles.algorithms.IDataProvider):void; + /** + * Returns the overall edge cost of the result. + * @param {yfiles.algorithms.INodeMap} result The result to calculate the cost for. + * @param {yfiles.algorithms.IEdgeMap} weight Provides the edge weights. + * @param {yfiles.algorithms.IEdgeMap} minLength Provides the min length for edges. + * @return {number} The total cost given the parameters. + */ + getCost(graph:yfiles.algorithms.Graph,result:yfiles.algorithms.INodeMap,weight:yfiles.algorithms.IEdgeMap,minLength:yfiles.algorithms.IEdgeMap):number; + } + var SimplexDrawer:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.SimplexDrawer; + /** + * Returns whether the given node is a dummy node. + */ + isDummy(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):boolean; + }; + /** + * This class is an extended variant of the HierarchicLayouter class. + * It is capable of laying out nested groups of nodes as well as the group nodes + * themselves. The grouping information is provided through + * DataProvider instances, which are registered with the LayoutGraph instance. + * The layout is being calculated recursively. The size of the group nodes is determined + * by the area occupied by the children of the group node. + * Here is a sample output of the algorithm. + *
+ */ + export interface HierarchicGroupLayouter extends yfiles.hierarchic.HierarchicLayouter{ + /** + * The associated Grouping instance. + */ + grouping:yfiles.layout.GraphGrouping; + /** + * Returns true.. + * @see Overrides {@link yfiles.hierarchic.HierarchicLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Layouts the given graph. + * @see Overrides {@link yfiles.hierarchic.HierarchicLayouter#doLayoutCore} + */ + doLayoutCore(g:yfiles.layout.LayoutGraph):void; + /** + * Layouts the children of root recursively. + * @param {yfiles.algorithms.Node} root The current root node (parent, invisible during layout) + * @param {yfiles.algorithms.NodeList} levelNodes The nodes to be laid out + * @return {yfiles.algorithms.Rectangle2D} the bounding box of the layout + */ + layoutLevel(root:yfiles.algorithms.Node,levelNodes:yfiles.algorithms.NodeList,buildGraphsOnly:boolean):yfiles.algorithms.Rectangle2D; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * The LayerSequencer, which is responsible for the second phase + * of the algorithm. + */ + layerSequencer:yfiles.hierarchic.ILayerSequencer; + /** + * The Layerer, which is responsible for the first phase + * of the algorithm. + */ + layerer:yfiles.hierarchic.ILayerer; + /** + * The current GroupBoundsCalculator instance. + * By specifying an instance of the GroupBoundsCalculator interface one can + * control the sizes of the group nodes. For every group of nodes which is in it's + * open state the instance will be asked to calculate the bounds for the given + * child nodes. The resulting size will be used during the ongoing layout. + */ + groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; + /** + * The drawer which is responsible for the third phase of the algorithm. + * A drawer is responsible for the layout style of + * this layouter. + * @see Overrides {@link yfiles.hierarchic.HierarchicLayouter#drawer} + */ + drawer:yfiles.hierarchic.IDrawer; + /** + * The currently set layout style or -1 + * if the style cannot be + * determined. + * Possible values are + * {@link yfiles.hierarchic.LayoutStyle#POLYLINE}, {@link yfiles.hierarchic.LayoutStyle#LINEAR_SEGMENTS}, {@link yfiles.hierarchic.LayoutStyle#MEDIAN_SIMPLEX}, + * {@link yfiles.hierarchic.LayoutStyle#SIMPLEX}, {@link yfiles.hierarchic.LayoutStyle#PENDULUM}, + * and {@link yfiles.hierarchic.LayoutStyle#TREE}. + * The default is set to {@link yfiles.hierarchic.LayoutStyle#LINEAR_SEGMENTS} + */ + layoutStyle:yfiles.hierarchic.LayoutStyle; + /** + * The currently set layering strategy. + * This layouter assigns the nodes to separate layers. The nodes within each layer will be + * placed on the same horizontal line. + * The layers will be arranged vertically starting with the small-numbered layers. + * The rank of a node is the number of the layer it belongs to. + * An important layering strategy for the hierarchic layout style is called Hierarchical Layering. + * A hierarchical layering tries to assign nodes to layers in a way that as much as possible + * edges of the graph will point to the main layout direction, i.e. the start nodes of the edges will + * have a smaller rank than the corresponding end nodes. Also, a hierarchical layering + * will never put two connected nodes in the same layer. + * By default the layering strategy {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_TIGHT_TREE} is set. + */ + layeringStrategy:yfiles.hierarchic.LayeringStrategy; + /** + * The property strongPortsScalingActive. + * This property determines whether strong port constraints at group nodes + * should be interpreted as coordinates, that should be scaled to the same + * amount as the sizes of the group nodes vary. + * The default value is true. + */ + strongPortsScalingActive:boolean; + /** + * Determines the order of the nodes within their layers. + */ + getLayerSequence(g:yfiles.layout.LayoutGraph,LayerKey:yfiles.algorithms.INodeMap,maxLayer:number):yfiles.algorithms.NodeList[]; + /** + * The current strategy for the node sequencing. + */ + globalSequencingActive:boolean; + } + var HierarchicGroupLayouter:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of HierarchicGroupLayouter. + */ + new ():yfiles.hierarchic.HierarchicGroupLayouter; + }; + export enum WeightHeuristic{ + /** + * Weight assignment heuristic specifier. A node position within a layer + * will be determined by the barycenter of its + * successor (downward pass) and predecessor (upward pass) nodes. + */ + BARYCENTER, + /** + * Weight assignment heuristic specifier. A node position within a layer + * will be determined by the median position of its + * successor (downward pass) and predecessor (upward pass) nodes. + */ + MEDIAN + } + export enum RoutingStyle{ + /** + * Edge routing style specifier. Routes the edges as polylines. + */ + POLYLINE, + /** + * Edge routing style specifier. Routes the edges orthogonally, i.e. + * all edge segments are either vertically or horizontally aligned. + */ + ORTHOGONAL + } + export enum LayoutStyle{ + /** + * Layout style specifier. Draws the edges in a way + * that nodes are balanced nicely and the number + * of bends on an edge is kept small. + * Note that this layout style is more time consuming than most of the + * other ones. + */ + PENDULUM, + /** + * Layout style specifier. Draws the edges in a way + * that at most two bends are used per edge unless two edges cross. + */ + LINEAR_SEGMENTS, + /** + * Layout style specifier. Draws the edges in a polyline + * fashion. The layout tends to be very compact but the + * number of edge bends may be high. + */ + POLYLINE, + /** + * Layout style specifier. Gives nice layouts if the + * graph is a tree. + */ + TREE, + /** + * Layout style specifier. Gives tight layouts with rather few bends. + */ + SIMPLEX, + /** + * Layout style specifier. Similar to SIMPLEX but more symmetric for the cost + * of a few more bends. + */ + MEDIAN_SIMPLEX + } + /** + * Layerer implementation that uses relative and absolute layering constraints. + *

This layerer can use two sets of + * constraints:

  • Absolute constraints, i.e. place nodes at the top or bottom layer
  • Relative + * constraints, i.e. place a node above, below or in the same layer as another node
Constraints for a given + * graph can be created with means of a {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory} instance, which should be created + * with {@link yfiles.hierarchic.ConstraintLayerer#createConstraintFactory} for a given graph instance.

+ */ + export interface ConstraintLayerer extends Object,yfiles.hierarchic.ILayerer,yfiles.hierarchic.incremental.ILayerer{ + /** + * The core layerer for this layerer instance. + * The ConstraintLayerer tries to create a layering for the + * nodes and edges that have no constraints that resembles the layering that would be created by the coreLayerer. This + * works the better the less constraints exist. Ideally, the constrained nodes are just embedded into the layering + * created by the coreLayerer. By default, an instance of {@link yfiles.hierarchic.TopologicalLayerer} is used. + */ + coreLayerer:yfiles.hierarchic.ILayerer; + /** + * Specifies whether same layer edges can be created by this layerer instance. + * This only concerns edges between nodes + * that have no hard constraints that will force a same layer edge (i.e. a same layer constraint). + *

+ * Default value is false. + *

+ */ + allowSameLayerEdges:boolean; + /** + * This method assigns the nodes in the graph to layers. + * @param {yfiles.layout.LayoutGraph} g the graph for which the layers are determined. + * @param {yfiles.algorithms.INodeMap} layer here the layers are stored + * @param {yfiles.algorithms.EdgeList} reversedEdges here the edges are stored which had been reversed. + * @return {number} the number of layers + * @throws {yfiles.system.ArgumentException} if any strong constraints are inconsistent + * @see Specified by {@link yfiles.hierarchic.ILayerer#assignNodeLayer}. + */ + assignNodeLayer(g:yfiles.layout.LayoutGraph,layer:yfiles.algorithms.INodeMap,reversedEdges:yfiles.algorithms.EdgeList):number; + /** + * Checks if the current set of strong constraints is consistent (i.e. + * has no cycles) + * @throws {yfiles.system.ArgumentException} if the constraint network is inconsistent + */ + checkConstraints():void; + /** + * This method assigns all nodes in the graph to layers and registers them + * in the {@link yfiles.hierarchic.incremental.ILayers} instance. + * In order to create new layers, the factory + * method {@link yfiles.hierarchic.incremental.ILayers#insert} must be used. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains the nodes that should be distributed + * into the layers + * @param {yfiles.hierarchic.incremental.ILayers} layers + * the object that will be filled with the results of the + * calculation + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * LayoutDataProvider that can be used to query information about + * the nodes - note that positional information + * (see {@link yfiles.hierarchic.incremental.INodeData#position} and {@link yfiles.hierarchic.incremental.INodeData#layer}) cannot + * be available at any time. + * @see {@link yfiles.hierarchic.incremental.ILayers#insert} + * @see {@link yfiles.hierarchic.incremental.ILayer#add} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerer#assignLayers}. + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + } + export module ConstraintLayerer{ + /** + * Interface specification for classes that can create suitable constraints for a {@link yfiles.hierarchic.ConstraintLayerer} instance. + * If you manually register a DataProvider under {@link yfiles.layout.LayouterKeys#NODE_ID_DP_KEY} + * on the graph, you must use the corresponding node ids stored in this DataProvider as arguments for + * all methods that create a constraint. Otherwise, you can just use the node instances themselves. + */ + export interface IConstraintFactory extends Object{ + /** + * A token that allows to bind a constraint factory to a graph instance after creation. + * This method should only be used if the constraint factory is not bound to a graph instance initially. It allows + * to bind the ConstraintFactory to a graph instance after creation. Please see the factory methods that create + * instances of this interface for a description. + * @see {@link yfiles.hierarchic.ConstraintLayerer#createConstraintFactory} + * @see Specified by {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory#memento}. + */ + memento:Object; + /** + * Disposes the ConstraintFactory. + *

This method should be called when the factory is not needed anymore, i.e. + * after the layout has been calculated. Calling this method also clears all constraints.

+ * @see Specified by {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory#dispose}. + */ + dispose():void; + /** + * Add a constraint that forces the node with id with id below to lie below the node with id reference. + * @param {Object} referenceId the id of the reference node + * @param {Object} belowId the id of the node that should lie below + * @see Specified by {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory#addPlaceNodeBelowConstraint}. + */ + addPlaceNodeBelowConstraint(referenceId:Object,belowId:Object):void; + /** + * Add a constraint that forces the node with id below to lie at least minDistance layers below + * the node with id reference. + * The minimum distance includes potentially empty layers that are removed by the layerer. In that case, the actual + * layer difference may be smaller than minDistance + * @param {Object} referenceId the id of the reference node + * @param {Object} belowId the id of the node that should lie below + * @param {number} minDistance the minimal layer distance between the node and its reference node + * @see Specified by {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory#addPlaceNodeBelowConstraintWithMinDistance}. + */ + addPlaceNodeBelowConstraintWithMinDistance(referenceId:Object,belowId:Object,minDistance:number):void; + /** + * Add a constraint that forces the node with id below to lie at least minDistance layers below + * the node with id reference with a given weight penalty for larger layer differences. + * The minimum distance includes potentially empty layers that are removed by the layerer. In that case, the actual + * layer difference may be smaller than minDistance + * @param {Object} referenceId the id of the reference node + * @param {Object} belowId the id of the node that should lie below + * @param {number} minDistance the minimal layer distance between the node and its reference node + * @see Specified by {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory#addPlaceNodeBelowConstraintWithMinDistanceAndWeight}. + */ + addPlaceNodeBelowConstraintWithMinDistanceAndWeight(referenceId:Object,belowId:Object,minDistance:number,weight:number):void; + /** + * Add a constraint that forces the node above to lie above the node reference. + * @param {Object} referenceId the id of the reference node + * @param {Object} aboveId the id of the node that should lie above + * @see Specified by {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory#addPlaceNodeAboveConstraint}. + */ + addPlaceNodeAboveConstraint(referenceId:Object,aboveId:Object):void; + /** + * Add a constraint that forces the node with id above to lie at least minDistance layers above + * the node with id reference. + * The minimum distance includes potentially empty layers that are removed by the layerer. In that case, the actual + * layer difference may be smaller than minDistance + * @param {Object} referenceId the id of the reference node + * @param {Object} aboveId the id of the node that should lie above + * @param {number} minDistance the minimal layer distance between the node and its reference node + * @see Specified by {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory#addPlaceNodeAboveConstraintWithMinDistance}. + */ + addPlaceNodeAboveConstraintWithMinDistance(referenceId:Object,aboveId:Object,minDistance:number):void; + /** + * Add a constraint that forces the node with id above to lie at least minDistance layers above + * the node with id reference with a given weight penalty for larger layer differences. + * The minimum distance includes potentially empty layers that are removed by the layerer. In that case, the actual + * layer difference may be smaller than minDistance + * @param {Object} referenceId the id of the reference node + * @param {Object} aboveId the id of the node that should lie above + * @param {number} minDistance the minimal layer distance between the node and its reference node + * @see Specified by {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory#addPlaceNodeAboveConstraintWithMinDistanceAndWeight}. + */ + addPlaceNodeAboveConstraintWithMinDistanceAndWeight(referenceId:Object,aboveId:Object,minDistance:number,weight:number):void; + /** + * Add a constraint that forces the node with id sameLayer to lie in the same layer as the node with id + * reference. + * @param {Object} referenceId the id of the reference node + * @param {Object} sameLayerId the id of the node that should lie in the same layer + * @see Specified by {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory#addPlaceNodeInSameLayerConstraint}. + */ + addPlaceNodeInSameLayerConstraint(referenceId:Object,sameLayerId:Object):void; + /** + * Add a constraint that places a node in the topmost layer. + * @param {Object} nodeId the id of the node that should lie at the top + * @see Specified by {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory#addPlaceNodeAtTopConstraint}. + */ + addPlaceNodeAtTopConstraint(nodeId:Object):void; + /** + * Add a constraint that places a node in the bottom layer. + * @param {Object} nodeId the id of the node that should lie at the bottom + * @see Specified by {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory#addPlaceNodeAtBottomConstraint}. + */ + addPlaceNodeAtBottomConstraint(nodeId:Object):void; + /** + * Clears all constraints for a given node. + * @param {Object} nodeId the id of the node for which all constraints should be cleared + * @see Specified by {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory#removeConstraints}. + */ + removeConstraints(nodeId:Object):void; + } + } + var ConstraintLayerer:{ + $class:yfiles.lang.Class; + /** + * DataProvider key to store the constraints. + */ + LAYER_CONSTRAINTS_MEMENTO_DP_KEY:Object; + WithCoreLayerer:{ + new (coreLayerer:yfiles.hierarchic.ILayerer):yfiles.hierarchic.ConstraintLayerer; + }; + new ():yfiles.hierarchic.ConstraintLayerer; + /** + * DataProvider key for additional edge weights of type int. + * The Layerer tries to keep edges with higher weights short. + */ + EDGE_WEIGHTS_DP_KEY:string; + /** + * Create an instance of {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory} that is suitable for this + * layerer implementation. + * The ConstraintFactory instance is usually bound to the graph instance g, i.e. if the input graph for the + * layerer changes, a new ConstraintFactory instance must be retrieved. This instance can be used to create + * constraints for this graph instance. + * @param {yfiles.algorithms.Graph} g the current graph for the layerer + * @return {yfiles.hierarchic.ConstraintLayerer.IConstraintFactory} a ConstraintFactory bound to this graph. + * @see {@link yfiles.hierarchic.ConstraintLayerer.IConstraintFactory#memento} + * @see {@link yfiles.hierarchic.ConstraintLayerer#LAYER_CONSTRAINTS_MEMENTO_DP_KEY} + */ + createConstraintFactory(g:yfiles.algorithms.Graph):yfiles.hierarchic.ConstraintLayerer.IConstraintFactory; + }; + /** + * Helper that reverses edges that are oriented in the wrong direction. + */ + export interface EdgeReverser extends Object{ + /** + * Reverses the edges contained ion the given edge list. + * @param {yfiles.algorithms.Graph} g the graph containing the edges in edgeList + * @param {yfiles.algorithms.EdgeList} edgeList contains to be reversed edges. + */ + reverseEdges(g:yfiles.algorithms.Graph,edgeList:yfiles.algorithms.EdgeList):void; + } + var EdgeReverser:{ + $class:yfiles.lang.Class; + /** + * Reverses edges in the given graph whose source node has a + * larger layer ID than the target node. + * @param {yfiles.algorithms.Graph} g target graph + * @param {yfiles.algorithms.INodeMap} layerMap node map that contains a layer ID for each node + * @return {yfiles.algorithms.EdgeList} a list of edges that have been reversed + */ + reverseUpwardEdges(g:yfiles.algorithms.Graph,layerMap:yfiles.algorithms.INodeMap):yfiles.algorithms.EdgeList; + }; + export enum RankingPolicy{ + /** + * Ranking policy specifier. Nodes do not get re-ranked after + * the initial topological layering step. + */ + NO_RERANKING, + /** + * Ranking policy specifier. Nodes get re-ranked by an + * inexpensive downshift rule. + */ + DOWN_SHIFT, + /** + * Ranking policy specifier. Nodes get re-ranked by + * finding a spanning tree that contains only tight + * (length 1) edges. + */ + TIGHT_TREE + } + export enum AlgorithmPhase{ + /** + * Constant describing the first phase of the HierarchicLayouter algorithm. + */ + LAYERING, + /** + * Constant describing the second phase of the HierarchicLayouter algorithm. + */ + SEQUENCING + } + /** + * This layerer implementation layers the nodes by given layer IDs. + * The layer IDs are given by a DataProvider that returns the integral + * layer ID of each node in the graph. + */ + export interface GivenLayersLayerer extends Object,yfiles.hierarchic.ILayerer,yfiles.hierarchic.incremental.ILayerer{ + /** + * Convenience method which removes empty layers and ensures that the smallest layer has value 0. + * @param {yfiles.algorithms.IDataProvider} layerId provides the current layer ids for nodes in g + * @param {yfiles.algorithms.IDataAcceptor} normalizedLayerId accepts the new layer ids that result after normalization. + * @return {number} The amount of layers left after removing all empty layers. + */ + normalize(g:yfiles.algorithms.Graph,layerId:yfiles.algorithms.IDataProvider,normalizedLayerId:yfiles.algorithms.IDataAcceptor):number; + /** + * Assigns layers to the graph that were given by the + * DataProvider g.getDataProvider(LAYER_ID_KEY). + * The returned layerMap will be a normalized variant of + * the user given data provider. A normalized variant has + * no empty layers and a minimum layerID 0. + * @see Specified by {@link yfiles.hierarchic.ILayerer#assignNodeLayer}. + */ + assignNodeLayer(g:yfiles.layout.LayoutGraph,layerMap:yfiles.algorithms.INodeMap,reversedEdges:yfiles.algorithms.EdgeList):number; + /** + * This method assigns all nodes in the graph to layers and registers them + * in the {@link yfiles.hierarchic.incremental.ILayers} instance. + * In order to create new layers, the factory + * method {@link yfiles.hierarchic.incremental.ILayers#insert} must be used. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains the nodes that should be distributed + * into the layers + * @param {yfiles.hierarchic.incremental.ILayers} layers + * the object that will be filled with the results of the + * calculation + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * LayoutDataProvider that can be used to query information about + * the nodes - note that positional information + * (see {@link yfiles.hierarchic.incremental.INodeData#position} and {@link yfiles.hierarchic.incremental.INodeData#layer}) cannot + * be available at any time. + * @see {@link yfiles.hierarchic.incremental.ILayers#insert} + * @see {@link yfiles.hierarchic.incremental.ILayer#add} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerer#assignLayers}. + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + } + var GivenLayersLayerer:{ + $class:yfiles.lang.Class; + /** + * The key used by this class to query a graph for a + * DataProvider that yields the layerID for each node in the + * graph. + */ + LAYER_ID_DP_KEY:Object; + }; + export enum LayoutMode{ + /** + * Layout mode constant that can be used in {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode}. + * This constant sets the layout algorithm to incremental mode, i.e. + * fixed elements will be handled by the fixedElementsSequencer + * and fixedElementsLayerer and elements marked for incremental + * layout will be added to the drawing later. + * @see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createLayerIncrementallyHint} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#fixedElementsSequencer} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#fixedElementsLayerer} + */ + INCREMENTAL, + /** + * Layout mode constant that can be used in {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode}. + * This constant sets the layout algorithm to "from scratch mode", i.e. + * the algorithm will recompute the layout from scratch. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#layoutMode} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#fromScratchSequencer} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#fromScratchLayerer} + */ + FROM_SCRATCH + } + export enum ComponentArrangementPolicy{ + /** + * Component arrangement constant that can be used in {@link yfiles.hierarchic.IncrementalHierarchicLayouter#componentArrangementPolicy}. + * If the graph consists of multiple components this constant specifies that, after layering the single components with + * the core layerer, the components will all be merged such that an 1:1 aspect ratio is fulfilled best. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#componentArrangementPolicy} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#componentArrangementPolicy} + */ + COMPACT, + /** + * Component arrangement constant that can be used in {@link yfiles.hierarchic.IncrementalHierarchicLayouter#componentArrangementPolicy}. + * If the graph consists of multiple components this constant specifies that, after layering the single components with + * the core layerer, the components are aligned with their topmost layer. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#componentArrangementPolicy} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#componentArrangementPolicy} + */ + TOPMOST + } + export enum LayeringStrategy{ + /** + * Layering strategy specifier. A simple hierarchical layering variant. + * All nodes with indegree zero will be assigned to the topmost layer of the layout. + * The number of separate layers will be as small as possible. + * @see {@link yfiles.hierarchic.HierarchicLayouter#layeringStrategy} + */ + HIERARCHICAL_TOPMOST, + /** + * Layering strategy specifier. An optimal hierarchical layering strategy. + * The layer distance of an edge is the absolute difference between the layer numbers + * of its source and target node. + * Layer assignment will be done in such a way that the overall sum of the layer distances + * of all edges in the layout is minimal. + * @see {@link yfiles.hierarchic.HierarchicLayouter#layeringStrategy} + */ + HIERARCHICAL_OPTIMAL, + /** + * Layering strategy specifier. A heuristic that approximates the ranking done by + * {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_OPTIMAL}. + * @see {@link yfiles.hierarchic.HierarchicLayouter#layeringStrategy} + */ + HIERARCHICAL_TIGHT_TREE, + /** + * Layering strategy specifier. A fast heuristic that improves the + * the ranking done by {@link yfiles.hierarchic.LayeringStrategy#HIERARCHICAL_TOPMOST} by down shifting + * some nodes in the layering. The quality is usually worse than the + * one produced by Tight Tree Heuristic. + * @see {@link yfiles.hierarchic.HierarchicLayouter#layeringStrategy} + */ + HIERARCHICAL_DOWNSHIFT, + /** + * Layering strategy specifier. + * Layering based on a breadth first search (bfs). + * All edges will span at most one layer in + * the resulting drawing. Edges between nodes that belong to the same layer are possible. + * The nodes that will be placed in the first layer can be provided by a + * data provider bound to the input graph using the key {@link yfiles.hierarchic.BFSLayerer#CORE_NODES_DP_KEY}. + * If this data provider is not given, then nodes that have no incoming edges are placed + * in the first layer. + * @see {@link yfiles.hierarchic.HierarchicLayouter#layeringStrategy} + */ + BFS, + /** + * Layering strategy specifier. A layer assignment strategy + * that uses the initial y-coordinates of the nodes + * (x-coordinates when the layout orientation is horizontal) + * to determine a node layering. It tries to find a layering that is similar to the + * one in the input graph. When this layering strategy is used, the layouter + * may place nodes in the same layer, even though they are connected by an edge. + * These inner layer edges are always routed in an orthogonal style. + * @see {@link yfiles.hierarchic.HierarchicLayouter#layeringStrategy} + */ + FROM_SKETCH, + /** + * Layering strategy specifier. The ranks of the nodes will be given by the user. + * The node ranks must be provided by a data provider bound to the input graph + * using the key {@link yfiles.hierarchic.GivenLayersLayerer#LAYER_ID_DP_KEY}. Like + * {@link yfiles.hierarchic.LayeringStrategy#FROM_SKETCH} this layering allows inner layer edges. + * @see {@link yfiles.hierarchic.HierarchicLayouter#layeringStrategy} + */ + USER_DEFINED, + /** + * Dummy layering strategy specifier. Returned by + * {@link yfiles.hierarchic.HierarchicLayouter#layeringStrategy} if the current strategy + * is not known. + */ + UNKNOWN + } + export enum GroupAlignmentPolicy{ + /** + * Group layering alignment strategy specifier. If recursive group layering is enabled, groups and normal nodes that occupy + * the same layer are top aligned with respect to their inner layers. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#groupAlignmentPolicy} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#recursiveGroupLayering} + */ + TOP, + /** + * Group layering alignment strategy specifier. If recursive group layering is enabled, groups and normal nodes that occupy + * the same layer are center aligned with respect to their inner layers. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#groupAlignmentPolicy} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#recursiveGroupLayering} + */ + CENTER, + /** + * Group layering alignment strategy specifier. If recursive group layering is enabled, groups and normal nodes that occupy + * the same layer are bottom aligned with respect to their inner layers. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#groupAlignmentPolicy} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#recursiveGroupLayering} + */ + BOTTOM + } + export module incremental{ + /** + * Wraps a {@link yfiles.hierarchic.ILayerer} implementation from the y.layout.hierarchic + * package to behave like a {@link yfiles.hierarchic.incremental.ILayerer} implementation from the + * y.layout.hierarchic.incremental package. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#layerer} + */ + export interface OldLayererWrapper extends Object,yfiles.hierarchic.incremental.ILayerer{ + /** + * This method assigns all nodes in the graph to layers and registers them + * in the {@link yfiles.hierarchic.incremental.ILayers} instance. + * In order to create new layers, the factory + * method {@link yfiles.hierarchic.incremental.ILayers#insert} must be used. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains the nodes that should be distributed + * into the layers + * @param {yfiles.hierarchic.incremental.ILayers} layers + * the object that will be filled with the results of the + * calculation + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * LayoutDataProvider that can be used to query information about + * the nodes - note that positional information + * (see {@link yfiles.hierarchic.incremental.INodeData#position} and {@link yfiles.hierarchic.incremental.INodeData#layer}) cannot + * be available at any time. + * @see {@link yfiles.hierarchic.incremental.ILayers#insert} + * @see {@link yfiles.hierarchic.incremental.ILayer#add} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerer#assignLayers}. + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + /** + * The y.layout.hierarchic.Layerer + * instance that is used for delegation. + * @throws {yfiles.system.ArgumentNullException} if the argument is null + */ + oldLayerer:yfiles.hierarchic.ILayerer; + } + var OldLayererWrapper:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of OldLayererWrapper, wrapping the given layerer. + * @param {yfiles.hierarchic.ILayerer} oldLayerer the old layerer implementation + */ + new (oldLayerer:yfiles.hierarchic.ILayerer):yfiles.hierarchic.incremental.OldLayererWrapper; + }; + /** + * Layout stage that is used for handling a given partition grid structure ({@link yfiles.layout.PartitionGrid}) that is + * attached to a graph with DataProvider {@link yfiles.layout.PartitionGrid#PARTITION_GRID_DP_KEY}. + * Note: the IncrementalHierarchicLayouter automatically uses this stage if required. + * @see {@link yfiles.layout.PartitionGrid} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter} + */ + export interface PartitionGridLayoutStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var PartitionGridLayoutStage:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.incremental.PartitionGridLayoutStage; + }; + /** + * This class is an implementation of the {@link yfiles.hierarchic.incremental.IPortConstraintOptimizer} interface which can be registered + * with the {@link yfiles.hierarchic.incremental.HierarchicLayouter} instance using it's + * {@link yfiles.hierarchic.incremental.HierarchicLayouter#portConstraintOptimizer} method. + * It will query the graph's DataProvider repository for + * the {@link yfiles.layout.PortCandidate#SOURCE_PC_LIST_DP_KEY} and {@link yfiles.layout.PortCandidate#TARGET_PC_LIST_DP_KEY} + * keys and expects them to hold {@link yfiles.algorithms.ICollection} instances of {@link yfiles.layout.PortCandidate}s for each edge. + * Additionally it will query the DataProvider associated with {@link yfiles.layout.PortCandidateSet#NODE_DP_KEY} and expects + * {@link yfiles.layout.PortCandidateSet} instances associated with each node in the input graph. + * This implementation will then try to assign each edge one of the PortCandidates without creating too many + * crossings or violating the cost constraints for each PortCandidate. + */ + export interface PCListOptimizer extends yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer{ + /** + * Determines whether this implementation should use a deterministic algorithm to assign the PortCandidates. + */ + deterministic:boolean; + /** + * The penalty cost that is associated with each backloop. + * The default value is 1.0d. + */ + backloopPenalty:number; + /** + * The penalty cost that is associated with each generated crossing that would be generated + * if a given combination of PortCandidates would be chosen. + * The default value is 10.0d. + */ + crossingPenalty:number; + /** + * The penalty cost that is associated with each edge being assigned to a port which has no + * capacity left. + * The default value is 100.0d. + * @see {@link yfiles.layout.PortCandidateSet.IEntry#connections} + */ + overUsagePenalty:number; + /** + * Called after the layering information has been determined. + * This method can be used to assign + * new temporary port constraints for the next phases of the algorithm. + * @see {@link yfiles.hierarchic.incremental.IItemFactory#setTemporaryPortConstraint} + * @param {yfiles.layout.LayoutGraph} graph the graph to work on + * @param {yfiles.hierarchic.incremental.ILayers} layers the layering information + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the implementation which provides access to the {@link yfiles.hierarchic.incremental.INodeData} and {@link yfiles.hierarchic.incremental.IEdgeData} instances + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory the factory to set the temporary port constraints with + * @see Specified by {@link yfiles.hierarchic.incremental.IPortConstraintOptimizer#optimizeAfterLayering}. + */ + optimizeAfterLayering(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + /** + * Returns the data provider that provides the port candidate sets for nodes. + * @param {yfiles.layout.LayoutGraph} graph The graph that stores the data provider + */ + getPortCandidateSetDataProvider(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; + /** + * Called after the sequence of the nodes has been determined. + * This method can be used to assign + * new temporary port constraints for the next phases of the algorithm. + * @see {@link yfiles.hierarchic.incremental.IItemFactory#setTemporaryPortConstraint} + * @param {yfiles.layout.LayoutGraph} graph the graph to work on + * @param {yfiles.hierarchic.incremental.ILayers} layers the layering information + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the implementation which provides access to the {@link yfiles.hierarchic.incremental.INodeData} and {@link yfiles.hierarchic.incremental.IEdgeData} instances + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory the factory to set the temporary port constraints with + * @see Specified by {@link yfiles.hierarchic.incremental.IPortConstraintOptimizer#optimizeAfterSequencing}. + */ + optimizeAfterSequencing(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + /** + * Called after the sequence of the nodes has been determined to assign new temporary port constraints to each + * original node. + * Note that, in this phase, it's not allowed to create back-loops, that is, in-edges must not connect to the south + * side and out-edges must not connect to the north side. + * @param {yfiles.algorithms.Node} node the original node to set temporary port constraints at. + * @param {yfiles.objectcollections.IComparer} inEdgeOrder + * a {@link yfiles.algorithms.Comparators.IPartialOrder} which defines the preferred ordering of the in-edges from left to right. + * Note: to sort collections according to a PartialOrder, an appropriate method like {@link yfiles.algorithms.Comparators#sortListWithComparer} or {@link yfiles.algorithms.YList#sort} must be used. + * @param {yfiles.objectcollections.IComparer} outEdgeOrder + * a {@link yfiles.algorithms.Comparators.IPartialOrder} which defines the preferred ordering of the out-edges from left to + * right. Note: to sort collections according to a PartialOrder, an appropriate method like {@link yfiles.algorithms.Comparators#sortListWithComparer} or {@link yfiles.algorithms.YList#sort} must be used. + * @param {yfiles.layout.LayoutGraph} graph the graph to work on. + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the LayoutDataProvider which provides access to the {@link yfiles.hierarchic.incremental.INodeData} and {@link yfiles.hierarchic.incremental.IEdgeData}. + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory the factory which can set the temporary port constraints. + * @see {@link yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer#optimizeAfterSequencing} + */ + optimizeAfterSequencingForSingleNode(node:yfiles.algorithms.Node,inEdgeOrder:yfiles.objectcollections.IComparer,outEdgeOrder:yfiles.objectcollections.IComparer,graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + } + var PCListOptimizer:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.incremental.PCListOptimizer; + }; + /** + * This class can be used to calculate bend points for orthogonally routed + * self loops. + * It is used during the layout phase of {@link yfiles.hierarchic.incremental.HierarchicLayouter}, but + * can be used as a stand-alone tool. + */ + export interface SelfloopCalculator extends Object{ + /** + * Calculates all self loops at the given node the given graph. + * The current port positions will be used to determine the start and end ports. + * The DataProvider instances can be used to specify the direction of first + * and last segments. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the node + * @param {yfiles.algorithms.Node} node the node whose self loops will be routed + * @param {yfiles.algorithms.IDataProvider} spc + * a DataProvider that contains {@link yfiles.layout.PortConstraint} information + * for the source ports of the edges + * @param {yfiles.algorithms.IDataProvider} tpc + * a DataProvider that contains {@link yfiles.layout.PortConstraint} information + * for the target ports of the edges + */ + calculateSelfLoops(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,spc:yfiles.algorithms.IDataProvider,tpc:yfiles.algorithms.IDataProvider):void; + /** + * Convenience method that calculates a list of self-loops that belong to a given node. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the node + * @param {yfiles.algorithms.Node} node the node whose self loops will be routed + * @param {yfiles.algorithms.YList} selfLoops + * a list of {@link yfiles.algorithms.Edge}s that will be routed + * @param {yfiles.algorithms.IDataProvider} spc + * a DataProvider that contains {@link yfiles.layout.PortConstraint} information + * for the source ports of the edges + * @param {yfiles.algorithms.IDataProvider} tpc + * a DataProvider that contains {@link yfiles.layout.PortConstraint} information + * for the target ports of the edges + */ + calculateSelfLoopsForEdgeList(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,selfLoops:yfiles.algorithms.YList,spc:yfiles.algorithms.IDataProvider,tpc:yfiles.algorithms.IDataProvider):void; + /** + * Returns the minimum length for the first segment of an edge. + * The value is fetched from the corresponding data provider. + */ + getMinimumFirstSegmentLength(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; + /** + * Returns whether or not the given edge is octilinear. + * The value is fetched from the corresponding data provider. + */ + isOctilinearEdge(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):boolean; + /** + * Returns the minimum octilinear segment length for the given edge. + * The value is fetched from the corresponding data provider. + */ + getMinimumOctilinearSegmentLength(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; + /** + * Returns the minimum length for the last segment of an edge. + * The value is fetched from the corresponding data provider. + */ + getMinimumLastSegmentLength(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; + /** + * Returns the minimum length between two edges. + * The value is fetched from the corresponding data provider. + */ + getMinimumDistance(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):number; + /** + * Returns the minimum length between two nodes. + * The value is fetched from the corresponding data provider. + */ + getMinimumNodeDistance(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):number; + } + var SelfloopCalculator:{ + $class:yfiles.lang.Class; + /** + * A key used for a {@link yfiles.algorithms.IDataProvider} bound to the graph that + * yields for each node a minimum distance to the self loop edges. + */ + MINIMUM_NODE_DISTANCE_DP_KEY:Object; + /** + * A key used for a {@link yfiles.algorithms.IDataProvider} bound to the graph that + * returns for each edge whether or not it is octilinear. + */ + IS_OCTILINEAR_DP_KEY:Object; + /** + * A key used for a {@link yfiles.algorithms.IDataProvider} bound to the graph that + * yields for each octilinear edge a minimum length of its octilinear segments. + */ + MINIMUM_OCTILINEAR_SEGMENT_LENGTH_DP_KEY:Object; + /** + * A key used for a {@link yfiles.algorithms.IDataProvider} bound to the graph that + * yields for each edge a minimum length of its first segment. + */ + MINIMUM_FIRST_SEGMENT_LENGTH_DP_KEY:Object; + /** + * A key used for a {@link yfiles.algorithms.IDataProvider} bound to the graph that + * yields for each edge a minimum length of its last segment. + */ + MINIMUM_LAST_SEGMENT_LENGTH_DP_KEY:Object; + /** + * A key used for a {@link yfiles.algorithms.IDataProvider} bound to the graph that + * yields for each edge a minimum distance to the next edge or node side. + */ + MINIMUM_EDGE_DISTANCE_DP_KEY:Object; + /** + * Creates a new instance of SelfloopCalculator using the given + * parameters for minimum first segment length and minimum distance between + * each pair of edges. + * @param {number} minFirstSegmentLength + * the minimum length of the first and last segment + * of an orthogonally routed self loop + * @param {number} minEdgeDistance the minimum distance between a pair of self loops + */ + new (minFirstSegmentLength:number,minEdgeDistance:number):yfiles.hierarchic.incremental.SelfloopCalculator; + }; + /** + * This class is used by {@link yfiles.hierarchic.incremental.EdgeLayoutDescriptor} + * to specify the routing style for different edge types. + * @see {@link yfiles.hierarchic.incremental.EdgeLayoutDescriptor#routingStyle} + */ + export interface RoutingStyle extends Object{ + /** + * The routing style for back-loops. + * This style is used for routing u-turns of common edges (i.e., edges that are neither self-loops nor same layer edges). + * A u-turn is a non-monotonic part of the edge route that is required for reversed edges if option {@link yfiles.hierarchic.IncrementalHierarchicLayouter#backloopRouting} is enabled + * or in some other scenarios with port constraints/candidates. + * Possible values are {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#OCTILINEAR}, {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#ORTHOGONAL} and {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#POLYLINE}. + */ + backloopRoutingStyle:yfiles.hierarchic.incremental.EdgeRoutingStyle; + /** + * The routing style for grouped edges at the common segments. + * More precisely, grouped edges are routed + * in bus-style (i.e., the paths of the edges will share a common edge segment) and this option allows to specify + * the routing style at the bus. + * Possible values are {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#OCTILINEAR}, {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#ORTHOGONAL} and {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#POLYLINE}. + */ + edgeGroupRoutingStyle:yfiles.hierarchic.incremental.EdgeRoutingStyle; + /** + * The default routing style. + * This style is used for edges or part of edges + * for which no other routing style applies. + * Possible values are {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#OCTILINEAR}, {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#ORTHOGONAL} and {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#POLYLINE}. + */ + defaultEdgeRoutingStyle:yfiles.hierarchic.incremental.EdgeRoutingStyle; + /** + * The routing style for same layer edges (i.e., edges whose source/target are assigned to the same layer). + * Possible values are {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#OCTILINEAR}, {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#ORTHOGONAL} and {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#POLYLINE}. + */ + sameLayerEdgeRoutingStyle:yfiles.hierarchic.incremental.EdgeRoutingStyle; + /** + * The routing style for self-loops. + * Possible values are {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#OCTILINEAR}, {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#ORTHOGONAL} and {@link yfiles.hierarchic.incremental.EdgeRoutingStyle#POLYLINE}. + */ + selfloopRoutingStyle:yfiles.hierarchic.incremental.EdgeRoutingStyle; + } + var RoutingStyle:{ + $class:yfiles.lang.Class; + /** + * Sets the routing style for each edge type to the specified value. + * @param {yfiles.hierarchic.incremental.EdgeRoutingStyle} routingStyle the routing style. + */ + new (routingStyle:yfiles.hierarchic.incremental.EdgeRoutingStyle):yfiles.hierarchic.incremental.RoutingStyle; + }; + /** + * Wrapper Layerer implementation that delegates the actual layering to a + * delegate Layerer. + * If the graph consists of multiple components, they will + * be identified and sorted and each of the components will be layered separately + * using the delegate Layerer instance. After that they will all be merged + * in order using the specified {@link yfiles.hierarchic.incremental.ILayeredComponentsMerger} instance. + */ + export interface MultiComponentLayerer extends Object,yfiles.hierarchic.incremental.ILayerer{ + /** + * This method assigns all nodes in the graph to layers and registers them + * in the {@link yfiles.hierarchic.incremental.ILayers} instance. + * In order to create new layers, the factory + * method {@link yfiles.hierarchic.incremental.ILayers#insert} must be used. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains the nodes that should be distributed + * into the layers + * @param {yfiles.hierarchic.incremental.ILayers} layers + * the object that will be filled with the results of the + * calculation + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * LayoutDataProvider that can be used to query information about + * the nodes - note that positional information + * (see {@link yfiles.hierarchic.incremental.INodeData#position} and {@link yfiles.hierarchic.incremental.INodeData#layer}) cannot + * be available at any time. + * @see {@link yfiles.hierarchic.incremental.ILayers#insert} + * @see {@link yfiles.hierarchic.incremental.ILayer#add} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerer#assignLayers}. + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + /** + * Callback method that is called during {@link yfiles.hierarchic.incremental.MultiComponentLayerer#assignLayers}. + * It is responsible for sorting an array consisting of {@link yfiles.algorithms.NodeList}s, each + * containing nodes that belong to a different component. By default this method + * uses the {@link yfiles.hierarchic.incremental.MultiComponentLayerer#componentComparator ComponentComparator} to sort the list + * or does nothing if that instance is null. + * @param {yfiles.algorithms.NodeList[]} nodeLists + * the array of NodeLists each containing all nodes that belong + * to the same component + * @param {yfiles.algorithms.IDataProvider} componentIndexProvider + * a DataProvider that can be used to query the + * nodes' component indices via {@link yfiles.algorithms.IDataProvider#getInt} and/or + * {@link yfiles.algorithms.IDataProvider#get}. + */ + sort(nodeLists:yfiles.algorithms.NodeList[],componentIndexProvider:yfiles.algorithms.IDataProvider):void; + /** + * The Layerer instance that is used for delegation. + * @throws {yfiles.system.ArgumentNullException} if the argument is null + */ + singleComponentLayerer:yfiles.hierarchic.incremental.ILayerer; + /** + * The merger. + * @throws {yfiles.system.ArgumentNullException} if the argument is null + */ + merger:yfiles.hierarchic.incremental.ILayeredComponentsMerger; + /** + * The current component Comparator or null. + */ + componentComparator:yfiles.objectcollections.IComparer; + } + var MultiComponentLayerer:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of MultiComponentLayerer using the given + * delegate and a new instance of {@link yfiles.hierarchic.incremental.DefaultLayeredComponentsMerger} + * as the merger and no component comparator. + */ + new (singleComponentLayerer:yfiles.hierarchic.incremental.ILayerer):yfiles.hierarchic.incremental.MultiComponentLayerer; + /** + * Creates a new instance of MultiComponentLayerer using the given + * delegates. + */ + WithMergerAndComparer:{ + new (singleComponentLayerer:yfiles.hierarchic.incremental.ILayerer,merger:yfiles.hierarchic.incremental.ILayeredComponentsMerger,componentComparator:yfiles.objectcollections.IComparer):yfiles.hierarchic.incremental.MultiComponentLayerer; + }; + }; + /** + * This class is used by {@link yfiles.hierarchic.incremental.HierarchicLayouter} during the various + * phases to determine the drawing details of the graph's nodes. + * Note: not all of these values will be used for all kinds of nodes and + * any kind of algorithm used. + * This class is designed as a class to allow for future additions of new getter + * methods. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#NODE_LAYOUT_DESCRIPTOR_DP_KEY} + * @see {@link yfiles.hierarchic.incremental.EdgeLayoutDescriptor} + */ + export interface NodeLayoutDescriptor extends Object{ + /** + * Sets the port border gap ratio for the port distribution at the given + * side. + * @param {number} side the side + * @param {number} ratio the new ratio + */ + setPortBorderGapRatio(side:number,ratio:number):void; + /** + * The port border gap ratio for the port distribution on all sides of + * the node. + * @see {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor#setPortBorderGapRatio} + */ + portBorderGapRatios:number; + /** + * Returns the port border gap ratio for the port distribution at the given + * side. + * Default is 0.5d for all sides. + * @param {number} side the 0-based clockwise side index for top-to-bottom layouts + * @return {number} the ratio + */ + getPortBorderGapRatio(side:number):number; + /** + * The alignment of the node within its layer + * Default is 0.5d which results in center-aligned nodes. + * A value of 0.0d means nodes are aligned at the top of the layer + * (for top-down drawing). A value of 0.5d results in center-aligned nodes + * and 1.0d leads to bottom-aligned nodes. + * @throws {yfiles.system.ArgumentException} if the alignment is not within [0.0d .. 1.0d] + */ + layerAlignment:number; + /** + * The mode that determines the consideration of node labels during the + * layout. + * This can be one of {@link yfiles.hierarchic.incremental.NodeLabelMode#NEVER}, + * {@link yfiles.hierarchic.incremental.NodeLabelMode#CONSIDER_FOR_SELF_LOOPS}, + * {@link yfiles.hierarchic.incremental.NodeLabelMode#CONSIDER_FOR_DRAWING}, or + * {@link yfiles.hierarchic.incremental.NodeLabelMode#CONSIDER_FOR_ROUTING}. + * Setter:Note that in order to get this feature working the algorithm must be provided + * information about the layout of the node labels. If + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter} is used for the layout + * the {@link yfiles.hierarchic.IncrementalHierarchicLayouter#considerNodeLabels} + * should be set to true. Otherwise one has to assure that + * e.g. via an instanceof {@link yfiles.layout.LabelLayoutTranslator} the algorithm + * receives the appropriate information. + * The mode constant can be one of {@link yfiles.hierarchic.incremental.NodeLabelMode#NEVER}, + * {@link yfiles.hierarchic.incremental.NodeLabelMode#CONSIDER_FOR_SELF_LOOPS}, + * {@link yfiles.hierarchic.incremental.NodeLabelMode#CONSIDER_FOR_DRAWING}, or + * {@link yfiles.hierarchic.incremental.NodeLabelMode#CONSIDER_FOR_ROUTING}. + * Getter: + * The default is {@link yfiles.hierarchic.incremental.NodeLabelMode#CONSIDER_FOR_DRAWING}. + * @throws {yfiles.system.ArgumentException} if the constant is unknown. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#considerNodeLabels} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#considerNodeLabels} + */ + nodeLabelMode:yfiles.hierarchic.incremental.NodeLabelMode; + /** + * The minimum height of the layer this node will be assigned to. + * Note, that this will only affect the drawing if different + * {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor#layerAlignment layerAlignments} are present. + */ + minimumLayerHeight:number; + /** + * The preferred minimum distance of the node to obstacles. + * Default is 5.0d. + */ + minimumDistance:number; + /** + * A reference point relative to the center of the node which will be placed on a grid coordinate. + * By default the reference point is {@link yfiles.algorithms.YPoint#ORIGIN} and the nodes' center is placed on the grid. + *

+ * The grid reference point will only be considered if there actually is a + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter#gridSpacing grid}. + *

+ */ + gridReference:yfiles.algorithms.YPoint; + /** + * The assignment strategy which is used to distribute the ports on the node borders. + *

+ * Note that the port assignments {@link yfiles.hierarchic.incremental.PortAssignmentMode#DEFAULT}, {@link yfiles.hierarchic.incremental.PortAssignmentMode#ON_GRID} and + * {@link yfiles.hierarchic.incremental.PortAssignmentMode#ON_SUBGRID} are currently only supported in + * {@link yfiles.hierarchic.incremental.DefaultPortAllocator}. A custom implementation of + * {@link yfiles.hierarchic.incremental.IPortAllocator} will have to handle these assignments itself or will + * replace them with its own behavior. + *

+ *

+ * Note that if no grid is specified + * ({@link yfiles.hierarchic.IncrementalHierarchicLayouter#gridSpacing grid spacing} is smaller or + * equal to 0), assignment PORT_ASSIGNMENT_DEFAULT is used. + *

+ *

+ * By default {@link yfiles.hierarchic.incremental.PortAssignmentMode#DEFAULT} is used. + *

+ */ + portAssignment:yfiles.hierarchic.incremental.PortAssignmentMode; + } + var NodeLayoutDescriptor:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of a NodeLayoutDescriptor using the + * default values. + */ + new ():yfiles.hierarchic.incremental.NodeLayoutDescriptor; + }; + /** + * This class is used by {@link yfiles.hierarchic.incremental.HierarchicLayouter} during the various + * phases to associate swim lanes with each node. + * Each node should be associated with a SwimLaneDescriptor instance; + * nodes in the same lane may share one instance. + * The results of the calculation of the geometry of the swim lanes will be placed + * into the instances of this class after the layout. + * It can be bound to the layout algorithm using the + * {@link yfiles.hierarchic.incremental.HierarchicLayouter#SWIMLANE_DESCRIPTOR_DP_KEY} {@link yfiles.algorithms.IDataProvider} key. + * This class is designed as a class to allow for future additions of new getter + * methods. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#SWIMLANE_DESCRIPTOR_DP_KEY} + */ + export interface SwimLaneDescriptor extends Object,yfiles.lang.IObjectComparable,yfiles.algorithms.Comparators.IPartialOrder{ + /** + * Specifies whether the index of this swim lane is fixed or whether + * the algorithm should try to find the best possible position. + * Getter:The default is true + * Setter:

+ * For all swim lanes where this property is set to true, the relative ordering given by the client objects + * is preserved. The remaining swim lanes may be resorted so that the overall edge lengths are minimized. + *

+ *

+ * By default, this feature is enabled.

+ */ + indexFixed:boolean; + /** + * The client object. + * @throws {yfiles.system.ArgumentException} + * if there is currently no comparator set and + * the specified object is not a {@link yfiles.lang.IObjectComparable} instance. + * @see {@link yfiles.hierarchic.incremental.SwimLaneDescriptor#comparator} + * @see {@link yfiles.hierarchic.incremental.SwimLaneDescriptor#comparator} + */ + clientObject:Object; + /** + * The tightness factor of the lane. + * Setter:The greater the value the + * more will the lane to be forced to be of its minimal possible width. + * A value of 0.0d will disable compression of the lane. + * A value of 1.0d will try to force the lane to be of + * its {@link yfiles.hierarchic.incremental.SwimLaneDescriptor#minimumLaneWidth minimum width}. + * Getter:The default is 0.0d. + * @throws {yfiles.system.ArgumentException} if tightness is out of the valid range + */ + laneTightness:number; + /** + * The comparator that is used for sorting the lanes. + * @throws {yfiles.system.ArgumentNullException} + * if the specified comparator is + * null. + */ + comparator:yfiles.objectcollections.IComparer; + /** + * The minimum lane width. + * The default is 0.0d. + * @throws {yfiles.system.ArgumentException} + * if the specified value is less than + * 0. + */ + minimumLaneWidth:number; + /** + * The left lane insets where no element + * will lie in the resulting drawing. + * The default is 0.0d. + * @throws {yfiles.system.ArgumentException} + * if the specified value is less than + * 0. + */ + leftLaneInset:number; + /** + * The right lane insets where no element + * will lie in the resulting drawing. + * The default is 0.0d. + * @throws {yfiles.system.ArgumentException} + * if the specified value is less than + * 0. + */ + rightLaneInset:number; + /** + * The computed position (smaller coordinate) of the lane + * after the layout has been calculated. + */ + computedLanePosition:number; + /** + * The computed width of the lane + * after the layout has been calculated. + */ + computedLaneWidth:number; + /** + * The computed zero-based index of the lane + * after the layout has been calculated. + */ + computedLaneIndex:number; + /** + * Implements the Comparable interface using the {@link yfiles.hierarchic.incremental.SwimLaneDescriptor#comparator} and + * {@link yfiles.hierarchic.incremental.SwimLaneDescriptor#clientObject} fields. + * @see Specified by {@link yfiles.lang.IObjectComparable#compareToObject}. + */ + compareToObject(o:Object):number; + } + var SwimLaneDescriptor:{ + $class:yfiles.lang.Class; + /** + * Creates a new swim lane descriptor with an associated client object. + * @param {yfiles.lang.IObjectComparable} clientObject + * an object provided by the client that will be used + * for determining the order of the lanes. + * @throws {yfiles.system.ArgumentNullException} + * if the specified client object is + * null. + */ + new (clientObject:yfiles.lang.IObjectComparable):yfiles.hierarchic.incremental.SwimLaneDescriptor; + /** + * Creates a new swim lane descriptor using the given + * client object and comparator. + * @param {Object} clientObject a client object used for sorting the lanes + * @param {yfiles.objectcollections.IComparer} cmp a Comparator used for comparing the client objects. + * @throws {yfiles.system.ArgumentNullException} + * if the specified client object is + * null or the specified comparator is null but the + * specified client object is not a {@link yfiles.lang.IObjectComparable} instance. + */ + WithComparer:{ + new (clientObject:Object,cmp:yfiles.objectcollections.IComparer):yfiles.hierarchic.incremental.SwimLaneDescriptor; + }; + }; + /** + * This implementation returns the minimum distances for each kind of node pair + * based on their type as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + */ + export interface TypeBasedDrawingDistanceCalculator extends Object,yfiles.hierarchic.incremental.IDrawingDistanceCalculator{ + /** + * Main interface method. + * Queried by {@link yfiles.hierarchic.incremental.INodePlacer} instances to determine + * the minimum distances between elements in one layer. Note that either of the Node + * arguments may be null. In that case only the border of the non-null + * node should be considered. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the nodes + * @param {yfiles.hierarchic.incremental.ILayer} layer the layer object that contains the nodes + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that can be used to query information + * @param {yfiles.algorithms.Node} left + * the left one of the two nodes whose + * minimum distance is to be determined or null if only the left border of the right node is + * of interest. + * @param {yfiles.algorithms.Node} right + * the right one of the two nodes whose + * minimum distance is to be determined or null if only the right border of the left node is + * of interest. + * @see Specified by {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#getMinDistance}. + */ + getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.incremental.ILayer,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,left:yfiles.algorithms.Node,right:yfiles.algorithms.Node):number; + /** + * Specifies whether or not the compaction option is enabled. + * If it is enabled adjacent layer elements may be placed + * in a stacked style (i.e., horizontally interleaving). By default this option is disabled. + */ + compaction:boolean; + /** + * The distance between nodes. + */ + node2NodeDistance:number; + /** + * The distance between nodes and edges. + */ + node2EdgeDistance:number; + /** + * The distance between edges. + */ + edge2EdgeDistance:number; + /** + * Called to dispose internal data structures. + * Implementations should + * release internally held data structures here. + * @see {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#initialize} + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains all elements that are used during + * the node placement + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layers object that was used + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that was used to query information + * @see Specified by {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#dispose}. + */ + dispose(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + /** + * Called to initialize internal data structures. + * Implementations may + * cache lengthy calculations in the initialization phase. + * It is guaranteed that the graph will not be changed during subsequent + * calls to {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#getMinDistance}. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains all elements that are used during + * the node placement + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layers object that will be used during subsequent calls + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that can be used to query information + * @see {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#dispose} + * @see Specified by {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#initialize}. + */ + initialize(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + /** + * The minimum length of the first and last segment of an edge. + */ + minimumFirstSegmentLength:number; + } + var TypeBasedDrawingDistanceCalculator:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of TypeBasedDrawingDistanceCalculator. + */ + new ():yfiles.hierarchic.incremental.TypeBasedDrawingDistanceCalculator; + }; + export interface LayerConstraintFactoryCompanion extends Object{ + } + var LayerConstraintFactoryCompanion:{ + $class:yfiles.lang.Class; + /** + * DataProvider key to store the constraints. + */ + LAYER_CONSTRAINTS_MEMENTO_DP_KEY:Object; + }; + /** + * This layout stage can be used to automatically assign {@link yfiles.hierarchic.incremental.SwimLaneDescriptor} + * instances to nodes using the {@link yfiles.hierarchic.IncrementalHierarchicLayouter#SWIMLANE_DESCRIPTOR_DP_KEY} + * by treating top-level group nodes as swimlanes. + * This stage will modify the hierarchy by removing the top level group nodes and assign corresponding + * descriptors to the remaining nodes. After running the core layout, the nodes will be arranged to function as swim + * lanes. This class allows for using the current coordinates of the group nodes + * to {@link yfiles.hierarchic.incremental.TopLevelGroupToSwimlaneStage#orderSwimlanesFromSketch arrange the swim lanes from sketch}. + * Also the {@link yfiles.hierarchic.incremental.TopLevelGroupToSwimlaneStage#spacing spacing} between swim lanes may be specified. + * This stage can be {@link yfiles.layout.CanonicMultiStageLayouter#appendStage appended} + * to the {@link yfiles.hierarchic.IncrementalHierarchicLayouter}. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter} + * @see {@link yfiles.hierarchic.incremental.SwimLaneDescriptor} + * @see {@link yfiles.layout.GroupingKeys} + */ + export interface TopLevelGroupToSwimlaneStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Determines the spacing between the lanes. + * The default is 0.0d. + */ + spacing:number; + /** + * Determines whether the order of the swimlanes should be read from the current sketch. + * The default is false. + */ + orderSwimlanesFromSketch:boolean; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var TopLevelGroupToSwimlaneStage:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.incremental.TopLevelGroupToSwimlaneStage; + }; + /** + * Inserts nodes incrementally into an existing layer structure, without destroying + * the latter. + * Nodes are inserted such that the length of backwards pointing edges + * is minimized (not their number!). The method implemented will insert new layers + * into the current layering if necessary at locally optimal positions. + */ + export interface TopologicalIncrementalLayerer extends Object,yfiles.hierarchic.incremental.ILayerer{ + /** + * Calculates an optimal layering for incremental nodes. + * @param {yfiles.layout.LayoutGraph} graph + * the graph containing all nodes in layers and all nodes in incrementalNodes as + * well as the respective edges. + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layers structure containing all nodes but the incremental ones. + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerer#assignLayers}. + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + /** + * The{@link yfiles.hierarchic.incremental.ILayerer} instance used for the layering of separate + * components. + * Default is an instance of {@link yfiles.hierarchic.incremental.OldLayererWrapper} wrapping a + * {@link yfiles.hierarchic.WeightedLayerer}. + */ + separateComponentsLayerer:yfiles.hierarchic.incremental.ILayerer; + /** + * The{@link yfiles.hierarchic.incremental.ILayeredComponentsMerger} instance that will be used to + * merge the layers of separate components into the current layering. + * Default is {@link yfiles.hierarchic.incremental.DefaultLayeredComponentsMerger} + */ + layeredComponentsMerger:yfiles.hierarchic.incremental.ILayeredComponentsMerger; + } + var TopologicalIncrementalLayerer:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of IncrementalLayerer. + */ + new ():yfiles.hierarchic.incremental.TopologicalIncrementalLayerer; + }; + /** + * This LayerSequencer implementation returns a sequencing that satisfies + * a comparator constraint. + */ + export interface GivenSequenceSequencer extends Object,yfiles.hierarchic.incremental.ISequencer{ + /** + * The comparator used by this GivenSequenceSequencer. + */ + sequenceComparator:yfiles.objectcollections.IComparer; + /** + * Called by {@link yfiles.hierarchic.incremental.HierarchicLayouter} during the second phase. + * Calculates a sequence of the nodes in layers and finally + * writes back the calculated sequence using the {@link yfiles.hierarchic.incremental.ILayer#setNodeOrder} + * method. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the elements from layers + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layer implementation that holds the Layers for sequencing + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the LayoutDataProvider that provides the necessary {@link yfiles.hierarchic.incremental.INodeData} + * and {@link yfiles.hierarchic.incremental.IEdgeData} + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory + * an ItemFactory implementation that can be used to modify the + * graph consistently + * @see Specified by {@link yfiles.hierarchic.incremental.ISequencer#sequenceNodeLayers}. + */ + sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + } + var GivenSequenceSequencer:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of GivenSequenceSequencer. + */ + new ():yfiles.hierarchic.incremental.GivenSequenceSequencer; + /** + * Creates a new instance of GivenSequenceSequencer using the specified + * comparator for the sequencing. + */ + WithComparer:{ + new (c:yfiles.objectcollections.IComparer):yfiles.hierarchic.incremental.GivenSequenceSequencer; + }; + }; + /** + * NodePlacer implementation based on {@link yfiles.algorithms.RankAssignments rank-assignment}. + * The drawer works with integer values and rounds double values to + * integers using sophisticated quantizing. + */ + export interface SimplexNodePlacer extends Object,yfiles.hierarchic.incremental.INodePlacer{ + /** + * Specifies whether or not nodes should be placed in a more compact style with respect to layout width. + * If enabled, the algorithm may place the nodes of a layer in a stacked style (horizontally interleaving), i.e., + * it splits the layer into an upper and lower sublayer and places adjacent nodes into different sublayers if + * this reduces the width of the layer. + * Note that enabling this option increases the required layout height. + * By default this option is disabled. + * Note that this option does not work with customized {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator}s, + * see {@link yfiles.hierarchic.incremental.HierarchicLayouter#drawingDistanceCalculator}. + * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer#minimumSublayerDistance} + * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer#assignNodesToSublayer} + * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer#minimumSublayerDistance} + * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer#assignNodesToSublayer} + */ + nodeCompaction:boolean; + /** + * The minimum distance between the upper and lower sublayer (see{@link yfiles.hierarchic.incremental.SimplexNodePlacer#nodeCompaction}). + * Note that this option is only considered if the node compaction is enabled. + * Furthermore, a too small distance value may prevent adjacent nodes from being placed in a stacked style + * (horizontally interleaving) because the vertical distance between these nodes must be larger or equal to the value + * specified by {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor#minimumDistance}. + * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer#nodeCompaction} + * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer#nodeCompaction} + */ + minimumSublayerDistance:number; + /** + * Specifies whether or not labels should be placed in a more compact style. + * If this option is enabled the algorithm + * tries to place adjacent label elements in a stacked style, i.e., horizontally interleaving. + * By default this option is disabled. + * Note that this option does not work with customized {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator}s, + * see {@link yfiles.hierarchic.incremental.HierarchicLayouter#drawingDistanceCalculator}. + */ + labelCompaction:boolean; + /** + * Specifies whether or not an optimization step should be applied that tries to further reduce the number of bends. + * By default this option is enabled. + * Note: using this option may increase runtime. If the runtime exceeds the maximal duration + * (see {@link yfiles.hierarchic.incremental.SimplexNodePlacer#maximalDuration}) the number of bends is not reduced. + * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer#maximalDuration} + */ + bendReductionEnabled:boolean; + /** + * Specifies whether this instance tries to create a maximally compact horizontal layout at the cost of more bends. + *

+ * For best results, {@link yfiles.hierarchic.incremental.SimplexNodePlacer#breakLongSegments} and {@link yfiles.hierarchic.incremental.SimplexNodePlacer#labelCompaction} should also be enabled. + *

+ * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer#labelCompaction} + * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer#breakLongSegments} + */ + horizontalCompaction:boolean; + /** + * Specifies whether a postprocessing step should be applied that tries to remove some bends. + * Note that this option is only considered if option {@link yfiles.hierarchic.incremental.SimplexNodePlacer#baryCenterMode} + * and {@link yfiles.hierarchic.incremental.SimplexNodePlacer#nodeCompaction} are both disabled. + * Furthermore, enabling edge straightening may violate some minimum distances specified by the user + * and the edge distribution is no longer uniform. + *

+ * The default is false. + *

+ */ + straightenEdges:boolean; + /** + * The strategy that is used to control the horizontal compactness + * of group nodes. + * @see {@link yfiles.hierarchic.incremental.GroupCompactionPolicy#MAXIMAL} + * @see {@link yfiles.hierarchic.incremental.GroupCompactionPolicy#NONE} + * @see {@link yfiles.hierarchic.incremental.GroupCompactionPolicy#MAXIMAL} + * @see {@link yfiles.hierarchic.incremental.GroupCompactionPolicy#NONE} + */ + groupCompactionStrategy:yfiles.hierarchic.incremental.GroupCompactionPolicy; + /** + * Specifies whether this instance should enforce the placement of nodes at + * their exact current position, even if this violates minimum distance + * constraints. + *

+ * The default is true. + *

+ */ + exactPlacementEnforced:boolean; + /** + * Specifies whether this instance tries to use the coordinates given from the current sketch for + * the determination of the layer coordinates. + */ + fromSketchLayerAssignment:boolean; + /** + * The time limit (in milliseconds) set for the algorithm. + * Note that restricting the maximal duration may result in a worse layout quality. + * Furthermore, the real runtime may exceed the maximal duration since the algorithm + * still have to find a valid solution. + */ + maximalDuration:number; + /** + * The relative weight of edges crossing a swim lane relative to edges that stay + * in their lane. + *

+ * A value of 0.0d will effectively make the algorithm + * ignore edges crossing a swim lane border. + *

+ *

+ * Defaults to 0.0d. + *

+ */ + swimLaneCrossingWeight:number; + /** + * Specifies whether or not to use the barycenter drawing mode. + * If this mode is enabled the resulting drawing is likely to have more bends + * but may be more symmetric. + *

+ * By default this mode is turned off. + *

+ */ + baryCenterMode:boolean; + /** + * Invoked by {@link yfiles.hierarchic.incremental.HierarchicLayouter} before the ports get assigned. + * This method is used to assign preliminary y coordinates for each layer. + * The distance between two layers will be adjusted later by the edge routing + * algorithm. This method is responsible for assigning the relative positions + * of the nodes within each layer. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the elements + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} layoutDataProvider + * the LayoutDataProvider that contains information about + * the elements + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layers that shall be calculated by this method + * @see Specified by {@link yfiles.hierarchic.incremental.INodePlacer#assignLayerCoordinates}. + */ + assignLayerCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.incremental.ILayoutDataProvider,layers:yfiles.hierarchic.incremental.ILayers):void; + /** + * If option {@link yfiles.hierarchic.incremental.SimplexNodePlacer#nodeCompaction} is enabled, this method is called to assign the nodes + * of a layer to the corresponding upper/lower sublayer. + * @param {yfiles.algorithms.NodeList} layerNodes + * list that contains all normal nodes (see {@link yfiles.hierarchic.incremental.NodeDataType#NORMAL}) of a layer. + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider instance. + * @param {yfiles.layout.LayoutGraph} graph the graph instance. + * @param {yfiles.algorithms.INodeMap} lowerSublayer + * NodeMap whose {@link yfiles.algorithms.INodeMap#getBool} method has to return true + * for each node that should be placed in the lower sublayer (values are set by this method). + * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer#nodeCompaction} + */ + assignNodesToSublayer(layerNodes:yfiles.algorithms.NodeList,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,graph:yfiles.layout.LayoutGraph,lowerSublayer:yfiles.algorithms.INodeMap):void; + /** + * Callback used by both {@link yfiles.hierarchic.incremental.SimplexNodePlacer#assignLayerCoordinates} + * and {@link yfiles.hierarchic.incremental.SimplexNodePlacer#assignSequenceCoordinates} + * to determine whether the given node should be treated as a node with fixed (given) coordinates. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the node + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} provider the current LayoutDataProvider + * @param {yfiles.algorithms.Node} node the node + * @param {boolean} inLayer + * whether the nodes' layer coordinate is queried or the sequence coordinate. + * Iff inLayer is true this method is called from within the + * {@link yfiles.hierarchic.incremental.SimplexNodePlacer#assignLayerCoordinates} + * method + * @return {boolean} whether the node should be treated as fixed + */ + isFixedNode(graph:yfiles.layout.LayoutGraph,provider:yfiles.hierarchic.incremental.ILayoutDataProvider,node:yfiles.algorithms.Node,inLayer:boolean):boolean; + /** + * Callback method used by {@link yfiles.hierarchic.incremental.SimplexNodePlacer#assignLayerCoordinates} + * to determine the minimum height of a layer. + */ + getMinimumLayerHeight(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,layer:yfiles.hierarchic.incremental.ILayer):number; + /** + * Callback method used by {@link yfiles.hierarchic.incremental.SimplexNodePlacer#assignLayerCoordinates} + * to determine the alignment of the node inside the layer. + */ + getLayerAlignment(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,node:yfiles.algorithms.Node,layerIndex:number,minLayerHeight:number):number; + /** + * Invoked by {@link yfiles.hierarchic.incremental.HierarchicLayouter} to determine the resulting x coordinates. + * This method is invoked after all ports have been assigned their final relative + * coordinates and nodes have been given relative coordinates within each layer. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the elements + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} layoutDataProvider + * the LayoutDataProvider that contains information about + * the elements + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layers that shall be calculated by this method + * @param {yfiles.hierarchic.incremental.IDrawingDistanceCalculator} drawingDistanceCalculator + * an instance that can be queried to determine + * the minimum distance between each pair of nodes in the graph + * @see Specified by {@link yfiles.hierarchic.incremental.INodePlacer#assignSequenceCoordinates}. + */ + assignSequenceCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.incremental.ILayoutDataProvider,layers:yfiles.hierarchic.incremental.ILayers,drawingDistanceCalculator:yfiles.hierarchic.incremental.IDrawingDistanceCalculator):void; + /** + * Determines the minimum allowed distance between two nodes in a given layer. + * @see {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator} + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the nodes + * @param {yfiles.hierarchic.incremental.ILayer} layer the layer that contains the nodes + * @param {yfiles.algorithms.Node} predNode the node to the left of the other one, may be null to indicate a border line + * @param {yfiles.algorithms.Node} succ the node to the right of the other one, may be null to indicate a border line + * @return {number} the minimum distance allowed between those two nodes ( >=0 ) + */ + getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.incremental.ILayer,predNode:yfiles.algorithms.Node,succ:yfiles.algorithms.Node):number; + /** + * Specifies whether this instance may break long edge segments in favor of a more compact layout. + */ + breakLongSegments:boolean; + } + var SimplexNodePlacer:{ + $class:yfiles.lang.Class; + new ():yfiles.hierarchic.incremental.SimplexNodePlacer; + }; + export enum EdgeRoutingStyle{ + /** + * Routing style constant. + * This constant specifies that the route should be orthogonal, i.e., the route only consists of + * vertical and horizontal segments. + */ + ORTHOGONAL, + /** + * Routing style constant. + * This constant specifies that the route should be octilinear, i.e., the route consists of + * vertical and horizontal segments as well as segments with slope -1 and 1. + */ + OCTILINEAR, + /** + * Routing style constant. + * This constant specifies that the route should be polyline. + */ + POLYLINE + } + /** + * Helper class that is used to manage hierarchically grouped graphs. + */ + export interface GroupingSupport extends Object{ + /** + * Hides the group nodes and adjacent edges from the graph. + */ + hideGroupNodes():void; + /** + * Unhides all previously hidden group nodes and adjacent edges. + */ + unhideGroupNodes():void; + minimumGroupDistance:number; + assignEdgeGroupNodesToGroups(layers:yfiles.hierarchic.incremental.ILayers):void; + removeEdgeGroupAssignment(layers:yfiles.hierarchic.incremental.ILayers):void; + /** + * Returns whether or not the given node is a non-empty group node. + */ + isGroupNode(node:yfiles.algorithms.Node):boolean; + assignLabelNodesToGroups(layers:yfiles.hierarchic.incremental.ILayers,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + /** + * Specifies whether or not groupingSupport is active. + * All return values of the methods of this + * class will be invalid if groupingSupport is inactive. + */ + active:boolean; + /** + * Visits all descendants of the given group node. + */ + visitDecendants(groupNode:yfiles.algorithms.Node,visitor:yfiles.hierarchic.incremental.GroupingSupport.IVisitor):void; + /** + * Returns all direct and indirect children of the given group node. + */ + getDecendants(groupNode:yfiles.algorithms.Node):yfiles.algorithms.NodeList; + /** + * Returns the direct children of the given group node. + */ + getChildren(groupNode:yfiles.algorithms.Node):yfiles.algorithms.NodeList; + /** + * Returns the parent group node of the given node, or null if the given node is a top-level node. + */ + getParentNode(node:yfiles.algorithms.Node):yfiles.algorithms.Node; + /** + * Returns whether or not the given node is a direct or indirect child of the given group node. + */ + isDescendant(node:yfiles.algorithms.Node,groupNode:yfiles.algorithms.Node):boolean; + } + export module GroupingSupport{ + /** + * Visitor interface that can be used to traverse the descendants of a group node. + */ + export interface IVisitor extends Object{ + visit(node:yfiles.algorithms.Node,parentNode:yfiles.algorithms.Node):void; + } + } + var GroupingSupport:{ + $class:yfiles.lang.Class; + }; + /** + * Wrapper Layerer implementation that delegates the actual layering to a + * delegate Layerer. + * If the graph consists of multiple components, they will + * be identified and each of the components will be layered separately + * using the delegate Layerer instance. After that they will all be merged + * such that the desired aspect ratio is fulfilled best. + * Note that for grouped graphs the desired aspect ratio is also considered for each group node separately. + * @see {@link yfiles.hierarchic.incremental.AspectRatioComponentLayerer#desiredAspectRatio} + * @see {@link yfiles.hierarchic.incremental.MultiComponentLayerer} + */ + export interface AspectRatioComponentLayerer extends Object,yfiles.hierarchic.incremental.ILayerer{ + /** + * The Layerer instance that is used for delegation. + * @throws {yfiles.system.ArgumentNullException} if the argument is null + */ + singleComponentLayerer:yfiles.hierarchic.incremental.ILayerer; + /** + * Specifies whether the node size should be considered. + * If this option is disabled, all nodes are considered to be of equal size. + * Hence, the given aspect ratio specifies the ratio between the number of nodes within a layer and the overall number of layers. + * The default value is true. + */ + considerNodeSize:boolean; + /** + * The desired aspect ratio. + * If the graph consists of multiple components, they will + * be identified and each of the components will be layered separately + * using the delegate Layerer instance. After that they will all be merged + * such that the desired aspect ratio is fulfilled best. + * Note that for grouped graphs the desired aspect ratio is also considered for each group node separately. + */ + desiredAspectRatio:number; + /** + * This method assigns all nodes in the graph to layers and registers them + * in the {@link yfiles.hierarchic.incremental.ILayers} instance. + * In order to create new layers, the factory + * method {@link yfiles.hierarchic.incremental.ILayers#insert} must be used. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains the nodes that should be distributed + * into the layers + * @param {yfiles.hierarchic.incremental.ILayers} layers + * the object that will be filled with the results of the + * calculation + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * LayoutDataProvider that can be used to query information about + * the nodes - note that positional information + * (see {@link yfiles.hierarchic.incremental.INodeData#position} and {@link yfiles.hierarchic.incremental.INodeData#layer}) cannot + * be available at any time. + * @see {@link yfiles.hierarchic.incremental.ILayers#insert} + * @see {@link yfiles.hierarchic.incremental.ILayer#add} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerer#assignLayers}. + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + } + var AspectRatioComponentLayerer:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of AspectRatioComponentLayerer using the given + * delegate. + */ + new (singleComponentLayerer:yfiles.hierarchic.incremental.ILayerer):yfiles.hierarchic.incremental.AspectRatioComponentLayerer; + }; + /** + * Sequencer implementation that returns a sequencing that + * corresponds to the current drawing. + */ + export interface AsIsSequencer extends Object,yfiles.hierarchic.incremental.ISequencer{ + /** + * Called by {@link yfiles.hierarchic.incremental.HierarchicLayouter} during the second phase. + * Calculates a sequence of the nodes in layers and finally + * writes back the calculated sequence using the {@link yfiles.hierarchic.incremental.ILayer#setNodeOrder} + * method. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the elements from layers + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layer implementation that holds the Layers for sequencing + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the LayoutDataProvider that provides the necessary {@link yfiles.hierarchic.incremental.INodeData} + * and {@link yfiles.hierarchic.incremental.IEdgeData} + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory + * an ItemFactory implementation that can be used to modify the + * graph consistently + * @see Specified by {@link yfiles.hierarchic.incremental.ISequencer#sequenceNodeLayers}. + */ + sequenceNodeLayers(g:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + } + var AsIsSequencer:{ + $class:yfiles.lang.Class; + /** + * Creates a new AsIsSequencer. + */ + new ():yfiles.hierarchic.incremental.AsIsSequencer; + }; + /** + * A partial implementation of the {@link yfiles.hierarchic.incremental.IPortConstraintOptimizer} interface to minimize the effort required to modify + * the port assignment after the sequencing phase. + * In this class, the + * {@link yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer#optimizeAfterSequencing callback method invoked after sequencing} temporarily restores all + * same layer edges which, otherwise, wouldn't be present in the layout graph at this time of the algorithm, then + * invokes the hook in which the custom port assignment should be done, and finally takes care to restore the original + * state of the layout graph by removing the temporary edges. + */ + export interface AbstractPortConstraintOptimizer extends Object,yfiles.hierarchic.incremental.IPortConstraintOptimizer{ + /** + * The mirror mask that defines which orientations should be mirrored. + * Setting a layout orientation can be + * seen as rotating the graph 90, 180 or 270 degrees. Afterwards the graph can be mirrored at the x-Axis (for + * horizontal layout orientations) or y-Axis (for vertical layout orientations). Which directions are mirrored can be + * defined by the given mask. + * By default a mirror mask is set, where {@link yfiles.layout.LayoutOrientation#BOTTOM_TO_TOP} will be mirrored at the + * y-Axis. + * @see {@link yfiles.layout.MirrorMask#BOTTOM_TO_TOP} + * @see {@link yfiles.layout.MirrorMask#LEFT_TO_RIGHT} + * @see {@link yfiles.layout.MirrorMask#RIGHT_TO_LEFT} + * @see {@link yfiles.layout.MirrorMask#TOP_TO_BOTTOM} + * @see {@link yfiles.layout.MirrorMask#BOTTOM_TO_TOP} + * @see {@link yfiles.layout.MirrorMask#LEFT_TO_RIGHT} + * @see {@link yfiles.layout.MirrorMask#RIGHT_TO_LEFT} + * @see {@link yfiles.layout.MirrorMask#TOP_TO_BOTTOM} + */ + mirrorMask:yfiles.layout.MirrorMask; + /** + * The currently set layout orientation for this class. + * This setting is necessary to correctly interpret the values + * provided in the {@link yfiles.layout.PortCandidate}s since the {@link yfiles.layout.OrientationLayouter} cannot automatically + * adjust these values. + * @see {@link yfiles.layout.CanonicMultiStageLayouter#layoutOrientation} + */ + layoutOrientation:yfiles.layout.LayoutOrientation; + /** + * Called after the layering information has been determined. + * This method can be used to assign new temporary port + * constraints for the next phases of the algorithm. In this phase, it is possible to create back-loops by assigning + * in-edges to the south side or out-edges to the north side, respectively. + * @param {yfiles.layout.LayoutGraph} graph the graph to work on + * @param {yfiles.hierarchic.incremental.ILayers} layers the layering information + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the implementation which provides access to the {@link yfiles.hierarchic.incremental.INodeData} and {@link yfiles.hierarchic.incremental.IEdgeData} instances + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory the factory to set the temporary port constraints with + * @see {@link yfiles.hierarchic.incremental.IItemFactory#setTemporaryPortConstraint} + * @see Specified by {@link yfiles.hierarchic.incremental.IPortConstraintOptimizer#optimizeAfterLayering}. + */ + optimizeAfterLayering(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + /** + * Called after the sequence of the nodes has been determined to assign new temporary port constraints. + * This method + * {@link yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer#insertSameLayerStructures inserts the same layer strucutres}, invokes + * {@link yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer#optimizeAfterSequencingForSingleNode the hook} + * in which the custom port assignment should be done, and finally takes care to {@link yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer#removeSameLayerStructures restore the original state} of the layout graph by removing the temporary edges. + * @param {yfiles.layout.LayoutGraph} graph the graph to work on. + * @param {yfiles.hierarchic.incremental.ILayers} layers the layering information. + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the LayoutDataProvider which provides access to the {@link yfiles.hierarchic.incremental.INodeData} and {@link yfiles.hierarchic.incremental.IEdgeData}. + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory the factory which can set the temporary port constraints. + * @see Specified by {@link yfiles.hierarchic.incremental.IPortConstraintOptimizer#optimizeAfterSequencing}. + */ + optimizeAfterSequencing(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + /** + * Called after the sequence of the nodes has been determined to assign new temporary port constraints to all nodes. + * This method invokes + * {@link yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer#optimizeAfterSequencingForSingleNode} + * for every node of the original layout graph, and omits the nodes of the same layer structures. + * Note that, in this phase, it's not allowed to create back-loops, that is, in-edges must not connect to the south + * side and out-edges must not connect to the north side. + * @param {yfiles.objectcollections.IComparer} inEdgeOrder + * a {@link yfiles.algorithms.Comparators.IPartialOrder} which defines the preferred ordering of the in-edges from left to right. + * Note: to sort collections according to a PartialOrder, an appropriate method like {@link yfiles.algorithms.Comparators#sortListWithComparer} or {@link yfiles.algorithms.YList#sort} must be used. + * @param {yfiles.objectcollections.IComparer} outEdgeOrder + * a {@link yfiles.algorithms.Comparators.IPartialOrder} which defines the preferred ordering of the out-edges from left to + * right. Note: to sort collections according to a PartialOrder, an appropriate method like {@link yfiles.algorithms.Comparators#sortListWithComparer} or {@link yfiles.algorithms.YList#sort} must be used. + * @param {yfiles.layout.LayoutGraph} graph the graph to work on. + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the LayoutDataProvider which provides access to the {@link yfiles.hierarchic.incremental.INodeData} and {@link yfiles.hierarchic.incremental.IEdgeData}. + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory the factory which can set the temporary port constraints. + * @see {@link yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer#optimizeAfterSequencing} + */ + optimizeAfterSequencingForAllNodes(inEdgeOrder:yfiles.objectcollections.IComparer,outEdgeOrder:yfiles.objectcollections.IComparer,graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + /** + * Called after the sequence of the nodes has been determined to assign new temporary port constraints to each + * original node. + * Note that, in this phase, it's not allowed to create back-loops, that is, in-edges must not connect to the south + * side and out-edges must not connect to the north side. + * @param {yfiles.algorithms.Node} node the original node to set temporary port constraints at. + * @param {yfiles.objectcollections.IComparer} inEdgeOrder + * a {@link yfiles.algorithms.Comparators.IPartialOrder} which defines the preferred ordering of the in-edges from left to right. + * Note: to sort collections according to a PartialOrder, an appropriate method like {@link yfiles.algorithms.Comparators#sortListWithComparer} or {@link yfiles.algorithms.YList#sort} must be used. + * @param {yfiles.objectcollections.IComparer} outEdgeOrder + * a {@link yfiles.algorithms.Comparators.IPartialOrder} which defines the preferred ordering of the out-edges from left to + * right. Note: to sort collections according to a PartialOrder, an appropriate method like {@link yfiles.algorithms.Comparators#sortListWithComparer} or {@link yfiles.algorithms.YList#sort} must be used. + * @param {yfiles.layout.LayoutGraph} graph the graph to work on. + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the LayoutDataProvider which provides access to the {@link yfiles.hierarchic.incremental.INodeData} and {@link yfiles.hierarchic.incremental.IEdgeData}. + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory the factory which can set the temporary port constraints. + * @see {@link yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer#optimizeAfterSequencing} + */ + optimizeAfterSequencingForSingleNode(node:yfiles.algorithms.Node,inEdgeOrder:yfiles.objectcollections.IComparer,outEdgeOrder:yfiles.objectcollections.IComparer,graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + /** + * Inserts a same layer edge structure for each same layer edge of the original graph. + * Note that, in this phase of the layout, + * the graph does not contain any same layer edges. The structure for a same layer edge (s,t) consists of + * a temporary node w and the edges (s,w) and (t,w). + * @param {yfiles.layout.LayoutGraph} graph the graph to work on. + * @param {yfiles.hierarchic.incremental.ILayers} layers the layering information. + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the LayoutDataProvider which provides access to the {@link yfiles.hierarchic.incremental.INodeData} and {@link yfiles.hierarchic.incremental.IEdgeData}. + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory the factory which can set the temporary port constraints. + * @see {@link yfiles.hierarchic.incremental.IItemFactory#setTemporaryPortConstraint} + */ + insertSameLayerStructures(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer.SameLayerData; + /** + * Removes the same layer edge structure created in {@link yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer#insertSameLayerStructures}. + * @param {yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer.SameLayerData} sameLayerData the information about the same layer structures. + * @param {yfiles.layout.LayoutGraph} graph the graph to work on. + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the LayoutDataProvider which provides access to the {@link yfiles.hierarchic.incremental.INodeData} and {@link yfiles.hierarchic.incremental.IEdgeData}. + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory the factory which can set the temporary port constraints. + * @see {@link yfiles.hierarchic.incremental.IItemFactory#setTemporaryPortConstraint} + */ + removeSameLayerStructures(sameLayerData:yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer.SameLayerData,graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + } + export module AbstractPortConstraintOptimizer{ + /** + * Provides information about the same layer structures created by class {@link yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer}. + */ + export interface SameLayerData extends Object{ + /** + * Adds a new dummy node and associates it with the given original (same layer) edge. + * @param {yfiles.algorithms.Node} sameLayerDummy a dummy node. + * @param {yfiles.algorithms.Edge} originalEdge the original (same layer) edge associated to the sameLayerDummy. + */ + addDummyNode(sameLayerDummy:yfiles.algorithms.Node,originalEdge:yfiles.algorithms.Edge):void; + /** + * All dummy nodes. + */ + dummyNodes:yfiles.algorithms.NodeList; + /** + * Returns the original (same layer) edge associated with the given dummy node. + * @param {yfiles.algorithms.Node} sameLayerDummy a dummy node. + * @return {yfiles.algorithms.Edge} the original (same layer) edge associated with the given dummy node. + */ + getOriginalEdge(sameLayerDummy:yfiles.algorithms.Node):yfiles.algorithms.Edge; + } + } + var AbstractPortConstraintOptimizer:{ + $class:yfiles.lang.Class; + /** + * Creates a new AbstractPortConstraintOptimizer. + */ + new ():yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer; + SameLayerData:{ + $class:yfiles.lang.Class; + /** + * Creates a new SameLayerData. + */ + new ():yfiles.hierarchic.incremental.AbstractPortConstraintOptimizer; + }; + }; + /** + * This class can be used to create hierarchical layouts of graphs. + * It has built-in support for incrementally adding elements to a previously + * calculated layout or optimizing existing elements + * of a previously calculated layout. + * In order to customize this layout algorithm, modify the + * {@link yfiles.hierarchic.incremental.HierarchicLayouter#layerer Layerer}, {@link yfiles.hierarchic.incremental.HierarchicLayouter#sequencer Sequencer}, + * {@link yfiles.hierarchic.incremental.HierarchicLayouter#portAllocator PortAllocator}, + * {@link yfiles.hierarchic.incremental.HierarchicLayouter#drawingDistanceCalculator DrawingDistanceCalculator}, and + * {@link yfiles.hierarchic.incremental.HierarchicLayouter#nodePlacer NodePlacer} instances. + * Use the {@link yfiles.hierarchic.incremental.HierarchicLayouter#INCREMENTAL_HINTS_DP_KEY} {@link yfiles.algorithms.IDataProvider} key to + * associate incremental hints with the elements in the graph. + * Incremental Hints can be obtained from the + * {@link yfiles.hierarchic.incremental.HierarchicLayouter#createIncrementalHintsFactory IncrementalHintsFactory}. + * They are used by the algorithm to determine which elements in the graph + * have to be inserted/updated incrementally. + * This layout algorithm respects {@link yfiles.layout.PortConstraint}s, that are bound to + * the graph using the {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} and + * {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} as well as + * {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} and + * {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} DataProviders that can be used + * to create bus-like edge routings. + * Fine-grained configuration of the layout style + * is supported via DataProviders that are bound to the graph using the + * {@link yfiles.hierarchic.incremental.HierarchicLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} and {@link yfiles.hierarchic.incremental.HierarchicLayouter#NODE_LAYOUT_DESCRIPTOR_DP_KEY} + * DataProvider keys. + * They can be used to associate {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor} and + * {@link yfiles.hierarchic.incremental.EdgeLayoutDescriptor} instances with each element in the graph. These + * may be shared. + * This algorithm sets a {@link yfiles.layout.LabelLayoutTranslator} instance as the current + * {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter} and configures it so that + * the node labels are passed to by setting {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} + * to true. + * In order to enable integrated edge labeling of this algorithm, make sure + * {@link yfiles.layout.LabelLayoutTranslator} is registered and edge labels are being translated + * and written back after the layout. + * This algorithm also support swimlane style drawings. This can be enabled by + * associating {@link yfiles.hierarchic.incremental.SwimLaneDescriptor} instances with the nodes in the graph + * using the {@link yfiles.hierarchic.incremental.HierarchicLayouter#SWIMLANE_DESCRIPTOR_DP_KEY} DataProvider key. + * Moreover, this algorithm supports sequence constraints. These constraints + * can be specified using a {@link yfiles.hierarchic.incremental.ISequenceConstraintFactory}. + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter} + * @see {@link yfiles.hierarchic.incremental.ILayerer} + * @see {@link yfiles.hierarchic.incremental.ISequencer} + * @see {@link yfiles.hierarchic.incremental.IPortAllocator} + * @see {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator} + * @see {@link yfiles.hierarchic.incremental.INodePlacer} + */ + export interface HierarchicLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * Factory method for the + * {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter label layouter} + * used by this layouter. + * In order to use the the integrated node label awareness feature one has to + * use an {@link yfiles.layout.LabelLayoutTranslator} instance with + * {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} + * set to true. + * Likewise in order to make use of the integrated edge labeling + * {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} must + * be set to true and + * {@link yfiles.layout.LabelLayoutTranslator#writeBackEdgeLabels} must + * be set to true also (which is the default). + * @return {yfiles.layout.ILayoutStage} + * a new LabelLayoutTranslator with node translation enabled + * and "node label write back" disabled. + */ + createLabelLayouter():yfiles.layout.ILayoutStage; + /** + * Factory method that is called lazily upon first usage. + * @return {yfiles.hierarchic.incremental.ILayerer} a default implementation (new MultiComponentLayerer(new OldLayererWrapper(new WeightedLayerer()))) + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#layerer} + * @see {@link yfiles.hierarchic.incremental.MultiComponentLayerer} + * @see {@link yfiles.hierarchic.incremental.OldLayererWrapper} + * @see {@link yfiles.hierarchic.WeightedLayerer} + */ + createLayerer():yfiles.hierarchic.incremental.ILayerer; + /** + * Specifies whether or not ComponentLayouter is enabled. + * By default it is disabled. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#componentLayouterEnabled} + */ + componentLayouterEnabled:boolean; + /** + * The time limit (in milliseconds) set for the layout algorithm. + * Note that restricting the maximal duration may result in a worse layout quality. + * Furthermore, the real runtime may exceed the maximal duration since the layout algorithm + * still have to find a valid solution. + */ + maximalDuration:number; + /** + * Factory method that is called lazily upon first usage. + * @return {yfiles.hierarchic.incremental.ISequencer} a default implementation (new DefaultLayerSequencer()) + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#sequencer} + * @see {@link yfiles.hierarchic.incremental.DefaultLayerSequencer} + */ + createSequencer():yfiles.hierarchic.incremental.ISequencer; + /** + * Factory method that is called lazily upon first usage. + * @return {yfiles.hierarchic.incremental.IDrawingDistanceCalculator} a default implementation (new DefaultDrawingDistanceCalculator()) + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#drawingDistanceCalculator} + */ + createDrawingDistanceCalculator():yfiles.hierarchic.incremental.IDrawingDistanceCalculator; + /** + * Factory method that is called lazily upon first usage. + * @return {yfiles.hierarchic.incremental.IPortAllocator} a default implementation (new DefaultPortAllocator()) + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#portAllocator} + */ + createPortAllocator():yfiles.hierarchic.incremental.IPortAllocator; + /** + * Factory method that is called lazily upon first usage. + * @return {yfiles.hierarchic.incremental.IPortConstraintOptimizer} null + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#portConstraintOptimizer} + */ + createPortConstraintOptimizer():yfiles.hierarchic.incremental.IPortConstraintOptimizer; + /** + * Factory method that is called lazily upon first usage. + * @return {yfiles.hierarchic.incremental.INodePlacer} a default implementation (new SimplexNodePlacer) + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#nodePlacer} + * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer} + */ + createNodePlacer():yfiles.hierarchic.incremental.INodePlacer; + /** + * The current Layerer instance. + * For the default see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createLayerer}. + * @throws {yfiles.system.ArgumentNullException} if the argument is null + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createLayerer} + */ + layerer:yfiles.hierarchic.incremental.ILayerer; + /** + * The current Sequencer instance. + * For the default see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createSequencer}. + * @throws {yfiles.system.ArgumentNullException} if the argument is null + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createSequencer} + */ + sequencer:yfiles.hierarchic.incremental.ISequencer; + /** + * The current NodePlacer instance. + * For the default see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createNodePlacer}. + * @throws {yfiles.system.ArgumentNullException} if the argument is null + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createNodePlacer} + */ + nodePlacer:yfiles.hierarchic.incremental.INodePlacer; + /** + * The current PortAllocator instance. + * For the default see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createPortAllocator}. + * @throws {yfiles.system.ArgumentNullException} if the argument is null + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createPortAllocator} + */ + portAllocator:yfiles.hierarchic.incremental.IPortAllocator; + /** + * The current PortConstraintOptimizer instance. + * For the default see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createPortConstraintOptimizer}. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createPortConstraintOptimizer} + */ + portConstraintOptimizer:yfiles.hierarchic.incremental.IPortConstraintOptimizer; + /** + * The current DrawingDistanceCalculator instance. + * For the default see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createDrawingDistanceCalculator}. + * @throws {yfiles.system.ArgumentNullException} if the argument is null + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createDrawingDistanceCalculator} + */ + drawingDistanceCalculator:yfiles.hierarchic.incremental.IDrawingDistanceCalculator; + /** + * The equidistant spacing between the horizontal and vertical grid lines. + *

+ * By default no grid is specified (spacing is <= 0). + *

+ */ + gridSpacing:number; + /** + * Always returns true. + * @param {yfiles.layout.LayoutGraph} graph the graph to check + * @return {boolean} true + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Provides access to implementation specific + * properties of the algorithms used. + * Used for internal purposes. + * @param {Object} key the key to a property + * @return {Object} the associated value or null + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#setAlgorithmProperty} + */ + getAlgorithmProperty(key:Object):Object; + /** + * Provides access to implementation specific + * properties of the algorithms used internally. + * Used for internal purposes. + * @param {Object} key the key to a property + * @param {Object} value the value to associate with the key + */ + setAlgorithmProperty(key:Object,value:Object):void; + /** + * Layouts the given graph. + * @param {yfiles.layout.LayoutGraph} graph the graph to layout + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * Factory method that is called during {@link yfiles.hierarchic.incremental.HierarchicLayouter#doLayoutCore}. + * @param {yfiles.layout.LayoutGraph} graph the graph to obtain the grouping information from. + * @return {yfiles.layout.GraphGrouping} a Grouping or null if there is no grouping information associated with the graph. + */ + createGrouping(graph:yfiles.layout.LayoutGraph):yfiles.layout.GraphGrouping; + /** + * Callback method that is called during {@link yfiles.hierarchic.incremental.HierarchicLayouter#doLayoutCore}. + * This method returns a DataProvider that holds the incremental hint information. + * @param {yfiles.layout.LayoutGraph} graph the graph to obtain the information from. + * @return {yfiles.algorithms.IDataProvider} a DataProvider instance or null + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#INCREMENTAL_HINTS_DP_KEY} + */ + getIncrementalHints(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; + /** + * Callback method that is called during {@link yfiles.hierarchic.incremental.HierarchicLayouter#doLayoutCore}. + * This method returns a DataProvider that holds the EdgeLayoutDescriptor information. + * @param {yfiles.layout.LayoutGraph} graph the graph to obtain the information from. + * @return {yfiles.algorithms.IDataProvider} a DataProvider instance or null + * @see {@link yfiles.hierarchic.incremental.EdgeLayoutDescriptor} + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + */ + getEdgeLayoutDescriptors(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; + /** + * Callback method that is called during {@link yfiles.hierarchic.incremental.HierarchicLayouter#doLayoutCore}. + * This method returns a DataProvider that holds the NodeLayoutDescriptor information. + * @param {yfiles.layout.LayoutGraph} graph the graph to obtain the information from. + * @return {yfiles.algorithms.IDataProvider} a DataProvider instance or null + * @see {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor} + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#NODE_LAYOUT_DESCRIPTOR_DP_KEY} + */ + getNodeLayoutDescriptors(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; + /** + * Callback method that is called during {@link yfiles.hierarchic.incremental.HierarchicLayouter#doLayoutCore}. + * This method returns a DataProvider that holds the SwimLaneDescriptor information. + * @param {yfiles.layout.LayoutGraph} graph the graph to obtain the information from. + * @return {yfiles.algorithms.IDataProvider} a DataProvider instance or null + * @see {@link yfiles.hierarchic.incremental.SwimLaneDescriptor} + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#SWIMLANE_DESCRIPTOR_DP_KEY} + */ + getSwimLaneDescriptors(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.IDataProvider; + /** + * Callback method that is called during {@link yfiles.hierarchic.incremental.HierarchicLayouter#doLayoutCore}. + * This method creates the {@link yfiles.hierarchic.incremental.INodeData} + * and {@link yfiles.hierarchic.incremental.IEdgeData} instances and binds them to the elements using the itemFactory. + * @param {yfiles.layout.LayoutGraph} g the graph to obtain the grouping information from. + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory the ItemFactory to use + */ + createItemData(g:yfiles.layout.LayoutGraph,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + /** + * Factory method that is called during {@link yfiles.hierarchic.incremental.HierarchicLayouter#doLayoutCore}. + * @return {yfiles.hierarchic.incremental.ISequencer} a Sequencer implementation that can sequence subgraphs incrementally. + */ + createSubgraphLayerSequencer():yfiles.hierarchic.incremental.ISequencer; + /** + * Factory method that is called during {@link yfiles.hierarchic.incremental.HierarchicLayouter#doLayoutCore}. + * Creates an appropriate Layers implementation using the LayoutDataProvider + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp provides the layout data + * @return {yfiles.hierarchic.incremental.ILayers} a Layers implementation + */ + createLayers(ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):yfiles.hierarchic.incremental.ILayers; + /** + * Factory method that is called during {@link yfiles.hierarchic.incremental.HierarchicLayouter#doLayoutCore}. + * Creates an appropriate IncrementalLayerer implementation + * @return {yfiles.hierarchic.incremental.ILayerer} an implementation + */ + createIncrementalLayerer():yfiles.hierarchic.incremental.ILayerer; + /** + * Factory method that is called during {@link yfiles.hierarchic.incremental.HierarchicLayouter#doLayoutCore}. + * Creates an appropriate EdgeReverser implementation + * @return {yfiles.hierarchic.incremental.IEdgeReverser} an implementation + */ + createEdgeReverser():yfiles.hierarchic.incremental.IEdgeReverser; + /** + * Callback method that publishes the layering information. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the elements + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layers implementation to get the layering information from + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#LAYER_VALUE_HOLDER_DP_KEY} + */ + publishLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers):void; + /** + * Callback method that publishes the sequencing information. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the elements + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layers implementation to get the layering information from + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the {@link yfiles.hierarchic.incremental.ILayoutDataProvider} to get the node information from + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#SEQUENCE_VALUE_HOLDER_DP_KEY} + */ + publishSequences(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + /** + * Removes bends from the edges which are obviously not necessary. + * This method removes bends from the graph that are collinear. + * @param {yfiles.layout.LayoutGraph} graph the graph to obtain the edges from + */ + reduceBendCount(graph:yfiles.layout.LayoutGraph):void; + /** + * Returns an {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory} implementation that can be used to obtain hint objects that can be + * associated with nodes and edges in the graph prior to the invocation of the layout algorithm using an appropriate + * {@link yfiles.algorithms.IDataProvider} implementation and the {@link yfiles.hierarchic.incremental.HierarchicLayouter#INCREMENTAL_HINTS_DP_KEY} DataProvider key. + * @return {yfiles.hierarchic.incremental.IIncrementalHintsFactory} an instance that can be used with this layouter instance + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#INCREMENTAL_HINTS_DP_KEY} + */ + createIncrementalHintsFactory():yfiles.hierarchic.incremental.IIncrementalHintsFactory; + createSequenceConstraintFactory(graph:yfiles.algorithms.Graph):yfiles.hierarchic.incremental.ISequenceConstraintFactory; + createLayerConstraintFactory(graph:yfiles.algorithms.Graph):yfiles.hierarchic.incremental.ILayerConstraintFactory; + } + export module HierarchicLayouter{ + /** + * Hint objects used internally by {@link yfiles.hierarchic.incremental.HierarchicLayouter this} layout algorithm implementation. + * @see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory} + * @see {@link yfiles.hierarchic.incremental.INodeData#incrementalHint} + */ + export interface IncrementalHint extends Object{ + /** + * The type constant for this hint. + */ + type:yfiles.hierarchic.incremental.IncrementalHintType; + } + } + var HierarchicLayouter:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key used to retrieve incremental layout hint + * objects for nodes and edges that have been set using the {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory} + * which itself can be obtained from the + * {@link yfiles.hierarchic.incremental.HierarchicLayouter#createIncrementalHintsFactory} method. + * Note that HierarchicLayouter uses the registered {@link yfiles.algorithms.IDataProvider} to get layout hint objects as well for + * nodes as for edges so neither {@link yfiles.algorithms.Graph#createNodeMap} nor {@link yfiles.algorithms.Graph#createEdgeMap} + * may be used to create this provider. + */ + INCREMENTAL_HINTS_DP_KEY:Object; + /** + * {@link yfiles.algorithms.IDataProvider} key used to retrieve {@link yfiles.hierarchic.incremental.EdgeLayoutDescriptor} + * instances for each edge in the graph. + * Different settings will affect the + * routing of the edges during the layout. + * @see {@link yfiles.hierarchic.incremental.IEdgeData#edgeLayoutDescriptor} + */ + EDGE_LAYOUT_DESCRIPTOR_DP_KEY:Object; + /** + * {@link yfiles.algorithms.IDataProvider} key used to retrieve {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor} + * instances for each node in the graph. + * Different settings will affect node + * placement and port assignment during the layout. + * @see {@link yfiles.hierarchic.incremental.INodeData#nodeLayoutDescriptor} + */ + NODE_LAYOUT_DESCRIPTOR_DP_KEY:Object; + /** + * {@link yfiles.algorithms.IDataProvider} key used to store {@link yfiles.hierarchic.incremental.SwimLaneDescriptor} + * instances for each node in the graph. + * If this key is present during the layout. + * The layout algorithm will arrange nodes in swim lanes. The information about the + * swim lanes is finally written back into the descriptor instances. + * Instances can be shared among multiple nodes in the same lane, but don't have to be shared. + * @see {@link yfiles.hierarchic.incremental.SwimLaneDescriptor} + * @see {@link yfiles.hierarchic.incremental.INodeData#swimLaneDescriptor} + */ + SWIMLANE_DESCRIPTOR_DP_KEY:Object; + /** + * Used for publishing the final layering information. + * If the {@link yfiles.algorithms.IDataProvider} associated to this key is also a + * {@link yfiles.algorithms.IDataAcceptor}, the integer layer id of each node is stored using + * the acceptor's {@link yfiles.algorithms.IDataAcceptor#setInt setInt} method. + * Otherwise, the provider's values should be of type + * {@link yfiles.hierarchic.incremental.IIntValueHolder} and the value holder's + * {@link yfiles.hierarchic.incremental.IIntValueHolder#value setValue} method is used to store the + * integer layer ids of each node. + */ + LAYER_VALUE_HOLDER_DP_KEY:Object; + /** + * Used for publishing the final sequencing information. + * If the {@link yfiles.algorithms.IDataProvider} associated to this key is also a + * {@link yfiles.algorithms.IDataAcceptor}, the sequence order number of each node is stored + * using the acceptor's {@link yfiles.algorithms.IDataAcceptor#setInt setInt} + * method. + * Otherwise, the provider's values should be of type + * {@link yfiles.hierarchic.incremental.IIntValueHolder} and the value holder's + * {@link yfiles.hierarchic.incremental.IIntValueHolder#value setValue} method is used to store the + * sequence order number of each node. + */ + SEQUENCE_VALUE_HOLDER_DP_KEY:Object; + /** + * DataProvider key used to hold boolean values for each node in the graph that indicate whether + * the node has to be added incrementally. + * This key is used by the incremental versions of {@link yfiles.hierarchic.incremental.ILayerer}, such as + * {@link yfiles.hierarchic.incremental.TopologicalIncrementalLayerer} to determine which nodes need to be + * inserted incrementally, as well as the {@link yfiles.hierarchic.incremental.ISequencer} implementation + * that determines incrementally sequenced nodes. + */ + INCREMENTAL_NODES_DP_KEY:Object; + /** + * Creates a new instance of HierarchicLayouter with default settings. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createLayerer} + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createIncrementalLayerer} + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createSequencer} + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createDrawingDistanceCalculator} + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#createNodePlacer} + */ + new ():yfiles.hierarchic.incremental.HierarchicLayouter; + IncrementalHint:{ + $class:yfiles.lang.Class; + /** + * Convenience singleton instance of type {@link yfiles.hierarchic.incremental.IncrementalHintType#NONE}. + */ + NONE:yfiles.hierarchic.incremental.HierarchicLayouter.IncrementalHint; + }; + }; + export enum GroupCompactionPolicy{ + /** + * Compaction strategy specifier for use with {@link yfiles.hierarchic.incremental.SimplexNodePlacer#groupCompactionStrategy}. + * This specifies no horizontal group compaction, i.e. group node contents will occupy nearly the same horizontal positions as when not grouped at all. + */ + NONE, + /** + * Compaction strategy specifier for use with {@link yfiles.hierarchic.incremental.SimplexNodePlacer#groupCompactionStrategy}. + * This specifies maximal horizontal group compaction, i.e. the node placer will try to minimize the horizontally occupied space for a group node. + */ + MAXIMAL + } + /** + * Specifies the general contract for factory classes that can be used + * to associate sequence constraints to a graph. + * Sequence constraints + * affect the per layer sequence calculated in hierarchical layouts. + *

+ * A SequenceConstraintFactory has to be + * {@link yfiles.hierarchic.incremental.ISequenceConstraintFactory#dispose disposed} after use. Disposing the factory will also remove + * all constraints previously specified for the factory's associated graph. + *

+ * Notes: + *
    + *
  • Sequence constraints can't be used together with swimlanes currently.
  • + *
  • Sequence constraints that are specified for a group child node will be applied to the parent node instead
  • + *
  • If you manually register a DataProvider under {@link yfiles.layout.LayouterKeys#NODE_ID_DP_KEY} + * on the graph, you must use the corresponding node ids stored in this DataProvider as arguments for + * all methods that create a constraint. Otherwise, you can just use the node instances themselves.
  • + *
+ */ + export interface ISequenceConstraintFactory extends Object{ + /** + * A token that allows to bind a constraint factory to a graph instance after creation. + * This method should only be used if the constraint factory is not bound to a graph instance initially. It allows + * to bind the ConstraintFactory to a graph instance after creation. Please see the factory methods that create + * instances of this interface for a description. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter.createSequenceConstraintFactory(yfiles.algorithms.Graph)} + * @see Specified by {@link yfiles.hierarchic.incremental.ISequenceConstraintFactory#memento}. + */ + memento:Object; + /** + * Disposes the SequenceConstraintFactory. + *

+ * This method should be called when the factory is not needed anymore, i.e. + * after the layout has been calculated. + * Calling this method also clears all constraints. + *

+ * @see Specified by {@link yfiles.hierarchic.incremental.ISequenceConstraintFactory#dispose}. + */ + dispose():void; + /** + * Add a constraint that forces the node with id before to lie before + * the node with id reference. + * @param {Object} referenceId the id of the reference node + * @param {Object} beforeId the id of the node that should be placed before the reference + * @see Specified by {@link yfiles.hierarchic.incremental.ISequenceConstraintFactory#addPlaceNodeBeforeConstraint}. + */ + addPlaceNodeBeforeConstraint(referenceId:Object,beforeId:Object):void; + /** + * Add a constraint that forces the node with id after to lie after + * the node with id reference. + * @param {Object} referenceId the id of the reference node + * @param {Object} afterId the id of the node that should be placed after the reference + * @see Specified by {@link yfiles.hierarchic.incremental.ISequenceConstraintFactory#addPlaceNodeAfterConstraint}. + */ + addPlaceNodeAfterConstraint(referenceId:Object,afterId:Object):void; + /** + * Add a constraint that places a node at the start of the sequence. + * @param {Object} nodeId the id of the node that should be placed at the start + * @see Specified by {@link yfiles.hierarchic.incremental.ISequenceConstraintFactory#addPlaceNodeAtHeadConstraint}. + */ + addPlaceNodeAtHeadConstraint(nodeId:Object):void; + /** + * Add a constraint that places a node at the end of the sequence. + * @param {Object} nodeId the id of the node that should be placed at the end + * @see Specified by {@link yfiles.hierarchic.incremental.ISequenceConstraintFactory#addPlaceNodeAtTailConstraint}. + */ + addPlaceNodeAtTailConstraint(nodeId:Object):void; + } + var ISequenceConstraintFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface specification for classes that can create layering constraints. + * If you manually register a DataProvider under {@link yfiles.layout.LayouterKeys#NODE_ID_DP_KEY} on the graph, you must use the + * corresponding node ids stored in this DataProvider as arguments for all methods that create a constraint. Otherwise, + * you can just use the node instances themselves. + */ + export interface ILayerConstraintFactory extends Object{ + /** + * A token that allows to bind a constraint factory to a graph instance after creation. + * This method should only be used if the constraint factory is not bound to a graph instance initially. It allows to + * bind the ConstraintFactory to a graph instance after creation. Please see the factory methods that create + * instances of this interface for a description. + * @see {@link yfiles.hierarchic.ConstraintLayerer.createConstraintFactory(yfiles.algorithms.Graph)} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerConstraintFactory#memento}. + */ + memento:Object; + /** + * Disposes the ConstraintFactory. + *

This method should be called when the factory is not needed anymore, i.e. + * after the layout has been calculated. Calling this method also clears all constraints.

+ * @see Specified by {@link yfiles.hierarchic.incremental.ILayerConstraintFactory#dispose}. + */ + dispose():void; + /** + * Add a constraint that forces the node with id with id below to lie below the node with id + * reference. + * @param {Object} referenceId the id of the reference node + * @param {Object} belowId the id of the node that should lie below + * @return {yfiles.hierarchic.incremental.ILayerConstraint} a LayerConstraint object that represents the constraint. + * @see {@link yfiles.hierarchic.incremental.ILayerConstraint} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerConstraintFactory#addPlaceNodeBelowConstraint}. + */ + addPlaceNodeBelowConstraint(referenceId:Object,belowId:Object):yfiles.hierarchic.incremental.ILayerConstraint; + /** + * Add a constraint that forces the node with id below to lie at least minDistance layers + * below the node with id reference. + * The minimum distance includes potentially empty layers that are removed by the layerer. In that case, the actual + * layer difference may be smaller than minDistance + * @param {Object} referenceId the id of the reference node + * @param {Object} belowId the id of the node that should lie below + * @param {number} minDistance the minimal layer distance between the node and its reference node + * @return {yfiles.hierarchic.incremental.ILayerConstraint} a LayerConstraint object that represents the constraint. + * @see {@link yfiles.hierarchic.incremental.ILayerConstraint} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerConstraintFactory#addPlaceNodeBelowConstraintWithMinDistance}. + */ + addPlaceNodeBelowConstraintWithMinDistance(referenceId:Object,belowId:Object,minDistance:number):yfiles.hierarchic.incremental.ILayerConstraint; + /** + * Add a constraint that forces the node with id below to lie at least minDistance layers + * below the node with id reference with a given weight penalty for larger layer differences. + * The minimum distance includes potentially empty layers that are removed by the layerer. In that case, the actual + * layer difference may be smaller than minDistance + * @param {Object} referenceId the id of the reference node + * @param {Object} belowId the id of the node that should lie below + * @param {number} minDistance the minimal layer distance between the node and its reference node + * @param {number} weight the weight penalty for larger layer differences + * @return {yfiles.hierarchic.incremental.ILayerConstraint} a LayerConstraint object that represents the constraint. + * @see {@link yfiles.hierarchic.incremental.ILayerConstraint} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerConstraintFactory#addPlaceNodeBelowConstraintWithMinDistanceAndWeight}. + */ + addPlaceNodeBelowConstraintWithMinDistanceAndWeight(referenceId:Object,belowId:Object,minDistance:number,weight:number):yfiles.hierarchic.incremental.ILayerConstraint; + /** + * Add a constraint that forces the node above to lie above the node reference. + * @param {Object} referenceId the id of the reference node + * @param {Object} aboveId the id of the node that should lie above + * @return {yfiles.hierarchic.incremental.ILayerConstraint} a LayerConstraint object that represents the constraint. + * @see {@link yfiles.hierarchic.incremental.ILayerConstraint} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerConstraintFactory#addPlaceNodeAboveConstraint}. + */ + addPlaceNodeAboveConstraint(referenceId:Object,aboveId:Object):yfiles.hierarchic.incremental.ILayerConstraint; + /** + * Add a constraint that forces the node with id above to lie at least minDistance layers + * above the node with id reference. + * The minimum distance includes potentially empty layers that are removed by the layerer. In that case, the actual + * layer difference may be smaller than minDistance + * @param {Object} referenceId the id of the reference node + * @param {Object} aboveId the id of the node that should lie above + * @param {number} minDistance the minimal layer distance between the node and its reference node + * @return {yfiles.hierarchic.incremental.ILayerConstraint} a LayerConstraint object that represents the constraint. + * @see {@link yfiles.hierarchic.incremental.ILayerConstraint} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerConstraintFactory#addPlaceNodeAboveConstraintWithMinDistance}. + */ + addPlaceNodeAboveConstraintWithMinDistance(referenceId:Object,aboveId:Object,minDistance:number):yfiles.hierarchic.incremental.ILayerConstraint; + /** + * Add a constraint that forces the node with id above to lie at least minDistance layers + * above the node with id reference with a given weight penalty for larger layer differences. + * The minimum distance includes potentially empty layers that are removed by the layerer. In that case, the actual + * layer difference may be smaller than minDistance + * @param {Object} referenceId the id of the reference node + * @param {Object} aboveId the id of the node that should lie above + * @param {number} minDistance the minimal layer distance between the node and its reference node + * @param {number} weight the weight penalty for larger layer differences + * @return {yfiles.hierarchic.incremental.ILayerConstraint} a LayerConstraint object that represents the constraint. + * @see {@link yfiles.hierarchic.incremental.ILayerConstraint} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerConstraintFactory#addPlaceNodeAboveConstraintWithMinDistanceAndWeight}. + */ + addPlaceNodeAboveConstraintWithMinDistanceAndWeight(referenceId:Object,aboveId:Object,minDistance:number,weight:number):yfiles.hierarchic.incremental.ILayerConstraint; + /** + * Add a constraint that forces the node with id sameLayer to lie in the same layer as the node with id + * reference. + * @param {Object} referenceId the id of the reference node + * @param {Object} sameLayerId the id of the node that should lie in the same layer + * @return {yfiles.hierarchic.incremental.ILayerConstraint} a LayerConstraint object that represents the constraint. + * @see {@link yfiles.hierarchic.incremental.ILayerConstraint} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerConstraintFactory#addPlaceNodeInSameLayerConstraint}. + */ + addPlaceNodeInSameLayerConstraint(referenceId:Object,sameLayerId:Object):yfiles.hierarchic.incremental.ILayerConstraint; + /** + * Add a constraint that places a node in the topmost layer. + * @param {Object} nodeId the id of the node that should lie at the top + * @return {yfiles.hierarchic.incremental.ILayerConstraint} a LayerConstraint object that represents the constraint. + * @see {@link yfiles.hierarchic.incremental.ILayerConstraint} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerConstraintFactory#addPlaceNodeAtTopConstraint}. + */ + addPlaceNodeAtTopConstraint(nodeId:Object):yfiles.hierarchic.incremental.ILayerConstraint; + /** + * Add a constraint that places a node in the bottom layer. + * @param {Object} nodeId the id of the node that should lie at the bottom + * @return {yfiles.hierarchic.incremental.ILayerConstraint} a LayerConstraint object that represents the constraint. + * @see {@link yfiles.hierarchic.incremental.ILayerConstraint} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerConstraintFactory#addPlaceNodeAtBottomConstraint}. + */ + addPlaceNodeAtBottomConstraint(nodeId:Object):yfiles.hierarchic.incremental.ILayerConstraint; + /** + * Clears all constraints for a given node. + * @param {Object} nodeId the id of the node for which all constraints should be cleared + * @see {@link yfiles.hierarchic.incremental.ILayerConstraint} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerConstraintFactory#removeConstraints}. + */ + removeConstraints(nodeId:Object):void; + } + var ILayerConstraintFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Describes a single layer in a hierarchical drawing + * with all its nodes and associated same layer edges. + * A layer has a type and an index. + * @see {@link yfiles.hierarchic.incremental.ILayers} + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter} + * @see {@link yfiles.hierarchic.incremental.ILayerer} + */ + export interface ILayer extends Object{ + /** + * Adds a newly created node to this layer. + * @see Specified by {@link yfiles.hierarchic.incremental.ILayer#add}. + */ + add(node:yfiles.algorithms.Node):void; + /** + * Adds a same layer edge to this layer. + * @see Specified by {@link yfiles.hierarchic.incremental.ILayer#addSameLayerEdge}. + */ + addSameLayerEdge(edge:yfiles.algorithms.Edge):void; + /** + * All same layer edges in this layer. + * @see Specified by {@link yfiles.hierarchic.incremental.ILayer#sameLayerEdges}. + */ + sameLayerEdges:yfiles.algorithms.YList; + /** + * Removes a node from this layer. + * @see Specified by {@link yfiles.hierarchic.incremental.ILayer#removeNode}. + */ + removeNode(node:yfiles.algorithms.Node):void; + /** + * Removes the current layer from the Layers structure. + * @see Specified by {@link yfiles.hierarchic.incremental.ILayer#remove}. + */ + remove():void; + /** + * The nodes in this layer. + * @see Specified by {@link yfiles.hierarchic.incremental.ILayer#list}. + */ + list:yfiles.algorithms.NodeList; + /** + * Adjusts the order of the nodes in this list according to the given order. + * @see Specified by {@link yfiles.hierarchic.incremental.ILayer#setNodeOrder}. + */ + setNodeOrder(list:yfiles.algorithms.YList):void; + /** + * The main type of this layer. + * @see Specified by {@link yfiles.hierarchic.incremental.ILayer#type}. + */ + type:yfiles.hierarchic.incremental.LayerType; + /** + * The index of this layer in the list of all layers. + * @see Specified by {@link yfiles.hierarchic.incremental.ILayer#index}. + */ + index:number; + /** + * The{@link yfiles.layout.RowDescriptor} associated with this layer. + * @see Specified by {@link yfiles.hierarchic.incremental.ILayer#row}. + */ + row:yfiles.layout.RowDescriptor; + } + var ILayer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Factory that consistently creates and destroys helper structures in the + * graph during layout. + * An implementation of this interface is provided by the {@link yfiles.hierarchic.incremental.HierarchicLayouter} + * during the layout for the different sub modules. + * It is mainly for internal use. + */ + export interface IItemFactory extends Object{ + /** + * Inserts an edge group node layer. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#insertGroupNodeLayer}. + */ + insertGroupNodeLayer(source:boolean,index:number):yfiles.hierarchic.incremental.ILayer; + /** + * Inserts a layer for label nodes group node layer. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#insertLabelNodeLayer}. + */ + insertLabelNodeLayer(source:boolean,index:number):yfiles.hierarchic.incremental.ILayer; + /** + * Destroys a previously created label layer. + * @param {yfiles.hierarchic.incremental.ILayer} layer the layer to destroy + * @param {boolean} useInEdges + * whether the incoming edges should be used + * as the resulting edges + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#destroyLabelNodeLayer}. + */ + destroyLabelNodeLayer(layer:yfiles.hierarchic.incremental.ILayer,useInEdges:boolean):void; + /** + * Inserts a same layer edge or an edge that may span multiple layers into the + * data structure. + * Returns the list of edges that has been created if this edge + * spans multiple layers. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#insertEdge}. + */ + insertEdge(edge:yfiles.algorithms.Edge):yfiles.algorithms.EdgeList; + /** + * Registers an edge as a same layer edge appropriately into all data structures. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#registerSameLayerEdge}. + */ + registerSameLayerEdge(edge:yfiles.algorithms.Edge):void; + /** + * Converts a node to a label node. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#convertToLabelNode}. + */ + convertToLabelNode(dummyNode:yfiles.algorithms.Node):void; + /** + * Reverts a label node to the previous kind of node. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#unconvertToLabelNode}. + */ + unconvertToLabelNode(labelNode:yfiles.algorithms.Node):void; + /** + * Creates a proxy node for an edge during the drawing phase, + * changing the edge to end/start at the proxy. + * @return {yfiles.algorithms.Node} the proxy + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createProxyNode}. + */ + createProxyNode(edge:yfiles.algorithms.Edge,source:boolean):yfiles.algorithms.Node; + /** + * Creates a proxy node for an edge during the drawing phase, + * changing the edge to end/start at the proxy. + * @return {yfiles.algorithms.Node} the proxy + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createProxyNodeWithEdgeSourceAndLaneDescriptor}. + */ + createProxyNodeWithEdgeSourceAndLaneDescriptor(edge:yfiles.algorithms.Edge,source:boolean,laneDescriptor:yfiles.hierarchic.incremental.SwimLaneDescriptor):yfiles.algorithms.Node; + /** + * Destroys a proxy node that has been created using + * {@link yfiles.hierarchic.incremental.IItemFactory#createProxyNode} for the drawing phase. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#destroyProxyNode}. + */ + destroyProxyNode(proxyNode:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * Creates a proxy node for a same layer edge during the drawing phase that + * ends at the side of a node. + * @return {yfiles.algorithms.Node} the proxy + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createSameLayerSideProxy}. + */ + createSameLayerSideProxy(inLayer:yfiles.hierarchic.incremental.ILayer,forNode:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge):yfiles.algorithms.Node; + /** + * Creates a proxy node for a same layer edge during the drawing phase that + * ends at the side of a node. + * @return {yfiles.algorithms.Node} the proxy + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createSameLayerSideProxyWithDescriptor}. + */ + createSameLayerSideProxyWithDescriptor(inLayer:yfiles.hierarchic.incremental.ILayer,forNode:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,sld:yfiles.hierarchic.incremental.SwimLaneDescriptor):yfiles.algorithms.Node; + /** + * Destroys a proxy node that has been created using. + * {@link yfiles.hierarchic.incremental.IItemFactory#createProxyNode} for the drawing phase + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#destroySameLayerSideProxy}. + */ + destroySameLayerSideProxy(proxyNode:yfiles.algorithms.Node):void; + /** + * Creates an edge group node. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createEdgeGroupNode}. + */ + createEdgeGroupNode(layer:yfiles.hierarchic.incremental.ILayer,groupId:Object):yfiles.algorithms.Node; + /** + * Creates a bend node in the layer for the given edge. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createBendNode}. + */ + createBendNode(layer:yfiles.hierarchic.incremental.ILayer,edge:yfiles.algorithms.Edge):yfiles.algorithms.Node; + /** + * Creates a bend node in the layer for the given edge and assigns it to the given lane descriptor. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createBendNodeForDescriptor}. + */ + createBendNodeForDescriptor(layer:yfiles.hierarchic.incremental.ILayer,edge:yfiles.algorithms.Edge,laneDescriptor:yfiles.hierarchic.incremental.SwimLaneDescriptor):yfiles.algorithms.Node; + /** + * Creates a spacer node for the drawing phase using the given bounds. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createDistanceNode}. + */ + createDistanceNode(layer:yfiles.hierarchic.incremental.ILayer,size:yfiles.algorithms.Rectangle2D.Double,edges:yfiles.algorithms.Edge[]):yfiles.algorithms.Node; + /** + * Destroys a previously created spacer node for the drawing phase. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#destroyDistanceNode}. + */ + destroyDistanceNode(distanceNode:yfiles.algorithms.Node):void; + /** + * Creates a dummy edge using the given data. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createDummyEdge}. + */ + createDummyEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,oldEdge:yfiles.algorithms.Edge,sourceEnd:boolean,targetEnd:boolean):yfiles.algorithms.Edge; + /** + * Creates a reversed dummy edge using the given data. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createReverseDummyEdge}. + */ + createReverseDummyEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,oldEdge:yfiles.algorithms.Edge,sourceEnd:boolean,targetEnd:boolean):yfiles.algorithms.Edge; + /** + * Creates a redirected edge to replace an edge connected to a group node. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createRedirectedGroupEdge}. + */ + createRedirectedGroupEdge(newSource:yfiles.algorithms.Node,newTarget:yfiles.algorithms.Node,groupEdge:yfiles.algorithms.Edge):yfiles.algorithms.Edge; + /** + * Creates a group node connector edge between two group nodes. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createGroupNodeConnectorEdge}. + */ + createGroupNodeConnectorEdge(gn1:yfiles.algorithms.Node,gn2:yfiles.algorithms.Node,representative:yfiles.algorithms.Edge):yfiles.algorithms.Edge; + /** + * Creates a same layer proxy node. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createSameLayerProxy}. + */ + createSameLayerProxy(layer:yfiles.hierarchic.incremental.ILayer,edge:yfiles.algorithms.Edge,toProxy:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * Destroy a previously created same layer edge proxy. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#destroySameLayerProxy}. + */ + destroySameLayerProxy(edge:yfiles.algorithms.Edge):yfiles.algorithms.Edge; + /** + * Creates a same layer switch proxy (switching between two same layer edges on two different sides + * of the layer). + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createSameLayerSwitchProxy}. + */ + createSameLayerSwitchProxy(layer:yfiles.hierarchic.incremental.ILayer,edge:yfiles.algorithms.Edge):yfiles.algorithms.Node; + /** + * Destroys a previously generated same layer switch proxy. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#destroySameLayerSwitchProxy}. + */ + destroySameLayerSwitchProxy(node:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * Creates node data for a normal node and associates it with the node. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createNormalNodeData}. + */ + createNormalNodeData(node:yfiles.algorithms.Node):yfiles.hierarchic.incremental.INodeData; + /** + * Creates proxy node data for a proxy node and associates it with the node. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createProxyNodeData}. + */ + createProxyNodeData(node:yfiles.algorithms.Node,proxy:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge):yfiles.hierarchic.incremental.INodeData; + /** + * Creates bend node data for a bend node and associates it with the node. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createBendNodeData}. + */ + createBendNodeData(node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge):yfiles.hierarchic.incremental.INodeData; + /** + * Creates bend node data for a bend node and associates it with the node. + * The bend is assigned to the given laneDescriptor + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createBendNodeDataForDescriptor}. + */ + createBendNodeDataForDescriptor(node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,laneDescriptor:yfiles.hierarchic.incremental.SwimLaneDescriptor):yfiles.hierarchic.incremental.INodeData; + /** + * Creates an edge group node data for an edge group node and associates it with the node. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createEdgeGroupNodeData}. + */ + createEdgeGroupNodeData(node:yfiles.algorithms.Node,groupId:Object,source:boolean):yfiles.hierarchic.incremental.INodeData; + /** + * Creates a group boundary node for a group node. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createGroupBorderNode}. + */ + createGroupBorderNode(groupNode:yfiles.algorithms.Node,layer:yfiles.hierarchic.incremental.ILayer,type:number):yfiles.algorithms.Node; + /** + * Create a dummy node for the group layer. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createGroupLayerDummyNode}. + */ + createGroupLayerDummyNode():yfiles.algorithms.Node; + /** + * Creates edge data for a normal edge and associates it with the edge. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createNormalEdgeData}. + */ + createNormalEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.incremental.IEdgeData; + /** + * Creates edge data for a same layer edge and associates it with the edge. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createSameLayerEdgeData}. + */ + createSameLayerEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.incremental.IEdgeData; + /** + * Creates edge data for a self loop edge and associates it with the edge. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createSelfLoopEdgeData}. + */ + createSelfLoopEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.incremental.IEdgeData; + /** + * Converts a normal edge to a {@link yfiles.hierarchic.incremental.EdgeDataType#DIRECT_SAME_LAYER_EDGE}. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#setDirectlyConnectSameLayerEdge}. + */ + setDirectlyConnectSameLayerEdge(sameLayerEdge:yfiles.algorithms.Edge):void; + /** + * Sets a port constraint for an edge at the given side. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#setTemporaryPortConstraint}. + */ + setTemporaryPortConstraint(edge:yfiles.algorithms.Edge,source:boolean,pc:yfiles.layout.PortConstraint):yfiles.hierarchic.incremental.IEdgeData; + /** + * Sets a edge group constraint for an edge. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#setTemporaryEdgeGroups}. + */ + setTemporaryEdgeGroups(edge:yfiles.algorithms.Edge,sgId:Object,tgId:Object):yfiles.hierarchic.incremental.IEdgeData; + /** + * Creates an edge that connects two group border nodes. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createGroupBorderEdge}. + */ + createGroupBorderEdge(source:yfiles.algorithms.Node,target:yfiles.algorithms.Node):yfiles.algorithms.Edge; + /** + * Create a dummy edge that mimics a connector to a group node. + * @see Specified by {@link yfiles.hierarchic.incremental.IItemFactory#createConnectorProxyForGroup}. + */ + createConnectorProxyForGroup(groupNode:yfiles.algorithms.Node,groupId:Object,layer:yfiles.hierarchic.incremental.ILayer,e:yfiles.algorithms.Edge):yfiles.algorithms.Node; + } + var IItemFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Multi-purpose edge descriptor for each edge in the graph during the layout. + * Used by {@link yfiles.hierarchic.incremental.HierarchicLayouter} during all stages to keep the state of + * the edges. + */ + export interface IEdgeData extends Object{ + /** + * The type constant of the edge. + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeData#type}. + */ + type:yfiles.hierarchic.incremental.EdgeDataType; + /** + * A possibly associated node. + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeData#associatedNode}. + */ + associatedNode:yfiles.algorithms.Node; + /** + * A possibly associated edge. + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeData#associatedEdge}. + */ + associatedEdge:yfiles.algorithms.Edge; + /** + * The current source port constraint. + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeData#spc}. + */ + spc:yfiles.layout.PortConstraint; + /** + * The Collection of{@link yfiles.layout.PortCandidate}s for the + * source port as obtained from the DataProvider bound to the graph via + * the {@link yfiles.layout.PortCandidate#SOURCE_PC_LIST_DP_KEY} data provider key + * bound to the original edge. + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeData#sourceCandidates}. + */ + sourceCandidates:yfiles.algorithms.ICollection; + /** + * The current target port constraint. + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeData#tpc}. + */ + tpc:yfiles.layout.PortConstraint; + /** + * The Collection of{@link yfiles.layout.PortCandidate}s for the + * source port as obtained from the DataProvider bound to the graph via + * the {@link yfiles.layout.PortCandidate#TARGET_PC_LIST_DP_KEY} data provider key + * bound to the original edge. + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeData#targetCandidates}. + */ + targetCandidates:yfiles.algorithms.ICollection; + /** + * The source group id object if any. + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeData#sourceGroup}. + */ + sourceGroup:Object; + /** + * The target group id object if any. + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeData#targetGroup}. + */ + targetGroup:Object; + /** + * The group that is represented by this edge. + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeData#group}. + */ + group:Object; + /** + * Specifies whether the edge has been reversed. + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeData#reversed}. + */ + reversed:boolean; + /** + * Specifies whether the edge is an upper same layer edge + * (in case it is a same layer edge). + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeData#upperSameLayerEdge}. + */ + upperSameLayerEdge:boolean; + /** + * The EdgeLayoutDescriptor instance that was initially bound to this edge + * or null. + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeData#edgeLayoutDescriptor}. + */ + edgeLayoutDescriptor:yfiles.hierarchic.incremental.EdgeLayoutDescriptor; + /** + * Specifies whether this edge should be an upper same layer edge if it is a + * same layer edge and it can be freely determined whether it should + * be routed above or below the layer. + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeData#fallbackUpperSameLayerEdge}. + */ + fallbackUpperSameLayerEdge:boolean; + } + var IEdgeData:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for a helper class used by {@link yfiles.hierarchic.incremental.HierarchicLayouter} during + * the node placement phase. + * {@link yfiles.hierarchic.incremental.INodePlacer} uses instances that implement + * this interface to determine the minimum distances between elements in one layer. + * The default implementation used in the {@link yfiles.hierarchic.incremental.HierarchicLayouter} is + * {@link yfiles.hierarchic.incremental.DefaultDrawingDistanceCalculator}. + */ + export interface IDrawingDistanceCalculator extends Object{ + /** + * Called to initialize internal data structures. + * Implementations may + * cache lengthy calculations in the initialization phase. + * It is guaranteed that the graph will not be changed during subsequent + * calls to {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#getMinDistance}. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains all elements that are used during + * the node placement + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layers object that will be used during subsequent calls + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that can be used to query information + * @see {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#dispose} + * @see Specified by {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#initialize}. + */ + initialize(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + /** + * Main interface method. + * Queried by {@link yfiles.hierarchic.incremental.INodePlacer} instances to determine + * the minimum distances between elements in one layer. Note that either of the Node + * arguments may be null. In that case only the border of the non-null + * node should be considered. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the nodes + * @param {yfiles.hierarchic.incremental.ILayer} layer the layer object that contains the nodes + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that can be used to query information + * @param {yfiles.algorithms.Node} left + * the left one of the two nodes whose + * minimum distance is to be determined or null if only the left border of the right node is + * of interest. + * @param {yfiles.algorithms.Node} right + * the right one of the two nodes whose + * minimum distance is to be determined or null if only the right border of the left node is + * of interest. + * @see Specified by {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#getMinDistance}. + */ + getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.incremental.ILayer,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,left:yfiles.algorithms.Node,right:yfiles.algorithms.Node):number; + /** + * Called to dispose internal data structures. + * Implementations should + * release internally held data structures here. + * @see {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#initialize} + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains all elements that are used during + * the node placement + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layers object that was used + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that was used to query information + * @see Specified by {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#dispose}. + */ + dispose(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + } + var IDrawingDistanceCalculator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for implementations that perform their work after the first phase. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter} + */ + export interface IEdgeReverser extends Object{ + /** + * Called at the beginning of the layout algorithm. + * This method should reverse all edges which point into the wrong direction. + * I.e. if the layer index of the source node is greater than the layer index + * of the target node. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the elements + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the LayoutDataProvider that can be queried to receive the + * layering information + * @see {@link yfiles.hierarchic.incremental.ILayoutDataProvider#getNodeData} + * @see {@link yfiles.hierarchic.incremental.INodeData#layer} + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeReverser#normalizeEdges}. + */ + normalizeEdges(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + /** + * May be called by the incremental parts of the layout algorithm. + * This method should reverse the given edge which points into the wrong direction. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the elements + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the LayoutDataProvider that can be queried to receive the + * layering information + * @param {yfiles.algorithms.Edge} edge the edge to reverse + * @see {@link yfiles.hierarchic.incremental.ILayoutDataProvider#getNodeData} + * @see {@link yfiles.hierarchic.incremental.INodeData#layer} + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeReverser#reverse}. + */ + reverse(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,edge:yfiles.algorithms.Edge):void; + /** + * Called at the end of the layout algorithm. + * This method should reverse all + * edges which have been marked as reversed. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the elements + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the LayoutDataProvider that can be queried to receive the + * layering information + * @see Specified by {@link yfiles.hierarchic.incremental.IEdgeReverser#restoreEdgeDirections}. + */ + restoreEdgeDirections(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + } + var IEdgeReverser:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Factory interface for {@link yfiles.hierarchic.IncrementalHierarchicLayouter}. + * Use this factory to obtain hints that will be interpreted by the layouter if + * they are bound to a DataProvider instance that is registered with the LayoutGraph + * using the {@link yfiles.hierarchic.IncrementalHierarchicLayouter#INCREMENTAL_HINTS_DP_KEY} + * key. + * An instance of a class implementing this interface can be obtained through + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter#createIncrementalHintsFactory}. + */ + export interface IIncrementalHintsFactory extends Object{ + /** + * Creates a hint object for a node that should be inserted incrementally + * during the layering phase. + * This will place the node in a suitable layer, + * thus possibly creating new layers. + * Neighbors of this node may be marked as to be laid out incrementally, too. + * This makes it possible to incrementally add whole subgraphs to the current + * layout. + * @param {Object} forNodeId + * the node to be layered and sequenced incrementally together + * with its adjacent edges and possibly marked neighboring nodes. + * @return {Object} + * an Object that can be interpreted by {@link yfiles.hierarchic.incremental.HierarchicLayouter} + * @see Specified by {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createLayerIncrementallyHint}. + */ + createLayerIncrementallyHint(forNodeId:Object):Object; + /** + * Creates a hint object for a node or edge that should be inserted incrementally + * during the sequencing phase. + * This will prevent the layering from being changed. + * The node will be placed into an already existing layer that is determined + * by the {@link yfiles.hierarchic.incremental.HierarchicLayouter#layerer} implementation, i.e. "from sketch". + * Adjacent edges will automatically be rerouted optimally. + * @param {Object} forItemId the node or edge to be sequenced/inserted incrementally. + * @return {Object} + * an Object that can be interpreted by {@link yfiles.hierarchic.incremental.HierarchicLayouter} + * @see Specified by {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createSequenceIncrementallyHint}. + */ + createSequenceIncrementallyHint(forItemId:Object):Object; + /** + * Creates a hint object for a group node that should be inserted incrementally. + * The group will be placed on a suitable position. The descendants of the group + * may be associated with hints created by method {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createLayerIncrementallyHint}, + * {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createSequenceIncrementallyHint} or this method (if the descendant is an inner group). + * All hints of the group's descendants are interpreted relative to the group node. Descendants without hints + * keep their relative ordering within the group node (but not with elements outside the group). + * The position of groups without incremental hint depends on the position of their descendants + * (i.e., the group is not interpreted as fixed - it is simply ignored). + *

+ * Note: Descendants of incremental groups must not be associated with exact coordinate hints (see method + * {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactCoordinatesHint}, {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactSequenceCoordinatesHint} and + * {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactLayerCoordinatesHint}). + *

+ * @param {Object} forItemId the group node. + * @return {Object} + * an Object that can be interpreted by {@link yfiles.hierarchic.incremental.HierarchicLayouter} + * @see Specified by {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createIncrementalGroupHint}. + */ + createIncrementalGroupHint(forItemId:Object):Object; + /** + * Creates a hint object for a node that should be inserted incrementally + * into the graph at its exact current position. + * The node will be placed into an already existing layer that is determined + * by the {@link yfiles.hierarchic.incremental.HierarchicLayouter#layerer layerer} + * implementation. The position within its layer + * will be determined by its current position. + * @see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactSequenceCoordinatesHint} + * @see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactLayerCoordinatesHint} + * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer#exactPlacementEnforced} + * @param {Object} forNodeId the node to be placed at its exact current position. + * @return {Object} + * an Object that can be interpreted by {@link yfiles.hierarchic.incremental.HierarchicLayouter} + * @see Specified by {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactCoordinatesHint}. + */ + createUseExactCoordinatesHint(forNodeId:Object):Object; + /** + * Creates a hint object for a node that should be inserted incrementally + * into the graph at its exact current layer position. + * The node will be placed into an already existing layer that is determined + * by the {@link yfiles.hierarchic.incremental.HierarchicLayouter#layerer layerer} + * at the position that it occupies initially. The position within its layer + * will be determined by the {@link yfiles.hierarchic.incremental.INodePlacer}. + * @see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactCoordinatesHint} + * @see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactSequenceCoordinatesHint} + * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer#exactPlacementEnforced} + * @param {Object} forNodeId the node to be placed at its exact current layer position. + * @return {Object} + * an Object that can be interpreted by {@link yfiles.hierarchic.incremental.HierarchicLayouter} + * @see Specified by {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactLayerCoordinatesHint}. + */ + createUseExactLayerCoordinatesHint(forNodeId:Object):Object; + /** + * Creates a hint object for a node that should be inserted incrementally + * into the graph at its exact current sequence position. + * The node will be placed into an already existing layer that is determined + * by the {@link yfiles.hierarchic.incremental.HierarchicLayouter#layerer layerer} + * at the position that is deemed best for its layer. The position within the sequence of its layer + * will be determined by its current coordinates. + * @see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactCoordinatesHint} + * @see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactLayerCoordinatesHint} + * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer#exactPlacementEnforced} + * @param {Object} forNodeId the node to be placed at its exact current sequence position. + * @return {Object} + * an Object that can be interpreted by {@link yfiles.hierarchic.incremental.HierarchicLayouter} + * @see Specified by {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactSequenceCoordinatesHint}. + */ + createUseExactSequenceCoordinatesHint(forNodeId:Object):Object; + } + var IIncrementalHintsFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum MergingPolicy{ + /** + * Constant for merging policy. + * This policy adds new layers from the source layering below the + * layers in the target layering. + */ + ADD_BELOW, + /** + * Constant for merging policy. + * This policy adds new layers from the source layering above the + * layers in the target layering. + */ + ADD_ABOVE, + /** + * Constant for merging policy. + * This policy adds new layers from the source layering to the right of + * the layers in the target layering. + * Both layerings will be top aligned before the merge. + */ + ADD_RIGHT_TOP_ALIGNED, + /** + * Constant for merging policy. + * This policy adds new layers from the source layering to the right of + * the layers in the target layering. + * Both layerings will be bottom aligned before the merge. + */ + ADD_RIGHT_BOTTOM_ALIGNED, + /** + * Constant for merging policy. + * This policy adds new layers from the source layering to the right of + * the layers in the target layering. + * Both layerings will be center aligned before the merge. + */ + ADD_RIGHT_CENTER_ALIGNED, + /** + * Constant for merging policy. + * This policy adds new layers from the source layering to the left of + * the layers in the target layering. + * Both layerings will be top aligned before the merge. + */ + ADD_LEFT_TOP_ALIGNED, + /** + * Constant for merging policy. + * This policy adds new layers from the source layering to the left of + * the layers in the target layering. + * Both layerings will be bottom aligned before the merge. + */ + ADD_LEFT_BOTTOM_ALIGNED, + /** + * Constant for merging policy. + * This policy adds new layers from the source layering to the left of + * the layers in the target layering. + * Both layerings will be center aligned before the merge. + */ + ADD_LEFT_CENTER_ALIGNED + } + /** + * This class is used by {@link yfiles.hierarchic.incremental.HierarchicLayouter} during the various + * phases to determine the routing details of the graph's edges. + * Note: not all of these values will be used for all kinds of edges and + * any kind of algorithm. + * This class is designed as a class to allow for future additions of new getter + * methods. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + * @see {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor} + */ + export interface EdgeLayoutDescriptor extends Object{ + /** + * The minimum length of the first segment (at the source). + * If the value is 0.0d the first segment does not need to be + * orthogonal. + * Default is 10.0d. + */ + minimumFirstSegmentLength:number; + /** + * The minimum length of the last segment (at the target). + * If the value is 0.0d the last segment does not need to be + * orthogonal. + * Default is 15.0d. + */ + minimumLastSegmentLength:number; + /** + * The minimum length of the edge. + * If this is used for polyline routing, it describes the minimum vertical length + * of the mid segment (the one that may be routed non-orthogonally). + * If it is used for orthogonal routing it describes the minimum length for the whole edge. + * Default is 20.0d. + */ + minimumLength:number; + /** + * The preferred minimum distance of the edge to obstacles. + * Default is 10.0d. + */ + minimumDistance:number; + /** + * The minimum slope this edge's mid-segments should have if the edge + * is routed polygonal in vertical layouts. + *

+ * Default is 0.3d. + *

+ */ + minimumSlope:number; + /** + * Specifies whether source port optimization is enabled, i.e. + * whether + * the algorithm should try to find a better source {@link yfiles.layout.PortConstraint} + * if the current constraint is null or {@link yfiles.layout.PortSide#ANY}. + * Default is false, which will result in ports being placed at the side of + * the node which lies closest to the target of the edge in terms of layering. + */ + sourcePortOptimizationEnabled:boolean; + /** + * Specifies whether target port optimization is enabled, i.e. + * whether + * the algorithm should try to find a better target {@link yfiles.layout.PortConstraint} + * if the current constraint is null or {@link yfiles.layout.PortSide#ANY}. + * Default is false, which will result in ports being placed at the side of + * the node which lies closest to the source of the edge in terms of layering. + */ + targetPortOptimizationEnabled:boolean; + /** + * Determines whether this edge should be routed orthogonally. + * Default is false. + * This does not affect the routing of bus-like structures. + */ + orthogonallyRouted:boolean; + /** + * The routing style for this edge. + * @see {@link yfiles.hierarchic.incremental.RoutingStyle} + * @see {@link yfiles.hierarchic.incremental.RoutingStyle} + */ + routingStyle:yfiles.hierarchic.incremental.RoutingStyle; + /** + * The minimum length of octilinear segments for this edge. + * Note: the layout algorithm cannot always maintain the specified minimum length. + *

+ * Default is 20.0d. + *

+ * @see {@link yfiles.hierarchic.incremental.EdgeLayoutDescriptor#routingStyle} + * @see {@link yfiles.hierarchic.incremental.EdgeLayoutDescriptor#routingStyle} + */ + minOctilinearSegmentLength:number; + } + var EdgeLayoutDescriptor:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of an EdgeLayoutDescriptor using the + * default values. + */ + new ():yfiles.hierarchic.incremental.EdgeLayoutDescriptor; + }; + export enum EdgeDataType{ + /** + * Describes a normal edge. + */ + NORMAL, + /** + * Describes an edge that connects to a source group node. + */ + SOURCE_GROUP_NODE_CONNECTOR, + /** + * Describes an edge that connects to a target group node. + */ + TARGET_GROUP_NODE_CONNECTOR, + /** + * Describes an edge that connects two group nodes. + */ + GROUP_NODE_INTERCONNECTOR, + /** + * Describes a same layer edge that connects two neighbouring nodes directly. + */ + DIRECT_SAME_LAYER_EDGE, + /** + * Describes a same layer edge that connects two neighbouring nodes directly. + */ + NON_DIRECT_SAME_LAYER_EDGE, + /** + * Describes an edge that connects group border nodes in adjacent layers. + */ + BORDER_EDGE, + /** + * Describes an edge that has been added temporarily to replace an edge connected to a group node. + */ + REDIRECTED_GROUP_EDGE + } + export enum PortAssignmentMode{ + /** + * Port assignment specifier that describes the default port assignment strategy of + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter}. The ports are distributed evenly at the border of the + * node. + */ + DEFAULT, + /** + * Port assignment specifier that describes a port assignment strategy which places all edges on grid lines. + * If there are not enough grid lines for each port, ports may overlap. + * In case there is no grid line available at the side of a node, the ports are placed centered at that side. + *

+ * Note that this port assignment can only be used if the + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter#gridSpacing grid spacing} is greater than 0. + *

+ */ + ON_GRID, + /** + * Port assignment specifier that describes a port assignment strategy which places all edges on grid lines + * or subgrid lines. If there are not enough grid lines for each port, the grid gets subdivided with subgrid lines + * until each edge has space for its port. + *

+ * Note that this port assignment can only be used if the + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter#gridSpacing grid spacing} is greater than 0. + *

+ */ + ON_SUBGRID + } + export enum NodeDataType{ + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A normal node - may have any degree, any size and any number of connected + * same layer edges. + */ + NORMAL, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A bend node - has degree 2, small size and no same layer edges. + */ + BEND, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A side proxy node in case port constraints are used for the drawing phase + * - has degree 1, small size and no same layer edges. + * The associated node is the node this node is the proxy of. + */ + SIDE_PROXY, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A side proxy node for drawing same layer edges - has degree 0, small size + * and one same layer edge. + * The associated node is the node this node is the proxy of. + * The associated edge is the same layer edge this node is the proxy of. + */ + SAME_LAYER_SIDE_PROXY, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A label node for drawing - has degree 2, size of the labels and no same layer edges. + * The borders of this node describe the layout of the labels + */ + LABEL, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A group node if nested graph layouts are calculated. + * Carries additional {@link yfiles.hierarchic.incremental.ILayers} information. + * @see {@link yfiles.hierarchic.incremental.INodeData#groupLayers} + */ + GROUP, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A source group node for bus edges. This node serves as a dummy node + * in a {@link yfiles.hierarchic.incremental.LayerType#SOURCE_GROUP_NODES} layer. + * @see {@link yfiles.hierarchic.incremental.INodeData#groupId} + */ + SOURCE_GROUP_NODE, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A target group node for bus edges. This node serves as a dummy node + * in a {@link yfiles.hierarchic.incremental.LayerType#TARGET_GROUP_NODES} layer. + * @see {@link yfiles.hierarchic.incremental.INodeData#groupId} + */ + TARGET_GROUP_NODE, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A backloop proxy that belongs to the source of an edge + * - has degree 2, small size and exactly one same layer edge + */ + SOURCE_BACKLOOP_PROXY, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A backloop proxy that belongs to the target of an edge + * - has degree 2, small size and exactly one same layer edge + */ + TARGET_BACKLOOP_PROXY, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A same layer edge crossing dummy node - has degree 2, + * small size and exactly two same layer edges. + * Is used to mark the crossing of the layer if source and target port + * are at opposite layer sides. + */ + SAME_LAYER_CENTER_NODE, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A node used for the drawing phase to keep the distance between two nodes. + */ + DISTANCE_NODE, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A node used for the drawing phase to mark the beginning of a node group interval. + */ + GROUP_BEGIN, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A node used for the drawing phase to mark the ending of a node group interval. + */ + GROUP_END, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A node used for the the sequencing and drawing phase to mark a dummy node inserted to guarantee that a group + * is non-empty on each layer that it is defined on. + */ + GROUP_LAYER_DUMMY, + /** + * Node type constant as returned by {@link yfiles.hierarchic.incremental.INodeData#type}. + * A node used for the the sequencing and drawing phase to mark a dummy node that has been inserted + * as a legal end point of an edge connecting to a group node. + */ + PROXY_FOR_EDGE_AT_GROUP + } + export enum NodeLabelMode{ + /** + * Byte constant used by {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor#nodeLabelMode} and + * {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor#nodeLabelMode}. This mode prevents node labels from being + * considered during the layout at all. + */ + NEVER, + /** + * Byte constant used by {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor#nodeLabelMode} and + * {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor#nodeLabelMode}. This mode makes the algorithm consider + * node labels for self-loops, node placement, and routing. + */ + CONSIDER_FOR_SELF_LOOPS, + /** + * Byte constant used by {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor#nodeLabelMode} and + * {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor#nodeLabelMode}. This mode makes the algorithm consider + * node labels for node placement and routing but not for self loops. + */ + CONSIDER_FOR_DRAWING, + /** + * Byte constant used by {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor#nodeLabelMode} and + * {@link yfiles.hierarchic.incremental.NodeLayoutDescriptor#nodeLabelMode}. This mode makes the algorithm consider + * node labels during routing only. + */ + CONSIDER_FOR_ROUTING + } + export enum IncrementalHintType{ + /** + * Type specifier that is used as a dummy. This hint actually tells the algorithm that the corresponding + * element should not be treated as an incrementally added element. + */ + NONE, + /** + * Type specifier that is used for nodes that shall be inserted into the drawing incrementally. + * @see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createLayerIncrementallyHint} + */ + LAYER_INCREMENTALLY, + /** + * Type specifier that is used for edges that shall be inserted into the drawing incrementally. + * @see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createSequenceIncrementallyHint} + */ + SEQUENCE_INCREMENTALLY, + /** + * Type specifier that is used for groups that shall be inserted into the drawing incrementally. + * @see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createIncrementalGroupHint} + */ + INCREMENTAL_GROUP, + /** + * Type specifier that is used for nodes that shall be placed into the drawing from sketch using the exact current + * coordinates for both the position within the layer and the position in the sequence. + * @see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactCoordinatesHint} + * @see {@link yfiles.hierarchic.incremental.IncrementalHintType#PLACE_USING_EXACT_LAYER_COORDINATES} + * @see {@link yfiles.hierarchic.incremental.IncrementalHintType#PLACE_USING_EXACT_SEQUENCE_COORDINATES} + */ + PLACE_USING_EXACT_COORDINATES, + /** + * Type specifier that is used for nodes that shall be placed into the drawing from sketch using + * the exact current coordinates for the position within the + * sequence in the layer. + * @see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactSequenceCoordinatesHint} + */ + PLACE_USING_EXACT_SEQUENCE_COORDINATES, + /** + * Type specifier that is used for nodes that shall be placed into the drawing from sketch using + * the exact current coordinates for the position within the layer. + * @see {@link yfiles.hierarchic.incremental.IIncrementalHintsFactory#createUseExactLayerCoordinatesHint} + */ + PLACE_USING_EXACT_LAYER_COORDINATES + } + export enum LayerType{ + /** + * Describes a normal layer consisting mainly of normal nodes. + */ + NORMAL, + /** + * Describes a layer consisting mainly of label nodes or dummy nodes. + */ + LABEL, + /** + * Describes a layer consisting of source group nodes and dummy nodes. + */ + SOURCE_GROUP_NODES, + /** + * Describes a layer consisting of target group nodes and dummy nodes. + */ + TARGET_GROUP_NODES + } + /** + * A default {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator} implementation that is used + * by {@link yfiles.hierarchic.incremental.HierarchicLayouter} to configure the {@link yfiles.hierarchic.incremental.INodePlacer}. + */ + export interface DefaultDrawingDistanceCalculator extends Object,yfiles.hierarchic.incremental.IDrawingDistanceCalculator{ + /** + * Called to initialize internal data structures. + * Implementations may + * cache lengthy calculations in the initialization phase. + * It is guaranteed that the graph will not be changed during subsequent + * calls to {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#getMinDistance}. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains all elements that are used during + * the node placement + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layers object that will be used during subsequent calls + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that can be used to query information + * @see {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#dispose} + * @see Specified by {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#initialize}. + */ + initialize(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + /** + * Called to dispose internal data structures. + * Implementations should + * release internally held data structures here. + * @see {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#initialize} + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains all elements that are used during + * the node placement + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layers object that was used + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that was used to query information + * @see Specified by {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#dispose}. + */ + dispose(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + /** + * Specifies whether or not an adaptive minimum edge distance should be used. + * If this option is enabled the minimum distance between two adjacent edges is the minimum of the set + * minimum edge distance and the distance of the edges' source/target points. + * By default this option is enabled. + */ + useAdaptiveMinEdgeDistance:boolean; + /** + * Specifies whether or not the compaction option is enabled. + * If it is enabled adjacent layer elements + * may be placed in a stacked style (i.e., horizontally interleaving). + * By default this option is disabled. + */ + compaction:boolean; + /** + * Main interface method. + * Queried by {@link yfiles.hierarchic.incremental.INodePlacer} instances to determine + * the minimum distances between elements in one layer. Note that either of the Node + * arguments may be null. In that case only the border of the non-null + * node should be considered. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the nodes + * @param {yfiles.hierarchic.incremental.ILayer} layer the layer object that contains the nodes + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that can be used to query information + * @param {yfiles.algorithms.Node} left + * the left one of the two nodes whose + * minimum distance is to be determined or null if only the left border of the right node is + * of interest. + * @param {yfiles.algorithms.Node} right + * the right one of the two nodes whose + * minimum distance is to be determined or null if only the right border of the left node is + * of interest. + * @see Specified by {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator#getMinDistance}. + */ + getMinDistance(graph:yfiles.layout.LayoutGraph,layer:yfiles.hierarchic.incremental.ILayer,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,left:yfiles.algorithms.Node,right:yfiles.algorithms.Node):number; + /** + * The minimum distance between two nodes. + * Default is 30.0d. + */ + node2NodeDistance:number; + /** + * The minimum distance between a node and an (non-adjacent) edge. + * Default is 15.0d. + */ + node2EdgeDistance:number; + /** + * The minimum distance between two edges. + * Default is 20.0d. + */ + edge2EdgeDistance:number; + /** + * Specifies whether the optimized minimum distance calculation for swim lane layouts + * is enabled. + * If set to true this instance will report 0.0d + * as the minimum distance between two nodes if they belong to different swim + * lanes. This avoids unwanted feedback between different swim lanes during + * node placement. + */ + optimizeSwimLaneDistances:boolean; + } + var DefaultDrawingDistanceCalculator:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of DefaultDrawingDistanceCalculator + * with default settings. + */ + new ():yfiles.hierarchic.incremental.DefaultDrawingDistanceCalculator; + }; + /** + * Layerer implementation that observes relative and absolute layering constraints defined by the layering constraint + * factory {@link yfiles.hierarchic.incremental.ILayerConstraintFactory}. + * For a given graph instance, this factory can be created with method + * {@link yfiles.hierarchic.IncrementalHierarchicLayouter#createLayerConstraintFactory}. + * The Layerer can be used for both common layering and layering of incremental nodes. + * Note: This layerer is always used automatically if the graph instance has constraints created with the layering + * constraint factory. + * @see {@link yfiles.hierarchic.incremental.ILayerConstraintFactory} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter} + */ + export interface ConstraintIncrementalLayerer extends Object,yfiles.hierarchic.incremental.ILayerer{ + /** + * Specifies whether same layer edges can be created by this layerer instance. + *

+ * This only concerns edges between nodes that have no hard constraints that + * will force a same layer edge (i.e. a same layer constraint). + *

+ * Default value is false. + *

+ */ + allowSameLayerEdges:boolean; + /** + * Calculates a layering for the given graph. + * @param {yfiles.layout.LayoutGraph} g the graph containing all nodes and edges. + * @param {yfiles.hierarchic.incremental.ILayers} layers + * a structure that is filled by the layerer. If the layerer is used for layering incremental nodes, + * the layers structure already have to contain all non-incremental nodes. + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerer#assignLayers}. + */ + assignLayers(g:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + /** + * Checks if the current set of strong constraints is consistent (i.e. + * has no cycles) + * @throws {yfiles.system.ArgumentException} if the constraint network is inconsistent + */ + checkConstraints():void; + } + var ConstraintIncrementalLayerer:{ + $class:yfiles.lang.Class; + /** + * DataProvider key for additional edge weights of type int. + *

+ * The Layerer tries to keep edges with higher weights short. + *

+ */ + EDGE_WEIGHTS_DP_KEY:string; + new (coreLayerer:yfiles.hierarchic.incremental.ILayerer):yfiles.hierarchic.incremental.ConstraintIncrementalLayerer; + }; + /** + * A default implementation of a {@link yfiles.hierarchic.incremental.ILayeredComponentsMerger} that provides + * simple default behaviors. + * Instances of this class are used internally + * by {@link yfiles.hierarchic.incremental.HierarchicLayouter} and {@link yfiles.hierarchic.incremental.MultiComponentLayerer} e.g. + */ + export interface DefaultLayeredComponentsMerger extends Object,yfiles.hierarchic.incremental.ILayeredComponentsMerger{ + /** + * The current policy constant. + */ + policy:yfiles.hierarchic.incremental.MergingPolicy; + /** + * All nodes in srcLayers and targetLayers are part of graph at the moment of + * invocation. + * The state of srcLayers is discarded after this call and need not + * be updated to reflect the changes. targetLayers must be updated accordingly. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains the nodes in srcLayers and + * targetLayers. + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that can be used to query the layer indices + * @param {yfiles.hierarchic.incremental.ILayers} srcLayers + * the Layers implementation that contains the layers that + * will be merged into targetLayers + * @param {yfiles.hierarchic.incremental.ILayers} targetLayers + * the Layers that will be modified to contain the resulting + * layering + * @see Specified by {@link yfiles.hierarchic.incremental.ILayeredComponentsMerger#merge}. + */ + merge(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,srcLayers:yfiles.hierarchic.incremental.ILayers,targetLayers:yfiles.hierarchic.incremental.ILayers):void; + } + var DefaultLayeredComponentsMerger:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of DefaultLayeredComponentsMerger + * with default policy ({@link yfiles.hierarchic.incremental.MergingPolicy#ADD_RIGHT_TOP_ALIGNED}). + */ + new ():yfiles.hierarchic.incremental.DefaultLayeredComponentsMerger; + /** + * Creates a new instance of DefaultLayeredComponentsMerger + * using the given policy constant. + */ + WithPolicy:{ + new (policy:yfiles.hierarchic.incremental.MergingPolicy):yfiles.hierarchic.incremental.DefaultLayeredComponentsMerger; + }; + }; + /** + * This class implements the second phase of the Sugiyama algorithm. + * It minimizes the crossings in the diagram by using either the + * barycentric or median heuristic. + */ + export interface DefaultLayerSequencer extends Object,yfiles.hierarchic.incremental.ISequencer{ + /** + * Specifies whether or not the transposition crossing minimization heuristic + * should be used. + * Activating this heuristic can reduce the overall + * number of edge crossings. On the other hand its activation + * increases running time. + * By default the transposition rule is active. + */ + transpositionEnabled:boolean; + /** + * Specifies whether or not the group transposition heuristic should + * be used. + * Activating this heuristic can reduce the overall + * number of edge crossings in grouped graphs. On the other hand its activation + * increases running time. + * By default the transposition rule is not active. + */ + groupTranspositionEnabled:boolean; + /** + * The currently set weight heuristic. + * By default {@link yfiles.hierarchic.WeightHeuristic#BARYCENTER} is set. + * @throws {yfiles.system.ArgumentException} if the constant is unknown + */ + weightHeuristic:yfiles.hierarchic.WeightHeuristic; + /** + * The proposed maximal duration for the calculation of the sequence. + * The default is 10000 + */ + maximalDuration:number; + /** + * The number of randomized rounds this algorithm will try + * if there was no optimal solution. + */ + randomizationRounds:number; + /** + * Called by {@link yfiles.hierarchic.incremental.HierarchicLayouter} during the second phase. + * Calculates a sequence of the nodes in layers and finally + * writes back the calculated sequence using the {@link yfiles.hierarchic.incremental.ILayer#setNodeOrder} + * method. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the elements from layers + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layer implementation that holds the Layers for sequencing + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the LayoutDataProvider that provides the necessary {@link yfiles.hierarchic.incremental.INodeData} + * and {@link yfiles.hierarchic.incremental.IEdgeData} + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory + * an ItemFactory implementation that can be used to modify the + * graph consistently + * @see Specified by {@link yfiles.hierarchic.incremental.ISequencer#sequenceNodeLayers}. + */ + sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,glayers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + } + var DefaultLayerSequencer:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the DefaultLayerSequencer class. + */ + new ():yfiles.hierarchic.incremental.DefaultLayerSequencer; + }; + /** + * Default implementation of the PortAllocator interface. + */ + export interface DefaultPortAllocator extends Object,yfiles.hierarchic.incremental.IPortAllocator{ + /** + * Assigns the port positions for the drawer. + * Assigns {@link yfiles.layout.PortSide#ANY} ports to appropriate sides. + * Assigns {@link yfiles.layout.PortConstraint#strong weak} ports to appropriate positions between strong ones + * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.hierarchic.incremental.ILayers} layers the layering + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that can be used to query information + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory the ItemFactory that can be used for temporarily altering the graph + * @see Specified by {@link yfiles.hierarchic.incremental.IPortAllocator#assignPorts}. + */ + assignPorts(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + /** + * Callback method used to determine the port border gap for each node and + * side. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that can be used to query information from + * @param {yfiles.algorithms.Node} node the node + * @param {number} sideIndex the zero based (top is 0) clock-wise index of the side of the node (for top-to-bottom layouts) + * @param {number} sideLength the width/height of the side + * @param {number} edgeCount the number of edges/port that connect to this side + * @return {number} the absolute gap to be used on both sides of the ports + * @see {@link yfiles.hierarchic.incremental.DefaultPortAllocator#getPortDistanceDelta} + */ + getPortBorderGap(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,node:yfiles.algorithms.Node,sideIndex:number,sideLength:number,edgeCount:number):number; + /** + * Callback method used to determine the distance between two adjacent ports. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that can be used to query information from + * @param {yfiles.algorithms.Node} node the node + * @param {number} sideIndex the zero based (top is 0) clock-wise index of the side of the node (for top-to-bottom layouts) + * @param {number} sideLength the width/height of the side + * @param {number} edgeCount the number of edges/port that connect to this side + * @param {number} portBorderGap the previously calculated port border gap + * @return {number} the absolute distance to be used between two adjacent ports + */ + getPortDistanceDelta(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,node:yfiles.algorithms.Node,sideIndex:number,sideLength:number,edgeCount:number,portBorderGap:number):number; + /** + * Callback method used to determine the port border gap ratio. + * See {@link yfiles.hierarchic.incremental.DefaultPortAllocator#defaultPortBorderGapRatio} for an explanation. + * This implementation returns the same value as {@link yfiles.hierarchic.incremental.DefaultPortAllocator#defaultPortBorderGapRatio} does. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that can be used to query information from + * @param {yfiles.algorithms.Node} node the node + * @param {number} sideIndex the zero based (top is 0) clock-wise index of the side of the node (for top-to-bottom layouts) + * @param {number} sideLength the width/height of the side + * @param {number} edgeCount the number of edges/port that connect to this side + * @return {number} the ratio + */ + getPortBorderGapRatio(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,node:yfiles.algorithms.Node,sideIndex:number,sideLength:number,edgeCount:number):number; + /** + * The default port to border gap ratio. + * This ratio determines the gap between a corner of the node and the first + * assigned port. A value of 0.0d results in ports being + * placed directly on the corner of the node (if there is more than one port). + * The default value of 0.5d results in ports being distributed + * along the side of the node so that the distance between the corner of the node + * and the first port is half as wide as the distance between two adjacent ports. + * A value of Double.POSITIVE_INFINITY results in all ports being + * centered at the side in one point. + */ + defaultPortBorderGapRatio:number; + } + var DefaultPortAllocator:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of DefaultPortAllocator with default settings. + * @see {@link yfiles.hierarchic.incremental.DefaultPortAllocator#defaultPortBorderGapRatio} + */ + new ():yfiles.hierarchic.incremental.DefaultPortAllocator; + }; + /** + * Merges two {@link yfiles.hierarchic.incremental.ILayers} instances, whose nodes reside in the same graph. + * Implementations of this interface may provide different strategies for merging. + */ + export interface ILayeredComponentsMerger extends Object{ + /** + * All nodes in srcLayers and targetLayers are part of graph at the moment of + * invocation. + * The state of srcLayers is discarded after this call and need not + * be updated to reflect the changes. targetLayers must be updated accordingly. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains the nodes in srcLayers and + * targetLayers. + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp the LayoutDataProvider that can be used to query the layer indices + * @param {yfiles.hierarchic.incremental.ILayers} srcLayers + * the Layers implementation that contains the layers that + * will be merged into targetLayers + * @param {yfiles.hierarchic.incremental.ILayers} targetLayers + * the Layers that will be modified to contain the resulting + * layering + * @see Specified by {@link yfiles.hierarchic.incremental.ILayeredComponentsMerger#merge}. + */ + merge(graph:yfiles.layout.LayoutGraph,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,srcLayers:yfiles.hierarchic.incremental.ILayers,targetLayers:yfiles.hierarchic.incremental.ILayers):void; + } + var ILayeredComponentsMerger:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Adapter class that uses a {@link yfiles.algorithms.IDataMap}, {@link yfiles.algorithms.INodeMap}, or {@link yfiles.algorithms.IEdgeMap} + * implementation and wraps it as a {@link yfiles.algorithms.IDataProvider} that provides + * {@link yfiles.hierarchic.incremental.IIntValueHolder} instances for each element. + * See {@link yfiles.hierarchic.incremental.HierarchicLayouter#LAYER_VALUE_HOLDER_DP_KEY} for a typical use case + * of this class. + */ + export interface IntValueHolderAdapter extends Object,yfiles.algorithms.IDataProvider{ + /** + * 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 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; + /** + * 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 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; + } + var IntValueHolderAdapter:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of IntValueHolderAdapter using a DataMap. + */ + FromDataMap:{ + new (map:yfiles.algorithms.IDataMap):yfiles.hierarchic.incremental.IntValueHolderAdapter; + }; + /** + * Creates a new instance of IntValueHolderAdapter using a NodeMap. + */ + FromNodeMap:{ + new (map:yfiles.algorithms.INodeMap):yfiles.hierarchic.incremental.IntValueHolderAdapter; + }; + /** + * Creates a new instance of IntValueHolderAdapter using an EdgeMap. + */ + FromEdgeMap:{ + new (map:yfiles.algorithms.IEdgeMap):yfiles.hierarchic.incremental.IntValueHolderAdapter; + }; + /** + * Creates a new instance of IntValueHolderAdapter using a pair + * of DataAcceptor and DataProvider instances for storage and retrieval. + */ + FromDataAcceptorAndDataProvider:{ + new (acc:yfiles.algorithms.IDataAcceptor,dp:yfiles.algorithms.IDataProvider):yfiles.hierarchic.incremental.IntValueHolderAdapter; + }; + }; + /** + * Used by to write back layering information. + */ + export interface IIntValueHolder extends Object{ + /** + * The value of the current context. + * @see Specified by {@link yfiles.hierarchic.incremental.IIntValueHolder#value}. + */ + value:number; + /** + * Returns whether the current context provides a value. + * @return {boolean} whether meaningful value can be queried from the current context. + * @see Specified by {@link yfiles.hierarchic.incremental.IIntValueHolder#providesValue}. + */ + providesValue():boolean; + } + var IIntValueHolder:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Multi-purpose node descriptor for each node in the graph during the + * hierarchic layout used internally by the algorithm implementations. + * Instances of this interface can be obtained during the layout from instances + * of the {@link yfiles.hierarchic.incremental.ILayoutDataProvider} interface. + * NodeData typically carries a node's type and depending on the type an + * optional {@link yfiles.hierarchic.incremental.INodeData#associatedEdge associated Edge } and + * {@link yfiles.hierarchic.incremental.INodeData#associatedNode associated Node }. Optionally they may carry + * a geometric description of the Node's borders and descriptors for various + * aspects of the layout. + */ + export interface INodeData extends Object{ + /** + * The group node this node belongs to. + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#groupNode}. + */ + groupNode:yfiles.algorithms.Node; + /** + * Returns a borderline for the given side which is treated as if the node's position + * was at (0,0). + * Clients may modify this instance but should always reset it to the + * original position, since this is a shared instance. + * May return null to indicate that the borderline can be determined + * through the node's NodeLayout + * @param {number} side + * the index of the side where 0 means top, 1 + * means right, 2 means bottom, and 3 means left. + * @return {yfiles.algorithms.BorderLine} a BorderLine instance if the node was at (0,0) or null + * @see {@link yfiles.hierarchic.incremental.INodeData#createBorderLine} + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#getNormalizedBorderLine}. + */ + getNormalizedBorderLine(side:number):yfiles.algorithms.BorderLine; + /** + * Creates, stores, and returns a BorderLine for the given side or returns the currently + * set BorderLine if it already exists. + * Not every type of node supports this operation. + * {@link yfiles.hierarchic.incremental.NodeDataType#NORMAL} supports borderlines. + * @param {number} side + * the side as defined in {@link yfiles.hierarchic.incremental.INodeData#getNormalizedBorderLine} + * @param {yfiles.layout.INodeLayout} nl + * the NodeLayout of the current node, the initial Borderline will + * be initialize from this instance + * @throws {yfiles.system.NotSupportedException} + * if this type of node does not support node + * borders + * @see {@link yfiles.hierarchic.incremental.INodeData#getNormalizedBorderLine} + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#createBorderLine}. + */ + createBorderLine(side:number,nl:yfiles.layout.INodeLayout):yfiles.algorithms.BorderLine; + /** + * The first same layer edge ListCell of all same layer edges. + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#firstSameLayerEdgeCell}. + */ + firstSameLayerEdgeCell:yfiles.algorithms.ListCell; + /** + * Returns the number of same layer edges that are associated with this node. + * @return {number} the number + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#sameLayerEdgeCount}. + */ + sameLayerEdgeCount():number; + /** + * The type constant for this node. + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#type}. + */ + type:yfiles.hierarchic.incremental.NodeDataType; + /** + * Group id of this node if it is a bus group node. + * @see {@link yfiles.hierarchic.incremental.NodeDataType#SOURCE_GROUP_NODE} + * @see {@link yfiles.hierarchic.incremental.NodeDataType#TARGET_GROUP_NODE} + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#groupId}. + */ + groupId:Object; + /** + * The associated node (in case of e.g. + * backloop proxy and side proxy) + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#associatedNode}. + */ + associatedNode:yfiles.algorithms.Node; + /** + * The associated edge (in case of e.g. + * bend or same layer center node) + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#associatedEdge}. + */ + associatedEdge:yfiles.algorithms.Edge; + /** + * The layer index this node resides in. + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#layer}. + */ + layer:number; + /** + * The current position of this node in its layer. + * Note: this may not always be up to date depending on which phase the layout + * algorithm is currently in + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#position}. + */ + position:number; + /** + * The parent group node if any. + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#parentGroupNode}. + */ + parentGroupNode:yfiles.algorithms.Node; + /** + * The inner layers of this group node. + * If this node is of type {@link yfiles.hierarchic.incremental.NodeDataType#GROUP}, this method returns the + * {@link yfiles.hierarchic.incremental.ILayers} object that describes the layering in the subgraph. + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#groupLayers}. + */ + groupLayers:yfiles.hierarchic.incremental.ILayers; + /** + * The hint of the incremental mode of this node if this node is of type{@link yfiles.hierarchic.incremental.NodeDataType#NORMAL} + * and a corresponding hint has been set via the {@link yfiles.hierarchic.incremental.HierarchicLayouter#INCREMENTAL_HINTS_DP_KEY} + * DataProvider. + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#incrementalHint}. + */ + incrementalHint:yfiles.hierarchic.incremental.HierarchicLayouter.IncrementalHint; + /** + * The NodeLayoutDescriptor instance that was initially + * bound to this node or null. + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#nodeLayoutDescriptor}. + */ + nodeLayoutDescriptor:yfiles.hierarchic.incremental.NodeLayoutDescriptor; + /** + * The SwimLaneDescriptor instance that was initially + * bound to this node or null. + * @see Specified by {@link yfiles.hierarchic.incremental.INodeData#swimLaneDescriptor}. + */ + swimLaneDescriptor:yfiles.hierarchic.incremental.SwimLaneDescriptor; + } + var INodeData:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Responsible for the x (sequence) and preliminary y coordinate assignments of + * a drawing. + * Implementations of this interface are used during the last phases of the algorithm + * of the {@link yfiles.hierarchic.incremental.HierarchicLayouter}. They determine preliminary y coordinates + * (which may be adjusted during the final edge routing) and the x coordinates + * of all the elements that are part of the graph during the node placement phase. + * @see {@link yfiles.hierarchic.incremental.SimplexNodePlacer} + * @see {@link yfiles.hierarchic.incremental.IDrawingDistanceCalculator} + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter} + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#nodePlacer} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#nodePlacer} + */ + export interface INodePlacer extends Object{ + /** + * Invoked by {@link yfiles.hierarchic.incremental.HierarchicLayouter} before the ports get assigned. + * This method is used to assign preliminary y coordinates for each layer. + * The distance between two layers will be adjusted later by the edge routing + * algorithm. This method is responsible for assigning the relative positions + * of the nodes within each layer. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the elements + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} layoutDataProvider + * the LayoutDataProvider that contains information about + * the elements + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layers that shall be calculated by this method + * @see Specified by {@link yfiles.hierarchic.incremental.INodePlacer#assignLayerCoordinates}. + */ + assignLayerCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.incremental.ILayoutDataProvider,layers:yfiles.hierarchic.incremental.ILayers):void; + /** + * Invoked by {@link yfiles.hierarchic.incremental.HierarchicLayouter} to determine the resulting x coordinates. + * This method is invoked after all ports have been assigned their final relative + * coordinates and nodes have been given relative coordinates within each layer. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the elements + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} layoutDataProvider + * the LayoutDataProvider that contains information about + * the elements + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layers that shall be calculated by this method + * @param {yfiles.hierarchic.incremental.IDrawingDistanceCalculator} drawingDistanceCalculator + * an instance that can be queried to determine + * the minimum distance between each pair of nodes in the graph + * @see Specified by {@link yfiles.hierarchic.incremental.INodePlacer#assignSequenceCoordinates}. + */ + assignSequenceCoordinates(graph:yfiles.layout.LayoutGraph,layoutDataProvider:yfiles.hierarchic.incremental.ILayoutDataProvider,layers:yfiles.hierarchic.incremental.ILayers,drawingDistanceCalculator:yfiles.hierarchic.incremental.IDrawingDistanceCalculator):void; + } + var INodePlacer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface serves as a callback for {@link yfiles.hierarchic.incremental.HierarchicLayouter} after the layering and sequencing phases. + * Implementations of this interface may modify the port constraints ({@link yfiles.layout.PortConstraint}) information + * via {@link yfiles.hierarchic.incremental.IItemFactory#setTemporaryPortConstraint}. + */ + export interface IPortConstraintOptimizer extends Object{ + /** + * Called after the layering information has been determined. + * This method can be used to assign + * new temporary port constraints for the next phases of the algorithm. + * @see {@link yfiles.hierarchic.incremental.IItemFactory#setTemporaryPortConstraint} + * @param {yfiles.layout.LayoutGraph} graph the graph to work on + * @param {yfiles.hierarchic.incremental.ILayers} layers the layering information + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the implementation which provides access to the {@link yfiles.hierarchic.incremental.INodeData} and {@link yfiles.hierarchic.incremental.IEdgeData} instances + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory the factory to set the temporary port constraints with + * @see Specified by {@link yfiles.hierarchic.incremental.IPortConstraintOptimizer#optimizeAfterLayering}. + */ + optimizeAfterLayering(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + /** + * Called after the sequence of the nodes has been determined. + * This method can be used to assign + * new temporary port constraints for the next phases of the algorithm. + * @see {@link yfiles.hierarchic.incremental.IItemFactory#setTemporaryPortConstraint} + * @param {yfiles.layout.LayoutGraph} graph the graph to work on + * @param {yfiles.hierarchic.incremental.ILayers} layers the layering information + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the implementation which provides access to the {@link yfiles.hierarchic.incremental.INodeData} and {@link yfiles.hierarchic.incremental.IEdgeData} instances + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory the factory to set the temporary port constraints with + * @see Specified by {@link yfiles.hierarchic.incremental.IPortConstraintOptimizer#optimizeAfterSequencing}. + */ + optimizeAfterSequencing(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + } + var IPortConstraintOptimizer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface is used by {@link yfiles.hierarchic.incremental.HierarchicLayouter} to calculate the node + * orders of nodes within the layers in a {@link yfiles.hierarchic.incremental.ILayers} object. + * Implementations are used during the second phase of the hierarchic layout + * process. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#sequencer} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#fixedElementsSequencer} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#fromScratchSequencer} + */ + export interface ISequencer extends Object{ + /** + * Called by {@link yfiles.hierarchic.incremental.HierarchicLayouter} during the second phase. + * Calculates a sequence of the nodes in layers and finally + * writes back the calculated sequence using the {@link yfiles.hierarchic.incremental.ILayer#setNodeOrder} + * method. + * @param {yfiles.layout.LayoutGraph} graph the graph that contains the elements from layers + * @param {yfiles.hierarchic.incremental.ILayers} layers the Layer implementation that holds the Layers for sequencing + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the LayoutDataProvider that provides the necessary {@link yfiles.hierarchic.incremental.INodeData} + * and {@link yfiles.hierarchic.incremental.IEdgeData} + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory + * an ItemFactory implementation that can be used to modify the + * graph consistently + * @see Specified by {@link yfiles.hierarchic.incremental.ISequencer#sequenceNodeLayers}. + */ + sequenceNodeLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + } + var ISequencer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface used by {@link yfiles.hierarchic.incremental.HierarchicLayouter} during the layout. + * Instances of this class are responsible for assigning port coordinates to + * the adjacent edges of each node in the graph. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter} + */ + export interface IPortAllocator extends Object{ + /** + * Called by {@link yfiles.hierarchic.incremental.HierarchicLayouter} before the actual node placing takes + * place (phase three). + * This method must assign each edge in the graph a source port and target + * port coordinate pair. + * @param {yfiles.layout.LayoutGraph} graph the graph which contains all the elements + * @param {yfiles.hierarchic.incremental.ILayers} layers the layers object that contains the elements in the layering + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * the LayoutDataProvider that can be queried for the {@link yfiles.hierarchic.incremental.INodeData} + * and {@link yfiles.hierarchic.incremental.IEdgeData} instances + * @param {yfiles.hierarchic.incremental.IItemFactory} itemFactory + * the ItemFactory that can be used to temporarily modify + * the graph instance + * @see Specified by {@link yfiles.hierarchic.incremental.IPortAllocator#assignPorts}. + */ + assignPorts(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider,itemFactory:yfiles.hierarchic.incremental.IItemFactory):void; + } + var IPortAllocator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Container class that manages multiple {@link yfiles.hierarchic.incremental.ILayer} instances. + * {@link yfiles.hierarchic.incremental.HierarchicLayouter} creates instances of this class and passes them + * to the instances that handle the various subtasks of the layout process during + * automatic layout. Method {@link yfiles.hierarchic.incremental.ILayers#createInstance} can be used like a factory + * method to obtain temporary Layers instances. + * @see {@link yfiles.hierarchic.incremental.ILayer} + */ + export interface ILayers extends Object{ + /** + * Returns the number of layers in this instance. + * @return {number} the number of layers + * @see Specified by {@link yfiles.hierarchic.incremental.ILayers#size}. + */ + size():number; + /** + * Returns a layer by index. + * @param {number} i the zero-based index + * @return {yfiles.hierarchic.incremental.ILayer} the layer at the given index + * @see Specified by {@link yfiles.hierarchic.incremental.ILayers#getLayer}. + */ + getLayer(i:number):yfiles.hierarchic.incremental.ILayer; + /** + * Creates, inserts and returns a layer of a given type. + * @param {yfiles.hierarchic.incremental.LayerType} type + * a type constant as defined in the {@link yfiles.hierarchic.incremental.ILayer} interface + * @param {number} position the position where this layer will be inserted + * @return {yfiles.hierarchic.incremental.ILayer} a newly created read-to-use layer instance + * @see Specified by {@link yfiles.hierarchic.incremental.ILayers#insert}. + */ + insert(type:yfiles.hierarchic.incremental.LayerType,position:number):yfiles.hierarchic.incremental.ILayer; + /** + * Removes a layer by index. + * @param {number} index the zero-based index of the layer + * @see Specified by {@link yfiles.hierarchic.incremental.ILayers#remove}. + */ + remove(index:number):void; + /** + * Creates a new and empty Layers instance that can be used on the same graph + * instance for temporary results. + * @return {yfiles.hierarchic.incremental.ILayers} + * an instance of the same type as the current instance. It will be + * empty initially. + * @see Specified by {@link yfiles.hierarchic.incremental.ILayers#createInstance}. + */ + createInstance():yfiles.hierarchic.incremental.ILayers; + } + var ILayers:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface is used by classes that are capable of generating a layer + * assignment. + * Layer assignment takes place during the first part of the + * algorithm in hierarchic layout algorithms. + * Each node in the graph is assigned to a layer. + * The {@link yfiles.hierarchic.incremental.OldLayererWrapper} class can be used to wrap existing implementations + * of the {@link yfiles.hierarchic.ILayerer ILayerer} interface + * from the y.layout.hierarchic package. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter#layerer} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#fixedElementsLayerer} + * @see {@link yfiles.hierarchic.IncrementalHierarchicLayouter#fromScratchLayerer} + */ + export interface ILayerer extends Object{ + /** + * This method assigns all nodes in the graph to layers and registers them + * in the {@link yfiles.hierarchic.incremental.ILayers} instance. + * In order to create new layers, the factory + * method {@link yfiles.hierarchic.incremental.ILayers#insert} must be used. + * @param {yfiles.layout.LayoutGraph} graph + * the graph that contains the nodes that should be distributed + * into the layers + * @param {yfiles.hierarchic.incremental.ILayers} layers + * the object that will be filled with the results of the + * calculation + * @param {yfiles.hierarchic.incremental.ILayoutDataProvider} ldp + * LayoutDataProvider that can be used to query information about + * the nodes - note that positional information + * (see {@link yfiles.hierarchic.incremental.INodeData#position} and {@link yfiles.hierarchic.incremental.INodeData#layer}) cannot + * be available at any time. + * @see {@link yfiles.hierarchic.incremental.ILayers#insert} + * @see {@link yfiles.hierarchic.incremental.ILayer#add} + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerer#assignLayers}. + */ + assignLayers(graph:yfiles.layout.LayoutGraph,layers:yfiles.hierarchic.incremental.ILayers,ldp:yfiles.hierarchic.incremental.ILayoutDataProvider):void; + } + var ILayerer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class represents a layering constraint. + * Such constraints can be given as additional input to the . + * @see {@link yfiles.hierarchic.incremental.ILayerConstraintFactory} + */ + export interface ILayerConstraint extends Object{ + /** + * The priority of a constraint. + * This value is used for resolving conflicting constraints. + * A constraint with a higher priority (int value) is more likely to be considered. + * The lowest (and default) priority is 1. + * @see Specified by {@link yfiles.hierarchic.incremental.ILayerConstraint#priority}. + */ + priority:number; + } + var ILayerConstraint:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for retrieving {@link yfiles.hierarchic.incremental.INodeData} and {@link yfiles.hierarchic.incremental.IEdgeData} instances + * for elements in the current layout graph. + * Instances of this interface are provided by {@link yfiles.hierarchic.incremental.HierarchicLayouter} for + * instances implementing subtasks during the layout. + * @see {@link yfiles.hierarchic.incremental.HierarchicLayouter} + */ + export interface ILayoutDataProvider extends Object{ + /** + * Returns the associated {@link yfiles.hierarchic.incremental.INodeData} instance. + * @param {yfiles.algorithms.Node} node the node for which the data will be returned + * @return {yfiles.hierarchic.incremental.INodeData} the instance + * @see Specified by {@link yfiles.hierarchic.incremental.ILayoutDataProvider#getNodeData}. + */ + getNodeData(node:yfiles.algorithms.Node):yfiles.hierarchic.incremental.INodeData; + /** + * Returns the associated {@link yfiles.hierarchic.incremental.IEdgeData} instance. + * @param {yfiles.algorithms.Edge} edge the edge for which the data will be returned + * @return {yfiles.hierarchic.incremental.IEdgeData} the instance + * @see Specified by {@link yfiles.hierarchic.incremental.ILayoutDataProvider#getEdgeData}. + */ + getEdgeData(edge:yfiles.algorithms.Edge):yfiles.hierarchic.incremental.IEdgeData; + } + var ILayoutDataProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + } + } + export module i18n{ + } + export module input{ + /** + * A specialized subclass of {@link yfiles.input.PopulateContextMenuEventArgs} that carries the + * {@link yfiles.input.PopulateItemContextMenuEventArgs#item} for which the context menu should be populated. + */ + export interface PopulateItemContextMenuEventArgs extends yfiles.input.PopulateContextMenuEventArgs{ + /** + * Gets the item for which the tool tip is queried. + * Value: The item, which may be null. + */ + item:TModelItem; + } + var PopulateItemContextMenuEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.PopulateItemContextMenuEventArgs} class. + * @param {yfiles.input.IInputModeContext} context The context to populate the menu for. + * @param {yfiles.geometry.PointD} queryLocation The query location. + * @param {TModelItem} item The item for which the context menu should be populated, may be null. + */ + new (context:yfiles.input.IInputModeContext,queryLocation:yfiles.geometry.PointD,item:TModelItem):yfiles.input.PopulateItemContextMenuEventArgs; + }; + /** + * An {@link yfiles.input.IConcurrentInputMode} implementation that can be used to block user interaction. + * Setting the {@link yfiles.input.WaitInputMode#waiting} property will try to cancel ongoing edits of the + * {@link yfiles.input.WaitInputMode#getMultiplexingInputMode MultiplexingInputMode} and set the {@link yfiles.canvas.CanvasControl#editable} + * state to false and set the preferred cursor to {@link yfiles.input.WaitInputMode#waitCursor}. + * This mode will try to add itself to the {@link yfiles.canvas.CanvasControl#lookup Lookup of the CanvasControl}, so that + * other clients can make use of its functionality. + * @see {@link yfiles.input.WaitInputMode#waiting} + */ + export interface WaitInputMode extends yfiles.input.AbstractConcurrentInputMode{ + /** + * Gets or sets the Waiting property. + * Setting this property to true will {@link yfiles.input.WaitInputMode#startWaiting start the waiting process.} + * Setting it to false will {@link yfiles.input.WaitInputMode#endWaiting end the waiting}. + */ + waiting:boolean; + /** + * Called when waiting is finished. + * This will reset the {@link yfiles.input.IConcurrentInputMode#preferredCursor} and + * {@link yfiles.input.AbstractConcurrentInputMode#releaseMutex the mutex is released.} + */ + endWaiting():void; + /** + * Raises the {@link yfiles.input.WaitInputMode#addWaitingEndedListener WaitingEnded} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The {@link yfiles.input.InputModeEventArgs} instance containing the event data. + */ + onWaitingEnded(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * This will initiate the waiting process by trying to {@link yfiles.input.AbstractConcurrentInputMode#requestMutex}request the + * input mutex. + * This will set the {@link yfiles.input.AbstractConcurrentInputMode#preferredCursor} to {@link yfiles.input.WaitInputMode#waitCursor} + * and set the {@link yfiles.canvas.CanvasControl#editable} property of the canvas to false. + */ + startWaiting():void; + /** + * Raises the {@link yfiles.input.WaitInputMode#addWaitingStartedListener WaitingStarted} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The {@link yfiles.input.InputModeEventArgs} instance containing the event data. + */ + onWaitingStarted(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Occurs when the waiting started. + */ + addWaitingStartedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Occurs when the waiting started. + */ + removeWaitingStartedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Occurs when the waiting ended. + */ + addWaitingEndedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Occurs when the waiting ended. + */ + removeWaitingEndedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Tries to get the {@link yfiles.input.MultiplexingInputMode} instance this mode is used in. + * @return {yfiles.input.MultiplexingInputMode} The mode or null. + */ + getMultiplexingInputMode():yfiles.input.MultiplexingInputMode; + /** + * Gets or sets the WaitCursor property. + */ + waitCursor:yfiles.canvas.ICanvasCursor; + /** + * Called by the client to unconditionally cancel all editing. + * This will be called prior to the uninstalling of this instance. + * In order to stop an active input mode manually, client code should use + * the following idiom: + *

+      * if (!mode.stop()){
+      *   mode.cancel();
+      * }
+      * 
+ * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Called by the client in order to stop a current editing progress. + * This should stop the current edit, if one is in progress and possibly commit + * all of the changes. If stopping is not possible, this method can return false + * @return {boolean} true if and only if the editing has been stopped or there was + * no edit in progress + * @see {@link yfiles.input.IInputMode#cancel} + * @see Specified by {@link yfiles.input.IInputMode#stop}. + */ + stop():boolean; + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + } + var WaitInputMode:{ + $class:yfiles.lang.Class; + new ():yfiles.input.WaitInputMode; + }; + /** + * A simple {@link yfiles.input.IInputMode} that displays a {@link yfiles.canvas.TextBox} + * instance in the canvas control to let the user edit a text. + * Hitting escape or enter will cancel or stop editing. + */ + export interface TextEditorInputMode extends yfiles.input.AbstractConcurrentInputMode{ + /** + * Triggered once the text has been edited. + */ + addTextEditedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Triggered once the text has been edited. + */ + removeTextEditedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Triggered if the editing has not been finished. + */ + addEditingCanceledListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Triggered if the editing has not been finished. + */ + removeEditingCanceledListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Triggered when text editing is started. + */ + addEditingStartedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Triggered when text editing is started. + */ + removeEditingStartedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Gets or sets a property that determines whether the text edited should + * be committed if the focus gets lost or the editing should be canceled. + * The default behavior is to cancel the editing process. + */ + autoCommitOnFocusLost:boolean; + /** + * Gets or sets a property that determines whether this mode should + * try to {@link yfiles.canvas.Control#focus} + * the {@link yfiles.input.AbstractInputMode#canvas} once the editor + * is closed via a keyboard gesture. + * The default is true + */ + autoSelectCanvasOnEditorClosed:boolean; + /** + * Determines whether this mode should automatically fire up the editor once it gets installed. + * If this mode is permanently installed, set this flag to false and + * set the {@link yfiles.input.TextEditorInputMode#editing} flag to true in order to start editing. + */ + autoStartEditing:boolean; + /** + * Factory method that creates a default text box. + * @return {yfiles.canvas.TextBox} A text box implementation. + */ + createTextBox():yfiles.canvas.TextBox; + /** + * Gets or sets the current editing state of the editor. + * Setting a new value will trigger the {@link yfiles.input.TextEditorInputMode#onBeginEditing} + * and {@link yfiles.input.TextEditorInputMode#onCancelEditing} methods respectively. + */ + editing:boolean; + /** + * Called when editing gets canceled. + * Removes the text box and releases the input mutex. + */ + onCancelEditing():void; + /** + * Raises the {@link yfiles.input.TextEditorInputMode#addEditingCanceledListener EditingCanceled} event. + * @param {yfiles.input.InputModeEventArgs} args The event argument + */ + onEditingCanceled(args:yfiles.input.InputModeEventArgs):void; + /** + * Removes the text box. + */ + uninstallTextBox():void; + /** + * Called when editing starts. + * Requests the input mutex, and installs the text box. + */ + onBeginEditing():void; + /** + * Returns the bounds of the {@link yfiles.input.TextEditorInputMode#textBox} in world coordinates. + */ + getTextBoxBounds():yfiles.geometry.RectD; + /** + * Adjusts the {@link yfiles.canvas.CanvasControl#viewport} of the + * such that the {@link yfiles.input.TextEditorInputMode#textBox} is in the visible area. Called once when the editing starts. + */ + ensureVisible():void; + /** + * Raises the {@link yfiles.input.TextEditorInputMode#addEditingStartedListener EditingStarted} event. + * @param {yfiles.input.InputModeEventArgs} args The event argument. + */ + onEditingStarted(args:yfiles.input.InputModeEventArgs):void; + /** + * Resets the contents of the text box. + */ + clear():void; + /** + * Called when editing is stopped. + * Triggers the {@link yfiles.input.TextEditorInputMode#addTextEditedListener TextEdited} event, removes the box and releases the input mutex. + */ + onStopEditing():void; + /** + * Raises the {@link yfiles.input.TextEditorInputMode#addTextEditedListener TextEdited} event. + * @param {yfiles.input.InputModeEventArgs} args The event arguments. + */ + onTextEdited(args:yfiles.input.InputModeEventArgs):void; + /** + * Stops editing and returns true. + * @return {boolean} base.Stop() + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#stop} + * @see Specified by {@link yfiles.input.IInputMode#stop}. + */ + stop():boolean; + /** + * Gets or sets the location of the text box in world coordinates. + */ + location:yfiles.geometry.IPoint; + /** + * Gets or sets the point that describes the "up"-vector that will be used to + * determine the orientation of the text box in the world coordinate system. + * The default is 0, -1. + * @see {@link yfiles.input.TextEditorInputMode#rotateTextBox} + */ + upVector:yfiles.geometry.IPoint; + /** + * Gets or sets the anchor of the text box. + * The anchor is the point inside the coordinate system of the text box that + * shall coincide with the {@link yfiles.input.TextEditorInputMode#location} in the world coordinate system. + * The X and Y values are expressed as relative width/height ratios. + */ + anchor:yfiles.geometry.IPoint; + /** + * Gets or sets the text box to use for displaying and editing. + * This will trigger the {@link yfiles.input.TextEditorInputMode#createTextBox} factory method, + * the first time this property is queried. + */ + textBox:yfiles.canvas.TextBox; + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Installs the text box in the canvas and puts focus into it. + */ + installTextBox():void; + /** + * Adjusts the position of the text box in the canvas control. + */ + adjustPosition():void; + /** + * Gets or sets a value indicating whether to automatically flip the orientation of + * the text box if the {@link yfiles.input.TextEditorInputMode#upVector} actually points downwards. + * The default is true. + * Value: true if the text box should be flipped if necessary; otherwise, false. + */ + autoFlipTextBox:boolean; + /** + * Gets or sets a value indiciating whether the text box should be rotated with the {@link yfiles.input.TextEditorInputMode#upVector}. + * If the value is false (the default), the text box will always be horizontal. + */ + rotateTextBox:boolean; + /** + * Adjusts the size of the text box in the canvas control. + * @param {yfiles.geometry.SizeD} maxSize The suggested maximum size. + */ + adjustSize(maxSize:yfiles.geometry.SizeD):void; + /** + * Calculates the maximum size for this instance. The result is passed to {@link yfiles.input.TextEditorInputMode#adjustSize}. + * This implementation makes sure the textbox does not exceed the bounds + * of the . + * @see {@link yfiles.input.TextEditorInputMode#adjustSize} + * @return {yfiles.geometry.SizeD} The maximum size for the textbox. + */ + calculateMaxTextBoxSize():yfiles.geometry.SizeD; + /** + * Cancels editing of the text box. + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#cancel} + * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + } + var TextEditorInputMode:{ + $class:yfiles.lang.Class; + /** + * The {@link yfiles.system.ResourceKey} that will be used to retrieve the style for the + * {@link yfiles.canvas.TextBox} that will be used for + * editing the text. + */ + TEXT_BOX_STYLE_KEY:yfiles.system.ResourceKey; + /** + * Creates a new instance using a default text box. + */ + new ():yfiles.input.TextEditorInputMode; + /** + * Creates a new instance using the given text box instance. + * @param {yfiles.canvas.TextBox} tb The text box to use. + */ + WithTextBox:{ + new (tb:yfiles.canvas.TextBox):yfiles.input.TextEditorInputMode; + }; + }; + /** + * An {@link yfiles.input.IConcurrentInputMode} implementation that uses a {@link yfiles.input.StateMachineInputMode#stateMachine} + * to manage its state. + * This instance does nothing and needs to be customized or subclassed in order to be useful. + */ + export interface StateMachineInputMode extends yfiles.input.AbstractConcurrentInputMode{ + /** + * The last {@link yfiles.input.Mouse2DEventArgs} that have been delivered to this instance. + */ + lastMouse2DEventArgs1:yfiles.input.Mouse2DEventArgs; + /** + * The last event arguments that have been delivered to this instance. + */ + lastEventArgs:yfiles.system.EventArgs; + /** + * An event that will be triggered if this state machine {@link yfiles.input.StateMachineInputMode#run}s. + */ + addRunHandlerListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * An event that will be triggered if this state machine {@link yfiles.input.StateMachineInputMode#run}s. + */ + removeRunHandlerListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Returns the start state of the state machine. + * The start state is the state the machine will be reset to if the mode is reset. + * This method will create one using {@link yfiles.input.StateMachineInputMode#createStartState} + * the first time it is queried. + */ + startState:yfiles.support.State; + /** + * Provides access to the last {@link yfiles.input.Mouse2DEventArgs} that have been delivered to this instance. + */ + lastMouse2DEventArgs:yfiles.input.Mouse2DEventArgs; + /** + * Provides access to the last {@link yfiles.input.Touch2DEventArgs} that have been delivered to this instance. + * @see {@link yfiles.input.StateMachineInputMode#lastMouse2DEventArgs} + */ + lastTouch2DEventArgs:yfiles.input.Touch2DEventArgs; + /** + * Gets or sets the location of the last event. + * This could be either from a {@link yfiles.input.StateMachineInputMode#lastMouse2DEventArgs mouse} or {@link yfiles.input.StateMachineInputMode#lastTouch2DEventArgs touch} event. + * Value: The last event location. + */ + lastEventLocation:yfiles.geometry.PointD; + /** + * Gets or sets the last location of the primary touch device + * or the mouse pointer. + * @see {@link yfiles.input.StateMachineInputMode#primaryMoveEventRecognizer} + */ + lastPrimaryLocation:yfiles.geometry.PointD; + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} that defines + * the condition when to update {@link yfiles.input.StateMachineInputMode#lastPrimaryLocation}. + */ + primaryMoveEventRecognizer:yfiles.input.IEventRecognizer; + /** + * Returns the canceled state of the state machine. + * The canceled state is the state the machine will be put into if the mode is canceled. + * This method will create one using {@link yfiles.input.StateMachineInputMode#createCanceledState} + * the first time it is queried. + */ + canceledState:yfiles.support.State; + /** + * Returns the stopped state of the state machine. + * The stopped state is the state the machine will be put into if the mode is stopped. + * This method will create one using {@link yfiles.input.StateMachineInputMode#createCanceledState} + * the first time it is queried. + */ + stoppedState:yfiles.support.State; + /** + * Factory method that can be used to obtain a function of type function({@link yfiles.support.Transition}) + * that sets the given {@link yfiles.input.AbstractConcurrentInputMode#preferredCursor}. + * @param {yfiles.canvas.ICanvasCursor} cursor The cursor to set if the transition is done. + * @return {function(yfiles.support.Transition)} An instance that can be added to a {@link yfiles.support.Transition}. + */ + setPreferredCursorTransition(cursor:yfiles.canvas.ICanvasCursor):(t:yfiles.support.Transition)=> void; + /** + * Factory method that can be used to obtain a function of type function({@link yfiles.support.Transition}) + * that resets the {@link yfiles.input.AbstractConcurrentInputMode#preferredCursor}. + * @return An instance that can be added to a {@link yfiles.support.Transition}. + */ + resetPreferredCursorTransition:(t:yfiles.support.Transition)=> void; + /** + * Factory method that can be used to obtain a function of type function({@link yfiles.support.Transition}) + * that request that {@link yfiles.canvas.Control#captureAllPointerInput all mouse input is + * captured} by the canvas. + * @return An instance that can be added to a {@link yfiles.support.Transition}. + */ + requestMouseTransition:(t:yfiles.support.Transition)=> void; + /** + * Factory method that can be used to obtain a function of type function({@link yfiles.support.Transition}) + * that request that {@link yfiles.canvas.Control#captureAllKeyboardInput all keyboard input is + * captured} by the canvas. + * @return An instance that can be added to a {@link yfiles.support.Transition}. + */ + requestKeyboardTransition:(t:yfiles.support.Transition)=> void; + /** + * Factory method that can be used to obtain a function of type function({@link yfiles.support.Transition}) + * that request that {@link yfiles.canvas.Control#captureAllPointerInput mouse and touch input + * capturing} is disabled if it has previously been enabled by this instance. + * @return An instance that can be added to a {@link yfiles.support.Transition}. + */ + releasePointerTransition:(t:yfiles.support.Transition)=> void; + /** + * Factory method that can be used to obtain a function of type function({@link yfiles.support.Transition}) + * that request that {@link yfiles.canvas.Control#captureAllKeyboardInput keyboard input + * capturing} is disabled if it has previously been enabled by this instance. + * @return An instance that can be added to a {@link yfiles.support.Transition}. + */ + releaseKeyboardTransition:(t:yfiles.support.Transition)=> void; + /** + * Factory method that can be used to obtain a function of type function({@link yfiles.support.Transition}) + * that request that {@link yfiles.canvas.Control#captureAllPointerInput touch input + * capturing} is disabled if it has previously been enabled by this instance. + * @return An instance that can be added to a {@link yfiles.support.Transition}. + */ + releaseTouchTransition:(t:yfiles.support.Transition)=> void; + /** + * Gets or sets a value indicating whether to also capture mouse and keyboard input + * if this mode gets the {@link yfiles.input.AbstractConcurrentInputMode#onMutexObtained mutex}. + * The default value is true. + * Value: + * true if input shall be captured whenever it receives the mutex; otherwise, false. + * @see {@link yfiles.input.AbstractInputMode#requestKeyboard} + * @see {@link yfiles.input.AbstractInputMode#requestPointer} + */ + captureInputWithMutex:boolean; + /** + * Factory method that creates the state machine. + * @return {yfiles.support.StateMachine} A new StateMachine + */ + createStateMachine():yfiles.support.StateMachine; + /** + * Factory method that creates a start {@link yfiles.support.State} + * for the given machine. + * @param {yfiles.support.StateMachine} machine The machine to create a state for. + * @return {yfiles.support.State} This implementation returns {@link yfiles.support.StateMachine#startState} + */ + createStartState(machine:yfiles.support.StateMachine):yfiles.support.State; + /** + * Factory method that creates a stopped {@link yfiles.support.State} + * for the given machine. + * This implementation automatically connects the stopped state to the start state. + * @param {yfiles.support.StateMachine} machine The machine to create a state for. + * @return {yfiles.support.State} This implementation returns a new state. + */ + createStoppedState(machine:yfiles.support.StateMachine):yfiles.support.State; + /** + * Factory method that creates a canceled {@link yfiles.support.State} + * for the given machine. + * This implementation automatically connects the returned state to the start state. + * @param {yfiles.support.StateMachine} machine The machine to create a state for. + * @return {yfiles.support.State} This implementation returns a new state. + */ + createCanceledState(machine:yfiles.support.StateMachine):yfiles.support.State; + /** + * Factory method that creates a callback function of type function(object, EventArgs) + * for the state machine that is triggered if this mode has been + * {@link yfiles.input.StateMachineInputMode#cancel canceled}. + */ + cancelEventRecognizer:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean; + /** + * Factory method that creates a callback function of type function(object, EventArgs) + * for the state machine that is triggered if this mode has been + * {@link yfiles.input.AbstractConcurrentInputMode#enabled enabled}. + */ + enabledEventRecognizer:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean; + /** + * Factory method that creates a callback function of type function(object, EventArgs) + * for the state machine that is triggered if this mode has been + * {@link yfiles.input.AbstractConcurrentInputMode#enabled disabled}. + */ + disabledEventRecognizer:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean; + /** + * Factory method that creates a callback function of type function(object, EventArgs) + * for the state machine that is triggered if this mode has been + * {@link yfiles.input.StateMachineInputMode#stop stopped}. + */ + stopEventRecognizer:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean; + /** + * Factory method that creates a callback function of type function(object, EventArgs) + * for the state machine that is triggered if this mode {@link yfiles.input.AbstractConcurrentInputMode#canRequestMutex} + * can request the input mutex. + */ + canRequestMutexRecognizer:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean; + /** + * Factory method that creates a callback function of type function(object, EventArgs) + * for the state machine that is triggered if this mode lost + * the mutex. + */ + mutexLostRecognizer:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean; + /** + * Factory method that creates a callback function of type function(object, EventArgs) + * for the state machine that is triggered if this mode acquired the input mutex. + */ + mutexAcquiredRecognizer:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean; + /** + * Factory method that creates a callback function of type function(object, EventArgs) + * for the state machine that is triggered if this canvas that is associated with this + * input mode has changed its {@link yfiles.canvas.CanvasControl#editable} state to + * true. + */ + canvasEditableEnabledRecognizer:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean; + /** + * Factory method that creates a callback function of type function(object, EventArgs) + * for the state machine that is triggered if this canvas that is associated with this + * input mode has changed its {@link yfiles.canvas.CanvasControl#editable} state to + * false. + */ + canvasEditableDisabledRecognizer:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean; + /** + * Factory method that creates a function of type function({@link yfiles.support.Transition}) + * for the state machine that {@link yfiles.input.AbstractConcurrentInputMode#requestMutex requests the input mutex}. + */ + requestMutexTransition:(t:yfiles.support.Transition)=> void; + /** + * Factory method that creates a function of type function({@link yfiles.support.Transition}) + * for the state machine that {@link yfiles.input.AbstractConcurrentInputMode#releaseMutex releases the input mutex}. + */ + releaseMutexTransition:(t:yfiles.support.Transition)=> void; + /** + * Creates a function of type function({@link yfiles.support.Transition}) that triggers {@link yfiles.canvas.CanvasControl#INPUT_FEEDBACK_COMMAND} + * with the current {@link yfiles.input.IInputModeContext} and {@link yfiles.input.StateMachineInputMode#lastEventLocation}. + * @param {yfiles.input.InputFeedbackParameter.ActionType} actionType The type of the action that triggers the feedback. + * @param {Object} tag Optional details about the action. + * @return {function(yfiles.support.Transition)} A function of type function({@link yfiles.support.Transition}) + */ + createFeedbackPost(actionType:yfiles.input.InputFeedbackParameter.ActionType_Interface,tag:Object):(t:yfiles.support.Transition)=> void; + /** + * Creates a function of type function({@link yfiles.support.Transition}) that will start a timer that will elapse once + * after the given duration. + * Using the {@link yfiles.input.StateMachineInputMode#createTimerElapsedEventRecognizer} one can create an {@link yfiles.input.IEventRecognizer} + * that can be used to determine when the timer with the provided ID has elapsed. + * @param {yfiles.system.TimeSpan} ellapseDuration The time until the timer ticks. + * @param {number} timerId The timer ID. + * @return {function(yfiles.support.Transition)} A handler that kicks off the timer when the transition is done. + * @see {@link yfiles.input.StateMachineInputMode#createStopTimerTransition} + * @see {@link yfiles.input.StateMachineInputMode#createTimerElapsedEventRecognizer} + */ + createStartTimerTransition(ellapseDuration:yfiles.system.TimeSpan,timerId:number):(t:yfiles.support.Transition)=> void; + /** + * Creates a function of type function({@link yfiles.support.Transition}) that stops the timer with the specific id. + * @param {number} timerId The id used for the creation of the timer in {@link yfiles.input.StateMachineInputMode#createStartTimerTransition}. + * @see {@link yfiles.input.StateMachineInputMode#createStartTimerTransition} + * @see {@link yfiles.input.StateMachineInputMode#createTimerElapsedEventRecognizer} + */ + createStopTimerTransition(timerId:number):(t:yfiles.support.Transition)=> void; + /** + * Creates a callback function of type function(object, EventArgs) that will recognize when a timer created using + * {@link yfiles.input.StateMachineInputMode#createStartTimerTransition} is triggered. + * @param {number} timerId The timer id used for starting the timer. + * @return {function(Object, yfiles.system.EventArgs):boolean} The callback. + * @see {@link yfiles.input.StateMachineInputMode#createStartTimerTransition} + * @see {@link yfiles.input.StateMachineInputMode#createStopTimerTransition} + */ + createTimerElapsedEventRecognizer(timerId:number):(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean; + /** + * Method that identifies an event as a {@link yfiles.input.IInputMode#cancel cancel} event. + * @return {boolean} Whether the event describes that input mode event. + */ + isCancelEvent(source:Object,ea:yfiles.system.EventArgs):boolean; + /** + * Method that identifies an event as a {@link yfiles.input.IInputMode#stop stop} event. + * @return {boolean} Whether the event describes that input mode event. + */ + isStopEvent(source:Object,ea:yfiles.system.EventArgs):boolean; + /** + * Method that identifies an event as an {@link yfiles.input.IConcurrentInputMode#enabled mode enabled} event. + * @return {boolean} Whether the event describes that input mode event. + */ + isEnabledEvent(source:Object,ea:yfiles.system.EventArgs):boolean; + /** + * Method that identifies an event as a {@link yfiles.input.IConcurrentInputMode#enabled mode disabled} event. + * @return {boolean} Whether the event describes that input mode event. + */ + isDisabledEvent(source:Object,ea:yfiles.system.EventArgs):boolean; + /** + * Method that identifies an event as an {@link yfiles.input.AbstractConcurrentInputMode#onMutexReleased mutex released} event. + * @return {boolean} Whether the event describes that input mode event. + */ + isMutexLostEvent(eventSource:Object,ea:yfiles.system.EventArgs):boolean; + /** + * Method that identifies an event as an {@link yfiles.input.AbstractConcurrentInputMode#onMutexObtained mutex acquired} event. + * @return {boolean} Whether the event describes that input mode event. + */ + isMutexAcquiredEvent(eventSource:Object,ea:yfiles.system.EventArgs):boolean; + /** + * Called to initialize the state machine. + * This implementation does nothing. + * @param {yfiles.support.StateMachine} machine The machine to initialize and configure + * @param {yfiles.support.State} startState The start state to use. + * @param {yfiles.support.State} canceledState The canceled state to use. + * @param {yfiles.support.State} stoppedState The stopped state to use. + * @param {yfiles.support.State} finishedState The finished state to use. + */ + initializeStateMachine(machine:yfiles.support.StateMachine,startState:yfiles.support.State,canceledState:yfiles.support.State,stoppedState:yfiles.support.State,finishedState:yfiles.support.State):void; + /** + * {@link yfiles.input.StateMachineInputMode#run Runs} the state machine using a disable event. + * @see {@link yfiles.input.StateMachineInputMode#isDisabledEvent} + */ + onDisable():void; + /** + * {@link yfiles.input.StateMachineInputMode#run Runs} the state machine using an enable event. + * @see {@link yfiles.input.StateMachineInputMode#isEnabledEvent} + */ + onEnable():void; + /** + * {@link yfiles.input.StateMachineInputMode#run Runs} the state machine using a mutex obtained event. + * @see {@link yfiles.input.StateMachineInputMode#isMutexAcquiredEvent} + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#onMutexObtained} + */ + onMutexObtained():void; + /** + * {@link yfiles.input.StateMachineInputMode#run Runs} the state machine using a mutex lost event. + * @see {@link yfiles.input.StateMachineInputMode#isMutexLostEvent} + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#onMutexReleased} + */ + onMutexReleased():void; + /** + * Tries to run the virtual machine using the pair of source and event argument + * to determine which transition to take. + * If this method is called reentrantly it will not immediately execute the transition + * but queue the event. + * @param {Object} source The source of the event to use to decide whether to make the transition. + * @param {yfiles.system.EventArgs} e The event to use to decide whether to make the transition. + */ + run(source:Object,e:yfiles.system.EventArgs):void; + /** + * Callback method that will be called after the state machine has + * been run using the arguments provided. + * This will trigger the {@link yfiles.input.StateMachineInputMode#addRunHandlerListener RunHandler} callback. + * @param {Object} source The source of the event that triggered the {@link yfiles.input.StateMachineInputMode#run} + * @param {yfiles.system.EventArgs} e The event that triggered the {@link yfiles.input.StateMachineInputMode#run} + */ + onRun(source:Object,e:yfiles.system.EventArgs):void; + /** + * Gets the state machine. + * Upon first access to instance, the machine will be {@link yfiles.input.StateMachineInputMode#initializeStateMachine initialized}. + */ + stateMachine:yfiles.support.StateMachine; + /** + * Installs this mode into the given context. + * Subclasses should override this method and call base.Install(context), first. + * One-time initialization should be performed in the {@link yfiles.input.AbstractInputMode#initialize} method. + * The Install method will call the Initialize method the first + * time this mode gets installed. + * This implementation calls {@link yfiles.input.StateMachineInputMode#installListeners}. + * @param {yfiles.input.IInputModeContext} context the context to install this mode into + * @see {@link yfiles.input.AbstractInputMode#inputModeContext} + * @see Overrides {@link yfiles.input.AbstractInputMode#install} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Runs the machine using a special reset event. + */ + resetMachine():void; + /** + * Resets the preferred cursor to null. + */ + onMachineReset():void; + /** + * Called when the cancel state has been entered. + * This implementation will release the input mutex and reset the preferred cursor. + * This will trigger another {@link yfiles.input.StateMachineInputMode#run} of the machine + * which will normally bring the machine back to the start state. + */ + onCancelStateEntered(newState:yfiles.support.State,oldState:yfiles.support.State):void; + /** + * Called when the cancel state has been entered. + * This will trigger another {@link yfiles.input.StateMachineInputMode#run} of the machine + * which will normally bring the machine back to the start state. + */ + onStopStateEntered(newState:yfiles.support.State,oldState:yfiles.support.State):void; + /** + * {@link yfiles.input.StateMachineInputMode#run Runs} the machine using a special stop event. + * If the machine arrives at the {@link yfiles.input.StateMachineInputMode#startState}, this method + * will release the input mutex and return true. + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#stop} + * @see Specified by {@link yfiles.input.IInputMode#stop}. + */ + stop():boolean; + /** + * {@link yfiles.input.StateMachineInputMode#run Runs} the state machine using the cancel and reset events, releases + * the input mutex and returns. + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#cancel} + * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Uninstalls this mode from the canvas. + * Subclasses should always call base.Uninstall(canvas) as the last + * statement. This implementation calls {@link yfiles.input.StateMachineInputMode#uninstallListeners}. + * @param {yfiles.input.IInputModeContext} context the context + * @see Overrides {@link yfiles.input.AbstractInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Installs all necessary listeners to trigger the {@link yfiles.input.StateMachineInputMode#run} method. + * This implementation registers for all mouse events, keyboard events, and + * the {@link yfiles.canvas.CanvasControl#addEditableChangedListener EditableChanged} event. + */ + installListeners():void; + /** + * Removes all listeners from the canvas that have been registered in {@link yfiles.input.StateMachineInputMode#installListeners}. + */ + uninstallListeners():void; + } + var StateMachineInputMode:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the given state machine. + * @param {yfiles.support.StateMachine} sm The machine to use. + */ + WithMachine:{ + new (sm:yfiles.support.StateMachine):yfiles.input.StateMachineInputMode; + }; + /** + * Creates a new instance using an empty state machine. + */ + new ():yfiles.input.StateMachineInputMode; + /** + * Creates a new instance using the given state machine and states. + * @param {yfiles.support.StateMachine} stateMachine The machine to use. + * @param {yfiles.support.State} startState The state to use as the start state. + * @param {yfiles.support.State} canceledState The state to use as the canceled state. + * @param {yfiles.support.State} stoppedState The state to use as the stopped state. + */ + FromMachineAndStates:{ + new (stateMachine:yfiles.support.StateMachine,startState:yfiles.support.State,canceledState:yfiles.support.State,stoppedState:yfiles.support.State):yfiles.input.StateMachineInputMode; + }; + }; + /** + * A simple implementation of {@link yfiles.input.IEventRecognizer} + * that recognizes various {@link yfiles.input.CompoundKeyEventArgs}. + */ + export interface KeyEventRecognizer extends Object,yfiles.input.IEventRecognizer{ + /** + * Callback that decides whether a given pair of event source and event argument + * is considered a match. + * @param {Object} eventSource the original source of the event + * @param {yfiles.system.EventArgs} eventArg the event argument + * @return {boolean} whether the pair is considered a match + * @see Specified by {@link yfiles.input.IEventRecognizer#isRecognized}. + */ + isRecognized(eventSource:Object,eventArg:yfiles.system.EventArgs):boolean; + hashCode():number; + equals(obj:Object):boolean; + } + var KeyEventRecognizer:{ + $class:yfiles.lang.Class; + /** + * Creates an event recognizer for a given key and type. + * @param {yfiles.input.CompoundKeyEventType} type The type of the event. + * @param {yfiles.input.Key} data The key that is subject of the event. + */ + FromTypeAndKey:{ + new (type:yfiles.input.CompoundKeyEventType,data:yfiles.input.Key):yfiles.input.KeyEventRecognizer; + }; + /** + * Creates an event recognizer for a given key and type using a given set of modifiers. + * @param {yfiles.input.CompoundKeyEventType} type The type of the event. + * @param {yfiles.input.Key} data The key that is subject of the event. + * @param {yfiles.input.ModifierKeys} modifier The state of the modifiers that must be set. + */ + FromTypeKeyAndModifier:{ + new (type:yfiles.input.CompoundKeyEventType,data:yfiles.input.Key,modifier:yfiles.input.ModifierKeys):yfiles.input.KeyEventRecognizer; + }; + }; + export enum CompoundKeyEventType{ + /** + * Neither Pressed, nor Typed, nor Released. + */ + NONE, + /** + * The key has been pressed. + */ + PRESSED, + /** + * The character has been typed. + */ + TYPED, + /** + * The key has been released. + */ + RELEASED + } + /** + * Utility class that holds implementation singletons for simple + * {@link yfiles.input.IEventRecognizer}s that work on {@link yfiles.input.CompoundKeyEventArgs}. + */ + export interface KeyEvents extends Object{ + } + var KeyEvents:{ + $class:yfiles.lang.Class; + /** + * An event recognizer that recognizes when escape has been typed. + */ + ESCAPE_TYPED:yfiles.input.IEventRecognizer; + /** + * An event recognizer that recognizes when any key has been pressed. + */ + KEY_PRESSED:yfiles.input.IEventRecognizer; + /** + * An event recognizer that recognizes when any key has been typed. + */ + KEY_TYPED:yfiles.input.IEventRecognizer; + /** + * An event recognizer that recognizes when any key has been released. + */ + KEY_RELEASED:yfiles.input.IEventRecognizer; + /** + * An event recognizer that recognizes when escape has been pressed. + */ + ESCAPE_PRESSED:yfiles.input.IEventRecognizer; + /** + * An event recognizer that recognizes when delete has been pressed. + */ + DELETE_PRESSED:yfiles.input.IEventRecognizer; + /** + * An event recognizer that recognizes when escape has been released. + */ + ESCAPE_RELEASED:yfiles.input.IEventRecognizer; + /** + * An event recognizer that recognizes when the shift modifier is active. + */ + SHIFT_PRESSED:yfiles.input.IEventRecognizer; + /** + * An event recognizer that recognizes when the alt modifier is active. + */ + ALT_PRESSED:yfiles.input.IEventRecognizer; + /** + * An event recognizer that recognizes when the shift modifier is active. + */ + CONTROL_PRESSED:yfiles.input.IEventRecognizer; + /** + * An event recognizer that recognizes when the shift modifier is being pressed. + */ + SHIFT_DOWN:yfiles.input.IEventRecognizer; + /** + * An event recognizer that recognizes when the shift modifier is being released. + */ + SHIFT_UP:yfiles.input.IEventRecognizer; + /** + * An event recognizer that recognizes when the ctrl modifier is being pressed. + */ + CTRL_DOWN:yfiles.input.IEventRecognizer; + /** + * An event recognizer that recognizes when the Ctrl modifier is being released. + */ + CTRL_UP:yfiles.input.IEventRecognizer; + }; + /** + * A basic input mode implementation that uses multiple minor + * input modes to handle the basic application needs of a main input mode. + * This mode offers a convenient composite of a {@link yfiles.input.MainInputMode#handleInputMode}, + * a {@link yfiles.input.MainInputMode#clickInputMode}, a {@link yfiles.input.MainInputMode#moveInputMode}, a {@link yfiles.input.MainInputMode#contextMenuInputMode}, + * a {@link yfiles.input.MainInputMode#keyboardInputMode}, and a {@link yfiles.input.MainInputMode#marqueeSelectionInputMode}. + *
+ * Related Information in the Developers Guide: + *

+ * MainInputMode is described in the section Class MainInputMode. + *

+ */ + export interface MainInputMode extends yfiles.input.MultiplexingInputMode{ + /** + * An event that will be triggered if a single or multi select operation has been started. + * The event is not triggered for the individual selection operations that constitute a multi selection operation. + */ + addMultiSelectionStartedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * An event that will be triggered if a single or multi select operation has been started. + * The event is not triggered for the individual selection operations that constitute a multi selection operation. + */ + removeMultiSelectionStartedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * An event that will be triggered if a single or multi select operation has been finished. + * The event is not triggered for the individual selection operations that constitute a multi selection operation. + */ + addMultiSelectionFinishedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * An event that will be triggered if a single or multi select operation has been finished. + * The event is not triggered for the individual selection operations that constitute a multi selection operation. + */ + removeMultiSelectionFinishedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Performs one-time initialization of this instance. This method should not + * be invoked by subclasses. This will be done automatically upon first + * {@link yfiles.input.AbstractInputMode#install installation} of this mode. + * This code will be executed only once per instance. The {@link yfiles.input.AbstractInputMode#canvas} property + * and {@link yfiles.input.AbstractInputMode#inputModeContext} property + * will be null when this code is executed. This method should not + * be used to install this mode into a specific canvas. + * Subclasses should always call base.Initialize() first. + * @see {@link yfiles.input.AbstractInputMode#install} + */ + initialize():void; + /** + * Gets or sets the context menu mode priority. + * The default is 60. + * Value: The context menu mode priority. + */ + contextMenuModePriority:number; + /** + * Gets or sets the mouse hover mode priority. + * The default is 100. + * Value: The mouse hover mode priority. + */ + mouseHoverModePriority:number; + /** + * Gets or sets the move mode priority. + * The default is 40. + * Value: The move mode priority. + */ + moveModePriority:number; + /** + * Gets or sets the wait mode priority. + * The default is -1. + * Value: The wait mode priority. + */ + waitModePriority:number; + /** + * Gets or sets the marquee selection mode priority. + * The default is 50. + * Value: The marquee selection mode priority. + */ + marqueeSelectionModePriority:number; + /** + * Gets or sets the click mode priority. + * The default is 10. + * Value: The click mode priority. + */ + clickModePriority:number; + /** + * Gets or sets the tap mode priority. + * The default is 20. + * Value: The tap mode priority. + */ + tapModePriority:number; + /** + * Gets or sets the handle mode priority. + * The default is 0. + * Value: The handle mode priority. + */ + handleModePriority:number; + /** + * Gets or sets the handle mode priority. + * The default is 39. + * Value: The handle mode priority. + */ + moveViewportModePriority:number; + /** + * Gets or sets the MouseHoverInputMode property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.MainInputMode#createMouseHoverInputMode} will be called. + * Upon change the {@link yfiles.input.MainInputMode#onMouseHoverInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + mouseHoverInputMode:yfiles.input.MouseHoverInputMode; + /** + * Called when the {@link yfiles.input.MainInputMode#mouseHoverInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.MouseHoverInputMode} oldMouseHoverInputMode the old value, which may be null the first time + * @param {yfiles.input.MouseHoverInputMode} newMouseHoverInputMode the new value + * @see {@link yfiles.input.MainInputMode#onMouseHoverInputModeQueryToolTip} + */ + onMouseHoverInputModeChanged(oldMouseHoverInputMode:yfiles.input.MouseHoverInputMode,newMouseHoverInputMode:yfiles.input.MouseHoverInputMode):void; + /** + * Callback method that will be triggered to display a tool tip for the given location. + */ + onMouseHoverInputModeQueryToolTip(src:Object,args:yfiles.input.ToolTipQueryEventArgs):void; + /** + * Factory method for the {@link yfiles.input.MainInputMode#mouseHoverInputMode} property. This method will be called + * upon first access to the {@link yfiles.input.MainInputMode#mouseHoverInputMode} property. + * @return {yfiles.input.MouseHoverInputMode} a new instance of {@link yfiles.input.MainInputMode#mouseHoverInputMode} + */ + createMouseHoverInputMode():yfiles.input.MouseHoverInputMode; + /** + * Gets or sets the HandleInputMode property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.MainInputMode#createHandleInputMode} will be called. + * Upon change the {@link yfiles.input.MainInputMode#onHandleInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + handleInputMode:yfiles.input.HandleInputMode; + /** + * Called when the {@link yfiles.input.MainInputMode#handleInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.HandleInputMode} oldHandleInputMode the old value, which may be null the first time + * @param {yfiles.input.HandleInputMode} newHandleInputMode the new value + */ + onHandleInputModeChanged(oldHandleInputMode:yfiles.input.HandleInputMode,newHandleInputMode:yfiles.input.HandleInputMode):void; + /** + * Factory method for the HandleInputMode property. This method will be called + * upon first access to the {@link yfiles.input.MainInputMode#handleInputMode} property. + * @return {yfiles.input.HandleInputMode} a new instance of HandleInputMode + */ + createHandleInputMode():yfiles.input.HandleInputMode; + /** + * Gets or sets the ClickInputMode property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.MainInputMode#createClickInputMode} will be called. + * Upon change the {@link yfiles.input.MainInputMode#onClickInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + clickInputMode:yfiles.input.ClickInputMode; + /** + * Called when the {@link yfiles.input.MainInputMode#clickInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.ClickInputMode} oldClickInputMode the old value, which may be null the first time + * @param {yfiles.input.ClickInputMode} newClickInputMode the new value + */ + onClickInputModeChanged(oldClickInputMode:yfiles.input.ClickInputMode,newClickInputMode:yfiles.input.ClickInputMode):void; + /** + * Factory method for the ClickInputMode property. This method will be called + * upon first access to the {@link yfiles.input.MainInputMode#clickInputMode} property. + * @return {yfiles.input.ClickInputMode} a new instance of ClickInputMode + */ + createClickInputMode():yfiles.input.ClickInputMode; + /** + * Gets or sets the TapInputMode property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.MainInputMode#createTapInputMode} will be called. + * Upon change the {@link yfiles.input.MainInputMode#onTapInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + tapInputMode:yfiles.input.TapInputMode; + /** + * Called when the {@link yfiles.input.MainInputMode#tapInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.TapInputMode} oldTapInputMode the old value, which may be null the first time + * @param {yfiles.input.TapInputMode} newTapInputMode the new value + */ + onTapInputModeChanged(oldTapInputMode:yfiles.input.TapInputMode,newTapInputMode:yfiles.input.TapInputMode):void; + /** + * Factory method for the TapInputMode property. This method will be called + * upon first access to the {@link yfiles.input.MainInputMode#tapInputMode} property. + * @return {yfiles.input.TapInputMode} a new instance of TapInputMode + */ + createTapInputMode():yfiles.input.TapInputMode; + /** + * Gets or sets the MoveInputMode property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.MainInputMode#createMoveInputMode} will be called. + * Upon change the {@link yfiles.input.MainInputMode#onMoveInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + * @see {@link yfiles.input.MainInputMode#shouldBeMovable} + */ + moveInputMode:yfiles.input.MoveInputMode; + /** + * Called when the {@link yfiles.input.MainInputMode#moveInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.MoveInputMode} oldMoveInputMode the old value, which may be null the first time + * @param {yfiles.input.MoveInputMode} newMoveInputMode the new value + */ + onMoveInputModeChanged(oldMoveInputMode:yfiles.input.MoveInputMode,newMoveInputMode:yfiles.input.MoveInputMode):void; + /** + * Called when {@link yfiles.input.MoveInputMode#addDragFinishedListener DragFinished} is triggered. + */ + onMoveInputModeDragFinished(sender:Object,e:yfiles.system.EventArgs):void; + /** + * Factory method for the MoveInputMode property. This method will be called + * upon first access to the {@link yfiles.input.MainInputMode#moveInputMode} property. + * @return {yfiles.input.MoveInputMode} a new instance of MoveInputMode + */ + createMoveInputMode():yfiles.input.MoveInputMode; + /** + * Helper method that can be used to create a {@link yfiles.input.MoveInputMode} + * instance that can be used to move unselected model items. + * In order to use this mode, the created instance should be installed in a {@link yfiles.input.MainInputMode} + * like this but using a smaller {@link yfiles.input.MultiplexingInputMode#addConcurrentWithPriority priority} + * value than the {@link yfiles.input.MainInputMode#moveModePriority priority of the mode that is installed by default.} + * @param {yfiles.input.IEventRecognizer} modifierRecognizer Use this instance to make this mode work under certain conditions only. null + * for default behavior, one of the {@link yfiles.input.KeyEvents} constants, e.g. for alternate behavior. + * @return {yfiles.input.MoveInputMode} A {@link yfiles.input.MainInputMode#moveInputMode} instance that uses the {@link yfiles.input.IPositionHandler} instances of + * the items that are hit at the position of the cursor, regardless of their selection state. + */ + createMoveUnselectedInputMode(modifierRecognizer:yfiles.input.IEventRecognizer):yfiles.input.MoveInputMode; + /** + * Gets or sets the MarqueeSelectionInputMode property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.MainInputMode#createMarqueeSelectionInputMode} will be called. + * Upon change the {@link yfiles.input.MainInputMode#onMarqueeSelectionInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + marqueeSelectionInputMode:yfiles.input.MarqueeSelectionInputMode; + /** + * Called when the {@link yfiles.input.MainInputMode#marqueeSelectionInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.MarqueeSelectionInputMode} oldMarqueeSelectionInputMode the old value, which may be null the first time + * @param {yfiles.input.MarqueeSelectionInputMode} newMarqueeSelectionInputMode the new value + */ + onMarqueeSelectionInputModeChanged(oldMarqueeSelectionInputMode:yfiles.input.MarqueeSelectionInputMode,newMarqueeSelectionInputMode:yfiles.input.MarqueeSelectionInputMode):void; + /** + * Factory method for the MarqueeSelectionInputMode property. This method will be called + * upon first access to the {@link yfiles.input.MainInputMode#marqueeSelectionInputMode} property. + * @return {yfiles.input.MarqueeSelectionInputMode} a new instance of MarqueeSelectionInputMode + */ + createMarqueeSelectionInputMode():yfiles.input.MarqueeSelectionInputMode; + /** + * Gets the {@link yfiles.model.ICollectionModel} of the {@link yfiles.model.IModelItem} + * that make up the elements in the view this mode is acting upon. + */ + collectionModel:yfiles.model.ICollectionModel; + /** + * Callback that gets triggered once the {@link yfiles.input.MainInputMode#collectionModel} changes. + */ + onCollectionModelChanged(oldValue:yfiles.model.ICollectionModel,newValue:yfiles.model.ICollectionModel):void; + /** + * Gets or sets the ContextMenuInputMode property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.MainInputMode#createContextMenuInputMode} will be called. + * Upon change the {@link yfiles.input.MainInputMode#onContextMenuInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + contextMenuInputMode:yfiles.input.ContextMenuInputMode; + /** + * Gets the input mode controller helper instance. + * The input mode controller is an helper object that collects {@link yfiles.input.IHandle}s, + * provides meta-{@link yfiles.geometry.IMovable}, {@link yfiles.geometry.IReshapeable}, and + * {@link yfiles.drawing.IHitTestable} instances that depend on the current + * selection and collection model. + */ + inputModeController:yfiles.model.InputModeController; + /** + * Called when the {@link yfiles.input.MainInputMode#contextMenuInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.ContextMenuInputMode} oldContextMenuInputMode the old value, which may be null the first time + * @param {yfiles.input.ContextMenuInputMode} newContextMenuInputMode the new value + */ + onContextMenuInputModeChanged(oldContextMenuInputMode:yfiles.input.ContextMenuInputMode,newContextMenuInputMode:yfiles.input.ContextMenuInputMode):void; + /** + * Factory method for the ContextMenuInputMode property. This method will be called + * upon first access to the {@link yfiles.input.MainInputMode#contextMenuInputMode} property. + * @return {yfiles.input.ContextMenuInputMode} a new instance of ContextMenuInputMode + */ + createContextMenuInputMode():yfiles.input.ContextMenuInputMode; + /** + * Creates the {@link yfiles.model.InputModeController} that will + * be used to coordinate the selection and the handles, etc. + * The input mode controller is an helper object that collects {@link yfiles.input.IHandle}s, + * provides meta-{@link yfiles.geometry.IMovable}, {@link yfiles.geometry.IReshapeable}, and + * {@link yfiles.drawing.IHitTestable} instances that depend on the current + * selection and collection model. + * @return {yfiles.model.InputModeController.} An instance of {@link yfiles.model.InputModeController} + */ + createInputModeController():yfiles.model.InputModeController; + /** + * Callback method that is used for {@link yfiles.model.InputModeController#useHandlesPredicate}. + * This implementation always yields true. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether to show the handles. + */ + shouldShowHandles(item:yfiles.model.IModelItem):boolean; + /** + * Callback method that is used for {@link yfiles.model.InputModeController#allowMovingPredicate}. + * This implementation always yields true. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether to make the object movable. + */ + shouldBeMovable(item:yfiles.model.IModelItem):boolean; + /** + * Gets or sets the MoveViewportInputMode associated with this instance. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.MainInputMode#createMoveViewportInputMode} will be called. + * Upon change the {@link yfiles.input.MainInputMode#onMoveViewportInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + moveViewportInputMode:yfiles.input.MoveViewportInputMode; + /** + * Called when the {@link yfiles.input.MainInputMode#moveViewportInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.MoveViewportInputMode} oldMoveViewportInputMode the old value, which may be null the first time + * @param {yfiles.input.MoveViewportInputMode} newMoveViewportInputMode the new value + */ + onMoveViewportInputModeChanged(oldMoveViewportInputMode:yfiles.input.MoveViewportInputMode,newMoveViewportInputMode:yfiles.input.MoveViewportInputMode):void; + /** + * Factory method for the MoveViewportInputMode property. This method will be called + * upon first access to the {@link yfiles.input.MainInputMode#moveViewportInputMode} property. + * @return {yfiles.input.MoveViewportInputMode} a new instance of {@link yfiles.input.MainInputMode#moveViewportInputMode} + */ + createMoveViewportInputMode():yfiles.input.MoveViewportInputMode; + /** + * Gets or sets the WaitInputMode associated with this instance. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.MainInputMode#createWaitInputMode} will be called. + * Upon change the {@link yfiles.input.MainInputMode#onWaitInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + waitInputMode:yfiles.input.WaitInputMode; + /** + * Called when the {@link yfiles.input.MainInputMode#waitInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.WaitInputMode} oldWaitInputMode the old value, which may be null the first time + * @param {yfiles.input.WaitInputMode} newWaitInputMode the new value + */ + onWaitInputModeChanged(oldWaitInputMode:yfiles.input.WaitInputMode,newWaitInputMode:yfiles.input.WaitInputMode):void; + /** + * Factory method for the WaitInputMode property. This method will be called + * upon first access to the {@link yfiles.input.MainInputMode#waitInputMode} property. + * @return {yfiles.input.WaitInputMode} a new instance of {@link yfiles.input.MainInputMode#waitInputMode} + */ + createWaitInputMode():yfiles.input.WaitInputMode; + /** + * Uses the {@link yfiles.input.MainInputMode#waitInputMode} to delegate wait requests to. + */ + waiting:boolean; + /** + * The canvas group that can be used by input modes to add temporary top-level + * canvas objects to. + * This group should be placed in front of the content elements in the canvas object tree. + * @see {@link yfiles.input.MainInputMode#inputModeCanvasGroup} + */ + inputModeCanvasGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Creates a group provider that yields {@link yfiles.input.MainInputMode#inputModeCanvasGroup}. + * @return {yfiles.model.ICanvasGroupProvider.} A provider that always yields the value of {@link yfiles.input.MainInputMode#inputModeCanvasGroup} + */ + getCanvasGroupProvider():yfiles.model.ICanvasGroupProvider; + /** + * Called when the {@link yfiles.input.MainInputMode#inputModeCanvasGroup} property changes. + * @param {yfiles.canvas.ICanvasObjectGroup} oldGroup + * @param {yfiles.canvas.ICanvasObjectGroup} newGroup + */ + onInputModeCanvasGroupChanged(oldGroup:yfiles.canvas.ICanvasObjectGroup,newGroup:yfiles.canvas.ICanvasObjectGroup):void; + /** + * Gets the SelectionModel property. + */ + selectionModel:yfiles.model.ISelectionModel; + /** + * Callback that gets triggered once the {@link yfiles.input.MainInputMode#selectionModel} changes. + */ + onSelectionModelChanged(oldModel:yfiles.model.ISelectionModel,newModel:yfiles.model.ISelectionModel):void; + /** + * Gets or sets the keyboard input mode. + * Value: The keyboard input mode. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + keyboardInputMode:yfiles.input.KeyboardInputMode; + /** + * Gets or sets the keyboard mode priority. + * Value: The keyboard mode priority. + * The default is 0. + */ + keyboardModePriority:number; + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Callback that gets triggered once {@link yfiles.input.MainInputMode#clickInputMode} + * triggers the {@link yfiles.input.ClickInputMode#addClickedListener Clicked} + * event. + */ + onClickInputModeClicked(sender:Object,e:yfiles.input.ClickEventArgs):void; + /** + * Callback that gets triggered once {@link yfiles.input.MainInputMode#clickInputMode} + * triggers the {@link yfiles.input.ClickInputMode#addDoubleClickedListener DoubleClicked} + * event. + */ + onClickInputModeDoubleClicked(sender:Object,e:yfiles.input.ClickEventArgs):void; + /** + * Callback that gets triggered once {@link yfiles.input.MainInputMode#tapInputMode} + * triggers the {@link yfiles.input.TapInputMode#addTappedListener Tapped} + * event. + */ + onTapInputModeTapped(sender:Object,e:yfiles.input.TapEventArgs):void; + /** + * Callback that gets triggered once {@link yfiles.input.MainInputMode#tapInputMode} + * triggers the {@link yfiles.input.TapInputMode#addDoubleTappedListener DoubleTapped} + * event. + */ + onTapInputModeDoubleTapped(sender:Object,e:yfiles.input.TapEventArgs):void; + /** + * Callback used by {@link yfiles.input.MainInputMode#marqueeSelectionInputMode} if the user + * has finished creating the marquee selection. + * This method delegates its work to {@link yfiles.input.MainInputMode#marqueeSelectElements} + */ + onMarqueeSelectionInputModeMarqueeSelected(sender:Object,e:yfiles.system.EventArgs):void; + /** + * Callback that selects the elements in the editor inside the marquee selection rectangle. + * This implementation iterates over all items in the {@link yfiles.input.MainInputMode#collectionModel} + * and queries them for an implementation of {@link yfiles.drawing.IMarqueeTestable} using + * their {@link yfiles.support.ILookup#lookup}. This instance will be used to determine + * whether the item should be selected. + * @param {yfiles.geometry.RectD} marqueeRectangle The rectangle in world coordinates. + * @see {@link yfiles.input.MainInputMode#setSelected} + */ + marqueeSelectElements(marqueeRectangle:yfiles.geometry.RectD):void; + /** + * Uses the {@link yfiles.input.MainInputMode#selectionModel} to select the given item. + * @param {yfiles.model.IModelItem} item The item to set the selection state on. + * @param {boolean} selected The new selection state. + */ + setSelected(item:yfiles.model.IModelItem,selected:boolean):void; + /** + * Convenience callback triggered by the {@link yfiles.input.MainInputMode#contextMenuInputMode} to populate or modify the + * context menu on an invocation. + */ + onContextMenuInputModePopulateContextMenu(src:Object,args:yfiles.input.PopulateContextMenuEventArgs):void; + /** + * Called when the keyboard input mode changed. + * @param {yfiles.input.KeyboardInputMode} oldKeyboardInputMode The old keyboard input mode. + * @param {yfiles.input.KeyboardInputMode} newKeyboardInputMode The new keyboard input mode. + */ + onKeyboardInputModeChanged(oldKeyboardInputMode:yfiles.input.KeyboardInputMode,newKeyboardInputMode:yfiles.input.KeyboardInputMode):void; + /** + * Factory method that creates the keyboard input mode instance. + */ + createKeyboardInputMode():yfiles.input.KeyboardInputMode; + /** + * Clears the selection on the current {@link yfiles.input.MainInputMode#selectionModel}. + * This implementation may be overridden for customizations. + * All it does is call {@link yfiles.model.ISelectionModel#clear}. + */ + clearSelection():void; + /** + * Selects the given elements in the editor inside the provided marquee selection rectangle. + * This implementation calls {@link yfiles.input.MainInputMode#marqueeSelectFiltered} + * using {@link yfiles.input.MainInputMode#shouldBeMarqueeSelectable} as the predicate. + * @param {yfiles.geometry.RectD} marqueeRectangle The rectangle in world coordinates. + * @param {yfiles.model.ICollectionModel.} items The items to iterate over. + * @see {@link yfiles.input.MainInputMode#setSelected} + * @see {@link yfiles.input.MainInputMode#marqueeSelectFiltered} + */ + marqueeSelect(marqueeRectangle:yfiles.geometry.RectD,items:yfiles.model.ICollectionModel):void; + /** + * Callback method used by {@link yfiles.input.MainInputMode#marqueeSelect}. + * This implementation unconditionally returns true. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether to select that item in response to a marquee selection operation. + */ + shouldBeMarqueeSelectable(item:yfiles.model.IModelItem):boolean; + /** + * Selects the given elements in the editor inside the provided marquee selection rectangle. + * This implementation iterates over the items + * and queries them for an implementation of {@link yfiles.drawing.IMarqueeTestable} using + * their {@link yfiles.support.ILookup#lookup}. This instance will be used to determine + * whether the item should be selected. + * @param {yfiles.geometry.RectD} marqueeRectangle The rectangle in world coordinates. + * @param {yfiles.model.ICollectionModel.} items The items to iterate over. + * @param {function(T):boolean} predicate The predicate that determines whether the provided item should be tested at all. + * May be null. + * @see {@link yfiles.input.MainInputMode#setSelected} + * @see {@link yfiles.input.MainInputMode#marqueeSelect} + */ + marqueeSelectFiltered(marqueeRectangle:yfiles.geometry.RectD,items:yfiles.model.ICollectionModel,predicate:(obj:T)=>boolean):void; + /** + * Callback method that will be used by the {@link yfiles.input.MultiplexingInputMode#createChildInputModeContext child context's} {@link yfiles.support.ILookup#lookup} method. + * @param {yfiles.lang.Class} type The type argument passed to {@link yfiles.support.ILookup#lookup}. + * @return {Object} The result of the lookup query, or null. + * @see {@link yfiles.input.MultiplexingInputMode#createChildInputModeContext} + */ + childInputModeContextLookup(type:yfiles.lang.Class):Object; + /** + * The {@link yfiles.input.SnapContext} instance that handles interactive snapping of elements during drag + * operations like movements. + * Setting this property to {@link yfiles.input.SnapContext#VOID_INSTANCE} will disable snapping, whereas + * setting it to null will make the child modes use the context from their {@link yfiles.input.IInputModeContext}s, if available. + * Upon change the {@link yfiles.input.MainInputMode#onSnapContextChanged} method is called, which will as a side effect configure the snap context to display + * the {@link yfiles.input.SnapResult}s in the {@link yfiles.canvas.CanvasControl}. + * Default is null. + */ + snapContext:yfiles.input.SnapContext; + /** + * Called when the {@link yfiles.input.MainInputMode#snapContext} property context changed. + * @param {yfiles.input.SnapContext} oldSnapContext The old snap context. + * @param {yfiles.input.SnapContext} newSnapContext The new snap context. + */ + onSnapContextChanged(oldSnapContext:yfiles.input.SnapContext,newSnapContext:yfiles.input.SnapContext):void; + /** + * Raises the {@link yfiles.input.MainInputMode#addMultiSelectionStartedListener MultiSelectionStarted} event. + */ + onMultiSelectionStarted(args:yfiles.system.EventArgs):void; + /** + * Raises the {@link yfiles.input.MainInputMode#addMultiSelectionFinishedListener MultiSelectionFinished} event. + */ + onMultiSelectionFinished(args:yfiles.system.EventArgs):void; + } + var MainInputMode:{ + $class:yfiles.lang.Class; + /** + * Constructs a new input mode using the given collection of items and a selection model. + * @param {yfiles.model.ICollectionModel.} collectionModel The collection of the items in the control. + * @param {yfiles.model.ISelectionModel.} selectionModel The selection model for the items. + */ + new (collectionModel:yfiles.model.ICollectionModel,selectionModel:yfiles.model.ISelectionModel):yfiles.input.MainInputMode; + }; + /** + * Utility class that holds implementation singletons and utility methods for simple + * {@link yfiles.input.IEventRecognizer}s. + */ + export interface EventRecognizers extends Object{ + } + var EventRecognizers:{ + $class:yfiles.lang.Class; + /** + * A callback that will always return true;. + */ + ALWAYS:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean; + /** + * A callback that will always return false;. + */ + NEVER:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean; + /** + * Creates an {@link yfiles.input.IEventRecognizer} from a function of type function(object, EventArgs). + * @param {function(Object, yfiles.system.EventArgs):boolean} callback The callback to wrap in an interface. + * @return {yfiles.input.IEventRecognizer} An implementation that wraps the callback. + */ + create(callback:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean):yfiles.input.IEventRecognizer; + /** + * Creates an {@link yfiles.input.IEventRecognizer} that uses an {@link yfiles.system.InputGesture} + * to {@link yfiles.system.InputGesture#matches match} input gestures. + * @param {yfiles.system.InputGesture} gesture The gesture to use + * @return {yfiles.input.IEventRecognizer} An event recognizer that uses the gesture. + */ + createWithGesture(gesture:yfiles.system.InputGesture):yfiles.input.IEventRecognizer; + /** + * Creates a function of type function(object, EventArgs) from an {@link yfiles.input.IEventRecognizer} + * instance. + * @param {yfiles.input.IEventRecognizer} instance The instance to wrap as a delegate. + * @return {function(Object, yfiles.system.EventArgs):boolean} A function that delegates to the implementations. + */ + createWithRecognizer(instance:yfiles.input.IEventRecognizer):(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean; + /** + * Creates an instance that is the logical 'and' combination of the provided recognizers. + * @param {yfiles.input.IEventRecognizer[]} recognizers The recognizers to perform the logical operation on. + * @return {yfiles.input.IEventRecognizer} An instance that is the result of the logical 'and' operation of the provided instances. + */ + createAndRecognizer(recognizers:yfiles.input.IEventRecognizer[]):yfiles.input.IEventRecognizer; + /** + * Creates an instance that is the logical 'or' combination of the provided recognizers. + * @param {yfiles.input.IEventRecognizer[]} recognizers The recognizers to perform the logical operation on. + * @return {yfiles.input.IEventRecognizer} An instance that is the result of the logical 'or' operation of the provided instances. + */ + createOrRecognizer(recognizers:yfiles.input.IEventRecognizer[]):yfiles.input.IEventRecognizer; + }; + /** + * An {@link yfiles.input.IHandle} implementation that modifies a rectangle. + * Implementations of this class work on a mutable rectangle instance, which they + * use for both determining the position of the handle and for handling drags of the handle. + * As a convenience this class also implements the {@link yfiles.geometry.IMutablePoint} and + * {@link yfiles.geometry.IMovable} interface which both modify the handle's position. + */ + export interface RectangleHandle extends Object,yfiles.geometry.IMutablePoint,yfiles.geometry.IMovable,yfiles.input.IHandle{ + /** + * Returns the center of the handle. + * @see Specified by {@link yfiles.input.IDragHandler#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Returns an appropriate type for this position. + * @see Specified by {@link yfiles.input.IHandle#type}. + */ + type:yfiles.input.HandleType; + /** + * Returns an appropriate cursor for the position. + * @see Specified by {@link yfiles.input.IHandle#cursor}. + */ + cursor:yfiles.canvas.ICanvasCursor; + /** + * This implementation does nothing. + * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. + */ + initializeDrag(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Return the x coordinate of the position for this rectangle. + * @see Specified by {@link yfiles.geometry.IMutablePoint#x}. + */ + x:number; + /** + * Return the y coordinate of the position for this rectangle. + * @see Specified by {@link yfiles.geometry.IMutablePoint#y}. + */ + y:number; + /** + * Actually moves this handle by modifying the reshapeable. + * @see Specified by {@link yfiles.geometry.IMovable#moveBy}. + */ + moveBy(delta:yfiles.geometry.PointD):boolean; + /** + * Returns this. + */ + getPoint():yfiles.geometry.IMutablePoint; + /** + * This implementation calls {@link yfiles.input.RectangleHandle#moveBy} using the delta values. + * @see Specified by {@link yfiles.input.IDragHandler#handleMove}. + */ + handleMove(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):boolean; + /** + * This implementation calls {@link yfiles.input.RectangleHandle#setWithXAndY} using the original values. + * @see Specified by {@link yfiles.input.IDragHandler#cancelDrag}. + */ + cancelDrag(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * This implementation does nothing. + * @see Specified by {@link yfiles.input.IDragHandler#dragFinished}. + */ + dragFinished(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + /** + * Maps to {@link yfiles.input.RectangleHandle#moveBy}. + */ + setWithXAndY(x:number,y:number):boolean; + } + var RectangleHandle:{ + $class:yfiles.lang.Class; + /** + * A combination of all possible handle positions. + */ + ALL:yfiles.input.HandlePositions; + /** + * A combination of all possible handle positions at the border of a rectangle. + */ + BORDER:yfiles.input.HandlePositions; + /** + * An empty enumeration that contains no Positions. + */ + NONE:yfiles.input.HandlePositions; + /** + * A combination of all possible handle positions at the four corners of a rectangle. + */ + CORNERS:yfiles.input.HandlePositions; + /** + * A combination of the two horizontal handles of a rectangle. + */ + HORIZONTAL:yfiles.input.HandlePositions; + /** + * A combination of the two vertical handles of a rectangle. + */ + VERTICAL:yfiles.input.HandlePositions; + /** + * Creates a handle for the given position that uses and modifies the rectangle instance + * provided. + * @param {yfiles.input.HandlePositions} position The position to use for the handle. + * @param {yfiles.geometry.IMutableRectangle} rect The rectangle that serves as a model for the handle. + * @return {yfiles.input.RectangleHandle} A new instance that models a handle at the given position of the rectangle. + */ + create(position:yfiles.input.HandlePositions,rect:yfiles.geometry.IMutableRectangle):yfiles.input.RectangleHandle; + /** + * Creates a handle for the given position that uses and modifies the instances that + * are interpreted as a rectangle. + * The implementation uses the location and size to model the rectangle and writes + * changes to the geometry of the rectangle to the reshapeable. + * @param {yfiles.input.HandlePositions} position The position to use for the handle. + * @param {yfiles.geometry.IPoint} location The upper left corner of the rectangle. + * @param {yfiles.geometry.ISize} size The size of the rectangle. + * @param {yfiles.geometry.IReshapeable} reshapeable The reshapeable to use for writing back changes of the handle. + * @return {yfiles.input.RectangleHandle} A new instance that models a handle at the given position of the rectangle. + */ + createWithReshapeable(position:yfiles.input.HandlePositions,location:yfiles.geometry.IPoint,size:yfiles.geometry.ISize,reshapeable:yfiles.geometry.IReshapeable):yfiles.input.RectangleHandle; + /** + * Constructor for subclasses. + * @param {number} index The index of the handle's position. 0 is north-west and 8 is south-east. + * @param {yfiles.geometry.IPoint} location The location of the upper left corner of the rectangle. + * @param {yfiles.geometry.ISize} size The size of the rectangle. + * @param {yfiles.geometry.IReshapeable} reshapeable The reshapeable to write back the coordinates. + */ + FromLocationSizeAndReshapeable:{ + new (index:number,location:yfiles.geometry.IPoint,size:yfiles.geometry.ISize,reshapeable:yfiles.geometry.IReshapeable):yfiles.input.RectangleHandle; + }; + }; + /** + * Abstract base class implementation of the {@link yfiles.input.IReshapeHandleProvider} interface + * that has properties to store the values provided by a corresponding {@link yfiles.input.ISizeConstraintProvider}. + */ + export interface ReshapeHandleProvider extends Object,yfiles.input.IReshapeHandleProvider{ + /** + * Gets or sets the minimum size allowed for the reshapeable. + * The default value is {@link yfiles.geometry.ImmutableSize#EMPTY}. + * Value: The minimum size. + * @see {@link yfiles.input.ReshapeableHandle#minimumSize} + */ + minimumSize:yfiles.geometry.ISize; + /** + * Gets or sets the minimum rectangular area that needs to be contained in the reshapeable. + * The default value is {@link yfiles.geometry.ImmutableSize#EMPTY}. + * Value: The minimum size. + * @see {@link yfiles.input.ReshapeableHandle#minimumEnclosedArea} + */ + minimumEnclosedArea:yfiles.geometry.IRectangle; + /** + * Gets or sets the maximum size allowed for the reshapeable. + * The default value is {@link yfiles.geometry.ImmutableSize#UNBOUND}. + * Value: The maximum size. + * @see {@link yfiles.input.ReshapeableHandle#maximumSize} + */ + maximumSize:yfiles.geometry.ISize; + /** + * Gets or sets the bitwise combination of all handle positions this + * instance provides a handle for. + * @see {@link yfiles.input.ReshapeHandleProvider#getAvailableHandles} + * @see {@link yfiles.input.ReshapeHandleProvider#getHandle} + */ + handlePositions:yfiles.input.HandlePositions; + /** + * Returns the {@link yfiles.input.ReshapeHandleProvider#handlePositions} property. + * @return {yfiles.input.HandlePositions} A bitwise combination of all handle positions this + * instance provides a handle for if queried in {@link yfiles.input.ReshapeHandleProvider#getHandle}. + * @see Specified by {@link yfiles.input.IReshapeHandleProvider#getAvailableHandles}. + */ + getAvailableHandles(inputModeContext:yfiles.input.IInputModeContext):yfiles.input.HandlePositions; + /** + * Provides a {@link yfiles.input.IHandle} that uses the rectangle and reshapeable instance + * bound to this instance to perform the actual reshaping. + * This method may be called for each possible single position contained in the + * set as returned by {@link yfiles.input.ReshapeHandleProvider#getAvailableHandles}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context for which the handles are queried. + * @param {yfiles.input.HandlePositions} position The position to provide an instance for. + * @return {yfiles.input.IHandle} A handle implementation. + * @see Specified by {@link yfiles.input.IReshapeHandleProvider#getHandle}. + */ + getHandle(inputModeContext:yfiles.input.IInputModeContext,position:yfiles.input.HandlePositions):yfiles.input.IHandle; + } + var ReshapeHandleProvider:{ + $class:yfiles.lang.Class; + new ():yfiles.input.ReshapeHandleProvider; + }; + /** + * Manages interactive snapping of elements to other elements during drag operations like movements. + * This class should be used by {@link yfiles.input.IInputMode} implementations and similar code as follows: + *
    + *
  • To initialize the operation {@link yfiles.input.SnapContext#initializeDrag} needs to be called.
  • + *
  • Method {@link yfiles.input.SnapContext#dragInitialized} needs to be called after the mode has performed all of its own initialization.
  • + *
  • Then a series of zero or more invocations of either {@link yfiles.input.SnapContext#handleMove} + * or {@link yfiles.input.SnapContext#disableSnapping} needs to be called for each incremental movement of the user's input device.
  • + *
  • + * If {@link yfiles.input.SnapContext#handleMove} had been called, the mode should perform the move and report back to the instance by calling + * the {@link yfiles.input.SnapContext#dragged} method. + *
  • + *
  • + * If the operation is canceled by the user {@link yfiles.input.SnapContext#cancelDrag} should be called. + *
  • + *
  • + * If the operation is finalized the {@link yfiles.input.SnapContext#dragFinished} method should be called. + *
  • + *
+ * @see {@link yfiles.input.HandleInputMode#snapContext} + * @see {@link yfiles.input.MoveInputMode#snapContext} + * @see {@link yfiles.input.SnapContext#createSnapResultsModelManager} + */ + export interface SnapContext extends Object{ + /** + * Dispatched during {@link yfiles.input.IDragHandler#handleMove moving}. + * The moving model items must register for this event, preferably in the + * {@link yfiles.input.IDragHandler#initializeDrag} method of the {@link yfiles.input.IDragHandler}. + * The event handler has to add {@link yfiles.input.SnapResult}s for the moving object to the list. + * The {@link yfiles.input.IDragHandler}s of the moved items have to take care themselves whether to add + * a handler to the list depending on the their settings. + */ + addCollectSnapResultsListener(value:(sender:Object,e:yfiles.input.CollectSnapResultsEventArgs)=> void):void; + /** + * Dispatched during {@link yfiles.input.IDragHandler#handleMove moving}. + * The moving model items must register for this event, preferably in the + * {@link yfiles.input.IDragHandler#initializeDrag} method of the {@link yfiles.input.IDragHandler}. + * The event handler has to add {@link yfiles.input.SnapResult}s for the moving object to the list. + * The {@link yfiles.input.IDragHandler}s of the moved items have to take care themselves whether to add + * a handler to the list depending on the their settings. + */ + removeCollectSnapResultsListener(value:(sender:Object,e:yfiles.input.CollectSnapResultsEventArgs)=> void):void; + /** + * Occurs when this instance has been cleaned up. + * @see {@link yfiles.input.SnapContext#cleanUp} + */ + addCleanedUpListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when this instance has been cleaned up. + * @see {@link yfiles.input.SnapContext#cleanUp} + */ + removeCleanedUpListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when this instance has been initialized. + * @see {@link yfiles.input.SnapContext#initializeDrag} + */ + addInitializedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when this instance has been initialized. + * @see {@link yfiles.input.SnapContext#initializeDrag} + */ + removeInitializedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when this instance is about to be initialized. + * @see {@link yfiles.input.SnapContext#initializeDrag} + */ + addInitializingListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when this instance is about to be initialized. + * @see {@link yfiles.input.SnapContext#initializeDrag} + */ + removeInitializingListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Gets or sets a value indicating whether to visualize the snap results. + * Value: + * true if the results should be visualized otherwise, false. + * @see {@link yfiles.input.SnapContext#createSnapResultsModelManager} + */ + visualizeSnapResults:boolean; + /** + * Gets or sets a value indicating whether this instance is currently initializing. + * Value: + * true if this instance is initializing; otherwise, false. + * @see {@link yfiles.input.SnapContext#addInitializedListener Initialized} + * @see {@link yfiles.input.SnapContext#addInitializingListener Initializing} + * @see {@link yfiles.input.SnapContext#isInitialized} + */ + isInitializing:boolean; + /** + * Performs clean up procedures. + * This is called in response to {@link yfiles.input.SnapContext#cancelDrag} and {@link yfiles.input.SnapContext#dragFinished} as well as initially during {@link yfiles.input.SnapContext#initializeDrag}. + */ + cleanUp():void; + /** + * Called by {@link yfiles.input.IInputMode} implementations when an interactive drag is started. + * Updates {@link yfiles.input.SnapContext#isInitializing}, {@link yfiles.input.SnapContext#originalLocation}, and {@link yfiles.input.SnapContext#currentInputModeContext} + * and then triggers the {@link yfiles.input.SnapContext#addInitializingListener Initializing} event. + * @param {yfiles.input.IInputModeContext} context The context in which the interactive drag is started. + * @param {yfiles.geometry.PointD} originalLocation The original location of the mouse. + * @throws {yfiles.system.InvalidOperationException} If this context is already {@link yfiles.input.SnapContext#isInitialized initialized}. + */ + initializeDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * Gets the current input mode context. + * Value: The current input mode context if this instance {@link yfiles.input.SnapContext#isInitialized} or + * {@link yfiles.input.SnapContext#isInitializing}, otherwise null. + */ + currentInputModeContext:yfiles.input.IInputModeContext; + /** + * Raises the {@link yfiles.input.SnapContext#cleanUp} event. + * @param {yfiles.system.EventArgs} eventArgs The {@link yfiles.system.EventArgs} instance containing the event data. + */ + onCleanUp(eventArgs:yfiles.system.EventArgs):void; + /** + * Helper method that creates the a {@link yfiles.model.CollectionModelManager} that can be used + * to present the current {@link yfiles.input.SnapResult}s in the provided {@link yfiles.canvas.CanvasControl}. + * @param {yfiles.canvas.CanvasControl} control The control to initialize the {@link yfiles.model.CollectionModelManager} with. + * @return {yfiles.model.CollectionModelManager.} The model manager that manages the visual representation of the {@link yfiles.input.SnapResult}s. + */ + createSnapResultsModelManager(control:yfiles.canvas.CanvasControl):yfiles.model.CollectionModelManager; + /** + * Helper method used by {@link yfiles.input.SnapContext#createSnapResultsModelManager} to create the {@link yfiles.model.IModelItemInstaller} + * for the {@link yfiles.input.SnapResult} type. + * @return {yfiles.model.IModelItemInstaller.} An instance that can install {@link yfiles.input.SnapResult}s in a {@link yfiles.canvas.CanvasControl}. + */ + createSnapResultModelItemInstaller():yfiles.model.IModelItemInstaller; + /** + * Collects a list of snap lines. + * Snap lines represent possible horizontal or vertical lines to which a moved item can "snap". + *

+ * This method is called in the {@link yfiles.input.MoveInputMode}'s or {@link yfiles.input.HandleInputMode}'s + * {@link yfiles.input.MoveInputMode#beginDrag} method after all items to be moved or reshaped + * have been added. + *

+ */ + dragInitialized():void; + /** + * Raises the {@link yfiles.input.SnapContext#addInitializedListener Initialized} event. + * @param {yfiles.system.EventArgs} eventArgs The {@link yfiles.system.EventArgs} instance containing the event data. + */ + onInitialized(eventArgs:yfiles.system.EventArgs):void; + /** + * Raises the {@link yfiles.input.SnapContext#addInitializingListener Initializing} event. + * @param {yfiles.system.EventArgs} eventArgs The {@link yfiles.system.EventArgs} instance containing the event data. + */ + onInitializing(eventArgs:yfiles.system.EventArgs):void; + /** + * This method can be called by the {@link yfiles.input.IInputMode} while this instance {@link yfiles.input.SnapContext#isInitialized} + * alternatively to {@link yfiles.input.SnapContext#handleMove}. + * Calling this method will temporarily disable any snapping operations and clears all {@link yfiles.input.SnapContext#snapResults}. + * @see {@link yfiles.input.SnapContext#initializeDrag} + * @see {@link yfiles.input.SnapContext#handleMove} + * @see {@link yfiles.input.SnapContext#dragged} + * @see {@link yfiles.input.SnapContext#cancelDrag} + * @see {@link yfiles.input.SnapContext#dragFinished} + */ + disableSnapping():void; + /** + * Handles a move. + * This method returns the adjusted (mouse) coordinates. It also manages the collection of + * {@link yfiles.input.SnapResult}s. + * If snapping should be temporarily (for a mouse move) disabled, {@link yfiles.input.SnapContext#disableSnapping} should be called instead. + * @param {yfiles.geometry.PointD} newLocation The current mouse location. + * @return {yfiles.input.SnapState} The adjusted coordinates and how they have been adjusted. + */ + handleMove(newLocation:yfiles.geometry.PointD):yfiles.input.SnapState; + /** + * The collection of {@link yfiles.input.SnapResult}s. + * This collection is automatically updated during moving the mouse. + */ + snapResults:yfiles.model.ICollectionModel; + /** + * Chooses the current {@link yfiles.input.SnapResult}s from a temporary list. + * Chooses from a list of possible results the most important ones. Also maintains the collection + * of snap results. + * @param {yfiles.collections.List.} snapResults A temporary list of suggested {@link yfiles.input.SnapResult}s. + * @param {yfiles.geometry.PointD} originalLocation The point in world coordinates where the mouse move started. + * @param {yfiles.geometry.PointD} newLocation The current mouse location. + * @return {yfiles.input.SnapState} The adjusted coordinates and how they have been adjusted. + */ + processSnapResults(snapResults:yfiles.collections.List,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):yfiles.input.SnapState; + /** + * Raises the {@link yfiles.input.SnapContext#addCollectSnapResultsListener CollectSnapResults} event. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The {@link yfiles.input.CollectSnapResultsEventArgs} instance containing the event data. + */ + onCollectSnapResults(args:yfiles.input.CollectSnapResultsEventArgs):void; + /** + * Called when a drag has been successfully finished. + * Clears all temporary lists and sets {@link yfiles.input.SnapContext#isInitialized} back to false. Also the {@link yfiles.input.SnapContext#cleanUp} method + * is invoked and the {@link yfiles.input.SnapContext#addCleanedUpListener CleanedUp} event is triggered. + * @param {yfiles.geometry.PointD} newLocation The current mouse location. + * @return {yfiles.input.SnapState} The adjusted coordinates. + */ + dragFinished(newLocation:yfiles.geometry.PointD):yfiles.input.SnapState; + /** + * Whether the context is initialized. + * The context is initialized between the calls to {@link yfiles.input.SnapContext#dragInitialized} + * and {@link yfiles.input.SnapContext#dragFinished} or {@link yfiles.input.SnapContext#cancelDrag}. + */ + isInitialized:boolean; + /** + * Sets the global snap distance, which is the maximum distance between the current mouse coordinates + * and the coordinates to which the mouse will snap. The distance is interpreted in view coordinates. + * The default is 5.0d + * @see {@link yfiles.input.CollectSnapResultsEventArgs#snapDistance} + */ + snapDistance:number; + /** + * Called when a drag has been canceled. + * Clears all temporary lists and sets {@link yfiles.input.SnapContext#isInitialized} back to false, as well as performs {@link yfiles.input.SnapContext#cleanUp} + * and finally triggers the {@link yfiles.input.SnapContext#addCleanedUpListener CleanedUp} event. + */ + cancelDrag():void; + /** + * Gets the original location of the mouse at the time the gesture was initialized. + * Value: The original location. + * @see {@link yfiles.input.SnapContext#initializeDrag} + */ + originalLocation:yfiles.geometry.PointD; + /** + * Gets or sets a value indicating whether this {@link yfiles.input.SnapContext} is enabled. + * Value: true if enabled; otherwise, false. + */ + enabled:boolean; + /** + * Helper method that wraps the given context so that a {@link yfiles.support.ILookup#lookup} + * query on the wrapped context for the {@link yfiles.input.SnapContext} type yields this instance. + * @param {yfiles.input.IInputModeContext} context The context to wrap and delegate all calls to. + * @return {yfiles.input.IInputModeContext} A modified instance that yields this instance if it is queried for the {@link yfiles.input.SnapContext} type. + */ + wrapContext(context:yfiles.input.IInputModeContext):yfiles.input.IInputModeContext; + /** + * This method needs to be called by the client {@link yfiles.input.IInputMode} that {@link yfiles.input.SnapContext#initializeDrag initialized} + * this instance after it has performed the actual move operation with the adjusted coordinates after a call to {@link yfiles.input.SnapContext#handleMove}. + * Most of the client code implementations will just call this method with the exact values returned by {@link yfiles.input.SnapContext#handleMove}. + * This method does not need to be called in the case where {@link yfiles.input.SnapContext#disableSnapping} was called for the current move. + * @param {yfiles.geometry.PointD} mouseLocation The actual mouse location. + * @param {yfiles.input.SnapState} finalSnapState The final snap state that contains the location that has been used by the client code for the move + * and how it has been snapped. + */ + dragged(mouseLocation:yfiles.geometry.PointD,finalSnapState:yfiles.input.SnapState):void; + } + var SnapContext:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.SnapContext} class. + */ + new ():yfiles.input.SnapContext; + /** + * The shared void instance. + * Note that this instance cannot be {@link yfiles.input.SnapContext#enabled}. + */ + VOID_INSTANCE:yfiles.input.SnapContext; + }; + /** + * A specialized subclass of {@link yfiles.input.ToolTipQueryEventArgs} that carries the + * {@link yfiles.input.QueryItemToolTipEventArgs#item} for which the tool tip is queried. + */ + export interface QueryItemToolTipEventArgs extends yfiles.input.ToolTipQueryEventArgs{ + /** + * Gets the item for which the tool tip is queried. + * Value: The item, which may be null. + */ + item:TModelItem; + } + var QueryItemToolTipEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.QueryItemToolTipEventArgs} class. + * @param {yfiles.input.IInputModeContext} context The context to yield the tool tip for. + * @param {yfiles.geometry.PointD} queryLocation The query location. + * @param {TModelItem} item The item for which the tool tip is queried.. + */ + new (context:yfiles.input.IInputModeContext,queryLocation:yfiles.geometry.PointD,item:TModelItem):yfiles.input.QueryItemToolTipEventArgs; + }; + /** + * A more sophisticated {@link yfiles.input.IHandle} implementation that delegates to a {@link yfiles.input.IReshapeHandler}. + * This class works on an {@link yfiles.input.IReshapeHandler}. + */ + export interface ReshapeHandlerHandle extends Object,yfiles.input.IHandle,yfiles.geometry.IPoint{ + /** + * The reshapeable instance to write the changes to. + */ + reshapeHandler:yfiles.input.IReshapeHandler; + /** + * Gets or sets the minimum size allowed for the reshapeable. + * The value is stored by reference. + * The default is {@link yfiles.geometry.ImmutableSize#EMPTY}. + */ + minimumSize:yfiles.geometry.ISize; + /** + * Gets or sets the minimum enclosed area that needs to be encompassed by this reshapeable. + * The value is stored by reference. + * The default is {@link yfiles.geometry.ImmutableSize#EMPTY}, which does not restrict the area at all. + */ + minimumEnclosedArea:yfiles.geometry.IRectangle; + /** + * Gets or sets the maximum size allowed for the reshapeable. + * The value is stored by reference. + * The default is {@link yfiles.geometry.ImmutableSize#UNBOUND}. + */ + maximumSize:yfiles.geometry.ISize; + /** + * Returns a view of the center of the handle. + * Value: + * The point describes the current world coordinate of the element that can + * be modified by this handle. + * @see Specified by {@link yfiles.input.IDragHandler#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Gets or sets the type of the handle that can be used by the rendering engine + * to render types differently. + * @see Specified by {@link yfiles.input.IHandle#type}. + */ + type:yfiles.input.HandleType; + /** + * Gets or sets the cursor to display when the mouse hovers over or drags this + * handle. + * @see Specified by {@link yfiles.input.IHandle#cursor}. + */ + cursor:yfiles.canvas.ICanvasCursor; + /** + * This implementation does nothing. + * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. + */ + initializeDrag(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Delegates the move request to the {@link yfiles.input.IReshapeHandler#handleReshape} method. + * @see Specified by {@link yfiles.input.IDragHandler#handleMove}. + */ + handleMove(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):boolean; + /** + * Delegates the cancel request to the {@link yfiles.input.IReshapeHandler}. + * @see Specified by {@link yfiles.input.IDragHandler#cancelDrag}. + */ + cancelDrag(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * Delegates the finish request to the {@link yfiles.input.IReshapeHandler}. + * @see Specified by {@link yfiles.input.IDragHandler#dragFinished}. + */ + dragFinished(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + } + var ReshapeHandlerHandle:{ + $class:yfiles.lang.Class; + /** + * Creates a handle for the given position that uses the provided handler to perform the actual reshaping. + * @param {yfiles.input.HandlePositions} position The position to use for the handle. + * @param {yfiles.input.IReshapeHandler} handler The handler to use for the actual reshaping + */ + FromPositionAndHandler:{ + new (position:yfiles.input.HandlePositions,handler:yfiles.input.IReshapeHandler):yfiles.input.ReshapeHandlerHandle; + }; + /** + * Subclass constructor that creates a handle for the given position using the location instance + * as the {@link yfiles.input.IDragHandler#location} for the handle. + * The instance modifies the instances using + * the reshapeable interface and reads the current state using the rect. + * The handle will automatically trim changes of the rectangle to the specified minimum + * and maximum size. + * @param {yfiles.input.HandlePositions} position The position of the handle. + * @param {yfiles.input.IReshapeHandler} reshapeHandler The reshapeable to write the changes to. + * @param {yfiles.geometry.ISize} maximumSize The maximum size allowed for the rectangle. + * @param {yfiles.geometry.ISize} minimumSize The minimum size allowed for the rectangle. + */ + FromPositionReshapeHandlerMinSizeAndMaxSize:{ + new (position:yfiles.input.HandlePositions,reshapeHandler:yfiles.input.IReshapeHandler,minimumSize:yfiles.geometry.ISize,maximumSize:yfiles.geometry.ISize):yfiles.input.ReshapeHandlerHandle; + }; + }; + /** + * A simple convenience implementation of an {@link yfiles.input.IReshapeHandleProvider} + * that returns handles that modify a {@link yfiles.geometry.IMutableRectangle}. + * @see {@link yfiles.input.RectangleHandles} + */ + export interface ReshapeableHandles extends yfiles.input.ReshapeHandleProvider{ + /** + * The rectangle to read the current state from. + */ + rectangle:yfiles.geometry.IRectangle; + /** + * The reshapeable to use for reshaping. + */ + reshapeable:yfiles.geometry.IReshapeable; + /** + * Provides a {@link yfiles.input.IHandle} that uses the rectangle and reshapeable instance + * bound to this instance to perform the actual reshaping. + * This method may be called for each possible single position contained in the + * set as returned by {@link yfiles.input.ReshapeHandleProvider#getAvailableHandles}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context for which the handles are queried. + * @param {yfiles.input.HandlePositions} position The position to provide an instance for. + * @return {yfiles.input.IHandle} A handle implementation. + * @see Overrides {@link yfiles.input.ReshapeHandleProvider#getHandle} + * @see Specified by {@link yfiles.input.IReshapeHandleProvider#getHandle}. + */ + getHandle(inputModeContext:yfiles.input.IInputModeContext,position:yfiles.input.HandlePositions):yfiles.input.IHandle; + } + var ReshapeableHandles:{ + $class:yfiles.lang.Class; + /** + * Creates a default instance that provides 8 handles for each corner and side + * for the given rectangle. + * @param {yfiles.geometry.IMutableRectangle} rectangle The rectangle to provide handles for. + */ + FromRectangle:{ + new (rectangle:yfiles.geometry.IMutableRectangle):yfiles.input.ReshapeableHandles; + }; + /** + * Creates a default instance that provide handle for each of the positions + * given for the rectangle and reshapeable instance. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle to create handles for. + * @param {yfiles.geometry.IReshapeable} reshapeable The reshapeable instance to use for the actual reshaping. + * @param {yfiles.input.HandlePositions} handlePositions A bitwise combination of all handle positions this instance should provide a handle for. + */ + FromRectangleReshapeableAndHandlePositions:{ + new (rectangle:yfiles.geometry.IRectangle,reshapeable:yfiles.geometry.IReshapeable,handlePositions:yfiles.input.HandlePositions):yfiles.input.ReshapeableHandles; + }; + }; + /** + * A simple convenience implementation of an {@link yfiles.input.IHandleProvider} + * that returns handles that modify a {@link yfiles.geometry.IMutableRectangle}. + * @see {@link yfiles.input.ReshapeableHandles} + */ + export interface RectangleHandles extends Object,yfiles.input.IHandleProvider{ + /** + * Gets the rectangle this instance works on. + */ + rectangle:yfiles.geometry.IMutableRectangle; + /** + * Gets or sets the bitwise combination of all handle positions this + * instance provides a handle for. + * @see {@link yfiles.input.RectangleHandles#getHandles} + */ + handlePositions:yfiles.input.HandlePositions; + /** + * Returns a collection of {@link yfiles.input.IHandle}s that contains a handle + * for each position in {@link yfiles.input.RectangleHandles#handlePositions}. + * @return {yfiles.collections.ICollection.} A collection of handles that modify the rectangle. + * @see Specified by {@link yfiles.input.IHandleProvider#getHandles}. + */ + getHandles(inputModeContext:yfiles.input.IInputModeContext):yfiles.collections.ICollection; + } + var RectangleHandles:{ + $class:yfiles.lang.Class; + /** + * Creates a default instance that provides 8 handles for each corner and side + * for the given rectangle. + * @param {yfiles.geometry.IMutableRectangle} rectangle The rectangle to create handles for. + */ + FromRectangle:{ + new (rectangle:yfiles.geometry.IMutableRectangle):yfiles.input.RectangleHandles; + }; + /** + * Creates a default instance that provide handle for each of the positions + * given for the rectangle. + * @param {yfiles.geometry.IMutableRectangle} rectangle The rectangle to create handles for. + * @param {yfiles.input.HandlePositions} handlePositions A bitwise combination of all handle positions this instance should provide a handle for. + */ + FromRectangleAndHandlePositions:{ + new (rectangle:yfiles.geometry.IMutableRectangle,handlePositions:yfiles.input.HandlePositions):yfiles.input.RectangleHandles; + }; + }; + export enum HandlePositions{ + /** + * Indicates no position at all. + */ + NONE, + /** + * Indicates the position at north west. + */ + NORTH_WEST, + /** + * Indicates the position at north. + */ + NORTH, + /** + * Indicates the position at north east. + */ + NORTH_EAST, + /** + * Indicates the position at west. + */ + WEST, + /** + * Indicates the position at the center. + */ + CENTER, + /** + * Indicates the position at east. + */ + EAST, + /** + * Indicates the position at south west. + */ + SOUTH_WEST, + /** + * Indicates the position at south. + */ + SOUTH, + /** + * Indicates the position at south east. + */ + SOUTH_EAST + } + export enum TapHandlingMode{ + /** + * Using this mode, in case of a double tap, only the double tap is reported, but neither of the two single taps. + * Single taps will be reported with a short delay to ensure that they do not become double taps. + */ + DOUBLE_TAP_ONLY, + /** + * In this mode, in case of a double tap, only one single tap is reported and one double tap. The second + * tap for the double tap is not reported as a single tap. + */ + INITIAL_SINGLE_AND_DOUBLE_TAP, + /** + * In this mode, every tap (i.e. both single tap and either of the taps of a multi-tap) is reported as a single tap + * and every double tap is reported as a double tap. + */ + BOTH_SINGLE_TAPS_AND_DOUBLE_TAP + } + /** + * An input mode that recognizes simple touch taps. + * Clients register to {@link yfiles.input.TapInputMode#addTappedListener Tapped} to get notified of touch taps. + * This mode can be instructed to {@link yfiles.input.TapInputMode#swallowFocusTap swallow taps} + * if they lead happen shortly after the control gained focus. This is useful to prevent + * accidental taps from being processed if the user wanted to put the focus into the control, only. + * @see {@link yfiles.input.TapInputMode#tapHandlingMode} + * @see {@link yfiles.input.TapInputMode#swallowFocusTap} + */ + export interface TapInputMode extends yfiles.input.StateMachineInputMode{ + /** + * The event handler that will be triggered once a tap has been + * detected. + * @see {@link yfiles.input.TapEventArgs} + * @see {@link yfiles.input.TapInputMode#tapHandlingMode} + */ + addTappedListener(value:(sender:Object,e:yfiles.input.TapEventArgs)=> void):void; + /** + * The event handler that will be triggered once a tap has been + * detected. + * @see {@link yfiles.input.TapEventArgs} + * @see {@link yfiles.input.TapInputMode#tapHandlingMode} + */ + removeTappedListener(value:(sender:Object,e:yfiles.input.TapEventArgs)=> void):void; + /** + * The event handler that will be triggered once a double-tap has been + * detected. + * @see {@link yfiles.input.TapEventArgs} + * @see {@link yfiles.input.TapInputMode#tapHandlingMode} + */ + addDoubleTappedListener(value:(sender:Object,e:yfiles.input.TapEventArgs)=> void):void; + /** + * The event handler that will be triggered once a double-tap has been + * detected. + * @see {@link yfiles.input.TapEventArgs} + * @see {@link yfiles.input.TapInputMode#tapHandlingMode} + */ + removeDoubleTappedListener(value:(sender:Object,e:yfiles.input.TapEventArgs)=> void):void; + /** + * Gets or sets the tap handling mode that determines the + * triggering behavior of {@link yfiles.input.TapInputMode#addTappedListener Tapped} and + * {@link yfiles.input.TapInputMode#addDoubleTappedListener DoubleTapped}. + * Value: + * The tap handling mode to use for this instance. The default is {@link yfiles.input.TapHandlingMode#BOTH_SINGLE_TAPS_AND_DOUBLE_TAP} + * @see {@link yfiles.input.TapInputMode#tapHandlingMode} + */ + tapHandlingMode:yfiles.input.TapHandlingMode; + /** + * Gets or sets a hit test that determines where this mode should recognize + * taps. + * This implementation is tested during the {@link yfiles.input.TapInputMode#isValidPress} + * to determine whether it is valid to tap here. + * The default implementation is {@link yfiles.drawing.HitTestable#ALWAYS}. + */ + validTapHitTestable:yfiles.drawing.IHitTestable; + /** + * Obsolete property that determines whether to detect double taps, only. + * If set to true this will detect double taps, only. + * This property is preceded by {@link yfiles.input.TapInputMode#tapHandlingMode} which allows for a better + * way of detecting both single taps and {@link yfiles.input.TapInputMode#addDoubleTappedListener double taps}. + * @see {@link yfiles.input.TapInputMode#createTapRecognizer} + */ + doubleTap:boolean; + /** + * Whether to {@link yfiles.input.AbstractConcurrentInputMode#requestMutex request the mutex} on a tap. + * If set to true this will discard other concurrent input modes on a tap. + * The default is true. + */ + requestMutextOnTap:boolean; + /** + * Called to initialize the state machine. + * This implementation does nothing. + * @param {yfiles.support.StateMachine} machine The machine to initialize and configure + * @param {yfiles.support.State} startState The start state to use. + * @param {yfiles.support.State} canceledState The canceled state to use. + * @param {yfiles.support.State} stoppedState The stopped state to use. + * @param {yfiles.support.State} finishedState The finished state to use. + */ + initializeStateMachine(machine:yfiles.support.StateMachine,startState:yfiles.support.State,canceledState:yfiles.support.State,stoppedState:yfiles.support.State,finishedState:yfiles.support.State):void; + /** + * Called when the {@link yfiles.input.AbstractConcurrentInputMode#enabled} property changes to true. + * This implementation does nothing. + */ + onEnabled():void; + /** + * Installs all necessary listeners to trigger the {@link yfiles.input.StateMachineInputMode#run} method. + * This implementation registers for all mouse events, keyboard events, and + * the {@link yfiles.canvas.CanvasControl#addEditableChangedListener EditableChanged} event. + */ + installListeners():void; + /** + * Removes all listeners from the canvas that have been registered in {@link yfiles.input.StateMachineInputMode#installListeners}. + */ + uninstallListeners():void; + /** + * Gets or sets a property that determines whether taps should + * be swallowed if they happen within a short amount of time + * after the CanvasControl got focus. + * The default is false. If set to true taps are discarded within + * 100 ms after the focus entered. + */ + swallowFocusTap:boolean; + /** + * Creates the event recognizer that is used to recognize the taps for this instance. + */ + createTapRecognizer():yfiles.input.IEventRecognizer; + /** + * Determines whether the given event is a valid tap event. + */ + isValidTap(eventSource:Object,eventArg:yfiles.system.EventArgs):boolean; + /** + * Creates the event recognizer that is used to recognize the release event for this instance. + */ + createReleaseRecognizer():yfiles.input.IEventRecognizer; + /** + * Determines whether the given event is a valid release event. + */ + isValidRelease(eventSource:Object,eventArg:yfiles.system.EventArgs):boolean; + /** + * Creates the event recognizer that is used to recognize the press event for this instance. + */ + createPressRecognizer():yfiles.input.IEventRecognizer; + /** + * Determines whether the given event is a valid press event. + */ + isValidPress(eventSource:Object,eventArg:yfiles.system.EventArgs):boolean; + /** + * Determines whether the given event is a press event that occurred at an invalid location. + * @see {@link yfiles.input.TapInputMode#validTapHitTestable} + */ + isInvalidPress(eventSource:Object,eventArg:yfiles.system.EventArgs):boolean; + /** + * Called once the gesture has begun. + */ + begin(t:yfiles.support.Transition):void; + /** + * Returns the location of the last tap. + * @return {yfiles.geometry.PointD} + */ + getTapPoint():yfiles.geometry.PointD; + /** + * Called once the gesture has ended. + * This will trigger the {@link yfiles.input.TapInputMode#addTappedListener Tapped} event. + */ + end(t:yfiles.support.Transition):void; + /** + * Called once this mode has recognized a tap gesture. + * This method will trigger the {@link yfiles.input.TapInputMode#addTappedListener Tapped} event. + * @param {yfiles.input.TapEventArgs} eventArgs The arguments. + */ + onTapped(eventArgs:yfiles.input.TapEventArgs):void; + /** + * Called once this mode has recognized a double-tap gesture. + * This method will trigger the {@link yfiles.input.TapInputMode#addDoubleTappedListener DoubleTapped} event. + * @param {yfiles.input.TapEventArgs} eventArgs The arguments. + */ + onDoubleTapped(eventArgs:yfiles.input.TapEventArgs):void; + /** + * Prevents a double-tap event from being issued if the next tap would do so and sends only a single tap instead. + *

+ * The intention is for "breaking" a double tap if an input mode using {@link yfiles.input.TapInputMode} performs actions + * that would lead to surprising behavior if the next tap would lead to a double-tap. Examples of this are + * {@link yWorks.yFiles.UI.Input.GraphEditorInputMode}'s selection cycling where several taps in short + * succession may occur, as well as creating a node by tapping on the canvas and selecting it immediately afterwards + * with another tap. + *

+ *

+ * This method's effect is very short-lived. It really only prevents a double-tap event for the very next tap that + * this input mode handles. The internal flag set by this method is re-set on every tap received. This also means that + * if you call this method and the next tap is just a regular single-tap the flag is cleared nonetheless. + *

+ */ + preventNextDoubleTap():void; + /** + * Returns and resets the flag set by {@link yfiles.input.TapInputMode#preventNextDoubleTap}. + * To ensure that the flag really acts just once, this method resets the flag and returns its value prior to the reset. + */ + queryAndResetPreventNextDoubleTap():boolean; + } + var TapInputMode:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this mode that detects touch taps. + */ + new ():yfiles.input.TapInputMode; + }; + /** + * Describes the state of a snapping operation. + * This class is used by {@link yfiles.input.SnapContext} to {@link yfiles.input.SnapContext#processSnapResults process} + * {@link yfiles.input.SnapResult#snap snap results}. + */ + export interface SnapState extends Object{ + /** + * Gets the current location. + * Value: The location. The value can be adjusted using the {@link yfiles.input.SnapState#snapX}, {@link yfiles.input.SnapState#snapY}, + * and {@link yfiles.input.SnapState#snapTo} methods. + */ + location:yfiles.geometry.PointD; + /** + * Gets or sets the type of the snap. + * Value: The type of the snap. + */ + snapType:yfiles.input.SnapTypes; + toString():string; + /** + * Modifies the Y property of the {@link yfiles.input.SnapState#location} and adjusts the {@link yfiles.input.SnapState#snapType} accordingly. + * @param {number} newY The new Y. + */ + snapY(newY:number):void; + /** + * Modifies the X property of the {@link yfiles.input.SnapState#location} and adjusts the {@link yfiles.input.SnapState#snapType} accordingly. + * @param {number} newX The new X. + */ + snapX(newX:number):void; + /** + * Sets the {@link yfiles.input.SnapState#location} to the given point and adjusts the {@link yfiles.input.SnapState#snapType} accordingly. + * @param {yfiles.geometry.PointD} newLocation The new location. + */ + snapTo(newLocation:yfiles.geometry.PointD):void; + } + var SnapState:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.SnapState} class. + * @param {yfiles.geometry.PointD} location The initial location. + * @param {yfiles.input.SnapTypes} snapType The current type of the snap. + */ + FromLocationAndSnapType:{ + new (location:yfiles.geometry.PointD,snapType:yfiles.input.SnapTypes):yfiles.input.SnapState; + }; + /** + * Initializes a new instance of the {@link yfiles.input.SnapState} class using {@link yfiles.input.SnapTypes#NOT_SNAPPED} + * as the initial {@link yfiles.input.SnapState#snapType}. + * @param {yfiles.geometry.PointD} location The initial location. + */ + FromLocation:{ + new (location:yfiles.geometry.PointD):yfiles.input.SnapState; + }; + }; + /** + * Event Arguments used by {@link yfiles.input.TapInputMode#addTappedListener Tapped}. + */ + export interface TapEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the location of the tap. + * Value: The location. + */ + location:yfiles.geometry.PointD; + /** + * Gets the context in which the tap occurred. + */ + context:yfiles.input.IInputModeContext; + /** + * Gets or sets a value indicating whether this {@link yfiles.input.TapEventArgs} have been handled. + * Client code that is triggered by the event and does not want the event to become handled + * by other handles should set this property to true to stop propagation + * of the event. + * Value: true if handled; otherwise, false. + */ + handled:boolean; + } + var TapEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.TapEventArgs} class. + * @param {yfiles.geometry.PointD} location The location. + */ + FromLocation:{ + new (location:yfiles.geometry.PointD):yfiles.input.TapEventArgs; + }; + /** + * Initializes a new instance of the {@link yfiles.input.TapEventArgs} class. + * @param {yfiles.input.IInputModeContext} context The context in which the tap occurred. + * @param {yfiles.geometry.PointD} location The location. + */ + FromContextAndLocation:{ + new (context:yfiles.input.IInputModeContext,location:yfiles.geometry.PointD):yfiles.input.TapEventArgs; + }; + }; + /** + * A convenience implementation of the {@link yfiles.input.IPositionHandler} interface + * that can be used to constrain the position of an item. + * @see {@link yfiles.input.ConstrainedDragHandler} + * @see {@link yfiles.input.ConstrainedDragHandler#constrainNewLocation} + */ + export interface ConstrainedPositionHandler extends yfiles.input.ConstrainedDragHandler,yfiles.input.IPositionHandler{ + /** + * Delegates to {@link yfiles.input.ConstrainedDragHandler#delegateHandler}'s {@link yfiles.input.IPositionHandler#setPosition} + * method. + * @param {yfiles.geometry.PointD} location + * @see Specified by {@link yfiles.input.IPositionHandler#setPosition}. + */ + setPosition(location:yfiles.geometry.PointD):void; + } + var ConstrainedPositionHandler:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.ConstrainedPositionHandler} class that delegates to the wrappedHandler. + * @param {yfiles.input.IPositionHandler} wrappedHandler The handler to delegate to. + */ + new (wrappedHandler:yfiles.input.IPositionHandler):yfiles.input.ConstrainedPositionHandler; + }; + /** + * This is the abstract base class used by the implementers of {@link yfiles.input.SnapContext} + * to model the result of the mouse being snapped to a certain coordinate. + * It carries a {@link yfiles.input.SnapResult#weight} and can be used to obtain a {@link yfiles.drawing.IVisualCreator} that will + * be included in the view if the result is actually {@link yfiles.input.SnapResult#isSnapped snapped} + * after all other results with higher weight have been {@link yfiles.input.SnapResult#snap snapped}. + */ + export interface SnapResult extends Object,yfiles.lang.IComparable{ + /** + * Yields the weight of this result, the higher the weight, the more important it is. + */ + weight:number; + /** + * The tag associated with this result. + * If more than one result uses the same tag (not null), only the one with the highest + * {@link yfiles.input.SnapResult#weight} will be rendered. + */ + tag:Object; + /** + * Returns a visual creator which is able to create a Visual for this snap result. + * @return {yfiles.drawing.IVisualCreator} A visual creator which creates a Visual which depicts this snap result. + * @see {@link yfiles.drawing.VoidVisualCreator#INSTANCE} + */ + getVisualCreator():yfiles.drawing.IVisualCreator; + /** + * Implements the {@link yfiles.lang.IComparable} interface using {@link yfiles.input.SnapResult#weight}. + * @param {yfiles.input.SnapResult} other The second SnapLineSnapResult + * @return {number} The comparison value of the two SnapResults' Weights + * @see Specified by {@link yfiles.lang.IComparable#compareTo}. + */ + compareTo(other:yfiles.input.SnapResult):number; + /** + * Core method that performs the actual snapping. + * This implementation does nothing. + * @param {yfiles.geometry.PointD} unSappedCoordinates The coordinates prior to the snapping. + * @param {yfiles.input.SnapState} currentSnapState The currently snapped coordinates and the state of the snapping. This instance can be modified by subclasses. + */ + snap(unSappedCoordinates:yfiles.geometry.PointD,currentSnapState:yfiles.input.SnapState):void; + /** + * Checks whether this instance is still snapped given the final mouse coordinates. + * This implementation simply returns false. + * @param {yfiles.geometry.PointD} unsnappedCoordinates The unsnapped coordinates. + * @param {yfiles.input.SnapState} finalSnapState The final snap state that has been used by the client. + * @return {boolean} Whether the coordinates are still snapped for this instance. + */ + isSnapped(unsnappedCoordinates:yfiles.geometry.PointD,finalSnapState:yfiles.input.SnapState):boolean; + } + var SnapResult:{ + $class:yfiles.lang.Class; + /** + * A SnapLineSnapResult representing that there is no snapping of the x or y coordinate. + */ + NULL_RESULT:yfiles.input.SnapResult; + /** + * Factory method that creates a {@link yfiles.input.SnapResult} that snaps to a given location. + * @param {yfiles.geometry.PointD} location The location to snap to. + * @param {number} weight The weight to assign to the result. + * @param {Object} tag The tag to use. + * @param {yfiles.drawing.IVisualCreator} visualCreator The visual creator to use. + * @param {yfiles.input.SnapTypes} snapType The type of the snapping operation to apply. + * @return {yfiles.input.SnapResult} A result that snaps to the provided location using the provided mode. + */ + createPointSnapResult(location:yfiles.geometry.PointD,weight:number,tag:Object,visualCreator:yfiles.drawing.IVisualCreator,snapType:yfiles.input.SnapTypes):yfiles.input.SnapResult; + }; + export enum SnapTypes{ + /** + * Indicates that the coordinate has been snapped to its x values. + * Constant for use in {@link yfiles.input.SnapResult#snap} and {@link yfiles.input.SnapResult#isSnapped}. + * The methods can take a bitwise combination of this field and {@link yfiles.input.SnapTypes#SNAPPED_Y}, {@link yfiles.input.SnapTypes#SNAPPED_X_Y} + * and {@link yfiles.input.SnapTypes#NOT_SNAPPED}. + */ + SNAPPED_X, + /** + * Indicates that the coordinate has been snapped to its y values. + * Constant for use in {@link yfiles.input.SnapResult#snap} and {@link yfiles.input.SnapResult#isSnapped}. + * The methods can take a bitwise combination of this field and {@link yfiles.input.SnapTypes#SNAPPED_X}, {@link yfiles.input.SnapTypes#SNAPPED_X_Y} + * and {@link yfiles.input.SnapTypes#NOT_SNAPPED}. + */ + SNAPPED_Y, + /** + * Indicates that the coordinate has been snapped to its x and y values. + * Constant for use in {@link yfiles.input.SnapResult#snap} and {@link yfiles.input.SnapResult#isSnapped}. + * This is a bitwise combination of {@link yfiles.input.SnapTypes#SNAPPED_X} and {@link yfiles.input.SnapTypes#SNAPPED_Y}. + */ + SNAPPED_X_Y, + /** + * Indicates that the coordinate has not been snapped to its x and y values. + * Constant for use in {@link yfiles.input.SnapResult#snap} and {@link yfiles.input.SnapResult#isSnapped}. + */ + NOT_SNAPPED + } + /** + * Event argument class for key events that carries the type of event. + */ + export interface CompoundKeyEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the type of the event. + */ + eventType:yfiles.input.CompoundKeyEventType; + /** + * Gets or sets a value that indicates whether this event has been handled. + */ + handled:boolean; + /** + * Returns the key code. + * This will be Keys.None for typed event. + */ + keyCode:yfiles.input.Key; + /** + * Returns the value of the character that has been typed. + */ + keyValue:string; + /** + * Returns the state of the modifiers at the time of the event. + */ + modifiers:yfiles.input.ModifierKeys; + } + var CompoundKeyEventArgs:{ + $class:yfiles.lang.Class; + /** + * Constructs a new event. + * @param {yfiles.input.CompoundKeyEventType} type The type to use + * @param {yfiles.input.KeyEventArgs} args The KeyArgs to use. + */ + FromTypeAndKeyEventArgs:{ + new (type:yfiles.input.CompoundKeyEventType,args:yfiles.input.KeyEventArgs):yfiles.input.CompoundKeyEventArgs; + }; + /** + * Constructs a new event for a key that has been typed. + */ + FromKeyEventArgs:{ + new (e:yfiles.input.KeyEventArgs):yfiles.input.CompoundKeyEventArgs; + }; + }; + export enum Key{ + ESCAPE, + DELETE, + SHIFT, + CTRL, + ENTER, + SPACE, + NONE, + ALT, + PAGE_UP, + PAGE_DOWN, + INSERT, + BACK, + ADD, + SUBTRACT, + F1, + F2, + F3, + F4, + F5, + F6, + F7, + F8, + F9, + F10, + F11, + F12, + ARROW_LEFT, + ARROW_UP, + ARROW_RIGHT, + ARROW_DOWN, + D0, + D1, + D2, + D3, + D4, + D5, + D6, + D7, + D8, + D9, + A, + B, + C, + D, + E, + F, + G, + H, + I, + J, + K, + L, + M, + N, + O, + P, + Q, + R, + S, + T, + U, + V, + W, + X, + Y, + Z, + TAB, + PAUSE, + HOME, + END, + N0, + N1, + N2, + N3, + N4, + N5, + N6, + N7, + N8, + N9, + MULTIPLY, + CAPS, + DECIMAL, + DIVIDE, + SEMICOLON, + EQUAL, + COMMA, + DASH, + PERIOD, + ACCENT, + OPEN_BRACKET, + BACK_SLASH, + CLOSE_BRACKET, + SINGLE_QUOTE + } + /** + * A wrapper for the native keyboard event which abstracts away incompatibilities in browser implementations. + */ + export interface KeyEventArgs extends yfiles.system.RoutedEventArgs{ + /** + * Gets the key. + */ + key:yfiles.input.Key; + /** + * Gets the modifiers. + */ + modifiers:yfiles.input.ModifierKeys; + /** + * Gets a value indicating whether the alt modifier is pressed. + * Value: + * true if the alt modifier is pressed; otherwise, false. + */ + alt:boolean; + /** + * Gets a value indicating whether the shift modifier is pressed. + * Value: + * true if the shift modifier is pressed; otherwise, false. + */ + shift:boolean; + /** + * Gets a value indicating whether the control modifier is pressed. + * Value: + * true if the control modifier is pressed; otherwise, false. + */ + control:boolean; + /** + * Gets a value indicating whether the meta modifier is pressed. + * Value: + * true if the meta modifier is pressed; otherwise, false. + */ + meta:boolean; + } + var KeyEventArgs:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this class from a native keyboard event. + * @param {KeyboardEvent} evt The native keyboard event. + * @param {boolean} isPrintable if set to true [is printable]. + */ + new (evt:KeyboardEvent,isPrintable:boolean):yfiles.input.KeyEventArgs; + }; + export enum ModifierKeys{ + /** + * Indicates that no modifier key was pressed. + */ + NONE, + /** + * Indicates that the control key was pressed. + */ + CONTROL, + /** + * Indicates that the shift key was pressed. + */ + SHIFT, + /** + * Indicates that the alt key was pressed. + */ + ALT, + /** + * Indicates that the windows (or meta) key was pressed. + */ + WINDOWS + } + /** + * A wrapper for native mouse events that abstracts over browser incompatibilities. + */ + export interface MouseEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the mouse button that was pressed or released. + */ + button:yfiles.system.MouseButtons; + /** + * Gets the X coordinate of the mouse event. + */ + x:number; + /** + * Gets the Y coordinate of the mouse event. + */ + y:number; + /** + * Gets the delta of the mouse wheel change. + */ + delta:number; + /** + * Sets a value indicating whether this {@link yfiles.input.MouseEventArgs} is handled. + * If the event is handled, then the native browser event handling will be prevented and the even won't be propagated to the + * parent element. + * Value: + * true if handled; otherwise, false. + */ + handled:boolean; + /** + * Gets the position of the event within the target bounds. + * @param {Element} target The target. + * @return {yfiles.geometry.PointD} + */ + getPosition(target:Element):yfiles.geometry.PointD; + /** + * Gets the original, native, mouse event. + */ + originalEvent:MouseEvent; + /** + * Gets the modifiers that were pressed when the event occurred. + */ + modifiers:yfiles.input.ModifierKeys; + } + var MouseEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.MouseEventArgs} class. + * @param {MouseEvent} mouseEvent The mouse event. + */ + FromDomEvent:{ + new (mouseEvent:MouseEvent):yfiles.input.MouseEventArgs; + }; + /** + * Initializes a new instance of the {@link yfiles.input.MouseEventArgs} class. + * @param {HTMLElement} target The target. + * @param {MouseEvent} mouseEvent The mouse event. + */ + FromTargetAndMouseEvent:{ + new (target:HTMLElement,mouseEvent:MouseEvent):yfiles.input.MouseEventArgs; + }; + /** + * Initializes a new instance of the {@link yfiles.input.MouseEventArgs} class. + * @param {HTMLElement} target The target. + * @param {WheelEvent} wheelEvent The wheel event. + */ + FromTargetAndWheelEvent:{ + new (target:HTMLElement,wheelEvent:WheelEvent):yfiles.input.MouseEventArgs; + }; + /** + * Determines whether the specified value is defined. A value is defined when it is not equal to undefined. + * @param {Object} value The value. + * @return {boolean} + * true if the specified value is defined; otherwise, false. + */ + isDefined(value:Object):boolean; + /** + * Determines whether the specified value is undefined. + * @param {Object} value The value. + * @return {boolean} + * true if the specified value is undefined; otherwise, false. + */ + isUndefined(value:Object):boolean; + }; + /** + * Event argument that can be used to query the text to display when + * the mouse hovers over the given point in world coordinate space. + * @see {@link yfiles.input.MouseHoverInputMode} + */ + export interface ToolTipQueryEventArgs extends yfiles.input.InputModeEventArgs{ + /** + * Gets the query location in world coordinates. + * Value: The query location. + */ + queryLocation:yfiles.geometry.PointD; + /** + * Gets or sets the tool tip content to use. + * Setting this property will set the {@link yfiles.input.ToolTipQueryEventArgs#handled} property + * to true. + * Value: The tool tip content. + */ + toolTip:Object; + /** + * Gets or sets a value indicating whether this {@link yfiles.input.ToolTipQueryEventArgs} + * has been handled. + * This property is automatically set to true if {@link yfiles.input.ToolTipQueryEventArgs#toolTip} + * property has been assigned a value. + * Marking this event as handled tells the issuer of the query whether the + * {@link yfiles.input.ToolTipQueryEventArgs#toolTip} property should be used or whether additional + * logic should be used to determine whether to show the menu. + * Value: true if handled; otherwise, false. + */ + handled:boolean; + } + var ToolTipQueryEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.ToolTipQueryEventArgs} class. + * @param {yfiles.input.IInputModeContext} context The context of the query. + * @param {yfiles.geometry.PointD} queryLocation The query location. + */ + new (context:yfiles.input.IInputModeContext,queryLocation:yfiles.geometry.PointD):yfiles.input.ToolTipQueryEventArgs; + }; + /** + * An {@link yfiles.input.IInputMode} that detects when the mouse hovers over the + * {@link yfiles.canvas.CanvasControl}. + * This implementation will show a {@link yfiles.input.MouseHoverInputMode#toolTip ToolTip}. + * In order to make use of this instance one has to register with the {@link yfiles.input.MouseHoverInputMode#addQueryToolTipListener QueryToolTip} + * event. + * Setting a custom {@link yfiles.input.MouseHoverInputMode#validHoverLocationHitTestable} + * will restrict the area where a tool tip can be shown. + */ + export interface MouseHoverInputMode extends yfiles.input.AbstractConcurrentInputMode{ + /** + * Gets or sets an {@link yfiles.drawing.IHitTestable} that determines where + * the mouse may hover and a tool tip can be {@link yfiles.input.MouseHoverInputMode#onShow shown}. + * The default value of this property is {@link yfiles.drawing.HitTestable#ALWAYS} + */ + validHoverLocationHitTestable:yfiles.drawing.IHitTestable; + /** + * Gets or sets the {@link yfiles.input.MouseHoverInputMode#toolTip} instance to use during display. + * This method will trigger the {@link yfiles.input.MouseHoverInputMode#createToolTip} method + * if no tool tip has been set. + */ + toolTip:yfiles.canvas.ToolTip; + /** + * Immediately shows the tool tip at the given location. + * @param {yfiles.geometry.PointD} location The location in the world coordinate system. + */ + show(location:yfiles.geometry.PointD):void; + /** + * Immediately hides the tool tip. + */ + hide():void; + /** + * Determines whether the tool tip is currently showing. + */ + showing:boolean; + /** + * Triggered when the mouse hovers over the given coordinates. + * This method will call {@link yfiles.input.MouseHoverInputMode#getToolTipContent} to query the content + * and will display the {@link yfiles.input.MouseHoverInputMode#toolTip} at the location + * returned by {@link yfiles.input.MouseHoverInputMode#getToolTipLocation} if the content is not null. + */ + onShow(location:yfiles.geometry.PointD):void; + /** + * Adjust the calculated tooltip position. + * This default implementation of this method moves the tooltip into the visible area + * if it extends beyond the document bounds. + * @param {yfiles.geometry.PointD} originalPosition The calculated tooltip position relative to the document root + * @return {yfiles.geometry.PointD} The adjusted tooltip location + * @see {@link yfiles.input.MouseHoverInputMode#getToolTipLocation} + */ + adjustTooltipPosition(originalPosition:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Gets or sets the tool tip location offset in view coordinates. + * The value of this property is used by {@link yfiles.input.MouseHoverInputMode#getToolTipLocation} + * in order to move the tool tip away from the mouse pointer. The default + * value is (0,0). + * @see {@link yfiles.input.MouseHoverInputMode#getToolTipLocation} + */ + toolTipLocationOffset:yfiles.geometry.PointD; + /** + * Finds the position in canvas view coordinates to + * display the tool tip at for the given world coordinates. + * This method adds the {@link yfiles.input.MouseHoverInputMode#toolTipLocationOffset} after + * converting the given location to view coordinates. + * @param {yfiles.geometry.PointD} location The position in world coordinates. + * @return {yfiles.geometry.PointD} The position in view coordinates. + * @see {@link yfiles.input.MouseHoverInputMode#toolTipLocationOffset} + */ + getToolTipLocation(location:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Gets or sets the delay time before showing + * the tool tip. + * The default value is 1 second + */ + hoverTime:yfiles.system.TimeSpan; + /** + * Gets or sets the duration to show the tool tip. + * The default value is 3 seconds. + */ + duration:yfiles.system.TimeSpan; + /** + * Gets or sets the amount the mouse pointer has to move in order to hide the tooltip. + * The default value is 10, 10. + */ + mouseHoverSize:yfiles.geometry.SizeD; + /** + * If true the tooltip is closed when the a click is performed over the tooltip. + */ + closeOnClick:boolean; + /** + * Factory method that creates the {@link yfiles.input.MouseHoverInputMode#toolTip}. + * @see {@link yfiles.input.MouseHoverInputMode#TOOL_TIP_TEMPLATE_KEY} + * @return {yfiles.canvas.ToolTip} A simple {@link yfiles.input.MouseHoverInputMode#toolTip}. + */ + createToolTip():yfiles.canvas.ToolTip; + /** + * Callback method that provides a text for the given location or null. + * @param {yfiles.geometry.PointD} location The location to find a text for. + * @return {Object} A string or null to indicate that no tool tip should be shown. + * @see {@link yfiles.input.MouseHoverInputMode#addQueryToolTipListener QueryToolTip} + * @see {@link yfiles.input.MouseHoverInputMode#createHoverInputModeContext} + */ + getToolTipContent(location:yfiles.geometry.PointD):Object; + /** + * Raises the {@link yfiles.input.MouseHoverInputMode#addQueryToolTipListener QueryToolTip} event. + * @param {yfiles.input.ToolTipQueryEventArgs} args The {@link yfiles.input.ToolTipQueryEventArgs} instance containing the event data. + */ + onQueryToolTip(args:yfiles.input.ToolTipQueryEventArgs):void; + /** + * Creates an {@link yfiles.input.IInputModeContext} for use + * with the {@link yfiles.input.MouseHoverInputMode#addQueryToolTipListener QueryToolTip} event for the upcoming + * text query operation. + * @return {yfiles.input.IInputModeContext} An instance of {@link yfiles.input.IInputModeContext}. + */ + createHoverInputModeContext():yfiles.input.IInputModeContext; + /** + * Occurs when this mode queries the tool tip for a certain query location. + * Handlers should set the {@link yfiles.input.ToolTipQueryEventArgs#toolTip} + * property or set/respect the {@link yfiles.input.ToolTipQueryEventArgs#handled} property + * accordingly. + */ + addQueryToolTipListener(value:(sender:Object,e:yfiles.input.ToolTipQueryEventArgs)=> void):void; + /** + * Occurs when this mode queries the tool tip for a certain query location. + * Handlers should set the {@link yfiles.input.ToolTipQueryEventArgs#toolTip} + * property or set/respect the {@link yfiles.input.ToolTipQueryEventArgs#handled} property + * accordingly. + */ + removeQueryToolTipListener(value:(sender:Object,e:yfiles.input.ToolTipQueryEventArgs)=> void):void; + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Called when the {@link yfiles.input.AbstractConcurrentInputMode#enabled} property changes to false. + * This implementation sets the {@link yfiles.input.AbstractConcurrentInputMode#preferredCursor} property to null + * and {@link yfiles.input.AbstractConcurrentInputMode#releaseMutex releases} the mutex if the mutex is currently owned + * by this instance. + */ + onDisabled():void; + /** + * Called when the tooltip should be hidden. + */ + onHide():void; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + } + var MouseHoverInputMode:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with default values. + */ + new ():yfiles.input.MouseHoverInputMode; + /** + * Creates a new instance using the provided {@link yfiles.input.MouseHoverInputMode#toolTip} and query callback. + */ + WithToolTipAndCallback:{ + new (toolTip:yfiles.canvas.ToolTip,textProvider:(sender:Object,e:yfiles.input.ToolTipQueryEventArgs)=> void):yfiles.input.MouseHoverInputMode; + }; + /** + * A {@link yfiles.system.ComponentResourceKey} that is used by this instance's {@link yfiles.input.MouseHoverInputMode#createToolTip} + * to find a {@link yfiles.drawing.DataTemplate} that will be used to create the {@link yfiles.input.MouseHoverInputMode#toolTip}. + */ + TOOL_TIP_TEMPLATE_KEY:yfiles.system.ResourceKey; + }; + /** + * A more sophisticated {@link yfiles.input.IHandle} implementation that modifies a rectangle. + * Implementations of this class work on a mutable rectangle instance for handling drags of the handle. + * A separate point implementation is used for specifying the position of the handle. + * As a convenience this class also implements the {@link yfiles.geometry.IMutablePoint} and + * {@link yfiles.geometry.IMovable} interface which both modify the handle's position. + */ + export interface ReshapeableHandle extends Object,yfiles.geometry.IMutablePoint,yfiles.geometry.IMovable,yfiles.input.IHandle{ + /** + * The position of the handle. + */ + position:yfiles.input.HandlePositions; + /** + * The reference for the location of the handle. + */ + location1:yfiles.geometry.IPoint; + /** + * The rectangle instance to modify. + */ + rect:yfiles.geometry.IRectangle; + /** + * The reshapeable instance to write the changes to. + */ + reshapeable:yfiles.geometry.IReshapeable; + /** + * Gets or sets the minimum size allowed for the reshapeable. + * The value is stored by reference. + * The default is {@link yfiles.geometry.ImmutableSize#EMPTY}. + */ + minimumSize:yfiles.geometry.ISize; + /** + * Gets or sets the minimum enclosed area that needs to be encompassed by this reshapeable. + * The value is stored by reference. + * The default is {@link yfiles.geometry.ImmutableSize#EMPTY}, which does not restrict the area at all. + */ + minimumEnclosedArea:yfiles.geometry.IRectangle; + /** + * Gets or sets the maximum size allowed for the reshapeable. + * The value is stored by reference. + * The default is {@link yfiles.geometry.ImmutableSize#UNBOUND}. + */ + maximumSize:yfiles.geometry.ISize; + /** + * Returns a view of the center of the handle. + * Value: + * The point describes the current world coordinate of the element that can + * be modified by this handle. + * @see Specified by {@link yfiles.input.IDragHandler#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Gets or sets the type of the handle that can be used by the rendering engine + * to render types differently. + * @see Specified by {@link yfiles.input.IHandle#type}. + */ + type:yfiles.input.HandleType; + /** + * Gets or sets the cursor to display when the mouse hovers over or drags this + * handle. + * @see Specified by {@link yfiles.input.IHandle#cursor}. + */ + cursor:yfiles.canvas.ICanvasCursor; + /** + * This implementation does nothing. + * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. + */ + initializeDrag(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Gets or sets the x coordinate. + * The setter delegates to {@link yfiles.input.ReshapeableHandle#moveBy} + * @see Specified by {@link yfiles.geometry.IMutablePoint#x}. + */ + x:number; + /** + * Gets or sets the y coordinate. + * The setter delegates to {@link yfiles.input.ReshapeableHandle#moveBy} + * @see Specified by {@link yfiles.geometry.IMutablePoint#y}. + */ + y:number; + /** + * Delegates the work to the reshapeable. + * @see Specified by {@link yfiles.geometry.IMovable#moveBy}. + */ + moveBy(delta:yfiles.geometry.PointD):boolean; + /** + * Delegates to {@link yfiles.input.ReshapeableHandle#moveBy}. + */ + setWithXAndY(x:number,y:number):boolean; + /** + * Delegates to {@link yfiles.input.ReshapeableHandle#setWithXAndY}. + * @see Specified by {@link yfiles.input.IDragHandler#handleMove}. + */ + handleMove(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):boolean; + /** + * Delegates the original values to {@link yfiles.input.ReshapeableHandle#setWithXAndY}. + * @see Specified by {@link yfiles.input.IDragHandler#cancelDrag}. + */ + cancelDrag(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * This implementation does nothing. + * @see Specified by {@link yfiles.input.IDragHandler#dragFinished}. + */ + dragFinished(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + } + var ReshapeableHandle:{ + $class:yfiles.lang.Class; + /** + * Creates a handle for the given position that uses and modifies the rectangle instance + * provided. + * @param {yfiles.input.HandlePositions} position The position to use for the handle. + * @param {yfiles.geometry.IMutableRectangle} rect The rectangle that serves as a model for the handle. + * @return {yfiles.input.ReshapeableHandle} A new instance that models a handle at the given position of the rectangle. + */ + createWithRectangle(position:yfiles.input.HandlePositions,rect:yfiles.geometry.IMutableRectangle):yfiles.input.ReshapeableHandle; + /** + * Creates a handle for the given position that uses and modifies the instances using + * the reshapeable interface. + * The implementation uses the rect instance to determine the position of the handle and writes + * changes to the geometry of the rectangle to the reshapeable. + * @param {yfiles.input.HandlePositions} position The position to use for the handle. + * @param {yfiles.geometry.IRectangle} rect The rectangle. + * @param {yfiles.geometry.IReshapeable} reshapeable The reshapeable to write the changes to. + * @return {yfiles.input.ReshapeableHandle} A new instance that models a handle at the given position of the rectangle. + */ + create(position:yfiles.input.HandlePositions,rect:yfiles.geometry.IRectangle,reshapeable:yfiles.geometry.IReshapeable):yfiles.input.ReshapeableHandle; + /** + * Creates a handle for the given position using the location instance + * as the {@link yfiles.input.IDragHandler#location} for the handle. + * The instance modifies the instances using + * the reshapeable interface and reads the current state using the rect. + * @param {yfiles.input.HandlePositions} position The position to use for the handle. + * @param {yfiles.geometry.IPoint} location The {@link yfiles.input.ReshapeableHandle#location} to use for the handle. + * @param {yfiles.geometry.IRectangle} rect The rectangle. + * @param {yfiles.geometry.IReshapeable} reshapeable The reshapeable to write the changes to. + * @return {yfiles.input.ReshapeableHandle} A new instance that models a handle at the given position of the rectangle. + */ + createAt(position:yfiles.input.HandlePositions,location:yfiles.geometry.IPoint,rect:yfiles.geometry.IRectangle,reshapeable:yfiles.geometry.IReshapeable):yfiles.input.ReshapeableHandle; + /** + * Creates a handle for the given position using the location instance + * as the {@link yfiles.input.IDragHandler#location} for the handle. + * The instance modifies the instances using + * the reshapeable interface and reads the current state using the rect. + * The handle will automatically trim changes of the rectangle to the specified minimum + * and maximum size. + * @param {yfiles.input.HandlePositions} position The position to use for the handle. + * @param {yfiles.geometry.IPoint} location The {@link yfiles.input.ReshapeableHandle#location} to use for the handle. + * @param {yfiles.geometry.IRectangle} rect The rectangle. + * @param {yfiles.geometry.IReshapeable} reshapeable The reshapeable to write the changes to. + * @param {yfiles.geometry.ISize} maximumSize The maximum size allowed for the rectangle. + * @param {yfiles.geometry.ISize} minimumSize The minimum size allowed for the rectangle. + * @return {yfiles.input.ReshapeableHandle} A new instance that models a handle at the given position of the rectangle. + */ + createConstrained(position:yfiles.input.HandlePositions,location:yfiles.geometry.IPoint,rect:yfiles.geometry.IRectangle,reshapeable:yfiles.geometry.IReshapeable,minimumSize:yfiles.geometry.ISize,maximumSize:yfiles.geometry.ISize):yfiles.input.ReshapeableHandle; + /** + * Subclass constructor that creates a handle for the given position using the location instance + * as the {@link yfiles.input.IDragHandler#location} for the handle. + * The instance modifies the instances using + * the reshapeable interface and reads the current state using the rect. + * The handle will automatically trim changes of the rectangle to the specified minimum + * and maximum size. + * @param {yfiles.input.HandlePositions} position The position of the handle. + * @param {yfiles.geometry.IPoint} location The {@link yfiles.input.ReshapeableHandle#location} to use for the handle. + * @param {yfiles.geometry.IRectangle} rect The rectangle. + * @param {yfiles.geometry.IReshapeable} reshapeable The reshapeable to write the changes to. + * @param {yfiles.geometry.ISize} maximumSize The maximum size allowed for the rectangle. + * @param {yfiles.geometry.ISize} minimumSize The minimum size allowed for the rectangle. + */ + new (position:yfiles.input.HandlePositions,location:yfiles.geometry.IPoint,rect:yfiles.geometry.IRectangle,reshapeable:yfiles.geometry.IReshapeable,minimumSize:yfiles.geometry.ISize,maximumSize:yfiles.geometry.ISize):yfiles.input.ReshapeableHandle; + }; + /** + * A utility implementation of the {@link yfiles.input.IReshapeHandler} interface that + * can be used to constrain the reshaping of an existing instance conveniently. + * @see {@link yfiles.input.ConstrainedHandle} + * @see {@link yfiles.input.ConstrainedPositionHandler} + * @see {@link yfiles.input.ConstrainedReshapeHandler#constrainNewBounds} + */ + export interface ConstrainedReshapeHandler extends Object,yfiles.input.IReshapeHandler{ + /** + * Gets the delegate handler to which calls will be ultimately delegated. + * Value: The delegate handler. + */ + delegateHandler:yfiles.input.IReshapeHandler; + /** + * Delegates to the {@link yfiles.input.ConstrainedReshapeHandler#delegateHandler}'s {@link yfiles.input.IReshapeHandler#bounds} property. + * @see Specified by {@link yfiles.input.IReshapeHandler#bounds}. + */ + bounds:yfiles.geometry.IRectangle; + /** + * Initializes the reshape operation and subsequently calls {@link yfiles.input.ConstrainedReshapeHandler#onInitialized}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context in which the drag will be performed. + * @see Specified by {@link yfiles.input.IReshapeHandler#initializeReshape}. + */ + initializeReshape(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Handles the reshape operation and subsequently calls {@link yfiles.input.ConstrainedReshapeHandler#onReshaped}. + * This method will use the {@link yfiles.input.ConstrainedReshapeHandler#constrainNewBounds} callback to let subclasses + * constrain the reshaping. + * @param {yfiles.input.IInputModeContext} inputModeContext The context in which the reshape will be performed. + * @param {yfiles.geometry.RectD} originalBounds The value of the {@link yfiles.input.ConstrainedReshapeHandler#bounds} property at the time of {@link yfiles.input.ConstrainedReshapeHandler#initializeReshape}. + * @param {yfiles.geometry.RectD} newBounds The coordinates in the world coordinate system that the client wants to reshape the item to. + * Depending on the implementation the {@link yfiles.input.ConstrainedReshapeHandler#bounds} may or may not be modified to reflect the new value. + * @return {boolean} + * Whether the reshape had any visual effect. This is a hint to the engine to optimize invalidation. + * @see Specified by {@link yfiles.input.IReshapeHandler#handleReshape}. + */ + handleReshape(inputModeContext:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.RectD,newBounds:yfiles.geometry.RectD):boolean; + /** + * Callback that needs to implement the constraints for the new bounds. + * @param {yfiles.input.IInputModeContext} inputModeContext The context in which the reshape will be performed. + * @param {yfiles.geometry.RectD} originalBounds The value of the {@link yfiles.input.ConstrainedReshapeHandler#bounds} property at the time of {@link yfiles.input.ConstrainedReshapeHandler#initializeReshape}. + * @param {yfiles.geometry.RectD} newBounds The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.ConstrainedReshapeHandler#bounds} may or may not be modified to reflect the new value. + * @return {yfiles.geometry.RectD} The constrained value of newBounds. + */ + constrainNewBounds(inputModeContext:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.RectD,newBounds:yfiles.geometry.RectD):yfiles.geometry.RectD; + /** + * Cancels the move operation and calls {@link yfiles.input.ConstrainedReshapeHandler#onCanceled}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.RectD} originalBounds The value of the coordinate of the {@link yfiles.input.ConstrainedReshapeHandler#bounds} property at the time of {@link yfiles.input.ConstrainedReshapeHandler#initializeReshape}. + * @see Specified by {@link yfiles.input.IReshapeHandler#cancelReshape}. + */ + cancelReshape(inputModeContext:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.RectD):void; + /** + * Called when the {@link yfiles.input.ConstrainedReshapeHandler#handleReshape} operation has been performed. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context. + * @param {yfiles.geometry.RectD} originalBounds The original Bounds. + * @param {yfiles.geometry.RectD} newBounds The new Bounds. + */ + onReshaped(inputModeContext:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.RectD,newBounds:yfiles.geometry.RectD):void; + /** + * Called when the {@link yfiles.input.ConstrainedReshapeHandler#initializeReshape} method has been called. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context. + * @param {yfiles.geometry.RectD} originalBounds The original bounds. + */ + onInitialized(inputModeContext:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.RectD):void; + /** + * Called when the {@link yfiles.input.ConstrainedReshapeHandler#cancelReshape} method has been called. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context. + * @param {yfiles.geometry.RectD} originalBounds The original bounds. + */ + onCanceled(inputModeContext:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.RectD):void; + /** + * Called when the {@link yfiles.input.ConstrainedReshapeHandler#reshapeFinished} method has been called. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context. + * @param {yfiles.geometry.RectD} originalBounds The original bounds. + * @param {yfiles.geometry.RectD} newBounds The new bounds. + */ + onFinished(inputModeContext:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.RectD,newBounds:yfiles.geometry.RectD):void; + /** + * Handles the finish operation and invokes {@link yfiles.input.ConstrainedReshapeHandler#onFinished}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.RectD} originalBounds The value of the {@link yfiles.input.ConstrainedReshapeHandler#bounds} property at the time of {@link yfiles.input.ConstrainedReshapeHandler#initializeReshape}. + * @param {yfiles.geometry.RectD} newBounds The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.ConstrainedReshapeHandler#bounds} may or may not be modified to reflect the new value. + * This is the same value as delivered in the last invocation of {@link yfiles.input.ConstrainedReshapeHandler#handleReshape} + * @see Specified by {@link yfiles.input.IReshapeHandler#reshapeFinished}. + */ + reshapeFinished(inputModeContext:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.RectD,newBounds:yfiles.geometry.RectD):void; + } + var ConstrainedReshapeHandler:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.ConstrainedReshapeHandler} class + * that delegates to the wrappedHandler. + * @param {yfiles.input.IReshapeHandler} wrappedHandler The handler to delegate to. + */ + new (wrappedHandler:yfiles.input.IReshapeHandler):yfiles.input.ConstrainedReshapeHandler; + }; + /** + * A utility class that offers {@link yfiles.input.IEventRecognizer} + * implementations that deal with {@link yfiles.input.Touch2DEventArgs}. + */ + export interface Touch2DEvents extends Object{ + } + var Touch2DEvents:{ + $class:yfiles.lang.Class; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies touch movements of the primary device. + */ + TOUCH_MOVED_PRIMARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies the loss of touch capture for the any device. + */ + LOST_CAPTURE:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies the loss of touch capture for the primary device. + */ + LOST_CAPTURE_PRIMARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies the loss of touch capture for the secondary device. + */ + LOST_CAPTURE_SECONDARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies touch movements of the primary device. + */ + TOUCH_DOWN_PRIMARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies touch movements of the primary device. + */ + TOUCH_UP_PRIMARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies touch taps of the primary device. + */ + TOUCH_TAPPED_PRIMARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies touch double-taps of the primary device. + */ + TOUCH_DOUBLE_TAPPED_PRIMARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies touch multi-taps of the primary device. + */ + TOUCH_MULTI_TAPPED_PRIMARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies when the primary device has left the control. + */ + TOUCH_EXITED_PRIMARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies when the primary device has entered the control. + */ + TOUCH_ENTERED_PRIMARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies long presses of the primary device. + */ + TOUCH_LONG_PRESSED_PRIMARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies touch movements of the secondary device. + */ + TOUCH_MOVED_SECONDARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies touch movements of the secondary device. + */ + TOUCH_DOWN_SECONDARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies touch movements of the secondary device. + */ + TOUCH_UP_SECONDARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies touch taps of the secondary device. + */ + TOUCH_TAPPED_SECONDARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies touch double-taps of the secondary device. + */ + TOUCH_DOUBLE_TAPPED_SECONDARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies touch multi-taps of the secondary device. + */ + TOUCH_MULTI_TAPPED_SECONDARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies when the secondary device has left the control. + */ + TOUCH_EXITED_SECONDARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies when the secondary device has entered the control. + */ + TOUCH_ENTERED_SECONDARY:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies long presses of the secondary device. + */ + TOUCH_LONG_PRESSED_SECONDARY:yfiles.input.IEventRecognizer; + }; + /** + * A utility implementation of the {@link yfiles.input.IDragHandler} interface that + * can be used to constrain the movement of an existing instance conveniently. + * @see {@link yfiles.input.ConstrainedHandle} + * @see {@link yfiles.input.ConstrainedPositionHandler} + * @see {@link yfiles.input.ConstrainedDragHandler#constrainNewLocation} + */ + export interface ConstrainedDragHandler extends Object,yfiles.input.IDragHandler{ + /** + * Gets the delegate handler to which calls will be ultimately delegated. + * Value: The delegate handler. + */ + delegateHandler:TDelegate; + /** + * Delegates to the {@link yfiles.input.ConstrainedDragHandler#delegateHandler}'s {@link yfiles.input.IDragHandler#location} property. + * @see Specified by {@link yfiles.input.IDragHandler#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Initializes the drag operation and subsequently calls {@link yfiles.input.ConstrainedDragHandler#onInitialized}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context in which the drag will be performed. + * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. + */ + initializeDrag(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Handles the move operation and subsequently calls {@link yfiles.input.ConstrainedDragHandler#onMoved}. + * This method will use the {@link yfiles.input.ConstrainedDragHandler#constrainNewLocation} callback to let subclasses + * constrain the movement. + * @param {yfiles.input.IInputModeContext} inputModeContext The context in which the drag will be performed. + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.ConstrainedDragHandler#location} property at the time of {@link yfiles.input.ConstrainedDragHandler#initializeDrag}. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.ConstrainedDragHandler#location} may or may not be modified to reflect the new value. + * @return {boolean} + * Whether the move had any visual effect. This is a hint to the engine to optimize invalidation. + * @see Specified by {@link yfiles.input.IDragHandler#handleMove}. + */ + handleMove(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):boolean; + /** + * Callback that needs to implement the constraints for the new location. + * @param {yfiles.input.IInputModeContext} context The context in which the drag will be performed. + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.ConstrainedDragHandler#location} property at the time of {@link yfiles.input.ConstrainedDragHandler#initializeDrag}. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.ConstrainedDragHandler#location} may or may not be modified to reflect the new value. + * @return {yfiles.geometry.PointD} The constrained value of newLocation. + */ + constrainNewLocation(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):yfiles.geometry.PointD; + /** + * Cancels the move operation and calls {@link yfiles.input.ConstrainedDragHandler#onCanceled}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} originalLocation The value of the coordinate of the {@link yfiles.input.ConstrainedDragHandler#location} property at the time of {@link yfiles.input.ConstrainedDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#cancelDrag}. + */ + cancelDrag(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * Called when the {@link yfiles.input.ConstrainedDragHandler#handleMove} operation has been performed. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context. + * @param {yfiles.geometry.PointD} originalLocation The original location. + * @param {yfiles.geometry.PointD} newLocation The new location. + */ + onMoved(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + /** + * Called when the {@link yfiles.input.ConstrainedDragHandler#initializeDrag} method has been called. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context. + * @param {yfiles.geometry.PointD} originalLocation The original location. + */ + onInitialized(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * Called when the {@link yfiles.input.ConstrainedDragHandler#cancelDrag} method has been called. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context. + * @param {yfiles.geometry.PointD} originalLocation The original location. + */ + onCanceled(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * Called when the {@link yfiles.input.ConstrainedDragHandler#dragFinished} method has been called. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context. + * @param {yfiles.geometry.PointD} originalLocation The original location. + * @param {yfiles.geometry.PointD} newLocation The new location. + */ + onFinished(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + /** + * Handles the finish operation and invokes {@link yfiles.input.ConstrainedDragHandler#onFinished}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.ConstrainedDragHandler#location} property at the time of {@link yfiles.input.ConstrainedDragHandler#initializeDrag}. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.ConstrainedDragHandler#location} may or may not be modified to reflect the new value. + * This is the same value as delivered in the last invocation of {@link yfiles.input.ConstrainedDragHandler#handleMove} + * @see Specified by {@link yfiles.input.IDragHandler#dragFinished}. + */ + dragFinished(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + } + var ConstrainedDragHandler:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.ConstrainedDragHandler} class + * that delegates to the wrappedHandler. + * @param {TDelegate} wrappedHandler The handler to delegate to. + */ + new (wrappedHandler:TDelegate):yfiles.input.ConstrainedDragHandler; + }; + /** + * An {@link yfiles.input.IInputMode} implementation that can + * handle marquee selections performed by the user with a mouse. + * This implementation will request the {@link yfiles.input.InputMutex} + * as soon as it recognizes a mouse drag. + */ + export interface MarqueeSelectionInputMode extends yfiles.input.StateMachineInputMode{ + /** + * Called to initialize the state machine. + * This implementation does nothing. + * @param {yfiles.support.StateMachine} machine The machine to initialize and configure + * @param {yfiles.support.State} startState The start state to use. + * @param {yfiles.support.State} canceledState The canceled state to use. + * @param {yfiles.support.State} stoppedState The stopped state to use. + * @param {yfiles.support.State} finishedState The finished state to use. + */ + initializeStateMachine(machine:yfiles.support.StateMachine,startState:yfiles.support.State,canceledState:yfiles.support.State,stoppedState:yfiles.support.State,finishedState:yfiles.support.State):void; + /** + * Cancels any pending marquee selection. + * @see Overrides {@link yfiles.input.StateMachineInputMode#cancel} + * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Returns copy of the state of the current or last marquee selection rectangle. + * @return {yfiles.geometry.RectD} A copy of the state of the marquee box. + */ + getSelectionRectangle():yfiles.geometry.RectD; + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(c:yfiles.input.IInputModeContext):void; + /** + * Gets or sets the template that is used for the visualization of the marquee rectangle. + * Value: The template. + */ + template:yfiles.drawing.DataTemplate; + /** + * Gets or sets the canvas object group provider this mode should render the + * visual representations of the marquee in. + * The default is an instance of {@link yfiles.model.CanvasGroupProviders#createTopGroupProvider}. + */ + canvasGroupProvider:yfiles.model.ICanvasGroupProvider; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Called by the state machine to prepare the marquee selection + * when the mouse is pressed. + */ + prepare(t:yfiles.support.Transition):void; + /** + * Called by the state machine to begin the marquee selection + * when the mouse is dragged. + */ + begin(t:yfiles.support.Transition):void; + /** + * Gets or sets the "cancel" recognizer. + * This recognizer recognizes the cancel action during the marquee selection. + * Value: The "cancel" recognizer. + */ + cancelRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the cursor to use during the dragging of the marquee. + * The default is Cursors.Cross + */ + marqueeCursor:yfiles.canvas.ICanvasCursor; + /** + * Gets or sets the "pressed" state recognizer. + * This recognizer instance will be used to determine when the user begins + * to draw the marquee. + * Value: The "pressed" recognizer. + */ + pressedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "dragged" recognizer. + * This recognizer instance determines when the user is dragging the marquee. + * Value: The "dragged" recognizer. + */ + draggedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "released" recognizer. + * This instance determines when the user has finished creating the marquee. + * Value: The "released" recognizer. + */ + releasedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "pressed" state recognizer for touch input. + * This recognizer instance will be used to determine when the user begins + * to draw the marquee. + * Value: The "pressed" recognizer for touch events. + */ + pressedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "dragged" recognizer for touch input. + * This recognizer instance determines when the user is dragging the marquee. + * Value: The "dragged" recognizer for touch events. + */ + draggedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "released" recognizer for touch input. + * This instance determines when the user has finished creating the marquee. + * Value: The "released" recognizer for touch events. + */ + releasedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Called by the state machine to drag the marquee selection. + */ + drag(t:yfiles.support.Transition):void; + /** + * Triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragStartingListener DragStarting} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragStarting(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragStartedListener DragStarted} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragStarted(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the start of each drag. + * This method triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDraggingListener Dragging} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragging(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the end of each drag. + * This method triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDraggedListener Dragged} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragged(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered once the drag has been finalized. + * This method triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragFinishedListener DragFinished} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragFinished(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered before the drag will be finalized. + * This method triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragFinishingListener DragFinishing} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragFinishing(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragCanceledListener DragCanceled} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragCanceled(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MarqueeSelectionInputMode#addDragCancelingListener DragCanceling} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragCanceling(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Event that will be triggered at the start of every drag. + */ + addDraggingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the start of every drag. + */ + removeDraggingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the end of every drag. + */ + addDraggedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the end of every drag. + */ + removeDraggedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered when the drag has been canceled. + */ + addDragCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered when the drag has been canceled. + */ + removeDragCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be canceled. + */ + addDragCancelingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be canceled. + */ + removeDragCancelingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be finished. + */ + addDragFinishingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be finished. + */ + removeDragFinishingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag has been finished. + */ + addDragFinishedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag has been finished. + */ + removeDragFinishedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is starting. + */ + addDragStartingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is starting. + */ + removeDragStartingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is initialized and has started. + */ + addDragStartedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is initialized and has started. + */ + removeDragStartedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * An event that will be triggered once the marquee selection has been finished. + * @see {@link yfiles.input.MarqueeSelectionInputMode#getSelectionRectangle} + */ + addMarqueeSelectedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * An event that will be triggered once the marquee selection has been finished. + * @see {@link yfiles.input.MarqueeSelectionInputMode#getSelectionRectangle} + */ + removeMarqueeSelectedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Called by the state machine once the selection has been finished. + */ + end(t:yfiles.support.Transition):void; + /** + * Returns the state of the modifier keys at the time of the last event. + */ + lastModifierState:yfiles.input.ModifierKeys; + /** + * Called when the marquee selection has been finished. + * This will trigger the {@link yfiles.input.MarqueeSelectionInputMode#addMarqueeSelectedListener MarqueeSelected} event. + */ + onMarqueeSelected():void; + } + var MarqueeSelectionInputMode:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of the marquee selection mode. + */ + new ():yfiles.input.MarqueeSelectionInputMode; + /** + * A {@link yfiles.system.ResourceKey} that can be used to store a {@link yfiles.drawing.DataTemplate} that can + * be used to create the visual that will be used to draw the marquee box. + */ + MARQUEE_RECTANGLE_TEMPLATE_KEY:yfiles.system.ResourceKey; + }; + /** + * A static class that contains information regarding certain yFiles settings. + */ + export interface SystemInformation extends Object{ + } + var SystemInformation:{ + $class:yfiles.lang.Class; + /** + * Gets the size of the double click, i.e. the allowed distance between two clicks so that they are handled as a double click. + * Value: + * The size of the double click. + */ + doubleClickSize:yfiles.geometry.SizeD; + /** + * Gets the maximum span of time between two clicks for them to count as a double click. + */ + doubleClickTimeSpan:yfiles.system.TimeSpan; + }; + /** + * An {@link yfiles.input.IInputMode} that recognizes simple key events and invokes + * a registered handler. + */ + export interface KeyboardInputMode extends yfiles.input.AbstractConcurrentInputMode{ + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(ctx:yfiles.input.IInputModeContext):void; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Adds a given handler to this instance that will be triggered if the + * IEventRecognizer recognizes a {@link yfiles.input.CompoundKeyEventArgs key event} + * that has been triggered by the canvas control. + * @param {yfiles.input.IEventRecognizer} recognizer An event recognizer that will be fed with all key events. + * @param {function(Object, yfiles.system.EventArgs)} handler The handler to invoke if the recognizer matches an event. + */ + addHandler(recognizer:yfiles.input.IEventRecognizer,handler:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Removes a previously registered handler. + * @param {yfiles.input.IEventRecognizer} recognizer The recognizer that had been registered. + * @param {function(Object, yfiles.system.EventArgs)} handler The event handler that had been registered. + */ + removeHandler(recognizer:yfiles.input.IEventRecognizer,handler:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Adds an event handler for a specific {@link yfiles.system.InputGesture} to this mode. + * Using this method, the handler will not be invoked if this instance is disabled. + * @param {yfiles.system.InputGesture} inputGesture The input gesture that will be used to recognize the gesture. + * @param {function(Object, yfiles.system.EventArgs)} handler The handler that will be used to handle the event. + */ + addHandlerForGesture(inputGesture:yfiles.system.InputGesture,handler:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Adds a command and associated handlers to this instance. + * Adding the command to the CanvasControl via this mechanism will allow for preventing the command + * from being executed if this mode is {@link yfiles.input.IConcurrentInputMode#enabled disabled}. + * @param {yfiles.system.ICommand} command The command to register handlers with. + * @param {function(Object, yfiles.system.ExecutedRoutedEventArgs)} executedHandler The handler for the execution. + * @param {function(Object, yfiles.system.CanExecuteRoutedEventArgs)} canExecuteHandler The handler that determines executability. + */ + addCommand(command:yfiles.system.ICommand,executedHandler:(sender:Object,e:yfiles.system.ExecutedRoutedEventArgs)=> void,canExecuteHandler:(sender:Object,e:yfiles.system.CanExecuteRoutedEventArgs)=> void):void; + /** + * Removes a previously registered command from this instance. + * @param {yfiles.system.ICommand} command The command to remove. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + removeCommand(command:yfiles.system.ICommand):void; + /** + * Removes a previously registered command from this instance. + * @param {yfiles.system.ICommand} command The command to remove. + * @param {function(Object, yfiles.system.ExecutedRoutedEventArgs)} executedHandler The event handler for the {@link yfiles.system.CommandBinding#addExecutedListener Executed} event. + * @param {function(Object, yfiles.system.CanExecuteRoutedEventArgs)} canExecuteHandler The event handler for the {@link yfiles.system.CommandBinding#addCanExecuteListener CanExecute} event. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + removeWrappedCommand(command:yfiles.system.ICommand,executedHandler:(sender:Object,e:yfiles.system.ExecutedRoutedEventArgs)=> void,canExecuteHandler:(sender:Object,e:yfiles.system.CanExecuteRoutedEventArgs)=> void):void; + /** + * Adds a command to this instance that will be triggered for the specific + * input gesture. + * Adding the command to this instance that way will prevent the command from being executed + * if this instance is {@link yfiles.input.AbstractConcurrentInputMode#enabled disabled}. + * @param {yfiles.system.InputGesture} inputGesture The input gesture that will be used to recognize invocations. + * @param {yfiles.system.ICommand} command The command to execute. + */ + addHandlerForGestureAndCommand(inputGesture:yfiles.system.InputGesture,command:yfiles.system.ICommand):void; + /** + * Removes a previously registered handler. + * @param {yfiles.system.InputGesture} inputGesture The gesture that had been registered. + * @param {yfiles.system.ICommand} command The command that had been registered. + */ + removeHandlerForGestureAndCommand(inputGesture:yfiles.system.InputGesture,command:yfiles.system.ICommand):void; + /** + * Removes a previously registered handler. + * @param {yfiles.system.InputGesture} inputGesture The gesture that had been registered. + * @param {function(Object, yfiles.system.EventArgs)} handler The handler that had been registered. + */ + removeHandlerForGesture(inputGesture:yfiles.system.InputGesture,handler:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Returns an enumerator over all distinct registered recognizers. + * @return {yfiles.collections.IEnumerator.} An enumerator over the recognizers added using {@link yfiles.input.KeyboardInputMode#addHandler}. + */ + getRegisteredRecognizers():yfiles.collections.IEnumerator; + /** + * Removes all handlers that have been registered under the given recognizer. + * @param {yfiles.input.IEventRecognizer} recognizer The recognizer + */ + clearHandlersWithRecognizer(recognizer:yfiles.input.IEventRecognizer):void; + /** + * Removes all handlers that have been registered with this instance. + */ + clearHandlers():void; + /** + * Returns all handlers registered using the given recognizer. + * @param {yfiles.input.IEventRecognizer} recognizer The recognizer. + * @return {yfiles.collections.IEnumerator.} An enumeration over all handlers. + */ + getHandlers(recognizer:yfiles.input.IEventRecognizer):yfiles.collections.IEnumerator; + /** + * Disables the registered commands. + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#onDisabled} + */ + onDisabled():void; + /** + * Enables the registered commands. + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#onEnabled} + */ + onEnabled():void; + /** + * Traps key events from the canvas control and checks the list + * of recognizers. + * If this mode is {@link yfiles.input.IConcurrentInputMode#enabled disabled}, it will + * silently return. + * If one of the recognizers matches the event, this implementation will + * request and release an input mutex, effectively canceling other + * modes. + */ + handleEvent(sender:Object,args:yfiles.input.CompoundKeyEventArgs):void; + } + var KeyboardInputMode:{ + $class:yfiles.lang.Class; + new ():yfiles.input.KeyboardInputMode; + }; + /** + * The representation of a touch point on the screen. + */ + export interface Touch2DDevice extends Object{ + /** + * Gets the original {@link yfiles.system.TouchDevice}. + */ + originalDevice:yfiles.system.TouchDevice; + /** + * Gets the device's index. + */ + deviceIndex:number; + /** + * Gets a value indicating whether this device is the primary one. + * If {@link yfiles.input.Touch2DDevice#deviceIndex} is 0 this property has the value true, otherwise false. + */ + isPrimaryDevice:boolean; + /** + * Gets the last device coordinate in the view coordinate system. + */ + lastViewCoordinate:yfiles.geometry.PointD; + /** + * Gets the time of the last {@link yfiles.input.Touch2DEventArgs event} that was raised by this device. + */ + lastEventTime:Date; + /** + * Indicates if this device is currently down or not. Default is true. + */ + isDown:boolean; + } + var Touch2DDevice:{ + $class:yfiles.lang.Class; + }; + /** + * Complex event arguments that is used by the {@link yfiles.canvas.CanvasControl} to indicate + * mouse events in world coordinates. + */ + export interface Mouse2DEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the type of this event. + */ + eventType:yfiles.input.Mouse2DEventTypes; + /** + * Returns the coordinates in the world coordinate space associated with this event. + */ + location:yfiles.geometry.PointD; + /** + * Returns the number of clicks the current event represents if it + * is of type {@link yfiles.input.Mouse2DEventTypes#CLICKED}. + */ + clickCount:number; + /** + * Gets the signed number of mouse wheel turn units. + */ + wheelDelta:number; + /** + * Returns the modifier keys that have changed for this event. + * @see {@link yfiles.input.Mouse2DEventArgs#modifierState} + */ + changedModifiers:yfiles.input.ModifierKeys; + /** + * Returns the mouse buttons that have changed for this event. + * @see {@link yfiles.input.Mouse2DEventArgs#buttonPressedState} + */ + changedButtons:yfiles.system.MouseButtons; + /** + * The state of the modifier keys at the time of the event creation. + */ + modifierState:yfiles.input.ModifierKeys; + /** + * The state of the mouse buttons at the time of the event creation. + */ + buttonPressedState:yfiles.system.MouseButtons; + /** + * Provides a human readable string representation of this event. + * @return {string} + */ + toString():string; + } + var Mouse2DEventArgs:{ + $class:yfiles.lang.Class; + /** + * Constructs a new Mouse2DEvent argument. + * @param {yfiles.input.Mouse2DEventTypes} eventType The type of the event + * @param {yfiles.geometry.PointD} location the position of the mouse in world coordinates at the time of the event + * @param {yfiles.system.MouseButtons} buttonChanged the mouse buttons that have changed state if the type of event + * is {@link yfiles.input.Mouse2DEventTypes#PRESSED} or {@link yfiles.input.Mouse2DEventTypes#RELEASED} + * @param {yfiles.input.ModifierKeys} modifierChanged the modifier Keys that have been changed + * @param {yfiles.system.MouseButtons} buttonState the current state of the MouseButtons + * @param {yfiles.input.ModifierKeys} modifierState the current state of the modifier Keys + */ + new (eventType:yfiles.input.Mouse2DEventTypes,location:yfiles.geometry.PointD,buttonChanged:yfiles.system.MouseButtons,modifierChanged:yfiles.input.ModifierKeys,buttonState:yfiles.system.MouseButtons,modifierState:yfiles.input.ModifierKeys):yfiles.input.Mouse2DEventArgs; + /** + * Constructs a new Mouse2DEvent argument. + * @param {yfiles.input.Mouse2DEventTypes} eventType The type of the event + * @param {yfiles.geometry.PointD} location the position of the mouse in world coordinates at the time of the event + * @param {yfiles.system.MouseButtons} buttonChanged the mouse buttons that have changed state if the type of event + * is {@link yfiles.input.Mouse2DEventTypes#PRESSED} or {@link yfiles.input.Mouse2DEventTypes#RELEASED} + * @param {yfiles.input.ModifierKeys} modifierChanged the modifier Keys that have been changed + * @param {yfiles.system.MouseButtons} buttonState the current state of the MouseButtons + * @param {yfiles.input.ModifierKeys} modifierState the current state of the modifier Keys + * @param {number} clickCount the number of clicks this event represents, 2 for a double click + * @param {number} mouseWheelDelta the signed number of mouse wheel turn units + */ + WithMouseWheelDeltaAndClickCount:{ + new (eventType:yfiles.input.Mouse2DEventTypes,location:yfiles.geometry.PointD,buttonChanged:yfiles.system.MouseButtons,modifierChanged:yfiles.input.ModifierKeys,buttonState:yfiles.system.MouseButtons,modifierState:yfiles.input.ModifierKeys,mouseWheelDelta:number,clickCount:number):yfiles.input.Mouse2DEventArgs; + }; + }; + export enum Touch2DEventTypes{ + /** + * Not a Touch2DEvent. + */ + NONE, + /** + * A pointer has been moved. + */ + MOVED, + /** + * A touch device went down. + */ + DOWN, + /** + * A touch device went up. + */ + UP, + /** + * A touch device has entered the control's bounds. + */ + ENTERED, + /** + * A touch device has exited the control's bounds. + */ + EXITED, + /** + * A touch tap has been recognized. This is the case if a down has directly been followed by an up. + */ + TAPPED, + /** + * A long press has been recognized. This is the case if a down has been held a certain amount of time without a move. + */ + LONG_PRESS, + /** + * Touch capture has been lost while the device was down. This can be the case if the application or control is minimized + * or sent to the background or similar actions. + */ + LOST_CAPTURE + } + /** + * A utility class that offers {@link yfiles.input.IEventRecognizer} + * implementations that deal with {@link yfiles.input.Mouse2DEventArgs}. + */ + export interface Mouse2DEvents extends Object{ + } + var Mouse2DEvents:{ + $class:yfiles.lang.Class; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies mouse movements that are not drags. + * @see {@link yfiles.input.Mouse2DEvents#MOUSE_DRAGGED} + * @see {@link yfiles.input.Mouse2DEvents#MOUSE_MOVED_OR_DRAGGED} + */ + MOUSE_MOVED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies mouse movements. + */ + MOUSE_MOVED_OR_DRAGGED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies mouse movements. + */ + MOUSE_PRESSED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies mouse movements. + */ + MOUSE_RELEASED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies mouse input capture lost events. + * This event will occur often, especially after all mouse buttons have been released. + * More relevant for {@link yfiles.input.IInputMode}s is the {@link yfiles.input.Mouse2DEvents#MOUSE_LOST_CAPTURE_DURING_DRAG} event + * recognizer. + */ + MOUSE_LOST_CAPTURE:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies mouse input capture lost events while at least one mouse + * button was pressed. + * Since the mouse capture has been lost, the necessary {@link yfiles.input.Mouse2DEventTypes#RELEASED} events + * will never be triggered. This recognizer is useful for identifying this situation. + */ + MOUSE_LOST_CAPTURE_DURING_DRAG:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies left mouse button clicks. + */ + MOUSE_LEFT_CLICKED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies button clicks. + */ + MOUSE_CLICKED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies button multi-clicks. + */ + MOUSE_MULTI_CLICKED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies right mouse button clicks. + */ + MOUSE_RIGHT_CLICKED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies middle mouse button clicks. + */ + MOUSE_MIDDLE_CLICKED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies left mouse button double clicks. + */ + MOUSE_LEFT_DOUBLE_CLICKED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies right mouse button double clicks. + */ + MOUSE_RIGHT_DOUBLE_CLICKED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies middle mouse button double clicks. + */ + MOUSE_MIDDLE_DOUBLE_CLICKED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies left mouse button press events. + */ + MOUSE_LEFT_PRESSED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies left mouse button release events. + */ + MOUSE_LEFT_RELEASED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies right mouse button press events. + */ + MOUSE_RIGHT_PRESSED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies right mouse button release events. + */ + MOUSE_RIGHT_RELEASED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies mouse drag events. + */ + MOUSE_DRAGGED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies left mouse button drags. + */ + MOUSE_LEFT_DRAGGED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies when the has left the control. + */ + MOUSE_EXITED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies when the mouse has entered the control. + */ + MOUSE_ENTERED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies right mouse button drags. + */ + MOUSE_RIGHT_DRAGGED:yfiles.input.IEventRecognizer; + /** + * An {@link yfiles.input.IEventRecognizer} that identifies middle mouse button drags. + */ + MOUSE_MIDDLE_DRAGGED:yfiles.input.IEventRecognizer; + }; + /** + * An interface that recognizes events. Given a sender and an event argument, + * instances of this interface decide whether the event is treated as a match + * depending on the context. + */ + export interface IEventRecognizer extends Object{ + /** + * Callback that decides whether a given pair of event source and event argument + * is considered a match. + * @param {Object} eventSource the original source of the event + * @param {yfiles.system.EventArgs} eventArg the event argument + * @return {boolean} whether the pair is considered a match + * @see Specified by {@link yfiles.input.IEventRecognizer#isRecognized}. + */ + isRecognized(eventSource:Object,eventArg:yfiles.system.EventArgs):boolean; + /** + * Creates an {@link yfiles.input.IEventRecognizer} that performs a logical and operation + * between this and the other instance. + * This is a bridge method that delegates to {@link yfiles.input.EventRecognizerExtensions#and}. + * @param {yfiles.input.IEventRecognizer} other The other recognizer. + * @return {yfiles.input.IEventRecognizer} An implementation that performs the logical and for the two arguments. + */ + and(other:yfiles.input.IEventRecognizer):yfiles.input.IEventRecognizer; + /** + * Creates an {@link yfiles.input.IEventRecognizer} that performs a logical or operation + * between this and the other instance. + * This is a bridge method that delegates to {@link yfiles.input.EventRecognizerExtensions#or}. + * @param {yfiles.input.IEventRecognizer} other The other recognizer. + * @return {yfiles.input.IEventRecognizer} An implementation that performs the logical or for the two arguments. + */ + or(other:yfiles.input.IEventRecognizer):yfiles.input.IEventRecognizer; + /** + * Creates an {@link yfiles.input.IEventRecognizer} that performs a logical and operation + * between this and the other callback. + * This is a bridge method that delegates to {@link yfiles.input.EventRecognizerExtensions#andWithCallback}. + * @param {function(Object, yfiles.system.EventArgs):boolean} other The other recognizer. + * @return {yfiles.input.IEventRecognizer} An implementation that performs the logical and for the two arguments. + */ + andWithCallback(other:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean):yfiles.input.IEventRecognizer; + /** + * Creates an {@link yfiles.input.IEventRecognizer} that performs a logical or operation + * between this and the other callback. + * This is a bridge method that delegates to {@link yfiles.input.EventRecognizerExtensions#orWithCallback}. + * @param {function(Object, yfiles.system.EventArgs):boolean} other The other recognizer. + * @return {yfiles.input.IEventRecognizer} An implementation that performs the logical and for the two arguments. + */ + orWithCallback(other:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean):yfiles.input.IEventRecognizer; + /** + * Creates an {@link yfiles.input.IEventRecognizer} instance that yields + * the boolean inverse if queried in {@link yfiles.input.IEventRecognizer#isRecognized}. + * This is a bridge method that delegates to {@link yfiles.input.EventRecognizerExtensions#inverse}. + * @return {yfiles.input.IEventRecognizer} An implementation that performs the logical negation for the argument. + */ + inverse():yfiles.input.IEventRecognizer; + } + var IEventRecognizer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum Mouse2DEventTypes{ + /** + * Not a Mouse2DEvent. + */ + NONE, + /** + * The mouse has been moved. + */ + MOVED, + /** + * The mouse has been dragged, i.e. it has been moved while at least one button has been pressed. + */ + DRAGGED, + /** + * A button has been pressed. + */ + PRESSED, + /** + * A button has been released. If there was no drag event since the last press event, this + * will result in a click. + */ + RELEASED, + /** + * The mouse has entered the control's bounds. + */ + ENTERED, + /** + * The mouse has exited the control's bounds. + */ + EXITED, + /** + * The mouse wheel has been turned. + */ + WHEEL_TURNED, + /** + * A mouse click has been recognized. This is the case if a press has directly been followed by a release. + */ + CLICKED, + /** + * Mouse input capture has been lost. This can happen during mouse drags, if any button is pressed and the focus is taken from the application + * or transferred to another component by other means then moving the mouse. + */ + LOST_CAPTURE + } + /** + * Utility class that contains extension method that deal with the {@link yfiles.input.IEventRecognizer} interface. + */ + export interface EventRecognizerExtensions extends Object{ + } + var EventRecognizerExtensions:{ + $class:yfiles.lang.Class; + /** + * Creates an {@link yfiles.input.IEventRecognizer} that performs a logical and operation + * between this and the other instance. + * @param {yfiles.input.IEventRecognizer} recognizer The recognizer to operate on. + * @param {yfiles.input.IEventRecognizer} other The other recognizer. + * @return {yfiles.input.IEventRecognizer} An implementation that performs the logical and for the two arguments. + */ + and(recognizer:yfiles.input.IEventRecognizer,other:yfiles.input.IEventRecognizer):yfiles.input.IEventRecognizer; + /** + * Creates a function of type function({@link yfiles.support.StateMachine}, {@link yfiles.support.Transition}) that performs both operations + * in sequence. + * @param {function(yfiles.support.Transition)} handler The handler to invoke first. + * @param {function(yfiles.support.Transition)} other The other handler. + * @return {function(yfiles.support.Transition)} An implementation that performs the logical and for the two arguments. + */ + andTransitionDoneHandlers(handler:(t:yfiles.support.Transition)=> void,other:(t:yfiles.support.Transition)=> void):(t:yfiles.support.Transition)=> void; + /** + * Creates an {@link yfiles.input.IEventRecognizer} that performs a logical or operation + * between this and the other instance. + * @param {yfiles.input.IEventRecognizer} recognizer The recognizer to operate on. + * @param {yfiles.input.IEventRecognizer} other The other recognizer. + * @return {yfiles.input.IEventRecognizer} An implementation that performs the logical or for the two arguments. + */ + or(recognizer:yfiles.input.IEventRecognizer,other:yfiles.input.IEventRecognizer):yfiles.input.IEventRecognizer; + /** + * Creates an {@link yfiles.input.IEventRecognizer} that performs a logical and operation + * between this and the other callback. + * @param {yfiles.input.IEventRecognizer} recognizer The recognizer to operate on. + * @param {function(Object, yfiles.system.EventArgs):boolean} other The other recognizer. + * @return {yfiles.input.IEventRecognizer} An implementation that performs the logical and for the two arguments. + */ + andWithCallback(recognizer:yfiles.input.IEventRecognizer,other:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean):yfiles.input.IEventRecognizer; + /** + * Creates an {@link yfiles.input.IEventRecognizer} that performs a logical or operation + * between this and the other callback. + * @param {yfiles.input.IEventRecognizer} recognizer The recognizer to operate on. + * @param {function(Object, yfiles.system.EventArgs):boolean} other The other recognizer. + * @return {yfiles.input.IEventRecognizer} An implementation that performs the logical and for the two arguments. + */ + orWithCallback(recognizer:yfiles.input.IEventRecognizer,other:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean):yfiles.input.IEventRecognizer; + /** + * Creates an {@link yfiles.input.IEventRecognizer} instance that yields + * the boolean inverse if queried in {@link yfiles.input.IEventRecognizer#isRecognized}. + * @param {yfiles.input.IEventRecognizer} recognizer The recognizer to invert. + * @return {yfiles.input.IEventRecognizer} An implementation that performs the logical negation for the argument. + */ + inverse(recognizer:yfiles.input.IEventRecognizer):yfiles.input.IEventRecognizer; + }; + /** + * An {@link yfiles.input.IInputMode} implementation that can + * be used to grab and drag the viewport of the control it is installed in. + * This implementation will request the {@link yfiles.input.InputMutex} + * as soon as it recognizes a drag with the mouse or touch. + * Zooming is done with two fingers using the pinch zoom gesture. If the primary + * pointer is released during pinch, the secondary pointer is used for viewpoint + * dragging. The pinch zoom then can be restarted by touching another pointer + * that is recognized as the primary pointer. + */ + export interface MoveViewportInputMode extends yfiles.input.StateMachineInputMode{ + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} that starts the 'move viewport' gesture. + * Value: The recognizer instance that identifies the event that starts the viewport moving gesture. + * The default instance recognizes if the user presses the primary touch device down. + */ + primaryDownRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} that moves the viewport + * or zooms the canvas if a secondary device is down. + * Value: The recognizer instance that identifies the event that moves the viewport or zooms the canvas. + * The default instance recognizes if the user moves the primary touch device. + */ + primaryMoveRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} that ends the 'move viewport' or 'pinch' gesture. + * Value: The recognizer instance that identifies the event that ends the viewport moving or pinch gesture. + * The default instance recognizes if the user releases the primary touch device. + */ + primaryUpRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} that starts the 'pinch' gesture. + * Value: The recognizer instance that identifies the event that starts the pinch gesture. + * The default instance recognizes if the user presses the secondary touch device down. + */ + secondaryDownRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} that zooms the canvas using the 'pinch' gesture + * or moves the viewport if no primary device is down. + * Value: The recognizer instance that identifies the event that zooms the canvas + * or moves the viewport if no primary device is down. + * The default instance recognizes if the user moves the secondary touch device. + */ + secondaryMoveRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} that ends the pinch zoom gesture + * or ends the move if no primary device is down. + * Value: The recognizer instance that identifies the event that ends the pinch zoom gesture + * or ends the move if no primary device is down. + * The default instance recognizes if the user releases the secondary touch device. + */ + secondaryUpRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the factor that determines how much the recent movement + * data is taken into account for the calculation of inertia speed and direction. + * Value: A value between 0 and 1. Lesser values mean less influence of old data. + */ + inertiaFactor:number; + /** + * Gets or sets the threshold that determines when inertia movement should stop. + * Value: A positive value that determines the threshold in pixels per second. + */ + inertiaThreshold:number; + /** + * The amount of damping that is applied to the inertia movement. + * Value: A value between 0 and 1 that determines the factor the + * inertia speed is reduced by after one second. + */ + inertiaDamping:number; + /** + * Gets or sets the mode that determines when to use inertia when dragging the viewport. + */ + inertia:yfiles.input.InertiaModes; + /** + * Gets or sets a value indicating whether to allow the pinch zoom gesture. + * Value: + * true if the pinch zoom gesture is allowed to change the zoom level; otherwise, false. + */ + allowPinchZoom:boolean; + /** + * The cursor to use during the dragging. + * The default is {@link yfiles.canvas.CanvasCursor#HAND}. + */ + dragCursor:yfiles.canvas.ICanvasCursor; + /** + * Gets or sets the "pressed" state recognizer. + * This recognizer instance will be used to determine when the user begins + * the navigation gesture. + * Value: The "pressed" recognizer. + */ + pressedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "dragged" recognizer. + * This recognizer instance determines when the user is dragging the viewport. + * Value: The "dragged" recognizer. + */ + draggedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "released" recognizer. + * This instance determines when the user has finished dragging the viewport. + * Value: The "released" recognizer. + */ + releasedRecognizer:yfiles.input.IEventRecognizer; + /** + * Called to initialize the state machine. + * This implementation does nothing. + * @param {yfiles.support.StateMachine} machine The machine to initialize and configure + * @param {yfiles.support.State} startState The start state to use. + * @param {yfiles.support.State} canceledState The canceled state to use. + * @param {yfiles.support.State} stoppedState The stopped state to use. + * @param {yfiles.support.State} finishedState The finished state to use. + */ + initializeStateMachine(machine:yfiles.support.StateMachine,startState:yfiles.support.State,canceledState:yfiles.support.State,stoppedState:yfiles.support.State,finishedState:yfiles.support.State):void; + /** + * Tries to run the virtual machine using the pair of source and event argument + * to determine which transition to take. + * If this method is called reentrantly it will not immediately execute the transition + * but queue the event. + * @param {Object} source The source of the event to use to decide whether to make the transition. + * @param {yfiles.system.EventArgs} e The event to use to decide whether to make the transition. + */ + run(source:Object,e:yfiles.system.EventArgs):void; + /** + * Cancels navigation. + * @see Overrides {@link yfiles.input.StateMachineInputMode#cancel} + * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Called by the state machine to prepare the marquee selection + * when the mouse is pressed. + */ + prepare(t:yfiles.support.Transition):void; + /** + * Called by the state machine to begin the dragging + * when the mouse is dragged. + */ + begin(t:yfiles.support.Transition):void; + /** + * Called by the state machine to drag the viewport. + */ + drag(t:yfiles.support.Transition):void; + /** + * Callback triggered at the end of each drag. + * This method triggers the {@link yfiles.input.MoveViewportInputMode#addDraggedListener Dragged} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragged(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the start of each drag. + * This method triggers the {@link yfiles.input.MoveViewportInputMode#addDraggingListener Dragging} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragging(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Event that will be triggered at the start of every drag. + */ + addDraggingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the start of every drag. + */ + removeDraggingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the end of every drag. + */ + addDraggedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the end of every drag. + */ + removeDraggedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be finished. + */ + addDragFinishingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be finished. + */ + removeDragFinishingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag has been finished. + */ + addDragFinishedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag has been finished. + */ + removeDragFinishedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is starting. + */ + addDragStartingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is starting. + */ + removeDragStartingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is initialized and has started. + */ + addDragStartedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is initialized and has started. + */ + removeDragStartedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered when the drag has been canceled. + */ + addDragCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered when the drag has been canceled. + */ + removeDragCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be canceled. + */ + addDragCancelingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be canceled. + */ + removeDragCancelingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Triggers the {@link yfiles.input.MoveViewportInputMode#addDragStartingListener DragStarting} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragStarting(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MoveViewportInputMode#addDragStartedListener DragStarted} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragStarted(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered once the drag has been finalized. + * This method triggers the {@link yfiles.input.MoveViewportInputMode#addDragFinishedListener DragFinished} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragFinished(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered before the drag will be finalized. + * This method triggers the {@link yfiles.input.MoveViewportInputMode#addDragFinishingListener DragFinishing} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragFinishing(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MoveViewportInputMode#addDragCanceledListener DragCanceled} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragCanceled(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MoveViewportInputMode#addDragCancelingListener DragCanceling} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragCanceling(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Called by the state machine once the dragging has been finished. + */ + end(t:yfiles.support.Transition):void; + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + } + var MoveViewportInputMode:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of the move viewport mode. + */ + new ():yfiles.input.MoveViewportInputMode; + }; + /** + * A composite {@link yfiles.input.IInputMode} implementation that additionally + * can deal with {@link yfiles.input.IConcurrentInputMode} instances . + * Instances of this class can {@link yfiles.input.MultiplexingInputMode#install} and {@link yfiles.input.MultiplexingInputMode#uninstall} + * multiple {@link yfiles.input.IInputMode}s. + * Modes added using the {@link yfiles.input.MultiplexingInputMode#add} methods will be active at all + * times while {@link yfiles.input.IConcurrentInputMode}s + * added using the {@link yfiles.input.MultiplexingInputMode#addConcurrent} + * methods will only be active as long as not one of them owns the {@link yfiles.input.InputMutex}. + * By providing priorities to the different modes, the order of their {@link yfiles.input.IInputMode#install installation + * } can be influenced. + * This class itself implements the {@link yfiles.input.IConcurrentInputMode} interface + * so that hierarchies of instances of this class can easily be built. + * This class will request the input mutex if one of its child modes requests the + * mutex. Also if the instance itself gets {@link yfiles.input.IConcurrentInputMode#enabled disabled}, + * it will stop or cancel the current {@link yfiles.input.MultiplexingInputMode#getMutexOwner owner of the mutex}. + * @see {@link yfiles.input.MultiplexingInputMode#getMutexOwner} + * @see {@link yfiles.input.MultiplexingInputMode#add} + * @see {@link yfiles.input.MultiplexingInputMode#addConcurrent} + */ + export interface MultiplexingInputMode extends yfiles.input.AbstractConcurrentInputMode{ + /** + * Create the {@link yfiles.input.ConcurrencyController} that is used to mange the concurrency of the child input modes. + * @return {yfiles.input.ConcurrencyController} A specialized {@link yfiles.input.ConcurrencyController} that correctly manages the child input mode concurrency with regard to the parent input mode. + */ + createChildConcurrencyController():yfiles.input.ConcurrencyController; + /** + * The {@link yfiles.input.ConcurrencyController} that is used to mange the concurrency of the child input modes. + * On first access to this property, {@link yfiles.input.MultiplexingInputMode#createChildConcurrencyController} is called to initialize the property. + */ + childController:yfiles.input.ConcurrencyController; + /** + * Finds the {@link yfiles.input.IConcurrentInputMode} that currently + * owns the mutex or null. + * @return {yfiles.input.IConcurrentInputMode} The {@link yfiles.input.IConcurrentInputMode} that currently + * owns the mutex or null. + */ + getMutexOwner():yfiles.input.IConcurrentInputMode; + /** + * Adds a mode with default (0) priority. + * Modes added using this method can and will not be disabled if an {@link yfiles.input.IConcurrentInputMode} + * added using one of the {@link yfiles.input.MultiplexingInputMode#addConcurrent} method + * gains the {@link yfiles.input.InputMutex}. + * @param {yfiles.input.IInputMode} inputMode The mode to add to this mode. + * @see {@link yfiles.input.MultiplexingInputMode#addWithPriority} + * @see {@link yfiles.input.MultiplexingInputMode#addConcurrent} + */ + add(inputMode:yfiles.input.IInputMode):void; + /** + * Adds an {@link yfiles.input.IConcurrentInputMode} to work concurrently with other + * concurrent instances. + * This method assumes a default (0) priority. + * @param {yfiles.input.IConcurrentInputMode} inputMode + * @see {@link yfiles.input.MultiplexingInputMode#addConcurrentWithPriority} + */ + addConcurrent(inputMode:yfiles.input.IConcurrentInputMode):void; + /** + * Adds an input mode using the given priority to this compound mode. + * The priority will influence the order in which the modes will + * be {@link yfiles.input.IInputMode#install installed} into the + * canvas control. The lower the priority value, the earlier it will be installed. + * If two modes are installed using the same priority value, the first one will be + * installed earlier. + * @param {yfiles.input.IInputMode} inputMode The mode to install using the given installation priority. + * @param {number} priority The priority to use for sorting the modes before installation. + */ + addWithPriority(inputMode:yfiles.input.IInputMode,priority:number):void; + /** + * Adds an input mode as a concurrent mode using the given priority to this compound mode. + * Concurrent input modes will be managed by a {@link yfiles.input.ConcurrencyController} instance + * owned by this instance. + * The priority will influence the order in which the modes will + * be {@link yfiles.input.IInputMode#install installed} into the + * canvas control. The lower the priority value, the earlier it will be installed. + * If two modes are installed using the same priority value, the first one will be + * installed earlier. + * @param {yfiles.input.IConcurrentInputMode} inputMode The mode to install using the given installation priority. + * @param {number} priority The priority to use for sorting the modes before installation. + */ + addConcurrentWithPriority(inputMode:yfiles.input.IConcurrentInputMode,priority:number):void; + /** + * Removes the given mode from this compound mode. + * @param {yfiles.input.IInputMode} mode The mode to remove. + */ + remove(mode:yfiles.input.IInputMode):void; + /** + * Returns a list of all modes managed by this instance in sorted order. + * @return {yfiles.collections.IList.} A list of the modes. + */ + getSortedModes():yfiles.collections.IList; + /** + * Adjusts the cursor of the CanvasControl according to the + * current input mutex owner or the first mode in the list + * that returns a non-null {@link yfiles.input.IConcurrentInputMode#preferredCursor}. + * This method will set {@link yfiles.input.MultiplexingInputMode#defaultCursor} as the current cursor if + * no other {@link yfiles.input.IConcurrentInputMode#preferredCursor} has been specified. + */ + adjustCursor():void; + /** + * Gets or sets the cursor to use whenever no child mode prefers a different cursor. + * The default is null + * @see {@link yfiles.input.MultiplexingInputMode#adjustCursor} + */ + defaultCursor:yfiles.canvas.ICanvasCursor; + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Yields an {@link yfiles.input.IInputModeContext} for the child modes + * of this mode. + * This method is called during {@link yfiles.input.MultiplexingInputMode#install installation} to create + * a new context for the child modes and can be used by client code to obtain a suitable context object. + * The {@link yfiles.input.AbstractInputMode#inputModeContext} property is already set, when this method is called. + * {@link yfiles.support.ILookup#lookup} calls for the created context will be resolved by this instance's {@link yfiles.input.MultiplexingInputMode#childInputModeContextLookup} + * method. + * @return {yfiles.input.IInputModeContext} A new instance that delegates to the {@link yfiles.input.AbstractInputMode#inputModeContext parent's context.} + */ + createChildInputModeContext():yfiles.input.IInputModeContext; + /** + * Callback method that will be used by the {@link yfiles.input.MultiplexingInputMode#createChildInputModeContext child context's} {@link yfiles.support.ILookup#lookup} method. + * @param {yfiles.lang.Class} type The type argument passed to {@link yfiles.support.ILookup#lookup}. + * @return {Object} The result of the lookup query, or null. + * @see {@link yfiles.input.MultiplexingInputMode#createChildInputModeContext} + */ + childInputModeContextLookup(type:yfiles.lang.Class):Object; + /** + * Tries to stop all modes. + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#stop} + * @see Specified by {@link yfiles.input.IInputMode#stop}. + */ + stop():boolean; + /** + * Cancels all modes. + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#cancel} + * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Called when the {@link yfiles.input.AbstractConcurrentInputMode#enabled} property changes to false. + * This implementation sets the {@link yfiles.input.AbstractConcurrentInputMode#preferredCursor} property to null + * and {@link yfiles.input.AbstractConcurrentInputMode#releaseMutex releases} the mutex if the mutex is currently owned + * by this instance. Also, all concurrent child modes will be disabled. + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#onDisabled} + */ + onDisabled():void; + /** + * Called when the {@link yfiles.input.AbstractConcurrentInputMode#enabled} property changes to true. + * This implementation reenabled previously disabled concurrent child modes. + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#onEnabled} + */ + onEnabled():void; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + } + var MultiplexingInputMode:{ + $class:yfiles.lang.Class; + /** + * Creates an instance with no initial modes. + */ + new ():yfiles.input.MultiplexingInputMode; + }; + /** + * Generic {@link yfiles.input.IInputMode} implementation that can be used + * to move something in the canvas using the mouse. + * This implementation uses the {@link yfiles.input.MoveInputMode#hitTestable} to determine where + * the user can begin dragging the selection. + * It will then use the {@link yfiles.input.MoveInputMode#movable} and/or {@link yfiles.input.MoveInputMode#positionHandler} + * to delegate the actual work of moving the elements to. + */ + export interface MoveInputMode extends yfiles.input.StateMachineInputMode{ + /** + * Gets or sets event recognizer that recognizes when the user temporarily disables snapping. + * Value: The instance to use for disabling snapping. The default is {@link yfiles.input.KeyEvents#CTRL_DOWN} + * @see {@link yfiles.input.MoveInputMode#enableSnappingRecognizer} + */ + disableSnappingRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets event recognizer that recognizes when the user reenables temporarily disabled snapping. + * Value: The instance to use for reenabling snapping. The default is {@link yfiles.input.KeyEvents#CTRL_UP} + */ + enableSnappingRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "pressed" state recognizer. + * This recognizer instance will be used to determine when the user begins + * to move the selection. + * Value: The "pressed" recognizer. + */ + pressedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "hovering" state recognizer. + * This recognizer instance will be used to determine whether the user is hovering + * over an item where pressing can initialize a move operation. + * The default implementation uses the {@link yfiles.input.MoveInputMode#isHovering} method to determine + * whether the mode can be initialized, here. + * Value: The "hover" recognizer. + */ + hoverRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "dragged" recognizer. + * This recognizer instance determines when the user is moving the selection + * Value: The "dragged" recognizer. + */ + draggedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "cancel" recognizer. + * This recognizer recognizes a cancel action during the move. + * Value: The "cancel" recognizer. + */ + cancelRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "released" recognizer. + * This instance determines when the user has finished the move. + * Value: The "released" recognizer. + */ + releasedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "pressed" recognizer for touch events. + * This recognizer instance determines when the user begins the move selection operation. + * Value: The "pressed" recognizer specifically for touch events. + */ + pressedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "dragged" recognizer for touch events. + * This recognizer instance determines when the user is moving the selection + * Value: The "dragged" recognizer specifically for touch events. + */ + draggedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "released" recognizer for touch events. + * This instance determines when the user has finished the move using touch. + * Value: The "released" recognizer specifically for touch events. + */ + releasedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Called to initialize the state machine. + * This implementation does nothing. + * @param {yfiles.support.StateMachine} machine The machine to initialize and configure + * @param {yfiles.support.State} startState The start state to use. + * @param {yfiles.support.State} canceledState The canceled state to use. + * @param {yfiles.support.State} stoppedState The stopped state to use. + * @param {yfiles.support.State} finishedState The finished state to use. + */ + initializeStateMachine(machine:yfiles.support.StateMachine,startState:yfiles.support.State,canceledState:yfiles.support.State,stoppedState:yfiles.support.State,finishedState:yfiles.support.State):void; + /** + * Called when the users cancels the dragging of the handle. + * @see {@link yfiles.input.MoveInputMode#onDragCanceled} + */ + cancelDrag(t:yfiles.support.Transition):void; + /** + * Callback used by the state machine to prepare this mode. + * This method will be invoked if a mouse button is + * {@link yfiles.input.MoveInputMode#pressedRecognizer pressed} over a valid target. + */ + prepare(t:yfiles.support.Transition):void; + /** + * Gets or sets the {@link yfiles.drawing.IHitTestable} that will be used + * by this mode to determine where the user may start dragging. + */ + hitTestable:yfiles.drawing.IHitTestable; + /** + * Gets or sets the {@link yfiles.geometry.IMovable} that will be used during + * dragging to perform the actual movement. + * For a more fine grained control of how the drag should be performed, use + * the {@link yfiles.input.MoveInputMode#positionHandler} property instead. + * @see {@link yfiles.input.MoveInputMode#positionHandler} + */ + movable:yfiles.geometry.IMovable; + /** + * Gets or sets the {@link yfiles.input.IPositionHandler} that will be used + * to handle that actual movement of the elements during the drag. + * @see {@link yfiles.input.MoveInputMode#movable} + */ + positionHandler:yfiles.input.IPositionHandler; + /** + * Callback for the state machine that determines whether the mouse + * currently hovers over the elements to be moved. + * The core of this call is delegated to {@link yfiles.input.MoveInputMode#isValidStartLocation} + * @see {@link yfiles.input.StateMachineInputMode#lastMouse2DEventArgs} + */ + isHovering(sender:Object,args:yfiles.system.EventArgs):boolean; + /** + * Determines whether the given location is a valid start location for the move gesture. + * This implementation delegates to the {@link yfiles.input.MoveInputMode#hitTestable}. + * During this callback it is possible to reset or reconfigure the {@link yfiles.input.MoveInputMode#positionHandler} + * or {@link yfiles.input.MoveInputMode#movable}. + * @param {yfiles.geometry.PointD} location The location in the world coordinate system. + * @return {boolean} + * true if at the given location it is valid to start the move gesture; otherwise, false. + */ + isValidStartLocation(location:yfiles.geometry.PointD):boolean; + /** + * Callback for the state machine that determines a touch has been performed on + * an element that is about to be moved. + * The core of this call is delegated to {@link yfiles.input.MoveInputMode#isValidStartLocation} + * @see {@link yfiles.input.StateMachineInputMode#lastTouch2DEventArgs} + */ + isValidTouchDown(sender:Object,args:yfiles.system.EventArgs):boolean; + /** + * Gets or sets the cursor to use during the move. + */ + moveCursor:yfiles.canvas.ICanvasCursor; + /** + * Callback used by the state machine to arm this mode. + * This method will be invoked if the mouse + * {@link yfiles.input.MoveInputMode#hoverRecognizer hovers} over the selection. + */ + arm(t:yfiles.support.Transition):void; + /** + * Callback used by the state machine to disarm this mode. + * This method will be invoked if the mouse stops hovering over the elements. + */ + disarm(t:yfiles.support.Transition):void; + /** + * The {@link yfiles.input.MoveInputMode#snapContext} which manages snapping model items to certain coordinates (e.g. other items). + * If set to null (the default) this input mode tries to obtain the {@link yfiles.input.MoveInputMode#snapContext} + * from the {@link yfiles.input.IInputModeContext}. To explicitly disable snapping, a {@link yfiles.input.MoveInputMode#snapContext} implementation that does nothing + * has to be set to this instance. + */ + snapContext:yfiles.input.SnapContext; + /** + * Callback used by the state machine to initialize the dragging. + * This method will {@link yfiles.input.AbstractConcurrentInputMode#requestMutex request the input mutex}. + * @see {@link yfiles.input.MoveInputMode#onDragStarting} + */ + beginDrag(t:yfiles.support.Transition):void; + /** + * Yields a value indicating whether a drag operation is currently in progress. + */ + isDragging:boolean; + /** + * Creates an {@link yfiles.input.IInputModeContext} for use + * with the {@link yfiles.input.IPositionHandler} interface for the upcoming + * drag operation. + * @return {yfiles.input.IInputModeContext} An instance of {@link yfiles.input.IInputModeContext}. + */ + createPositionHandlerInputModeContext():yfiles.input.IInputModeContext; + /** + * Returns the initial position where the dragging was initiated. + */ + initialLocation:yfiles.geometry.PointD; + /** + * Called by the state machine during the dragging. + * This method will delegate the actual dragging work to the {@link yfiles.input.MoveInputMode#movable} + * and {@link yfiles.input.MoveInputMode#positionHandler}. + */ + onDrag(t:yfiles.support.Transition):void; + /** + * Called by the state machine to end the dragging. + * This method will delegate the actual cleanup work to the {@link yfiles.input.MoveInputMode#movable} + * and {@link yfiles.input.MoveInputMode#positionHandler}. + * @see {@link yfiles.input.MoveInputMode#onDragFinished} + */ + endDrag(t:yfiles.support.Transition):void; + /** + * Gets an immutable snapshot of the {@link yfiles.model.IModelItem}s affected by the currently {@link yfiles.input.MoveInputMode#isDragging active} + * gesture. + *

+ * When the gesture is {@link yfiles.input.MoveInputMode#addDragStartingListener starting} and the {@link yfiles.input.MoveInputMode#positionHandler} + * is {@link yfiles.input.IDragHandler#initializeDrag initialized}, the implementation can + * {@link yfiles.input.IModelItemCollector#add register} the affected item(s) through the {@link yfiles.input.IModelItemCollector} + * instance that is bound to the {@link yfiles.input.MoveInputMode#createPositionHandlerInputModeContext context} available via + * its {@link yfiles.support.ILookup#lookup}. + *

+ *

+ * Client code can register with the {@link yfiles.input.MoveInputMode#addDragStartedListener DragStarted} event, as well as the {@link yfiles.input.MoveInputMode#addDragFinishedListener DragFinished} event + * to get notified of the elements that may be or have been affected respectively by this input mode. + *

+ * Value: + * A snapshot of the current collection of the items that are affected by the move operation. + */ + affectedItems:yfiles.collections.IEnumerable; + /** + * Event that will be triggered before the drag will be finished. + */ + addDragFinishingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be finished. + */ + removeDragFinishingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag has been finished. + */ + addDragFinishedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag has been finished. + */ + removeDragFinishedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is starting. + */ + addDragStartingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is starting. + */ + removeDragStartingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is initialized and has started. + */ + addDragStartedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is initialized and has started. + */ + removeDragStartedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the start of every drag. + */ + addDraggingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the start of every drag. + */ + removeDraggingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the end of every drag. + */ + addDraggedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the end of every drag. + */ + removeDraggedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered when the drag has been canceled. + */ + addDragCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered when the drag has been canceled. + */ + removeDragCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be canceled. + */ + addDragCancelingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be canceled. + */ + removeDragCancelingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Triggers the {@link yfiles.input.MoveInputMode#addDragStartingListener DragStarting} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragStarting(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MoveInputMode#addDragStartedListener DragStarted} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragStarted(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the start of each drag. + * This method triggers the {@link yfiles.input.MoveInputMode#addDraggingListener Dragging} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragging(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the end of each drag. + * This method triggers the {@link yfiles.input.MoveInputMode#addDraggedListener Dragged} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragged(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered once the drag has been finalized. + * This method triggers the {@link yfiles.input.MoveInputMode#addDragFinishedListener DragFinished} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragFinished(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered before the drag will be finalized. + * This method triggers the {@link yfiles.input.MoveInputMode#addDragFinishingListener DragFinishing} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragFinishing(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MoveInputMode#addDragCanceledListener DragCanceled} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragCanceled(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.MoveInputMode#addDragCancelingListener DragCanceling} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragCanceling(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Simulates the start of a drag and puts the state machine into the dragging state. + * Subsequent moves of input devices will behave as if the dragging has been successfully initiated at startLocation. + * @param {yfiles.geometry.PointD} startLocation The location where the drag had been initialized. + */ + doStartDrag(startLocation:yfiles.geometry.PointD):void; + } + var MoveInputMode:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.MoveInputMode} class. + */ + new ():yfiles.input.MoveInputMode; + }; + export enum InertiaModes{ + /** + * Never move the viewport using inertia. + */ + NEVER, + /** + * Move the viewport using inertia when the mouse has been used to drag the viewport. + */ + MOUSE, + /** + * Move the viewport using inertia when touch has been used to drag the viewport. + */ + TOUCH, + /** + * Always move the viewport using inertia no matter what input gesture has been used. + */ + ALWAYS + } + /** + * Complex event arguments that is used by the {@link yfiles.canvas.CanvasControl} to indicate + * touch events in world coordinates. + */ + export interface Touch2DEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the type of this event. + */ + eventType:yfiles.input.Touch2DEventTypes; + /** + * Returns the location represented by this event in world coordinates. + */ + location:yfiles.geometry.PointD; + /** + * Returns the touch device associated with this event. + */ + device:yfiles.input.Touch2DDevice; + /** + * Returns the number of taps the current event represents if it + * is of type {@link yfiles.input.Touch2DEventTypes#TAPPED}. + */ + tapCount:number; + /** + * Provides a human readable string representation of this event. + * @return {string} + */ + toString():string; + } + var Touch2DEventArgs:{ + $class:yfiles.lang.Class; + /** + * Constructs a new Touch2DEvent argument. + * @param {yfiles.input.Touch2DEventTypes} eventType The type of the event + * @param {yfiles.geometry.PointD} location The position of the touch device in world coordinates at the time of the event + * @param {yfiles.input.Touch2DDevice} device The device the event was triggered by + */ + FromEventTypeLocationAndDevice:{ + new (eventType:yfiles.input.Touch2DEventTypes,location:yfiles.geometry.PointD,device:yfiles.input.Touch2DDevice):yfiles.input.Touch2DEventArgs; + }; + /** + * Constructs a new Touch2DEvent argument. + * @param {yfiles.input.Touch2DEventTypes} eventType The type of the event + * @param {yfiles.geometry.PointD} location The position of the touch device in world coordinates at the time of the event + * @param {yfiles.input.Touch2DDevice} device The device the event was triggered by + * @param {number} tapCount the number of taps this event represents, 2 for a double tap + */ + FromEventTypeLocationDeviceAndTapCount:{ + new (eventType:yfiles.input.Touch2DEventTypes,location:yfiles.geometry.PointD,device:yfiles.input.Touch2DDevice,tapCount:number):yfiles.input.Touch2DEventArgs; + }; + }; + /** + * A convenience implementation of the {@link yfiles.input.IHandle} interface + * that can be used to constrain the handle of an item. + * @see {@link yfiles.input.ConstrainedDragHandler} + * @see {@link yfiles.input.ConstrainedDragHandler#constrainNewLocation} + */ + export interface ConstrainedHandle extends yfiles.input.ConstrainedDragHandler,yfiles.input.IHandle{ + /** + * Delegates to {@link yfiles.input.ConstrainedDragHandler#delegateHandler}'s {@link yfiles.input.IHandle#type} + * property. + * @see Specified by {@link yfiles.input.IHandle#type}. + */ + type:yfiles.input.HandleType; + /** + * Delegates to {@link yfiles.input.ConstrainedDragHandler#delegateHandler}'s {@link yfiles.input.IHandle#cursor} + * property. + * @see Specified by {@link yfiles.input.IHandle#cursor}. + */ + cursor:yfiles.canvas.ICanvasCursor; + } + var ConstrainedHandle:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.ConstrainedHandle} class that delegates to the + * wrappedHandle. + * @param {yfiles.input.IHandle} wrappedHandle The handle to delegate to. + */ + new (wrappedHandle:yfiles.input.IHandle):yfiles.input.ConstrainedHandle; + }; + /** + * An {@link yfiles.input.IInputMode} that can be used + * for an overview {@link yfiles.canvas.CanvasControl}. + * This mode will add navigation capabilities to the + * control it is installed in. + * @see {@link yfiles.input.OverviewInputMode#clientCanvas} + */ + export interface OverviewInputMode extends yfiles.input.AbstractInputMode{ + /** + * Determines whether the the canvas this mode is installed in should automatically be + * invalidated if the client canvas gets invalidated. + * Automatic invalidation will be deferred shortly. + */ + autoInvalidate:boolean; + /** + * Gets the multiplexing input mode this implementation uses internally to host the various + * minor input modes. + * Value: + * The multiplexing input mode. + * @see {@link yfiles.input.OverviewInputMode#handleInputMode} + * @see {@link yfiles.input.OverviewInputMode#moveInputMode} + * @see {@link yfiles.input.OverviewInputMode#keyboardInputMode} + * @see {@link yfiles.input.OverviewInputMode#clickInputMode} + * @see {@link yfiles.input.OverviewInputMode#tapInputMode} + */ + multiplexingInputMode:yfiles.input.MultiplexingInputMode; + /** + * Performs one-time initialization of this instance. This method should not + * be invoked by subclasses. This will be done automatically upon first + * {@link yfiles.input.AbstractInputMode#install installation} of this mode. + * This code will be executed only once per instance. The {@link yfiles.input.AbstractInputMode#canvas} property + * and {@link yfiles.input.AbstractInputMode#inputModeContext} property + * will be null when this code is executed. This method should not + * be used to install this mode into a specific canvas. + * Subclasses should always call base.Initialize() first. + * @see {@link yfiles.input.AbstractInputMode#install} + */ + initialize():void; + /** + * Gets the HandleInputMode. This mode is responsible for handling the single + * handle that allows to resize the viewport rectangle. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.OverviewInputMode#createHandleInputMode} will be called. + */ + handleInputMode:yfiles.input.HandleInputMode; + /** + * Factory method for the HandleInputMode property. This method will be called + * upon first access to the {@link yfiles.input.OverviewInputMode#handleInputMode} property. + * @return {yfiles.input.HandleInputMode} a new instance of HandleInputMode + */ + createHandleInputMode():yfiles.input.HandleInputMode; + /** + * Gets the MoveInputMode. This mode is responsible for moving the viewport rectangle. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.OverviewInputMode#createMoveInputMode} will be called. + */ + moveInputMode:yfiles.input.MoveInputMode; + /** + * Factory method for the MoveInputMode property. This method will be called + * upon first access to the {@link yfiles.input.OverviewInputMode#moveInputMode} property. + * @return {yfiles.input.MoveInputMode} a new instance of MoveInputMode + */ + createMoveInputMode():yfiles.input.MoveInputMode; + /** + * Gets the ClickInputMode. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.OverviewInputMode#createClickInputMode} will be called. + */ + clickInputMode:yfiles.input.ClickInputMode; + /** + * Factory method for the ClickInputMode property. This method will be called + * upon first access to the {@link yfiles.input.OverviewInputMode#clickInputMode} property. + * @return {yfiles.input.ClickInputMode} a new instance of ClickInputMode + */ + createClickInputMode():yfiles.input.ClickInputMode; + /** + * Gets the TapInputMode. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.OverviewInputMode#createTapInputMode} will be called. + */ + tapInputMode:yfiles.input.TapInputMode; + /** + * Factory method for the TapInputMode property. This method will be called + * upon first access to the {@link yfiles.input.OverviewInputMode#tapInputMode} property. + * @return {yfiles.input.TapInputMode} a new instance of TapInputMode + */ + createTapInputMode():yfiles.input.TapInputMode; + /** + * Gets the KeyboardInputMode. This mode handles all keyboard interaction gestures with the overview control. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.OverviewInputMode#createKeyboardInputMode} will be called. + */ + keyboardInputMode:yfiles.input.KeyboardInputMode; + /** + * Factory method for the KeyboardInputMode property. This method will be called + * upon first access to the {@link yfiles.input.OverviewInputMode#keyboardInputMode} property. + * @return {yfiles.input.KeyboardInputMode} a new instance of KeyboardInputMode + */ + createKeyboardInputMode():yfiles.input.KeyboardInputMode; + /** + * Gets the list of commands that are available in this instance. + *

+ * Removing commands from this collection also removes the command bindings + * registered by this instance. + *

+ *

+ * Add supported commands to make them available in this instance. + *

+ *

+ * Supported commands are + *

    + *
  • {@link yfiles.system.ComponentCommands#MOVE_LEFT}
  • + *
  • {@link yfiles.system.ComponentCommands#MOVE_RIGHT}
  • + *
  • {@link yfiles.system.ComponentCommands#MOVE_UP}
  • + *
  • {@link yfiles.system.ComponentCommands#MOVE_DOWN}
  • + *
  • {@link yfiles.system.NavigationCommands#ZOOM}
  • + *
  • {@link yfiles.system.NavigationCommands#INCREASE_ZOOM}
  • + *
  • {@link yfiles.system.NavigationCommands#DECREASE_ZOOM}
  • + *
  • {@link yfiles.system.ComponentCommands#SCROLL_PAGE_DOWN}
  • + *
  • {@link yfiles.system.ComponentCommands#SCROLL_PAGE_UP}
  • + *
  • {@link yfiles.system.ComponentCommands#SCROLL_PAGE_LEFT}
  • + *
  • {@link yfiles.system.ComponentCommands#SCROLL_PAGE_RIGHT}
  • + *
  • {@link yfiles.canvas.CanvasControl#FIT_CONTENT_COMMAND}
  • + *
  • {@link yfiles.canvas.CanvasControl#UPDATE_CONTENT_RECT_COMMAND}
  • + *
+ *

+ */ + availableCommands:yfiles.collections.ICollection; + /** + * Callback method that is used by {@link yfiles.input.OverviewInputMode#createKeyboardInputMode} + * to determine which of the built-in {@link yfiles.system.ICommand}s to install. + * This implementation unconditionally returns true, subclasses + * may override this method to adjust the behavior. + * @param {yfiles.system.ICommand} command The command to install. + * @return {boolean} Whether to install this command. + */ + shouldInstallCommand(command:yfiles.system.ICommand):boolean; + /** + * Gets or sets the canvas this canvas should use to + * navigate. + */ + clientCanvas:yfiles.canvas.CanvasControl; + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Called by the client in order to stop a current editing progress. + * This should stop the current edit, if one is in progress and possibly commit + * all of the changes. If stopping is not possible, this method can return false + * @return {boolean} true if and only if the editing has been stopped or there was + * no edit in progress + * @see {@link yfiles.input.IInputMode#cancel} + * @see Specified by {@link yfiles.input.IInputMode#stop}. + */ + stop():boolean; + /** + * Called by the client to unconditionally cancel all editing. + * This will be called prior to the uninstalling of this instance. + * In order to stop an active input mode manually, client code should use + * the following idiom: + *

+      * if (!mode.stop()){
+      *   mode.cancel();
+      * }
+      * 
+ * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Gets or sets the template that is used for the visualization of the marquee rectangle. + * Value: The template. + */ + template:yfiles.drawing.DataTemplate; + /** + * Determines whether the mouse wheel can be used to perform zooming in the {@link yfiles.input.OverviewInputMode#clientCanvas}. + * The default value is true. + */ + autoMouseWheelZoom:boolean; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Gets and sets the insets in view coordinates that should be used + * by the {@link yfiles.input.OverviewInputMode#updateVisibleArea} operation. + * This influences the amount of visible whitespace in the view coordinate system around the + * graph after the {@link yfiles.canvas.CanvasControl#contentRect content rect} + * of the {@link yfiles.input.OverviewInputMode#clientCanvas} has changed. + * The default value is (5,5,5,5). + */ + margins:yfiles.geometry.InsetsD; + /** + * Updates the {@link yfiles.canvas.CanvasControl#zoom zoom} and {@link yfiles.canvas.CanvasControl#viewPoint viewpoint} + * of the {@link yfiles.input.AbstractInputMode#canvas overview control}. + * This method is called when the {@link yfiles.canvas.CanvasControl#contentRect graph bounds} + * of the {@link yfiles.input.OverviewInputMode#clientCanvas} have changed. The {@link yfiles.input.OverviewInputMode#margins margins} + * should be respected. + */ + updateVisibleArea():void; + } + var OverviewInputMode:{ + $class:yfiles.lang.Class; + /** + * A {@link yfiles.system.ComponentResourceKey} that should yield a {@link yfiles.drawing.DataTemplate} that will be used + * by this mode render the viewport. + */ + VIEWPORT_TEMPLATE_KEY:yfiles.system.ComponentResourceKey; + /** + * Creates a new instance. + */ + new ():yfiles.input.OverviewInputMode; + }; + /** + * Convenience implementation of the {@link yfiles.input.IHandle} interface that + * delegates most of the work to instances of {@link yfiles.geometry.IPoint} and {@link yfiles.geometry.IPointSetter}. + * This implementation will not do anything special in the {@link yfiles.input.PointHandle#initializeDrag}, + * {@link yfiles.input.PointHandle#dragFinished}, and {@link yfiles.input.PointHandle#cancelDrag} methods. + * @see {@link yfiles.input.IHandle} + * @see {@link yfiles.input.RectangleHandle} + */ + export interface PointHandle extends Object,yfiles.input.IHandle{ + /** + * Returns a view of the location of the item. + * The point describes the current world coordinate of the element that can + * be modified by this handler. + * @see Specified by {@link yfiles.input.IDragHandler#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Provides the cursor to display when the mouse hovers over or drags this + * handle. + * @see Specified by {@link yfiles.input.IHandle#cursor}. + */ + cursor:yfiles.canvas.ICanvasCursor; + /** + * This implementation does nothing. + * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. + */ + initializeDrag(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Gets a point implementation that is based on the getter and setter. + */ + point:yfiles.geometry.IMutablePoint; + /** + * Performs the actual setting of the new values on the IPointSetter. + * @param {yfiles.geometry.PointD} newLocation The new value to set on the setter. + */ + set(newLocation:yfiles.geometry.PointD):boolean; + /** + * This implementation uses the {@link yfiles.geometry.IPointSetter} to set the new values. + * @see Specified by {@link yfiles.input.IDragHandler#handleMove}. + */ + handleMove(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):boolean; + /** + * This implementation uses the {@link yfiles.geometry.IPointSetter} to set the original values. + * @see Specified by {@link yfiles.input.IDragHandler#cancelDrag}. + */ + cancelDrag(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * This implementation does nothing. + * @see Specified by {@link yfiles.input.IDragHandler#dragFinished}. + */ + dragFinished(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + /** + * Returns the type of the handle that can be used by the rendering engine + * to render types differently. + * @see Specified by {@link yfiles.input.IHandle#type}. + */ + type:yfiles.input.HandleType; + } + var PointHandle:{ + $class:yfiles.lang.Class; + /** + * Factory method that creates a PointHandle using the given {@link yfiles.geometry.IMutablePoint}. + * @param {yfiles.geometry.IMutablePoint} point The point to use for the location and moving of the handle. + * @return {yfiles.input.PointHandle} A PointHandle that uses the given point instance to delegate its work to. + */ + createWithPoint(point:yfiles.geometry.IMutablePoint):yfiles.input.PointHandle; + /** + * Factory method that creates a PointHandle using the given {@link yfiles.geometry.IMutablePoint}. + * @param {yfiles.canvas.ICanvasCursor} cursor The cursor to use for the handle + * @param {yfiles.input.HandleType} handleType The type of the handle to create. + * @param {yfiles.geometry.IMutablePoint} point The point to use for the location and moving of the handle. + * @return {yfiles.input.PointHandle} A PointHandle that uses the given point instance to delegate its work to. + */ + createWithPointAndType(point:yfiles.geometry.IMutablePoint,cursor:yfiles.canvas.ICanvasCursor,handleType:yfiles.input.HandleType):yfiles.input.PointHandle; + /** + * Factory method that creates a PointHandle using the given {@link yfiles.geometry.IPoint} for + * the location and {@link yfiles.geometry.IPointSetter} for modifying it. + * The point and pointSetter are live instances of the handle. + * @param {yfiles.canvas.ICanvasCursor} cursor The cursor to use for the handle + * @param {yfiles.input.HandleType} handleType The type of the handle to create. + * @param {yfiles.geometry.IPoint} point The point to use for the location + * @param {yfiles.geometry.IPointSetter} pointSetter The point setter to use for moving the handle. + * @return {yfiles.input.PointHandle} A PointHandle that uses the given point instances to delegate its work to. + */ + create(point:yfiles.geometry.IPoint,pointSetter:yfiles.geometry.IPointSetter,cursor:yfiles.canvas.ICanvasCursor,handleType:yfiles.input.HandleType):yfiles.input.PointHandle; + /** + * Constructor for subclass implementations. + * @param {yfiles.canvas.ICanvasCursor} cursor The cursor to use. + * @param {yfiles.geometry.IPoint} getter The location of the handle. + * @param {yfiles.geometry.IPointSetter} setter The location modifier of the handle. + * @param {yfiles.input.HandleType} type The type of the cursor to create. + */ + new (cursor:yfiles.canvas.ICanvasCursor,getter:yfiles.geometry.IPoint,setter:yfiles.geometry.IPointSetter,type:yfiles.input.HandleType):yfiles.input.PointHandle; + }; + /** + * Default implementation of the {@link yfiles.input.IOrthogonalEdgeHelper}. + * This class inspects the edges in question and infers the {@link yfiles.input.SegmentOrientation}s of + * the segments from the current geometry of the edge path. + */ + export interface OrthogonalEdgeHelper extends Object,yfiles.input.IOrthogonalEdgeHelper{ + /** + * Gets the orientation of the given segment by looking at the geometry of the segment. + * If the segment has a zero length, the adjacent segments will be inspected to infer the orientation such + * that the orientation toggles between {@link yfiles.input.SegmentOrientation#VERTICAL} and {@link yfiles.input.SegmentOrientation#HORIZONTAL}. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context in which the orientation is needed. + * @param {yfiles.graph.IEdge} edge The edge to inspect. + * @param {number} segmentIndex The index of the segment. + * @return {yfiles.input.SegmentOrientation} The declared orientation of the segment. + * @see Specified by {@link yfiles.input.IOrthogonalEdgeHelper#getSegmentOrientation}. + */ + getSegmentOrientation(inputModeContext:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,segmentIndex:number):yfiles.input.SegmentOrientation; + /** + * This implementation always returns false. + * @see Specified by {@link yfiles.input.IOrthogonalEdgeHelper#canBeMoved}. + */ + canBeMoved(inputModeContext:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourceEnd:boolean):boolean; + /** + * This implementation always returns true. + * @see Specified by {@link yfiles.input.IOrthogonalEdgeHelper#isOrthogonallyEdited}. + */ + isOrthogonallyEdited(inputModeContext:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):boolean; + /** + * This implementation removes duplicate and collinear bends, as well as segments of zero length. + * @see Specified by {@link yfiles.input.IOrthogonalEdgeHelper#cleanUpEdge}. + */ + cleanUpEdge(inputModeContext:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge):void; + /** + * This implementation always returns true. + */ + canRemoveBend(context:yfiles.input.IInputModeContext,bendToRemove:yfiles.graph.IBend):boolean; + } + var OrthogonalEdgeHelper:{ + $class:yfiles.lang.Class; + }; + /** + * A helper class that can be used to interactively reshape orthogonal edge paths. + *

+ * This class will be queried from the {@link yfiles.input.IInputModeContext} of implementations of + * {@link yfiles.input.IPositionHandler}, {@link yfiles.input.IHandle}, and {@link yfiles.input.IReshapeHandler} that support + * orthogonal editing of edges. + *

+ *

+ * In a first step, the edit (which is a movement of one or more {@link yfiles.graph.IPort}s, {@link yfiles.graph.IBend}s, + * {@link yfiles.input.EdgeEndMovementInfo edge ends}, or {@link yfiles.graph.IPortOwner}s) is being {@link yfiles.input.OrthogonalEdgeEditingContext#initializeDrag initialized} + * before anything has been changed. + * Then, client code that seeks to modify the graph, uses the methods {@link yfiles.input.OrthogonalEdgeEditingContext#addExplicitlyMovedBend}, + * {@link yfiles.input.OrthogonalEdgeEditingContext#addMovedEdgeEnd}, {@link yfiles.input.OrthogonalEdgeEditingContext#addMovedPort}, and {@link yfiles.input.OrthogonalEdgeEditingContext#addTransformedPortOwner}. + * In the next step, the {@link yfiles.input.OrthogonalEdgeEditingContext#dragInitialized drag is being initialized} and all affected edges will + * be {@link yfiles.input.OrthogonalEdgeEditingContext#prepareEdgePaths prepared} so that the editing will not destroy the orthogonality. + * Interested editors now get the chance to register and negotiate {@link yfiles.input.OrthogonalEdgeEditingContext#addImplicitlyMovedBend implicitly moved} bends. + * Then the actual editing is performed and the edit is either {@link yfiles.input.OrthogonalEdgeEditingContext#cancelDrag canceled}, in which case + * the {@link yfiles.input.OrthogonalEdgeEditingContext#removeAddedBends added bends are removed} or the edit is {@link yfiles.input.OrthogonalEdgeEditingContext#dragFinished finished} + * and the affected edges are being {@link yfiles.input.OrthogonalEdgeEditingContext#cleanUp cleaned up}. + *

+ * @see {@link yfiles.input.IOrthogonalEdgeHelper} + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#orthogonalEdgeEditing} + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#movePorts} + */ + export interface OrthogonalEdgeEditingContext extends Object{ + /** + * Occurs when the recent edit operation has been cleaned up. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#cleanUp} + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#onCleanedUp} + */ + addCleanedUpListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when the recent edit operation has been cleaned up. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#cleanUp} + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#onCleanedUp} + */ + removeCleanedUpListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when the edit is about to be initialized. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#initializeDrag} + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#onInitializing} + */ + addInitializingListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when the edit is about to be initialized. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#initializeDrag} + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#onInitializing} + */ + removeInitializingListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when the edit has been initialized. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#dragInitialized} + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#onInitialized} + */ + addInitializedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when the edit has been initialized. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#dragInitialized} + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#onInitialized} + */ + removeInitializedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Gets or sets a value indicating whether this instance is currently initializing. + * Value: + * true if this instance is {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener Initializing} but not yet {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener Initialized}; otherwise, false. + */ + isInitializing:boolean; + /** + * Gets or sets a value indicating whether orthogonal edge editing is enabled at all. + * Value: + * true if orthogonal edge editing is enabled at all; otherwise, false. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#isOrthogonallyEditedEdge} + * @see {@link yfiles.input.IOrthogonalEdgeHelper#isOrthogonallyEdited} + */ + orthogonalEdgeEditing:boolean; + /** + * Gets or sets a value indicating ports are allowed to be moved at all. + * Value: true (the default) if bends adjacent to ports should try to move the port + * to stay perpendicular to the bend, false otherwise. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#canBeMoved} + * @see {@link yfiles.input.IOrthogonalEdgeHelper#canBeMoved} + */ + movePorts:boolean; + /** + * Performs clean up procedures. + * This is called in response to {@link yfiles.input.OrthogonalEdgeEditingContext#cancelDrag} and {@link yfiles.input.OrthogonalEdgeEditingContext#dragFinished} as well as initially during {@link yfiles.input.OrthogonalEdgeEditingContext#initializeDrag}. + */ + cleanUp():void; + /** + * Called by client code when a drag is started about to be started. + * This code needs to be called before any of the {@link yfiles.input.IDragHandler} implementations are initialized + * so that they can then register the items they are going to modify with this instance. + * After this method has been called, the handlers that perform the actual edit need to be initialized and + * as soon as this has been done, {@link yfiles.input.OrthogonalEdgeEditingContext#dragInitialized} should be called. + * @param {yfiles.input.IInputModeContext} context The context in which the edit is going to be performed. + * @throws {yfiles.system.InvalidOperationException} If this context is already {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener Initialized} or currently {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener Initializing}. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#dragInitialized} + */ + initializeDrag(context:yfiles.input.IInputModeContext):void; + /** + * Gets the current input mode context that is in effect for the current edit. + * Value: The current input mode context, which is only available if this instance + * is {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener Initializing} or {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener Initialized}. + */ + currentInputModeContext:yfiles.input.IInputModeContext; + /** + * Raises the {@link yfiles.input.OrthogonalEdgeEditingContext#addCleanedUpListener CleanedUp} event. + * @param {yfiles.system.EventArgs} eventArgs The {@link yfiles.system.EventArgs} instance containing the event data. + */ + onCleanedUp(eventArgs:yfiles.system.EventArgs):void; + /** + * Called when a drag has been successfully finished. + * This method will perform the necessary clean up and {@link yfiles.input.OrthogonalEdgeEditingContext#cleanupEdgePaths clean up edge paths}. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#addCleanedUpListener CleanedUp} + */ + dragFinished():void; + /** + * Called after a successfully {@link yfiles.input.OrthogonalEdgeEditingContext#dragFinished finished drag} to clean up + * artifacts of modified edges. + * @param {yfiles.graph.IGraph} graph The graph. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#cleanUpEdgePath} + */ + cleanupEdgePaths(graph:yfiles.graph.IGraph):void; + /** + * Cleans up the edge's path after a successfully {@link yfiles.input.OrthogonalEdgeEditingContext#dragFinished finished drag}. + * This implementations delegates to the {@link yfiles.input.IOrthogonalEdgeHelper}'s + * {@link yfiles.input.IOrthogonalEdgeHelper#cleanUpEdge} method. + * @param {yfiles.graph.IGraph} graph The graph in which the edge resides. + * @param {yfiles.graph.IEdge} modifiedEdge The modified edge. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper} + */ + cleanUpEdgePath(graph:yfiles.graph.IGraph,modifiedEdge:yfiles.graph.IEdge):void; + /** + * Whether the context is initialized. + * The context is initialized between the calls to {@link yfiles.input.OrthogonalEdgeEditingContext#initializeDrag} + * and {@link yfiles.input.OrthogonalEdgeEditingContext#dragFinished} or {@link yfiles.input.OrthogonalEdgeEditingContext#cancelDrag}. + */ + isInitialized:boolean; + /** + * Called by client edit code when a drag has been canceled. + * Resets all internal state lists and sets {@link yfiles.input.OrthogonalEdgeEditingContext#isInitialized} back to false. + * Also {@link yfiles.input.OrthogonalEdgeEditingContext#removeAddedBends temporarily added bends are removed} and {@link yfiles.input.OrthogonalEdgeEditingContext#addCleanedUpListener CleanedUp} + * will be triggered. + */ + cancelDrag():void; + /** + * Removes previously {@link yfiles.input.OrthogonalEdgeEditingContext#registerAddedBend registered} added bends. + * @param {yfiles.graph.IGraph} graph The graph to use for removing the bends. + * @param {yfiles.collections.IEnumerable.} addedBends The added bends. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#addedBends} + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#registerAddedBend} + */ + removeAddedBends(graph:yfiles.graph.IGraph,addedBends:yfiles.collections.IEnumerable):void; + /** + * Needs to be called by client editing code after {@link yfiles.input.OrthogonalEdgeEditingContext#initializeDrag} has been called + * and all {@link yfiles.input.IDragHandler} have been initialized. + * This method will update the {@link yfiles.input.OrthogonalEdgeEditingContext#isInitializing} and {@link yfiles.input.OrthogonalEdgeEditingContext#isInitialized} state + * accordingly and will then {@link yfiles.input.OrthogonalEdgeEditingContext#prepareEdgePaths prepare} the edge paths. + * Finally {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener Initialized} is triggered so that registered handlers can perform their + * post-initialization process. + */ + dragInitialized():void; + /** + * Called during {@link yfiles.input.OrthogonalEdgeEditingContext#dragInitialized} to prepare the edge paths for orthogonal editing. + * @param {yfiles.graph.IGraph} graph The graph that contains the edges to be edited. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#prepareOrthogonalEdge} + */ + prepareEdgePaths(graph:yfiles.graph.IGraph):void; + /** + * Helper method that inspects and prepares an orthogonal edge for the upcoming edit process. + * This method inspects an edge and possibly inserts new bends into an edge to assure that during editing + * the orthogonality won't be lost. + * @param {yfiles.graph.IGraph} graph The graph to use for modifying the bends. + * @param {yfiles.graph.IEdge} edge The edge to inspect. + * @param {yfiles.input.SegmentOrientation[]} orientations The orientations of the segments - the array is of length (edge.Bends.Count + 1). + * @param {yfiles.input.MovementInfo[]} infos The {@link yfiles.input.MovementInfo} instances for the source end, the bends, and the target end. This array + * contains either {@link yfiles.input.EdgeEndMovementInfo} or {@link yfiles.input.PortMovementInfo} instances at the first and last position + * and {@link yfiles.input.BendMovementInfo}s or null entries for the bends. The length thus is (edge.Bends.Count + 2) + * and null entries indicate that there is no information about the movement (in case the bend will only be moved implicitly later, if at all). + */ + prepareOrthogonalEdge(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,orientations:yfiles.input.SegmentOrientation[],infos:yfiles.input.MovementInfo[]):void; + /** + * Can be used by subclasses during {@link yfiles.input.OrthogonalEdgeEditingContext#prepareOrthogonalEdge} to register added bends that + * can later be {@link yfiles.input.OrthogonalEdgeEditingContext#removeAddedBends removed} in case the operation is canceled. + * This method will only record the addition of bends if this instance is {@link yfiles.input.OrthogonalEdgeEditingContext#isInitialized initialized} + * or {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener still initializing}. + * @param {yfiles.graph.IBend} bend The bend that has been added to guarantee orthogonality. + */ + registerAddedBend(bend:yfiles.graph.IBend):void; + /** + * Gets the previously {@link yfiles.input.OrthogonalEdgeEditingContext#registerAddedBend registered added} bends. + * Value: An enumerable over the bends that have been added previously using {@link yfiles.input.OrthogonalEdgeEditingContext#registerAddedBend}. + */ + addedBends:yfiles.collections.IEnumerable; + /** + * Gets the {@link yfiles.input.MovementInfo movement infos} + * that describe the orthogonal path of the edge. + * @param {yfiles.graph.IEdge} edge The edge to obtain the infos for. + * @return {yfiles.input.MovementInfo[]} An array that contains for the first entry the source end of the edge, then all bends and then as the final entry + * the target end of the edge. For the bends, this can be be null values if nothing is known about the bend, yet. + */ + getMovementInfos(edge:yfiles.graph.IEdge):yfiles.input.MovementInfo[]; + /** + * Raises the {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener Initialized} event. + * @param {yfiles.system.EventArgs} eventArgs The {@link yfiles.system.EventArgs} instance containing the event data. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializedListener Initialized} + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#dragInitialized} + */ + onInitialized(eventArgs:yfiles.system.EventArgs):void; + /** + * Raises the {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener Initializing} event. + * @param {yfiles.system.EventArgs} eventArgs The {@link yfiles.system.EventArgs} instance containing the event data. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#addInitializingListener Initializing} + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#initializeDrag} + */ + onInitializing(eventArgs:yfiles.system.EventArgs):void; + /** + * Callback that can be used by {@link yfiles.input.IDragHandler}s and the like to determines whether + * the given edge is orthogonally edited edge in the specified input mode context. + * This implementation will always yield false if {@link yfiles.input.OrthogonalEdgeEditingContext#orthogonalEdgeEditing} is disabled + * globally. Otherwise {@link yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper} will be used to delegate the query + * to {@link yfiles.input.IOrthogonalEdgeHelper#isOrthogonallyEdited}. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context which is editing the edge. + * @param {yfiles.graph.IEdge} edge The edge that will be edited. + * @return {boolean} + * true if this edge should be orthogonally edited for the specified input mode context; otherwise, false. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#orthogonalEdgeEditing} + * @see {@link yfiles.input.IOrthogonalEdgeHelper#isOrthogonallyEdited} + */ + isOrthogonallyEditedEdge(inputModeContext:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):boolean; + /** + * Callback that can be used by {@link yfiles.input.IDragHandler}s and the like to determines whether + * the specified end of the provided edge should be moved implicitly. + * If an item is next to the end of an edge and the last segment should be kept orthogonal, this may only + * be possible if the end of the edge is moved, too. This can be achieved by moving the edge to another {@link yfiles.graph.IPort}, + * or by moving the port instance itself. This depends on the implementation of the {@link yfiles.input.IEdgePortHandleProvider} + * for the given edge. + * This implementation will delegate to + * {@link yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper GetOrthogonalEdgeHelper()}.{@link yfiles.input.IOrthogonalEdgeHelper#canBeMoved CanBeMoved} + * unless the side of the edge is connected to an {@link yfiles.graph.IPortOwner} instance that is marked as + * {@link yfiles.input.OrthogonalEdgeEditingContext#addTransformedPortOwner transformed} during the edit. + * @param {yfiles.graph.IEdge} edge The edge for which it should be determined whether the edge end can be moved. + * @param {boolean} sourceSide if set to true the source side of the end is queried, else the target side. + * @return {boolean} + * true if the specified side of the edge can be moved; otherwise, false, in which case the segment should be split + * to maintain orthogonality. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper} + * @see {@link yfiles.input.IOrthogonalEdgeHelper#canBeMoved} + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#movePorts} + */ + canBeMoved(edge:yfiles.graph.IEdge,sourceSide:boolean):boolean; + /** + * Callback method that gets the {@link yfiles.input.IOrthogonalEdgeHelper} instance associated with the given edge. + * This implementation obtains the helper instance from the {@link yfiles.support.ILookup#lookup} of the + * edge. + * @param {yfiles.graph.IEdge} edge The edge to obtain the helper instance for. + * @return {yfiles.input.IOrthogonalEdgeHelper} The helper instance to use or null, in which case the default behavior will be used. + * @see {@link yfiles.input.OrthogonalEdgeHelper} + */ + getOrthogonalEdgeHelper(edge:yfiles.graph.IEdge):yfiles.input.IOrthogonalEdgeHelper; + /** + * Gets the declared segment orientation for the provided segment at the given edge. + * This implementation uses the + * {@link yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper GetOrthogonalEdgeHelper()}.{@link yfiles.input.IOrthogonalEdgeHelper#getSegmentOrientation GetSegmentOrientation} + * method to yield the orientation. + * @param {yfiles.graph.IEdge} edge The edge to determine the orientation of the segment. + * @param {number} segmentIndex Index of the segment. + * @return {yfiles.input.SegmentOrientation} The orientation of the segment. + */ + getSegmentOrientation(edge:yfiles.graph.IEdge,segmentIndex:number):yfiles.input.SegmentOrientation; + /** + * Creates or obtains a previously created {@link yfiles.input.BendMovementInfo} + * for the provided implicitly moved bend. + * This method is queried by client {@link yfiles.input.IDragHandler} implementations that have been initialized + * for the current edit that need to move adjacent bends implicitly. + * Implementations should pass as the parameters the movement information that controls the vertical or horizontal + * movement of the bend implicitly. + * @param {yfiles.graph.IBend} implicitlyMovedBend The implicitly moved bend. + * @param {yfiles.input.MovementInfo} verticalAdjacentInfo The movement info that implicitly constrains the vertical movement of the bend or null. + * @param {yfiles.input.MovementInfo} horizontalAdjacentInfo The movement info that implicitly constrains the horizontal movement of the bend or null. + * @return {yfiles.input.BendMovementInfo} The info to be used by clients that requested it. + */ + createImplicitlyMovedBendInfo(implicitlyMovedBend:yfiles.graph.IBend,horizontalAdjacentInfo:yfiles.input.MovementInfo,verticalAdjacentInfo:yfiles.input.MovementInfo):yfiles.input.BendMovementInfo; + /** + * Registers the provided bend with this instance so that it will be considered explicitly moved for this edit. + * {@link yfiles.input.IDragHandler} implementations that are being used to explicitly move a bend during the edit should + * use this method to register their edit while they are being {@link yfiles.input.IDragHandler#initializeDrag initialized}. + * @param {yfiles.input.BendMovementInfo} movementInfo The movement info that describes the movement of the bend. + */ + addExplicitlyMovedBend(movementInfo:yfiles.input.BendMovementInfo):void; + /** + * Registers the provided port with this instance so that it will be considered explicitly moved for this edit. + * {@link yfiles.input.IDragHandler} implementations that are being used to explicitly move a bend during the edit should + * use this method to register their edit while they are being {@link yfiles.input.IDragHandler#initializeDrag initialized}. + * @param {yfiles.input.PortMovementInfo} movementInfo The movement info that describes the movement of the port. + */ + addMovedPort(movementInfo:yfiles.input.PortMovementInfo):void; + /** + * Registers the provided bend as being moved implicitly for this edit. + * The instance will be returned by {@link yfiles.input.OrthogonalEdgeEditingContext#createImplicitlyMovedBendInfo} and the {@link yfiles.input.MovementInfo#moveType} + * will be combined with the requested move type. + * @param {yfiles.input.BendMovementInfo} movementInfo The movement info for the bend. + * @return {yfiles.input.BendMovementInfo} The info that has been registered with this instance. + */ + addImplicitlyMovedBend(movementInfo:yfiles.input.BendMovementInfo):yfiles.input.BendMovementInfo; + /** + * Registers the provided end of the edge with this instance so that it will be considered explicitly moved for this edit. + * {@link yfiles.input.IDragHandler} implementations that are being used to explicitly move the end of an edge during the edit should + * use this method to register their edit while they are being {@link yfiles.input.IDragHandler#initializeDrag initialized}. + * @param {yfiles.input.EdgeEndMovementInfo} movementInfo The movement info that describes the movement of the end of the edge. + * @see {@link yfiles.input.IEdgePortHandleProvider} + */ + addMovedEdgeEnd(movementInfo:yfiles.input.EdgeEndMovementInfo):void; + /** + * Provides access to the enumeration of {@link yfiles.graph.IPortOwner} instances that are being transformed during the edit. + * For elements in the enumerable the attached {@link yfiles.graph.IPortOwner#ports} are considered to be moved in an irregular way + * during the edit. + * Value: The transformed port owners. + * @see {@link yfiles.input.MoveTypes#NON_LINEAR_MOVE} + */ + transformedPortOwners:yfiles.collections.IEnumerable; + /** + * Provides access to the enumeration of {@link yfiles.graph.IEdge} instances whose ports have been locked at source and target end. + * For elements in the enumerable the end points should not be moved and thus {@link yfiles.input.OrthogonalEdgeEditingContext#canBeMoved} returns false for these + * edges. + * Note that this collection is reset for each edit. + * Value: The transformed port owners. + * @see {@link yfiles.input.MoveTypes#NON_LINEAR_MOVE} + */ + lockedPortEdges:yfiles.collections.IEnumerable; + /** + * Adds an {@link yfiles.graph.IPortOwner} that is being transformed somehow during the edit so that the attached + * {@link yfiles.graph.IPortOwner#ports ports} will be moved in an irregular ({@link yfiles.input.MoveTypes#NON_LINEAR_MOVE non-linear}) + * way. + * Normally this will be nodes that are being resized or moved in a non-linear way, or edges, whose bends or ports are being changed. + * @param {yfiles.graph.IPortOwner} portOwner The item that will be transformed. + */ + addTransformedPortOwner(portOwner:yfiles.graph.IPortOwner):void; + /** + * Locks the movement of the ports of the edges so that {@link yfiles.input.OrthogonalEdgeEditingContext#canBeMoved} will yield false for the provided edge + * during the current edit. + * This state will be reset after the current edit. + * @param {yfiles.graph.IEdge} edge The edge to lock the ports of. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#lockedPortEdges} + */ + lockPortMovement(edge:yfiles.graph.IEdge):void; + } + var OrthogonalEdgeEditingContext:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.OrthogonalEdgeEditingContext} class where {@link yfiles.input.OrthogonalEdgeEditingContext#orthogonalEdgeEditing} + * is turned on. + */ + new ():yfiles.input.OrthogonalEdgeEditingContext; + }; + /** + * An implementation of the {@link yfiles.input.IHandle} + * that can be used to move an {@link yfiles.graph.IPort} + * interactively by assigning new {@link yfiles.graph.IPortLocationModelParameter}s + * to the {@link yfiles.graph.IPort#locationModelParameter}. + * This class also provides snapping facilities and can be used in conjunction with + * both {@link yfiles.input.OrthogonalEdgeEditingContext}, as well as {@link yfiles.input.GraphSnapContext}. + */ + export interface PortLocationModelParameterHandle extends Object,yfiles.input.IHandle,yfiles.geometry.IPoint{ + /** + * Returns a view of the location of the item. + * The point describes the current world coordinate of the element that can + * be modified by this handler. + * @see Specified by {@link yfiles.input.IDragHandler#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Gets the port this instance acts on. + * Value: The port. + */ + port:yfiles.graph.IPort; + /** + * Called by clients to indicate that the element is going to be dragged. + * This call will be followed by one or more calls to {@link yfiles.input.IDragHandler#handleMove}, + * and a final {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. + */ + initializeDrag(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Gets the graph to use for {@link yfiles.graph.IGraph#setLocationModelParameter setting the parameter} + * from the context. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context to use. + * @return {yfiles.graph.IGraph} The graph or null if the graph could not be obtained. + * @see {@link yfiles.graph.GraphExtensions#getGraph} + */ + getGraph(inputModeContext:yfiles.input.IInputModeContext):yfiles.graph.IGraph; + /** + * Called by clients to indicate that the element has been dragged and its position + * should be updated. + * This method may be called more than once after an initial {@link yfiles.input.IDragHandler#initializeDrag} + * and will the final call will be followed by either one + * {@link yfiles.input.IDragHandler#dragFinished} or one {@link yfiles.input.IDragHandler#cancelDrag} call. + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @return {boolean} Whether the move had any visual effect. This is a hint to the engine to optimize invalidation. + * @see Specified by {@link yfiles.input.IDragHandler#handleMove}. + */ + handleMove(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):boolean; + /** + * Callback method that applies the parameter. + * @param {yfiles.graph.IGraph} graph The graph to use for applying. + * @param {yfiles.graph.IPort} port The port to apply the parameter to. + * @param {yfiles.graph.IPortLocationModelParameter} newParameter The new parameter to apply. + */ + setParameter(graph:yfiles.graph.IGraph,port:yfiles.graph.IPort,newParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * Callback method that obtains the new parameter for the given location and port. + * @param {yfiles.graph.IPort} port The port to obtain a parameter for. + * @param {yfiles.graph.IPortLocationModel} model The model to use. + * @param {yfiles.geometry.PointD} newLocation The new location. + * @return {yfiles.graph.IPortLocationModelParameter} The new parameter to use. + */ + getNewParameter(port:yfiles.graph.IPort,model:yfiles.graph.IPortLocationModel,newLocation:yfiles.geometry.PointD):yfiles.graph.IPortLocationModelParameter; + /** + * Called by clients to indicate that the dragging has been canceled by the user. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Implementations should reset the position of the items they modify to their initial state. + * Alternatively to this method the {@link yfiles.input.IDragHandler#dragFinished} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} originalLocation The value of the coordinate of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#cancelDrag}. + */ + cancelDrag(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * Called by clients to indicate that the repositioning has just been finished. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Alternatively to this method the {@link yfiles.input.IDragHandler#cancelDrag} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * This is the same value as delivered in the last invocation of {@link yfiles.input.IDragHandler#handleMove} + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#dragFinished}. + */ + dragFinished(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + /** + * Gets or sets the type of the handle that can be used by the rendering engine + * to render types differently. + * Value: The type for rendering. + * @see Specified by {@link yfiles.input.IHandle#type}. + */ + type:yfiles.input.HandleType; + /** + * Gets or sets the cursor to display when the mouse hovers over or drags this + * handle. + * Value: The cursor to display. + * @see Specified by {@link yfiles.input.IHandle#cursor}. + */ + cursor:yfiles.canvas.ICanvasCursor; + /** + * Determines the type of the movement for the given port. + * This is used for the {@link yfiles.input.PortMovementInfo} that is passed to the + * {@link yfiles.input.OrthogonalEdgeEditingContext#addMovedPort} method. + * @param {yfiles.graph.IPort} port The port to determine the move type for. + * @return {yfiles.input.MoveTypes} This implementation returns {@link yfiles.input.MoveTypes#LINEAR_MOVE} for models + * of type {@link yfiles.drawing.NodeScaledPortLocationModel} and {@link yfiles.input.MoveTypes#NON_LINEAR_MOVE} + * for all others. + */ + getMoveType(port:yfiles.graph.IPort):yfiles.input.MoveTypes; + /** + * Called during the drag to collect snap results. + * This implementation will delegate to the {@link yfiles.input.IPortSnapResultProvider} that has been received from the port + * this instance is bound to. + * @param {Object} source The source of the event. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The {@link yfiles.input.CollectSnapResultsEventArgs} instance containing the event data. + */ + collectSnapResults(source:Object,args:yfiles.input.CollectSnapResultsEventArgs):void; + } + var PortLocationModelParameterHandle:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.PortLocationModelParameterHandle} class + * to change the {@link yfiles.graph.IPortLocationModelParameter} of the given port. + * @param {yfiles.graph.IPort} port The port to adjust the location parameter of. + */ + new (port:yfiles.graph.IPort):yfiles.input.PortLocationModelParameterHandle; + }; + /** + * An {@link yfiles.input.IInputMode} that can be used + * to drag a {@link yfiles.graph.ILabel} in a {@link yfiles.canvas.GraphControl}. + * This implementation shows the possible candidate positions for a + * given label and allows the user to drag the label to one of these positions. + */ + export interface MoveLabelInputMode extends yfiles.input.MoveInputMode{ + /** + * Performs one-time initialization of this instance. This method should not + * be invoked by subclasses. This will be done automatically upon first + * installment of this mode. + * This code will be executed only once. The property + * will yield null when this code is executed. This method should not + * be used to install this mode into a specific canvas. + * Subclasses should always call base.Initialize() first. + * @see {@link yfiles.input.MoveLabelInputMode#createLabelHitTestable} + * @see Overrides {@link yfiles.input.AbstractInputMode#initialize} + */ + initialize():void; + /** + * Creates the hit testable that will be used to determine whether + * this mode may be activated. + * This implementation returns an instance that delegates to {@link yfiles.input.MoveLabelInputMode#isValidLabelHit}. + * @return {yfiles.drawing.IHitTestable} A hit testable. + */ + createLabelHitTestable():yfiles.drawing.IHitTestable; + /** + * Determines whether or not a valid label has been hit at the specified position. + * This implementation calls {@link yfiles.input.MoveLabelInputMode#getHitLabel} to find the label at + * the specified location. If a label is hit, the {@link yfiles.input.IPositionHandler} + * is created by {@link yfiles.input.MoveLabelInputMode#createLabelPositionHandler}. + * @param {yfiles.geometry.PointD} location The coordinates for the hit test. + * @param {yfiles.canvas.ICanvasContext} context The context for the hit test. + * @return {boolean} + * true if a valid label is hit and the label moving should be started here. Otherwise, false. + */ + isValidLabelHit(location:yfiles.geometry.PointD,context:yfiles.canvas.ICanvasContext):boolean; + /** + * Looks for a label that has been hit at the specified position. + * This implementation checks the {@link yfiles.input.MoveLabelInputMode#graphSelection} to see if + * there is exactly one selected label. This label is returned if it is hit + * by the mouse and {@link yfiles.input.MoveLabelInputMode#shouldBeMovable} returns + * true. Otherwise, null is returned. + * @param {yfiles.geometry.PointD} location The coordinates for the hit test. + * @param {yfiles.canvas.ICanvasContext} context The context for the hit test. + * @return {yfiles.graph.ILabel} The label hit at the given location or null. + * @see {@link yfiles.input.MoveLabelInputMode#isValidLabelHit} + * @see {@link yfiles.input.MoveLabelInputMode#shouldBeMovable} + */ + getHitLabel(location:yfiles.geometry.PointD,context:yfiles.canvas.ICanvasContext):yfiles.graph.ILabel; + /** + * Determines whether or not a label is allowed to be moved. + * This implementation returns false if the parent input + * mode {@link yfiles.input.GraphEditorInputMode#shouldBeMovable forbids} + * moving the label. Overriding implementations should query this + * implementation as base if this feature is desired. + * @param {yfiles.graph.ILabel} label The label to be checked. + * @param {yfiles.canvas.ICanvasContext} context The context. + * @return {boolean} true if the label is allowed to move. + * @see {@link yfiles.input.MoveLabelInputMode#getHitLabel} + */ + shouldBeMovable(label:yfiles.graph.ILabel,context:yfiles.canvas.ICanvasContext):boolean; + /** + * Creates the {@link yfiles.input.IPositionHandler position handler} for the + * given label used in {@link yfiles.input.MoveLabelInputMode#isValidLabelHit}. + * First, this implementation checks for a position handler in the label's + * {@link yfiles.support.ILookup lookup}. If this fails, it creates a new label + * position handler for the given graph and label. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.ILabel} label The label to create a position handler for. + * @return {yfiles.input.IPositionHandler} A position handler for the given label. + */ + createLabelPositionHandler(graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel):yfiles.input.IPositionHandler; + /** + * Registers the {@link yfiles.input.MoveInputMode#positionHandler} + * created during the last {@link yfiles.input.MoveLabelInputMode#createLabelPositionHandler} + * call. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs + * @see Overrides {@link yfiles.input.MoveInputMode#onDragStarting} + */ + onDragStarting(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Clears the {@link yfiles.input.MoveInputMode#positionHandler} property. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs + * @see Overrides {@link yfiles.input.MoveInputMode#onDragCanceled} + */ + onDragCanceled(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Clears the {@link yfiles.input.MoveInputMode#positionHandler} property. + * @see Overrides {@link yfiles.input.MoveInputMode#onDragFinished} + */ + onDragFinished(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Determines whether or not using the + * {@link yfiles.graph.ILabelModelParameterFinder} to assign new label model + * parameters is allowed. + *

+ * The default is true + *

+ *

+ * This property has no effect if an {@link yfiles.input.IPositionHandler} + * is available in the label's {@link yfiles.support.ILookup lookup}. + *

+ * @see {@link yfiles.input.MoveLabelInputMode#createLabelPositionHandler} + */ + useLabelModelParameterFinder:boolean; + /** + * Gets the label that is currently moved or null if + * there is no such label. + * The value of this property is not null only if this + * mode is currently active and performs a move operation, that is between + * the + * {@link yfiles.input.MoveInputMode#addDragStartingListener DragStarting} and the + * {@link yfiles.input.MoveInputMode#addDragFinishedListener DragFinished} event handlers. + */ + movedLabel:yfiles.graph.ILabel; + /** + * Gets the Graph this mode is acting upon. + */ + graphSelection:yfiles.graph.IGraphSelection; + /** + * Called when the {@link yfiles.input.MoveLabelInputMode#graphSelection} property changes. + * @param {yfiles.graph.IGraphSelection} oldGraphSelection The old instance. + * @param {yfiles.graph.IGraphSelection} newGraphSelection The new instance. + */ + onGraphSelectionChanged(oldGraphSelection:yfiles.graph.IGraphSelection,newGraphSelection:yfiles.graph.IGraphSelection):void; + /** + * Set a new Graph Selection for this mode. + * Normally the graph selection is retrieved from this instance's {@link yfiles.input.AbstractInputMode#inputModeContext}. + * If the instance needs to be overridden, this method can be used. + * Triggers {@link yfiles.input.MoveLabelInputMode#onGraphChanged}. + * @param {yfiles.graph.IGraphSelection} newGraphSelection The new graph selection. + */ + setGraphSelectionCore(newGraphSelection:yfiles.graph.IGraphSelection):void; + /** + * Gets the Graph this mode is acting upon. + */ + graph:yfiles.graph.IGraph; + /** + * Called when the {@link yfiles.input.MoveLabelInputMode#graph} property changes. + * @param {yfiles.graph.IGraph} oldGraph The old graph instance. + * @param {yfiles.graph.IGraph} newGraph The new graph instance. + */ + onGraphChanged(oldGraph:yfiles.graph.IGraph,newGraph:yfiles.graph.IGraph):void; + /** + * Set a new Graph for this mode. + * Normally the graph is retrieved from this instance's {@link yfiles.input.AbstractInputMode#inputModeContext}. + * If the instance needs to be overridden, this method can be used. + * Triggers {@link yfiles.input.MoveLabelInputMode#onGraphChanged}. + * @param {yfiles.graph.IGraph} newGraph The new graph. + */ + setGraphCore(newGraph:yfiles.graph.IGraph):void; + } + var MoveLabelInputMode:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that will move labels in the graph retrieved + * from the {@link yfiles.input.AbstractInputMode#inputModeContext}. + * @see {@link yfiles.input.MoveLabelInputMode#graph} + */ + new ():yfiles.input.MoveLabelInputMode; + /** + * Creates a new instance that will move labels in the given graph. + * It is recommended to use the parameterless constructor and let the instance retrieve the graph + * and selection from the context. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.IGraphSelection} selection The selection to use for determining which label is selected. + * @see {@link yfiles.input.MoveLabelInputMode#graph} + * @see {@link yfiles.input.MoveLabelInputMode#graphSelection} + */ + ForGraphAndSelection:{ + new (graph:yfiles.graph.IGraph,selection:yfiles.graph.IGraphSelection):yfiles.input.MoveLabelInputMode; + }; + }; + /** + * Event argument used by {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener ValidateLabelText}. + */ + export interface LabelTextValidatingEventArgs extends yfiles.input.InputModeEventArgs{ + /** + * Gets the label that is being edited. + * Note that the label might not belong to a graph if it is a dummy for a label that is about to be created. + */ + label:yfiles.graph.ILabel; + /** + * Gets or sets the new text to use for the label. + * Value: The new text. + * @see {@link yfiles.input.LabelTextValidatingEventArgs#cancel} + */ + newText:string; + /** + * Gets or sets a value indicating whether the edit should be canceled. + * Value: true if the new text is not valid and should not be used for the edit; otherwise, false. + */ + cancel:boolean; + } + var LabelTextValidatingEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.LabelTextValidatingEventArgs} class. + * @param {yfiles.input.IInputModeContext} context The context. + * @param {yfiles.graph.ILabel} label The label. + * @param {string} newText The initial new text as entered by the user. + */ + new (context:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel,newText:string):yfiles.input.LabelTextValidatingEventArgs; + }; + /** + * An {@link yfiles.input.ItemDropInputMode} specialized to drag'n'drop {@link yfiles.graph.INode}s. + * A dragged {@link yfiles.graph.INode} is visualized during the drag operation. + * The input mode does also support snapping of the dragged {@link yfiles.graph.INode} via the {@link yfiles.input.SnapContext}. + * When the {@link yfiles.input.NodeDropInputMode#getDraggedNode dragged node} is dropped, + * This mode can can drag nodes onto {@link yfiles.graph.IGroupedGraph group} and optional {@link yfiles.graph.IFoldedGraph#collapse folder nodes} + * and automatically add the node to the corresponding group node in the hierarchy. + * In this case the {@link yfiles.input.NodeDropInputMode#isValidParentPredicate} will be queried if the dropped upon node is actually a valid parent. + */ + export interface NodeDropInputMode extends yfiles.input.ItemDropInputMode{ + /** + * Event that is triggered when a new node gets created by this input mode. + * Note that if {@link yfiles.input.NodeDropInputMode#folderNodeParentsAllowed} is set to true, the node + * can actually be part of the {@link yfiles.graph.IFoldedGraph master graph}. + */ + addNodeCreatedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered when a new node gets created by this input mode. + * Note that if {@link yfiles.input.NodeDropInputMode#folderNodeParentsAllowed} is set to true, the node + * can actually be part of the {@link yfiles.graph.IFoldedGraph master graph}. + */ + removeNodeCreatedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Gets or sets the callback for node creation. + * Can be set to a different value to implement a custom behavior. + */ + nodeCreator:(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,draggedNode:yfiles.graph.INode,newNodeLayout:yfiles.geometry.RectD)=>yfiles.graph.INode; + /** + * Gets or sets the callback for testing whether a {@link yfiles.input.NodeDropInputMode#getDraggedNode dragged node} + * should be created as a {@link yfiles.graph.IGroupedGraph group node}. + * The default implementation returns false always. + * Can be set to a different value to implement custom group node detection. + */ + isGroupNodePredicate:(obj:yfiles.graph.INode)=>boolean; + /** + * Gets or sets the callback for testing whether an existing node in the graph + * can be used as a valid parent node in the context of {@link yfiles.graph.IGroupedGraph grouping}. + * The default implementation returns true always. + * Can be set to a different value to implement custom group node detection. + * Note that the node passed to the predicate may be null to indicate that + * the node will be placed at the root of the hierarchy. + * @see {@link yfiles.input.NodeDropInputMode#leafParentsAllowed} + * @see {@link yfiles.input.NodeDropInputMode#folderNodeParentsAllowed} + */ + isValidParentPredicate:(obj:yfiles.graph.INode)=>boolean; + /** + * Determines whether a preview of the dragged node is displayed during the drag. + */ + showNodePreview:boolean; + /** + * Adds a highlight to the given {@link yfiles.graph.INode Node}. + * This is used for highlighting a group node when dragging over it. + */ + highlightedNode:yfiles.graph.INode; + /** + * Initializes the item preview. + * This method is called by {@link yfiles.input.ItemDropInputMode#onDragEntered}. + * If a preview {@link yfiles.input.ItemDropInputMode#showPreview shall be displayed}, + * the {@link yfiles.input.ItemDropInputMode#getPreviewGraph preview graph} is initialized + * and {@link yfiles.input.ItemDropInputMode#populatePreviewGraph} is called. + */ + initializePreview(e:yfiles.system.DragEventArgs):void; + /** + * Subclasses shall fill the specified graph that is used to preview the dragged item. + * @param {yfiles.graph.IGraph} previewGraph The preview graph to fill. + */ + populatePreviewGraph(previewGraph:yfiles.graph.IGraph):void; + /** + * Gets the currently dragged {@link yfiles.graph.INode} instance. + * This implementation simply tries to cast the {@link yfiles.input.DropInputMode#dropData} to {@link yfiles.graph.INode}. + */ + getDraggedNode():yfiles.graph.INode; + /** + * Returns the drop target at the specified location. + * The drop target is highlighted, if {@link yfiles.input.ItemDropInputMode#highlightDropTarget} is enabled. + * Per default, null is returned. + * @param {yfiles.geometry.PointD} dragLocation The location to return the drop target for. + * @return {yfiles.model.IModelItem} The drop target at the specified location or null if no drop target can be found. + */ + getDropTarget(dragLocation:yfiles.geometry.PointD):yfiles.model.IModelItem; + /** + * Looks for a group node in the drop location. If there are several nested nodes the innermost that satisfies the constraints is returned. + * This implementation uses the {@link yfiles.input.NodeDropInputMode#isValidParentPredicate} to determine whether the node is a valid parent. + * If {@link yfiles.input.NodeDropInputMode#leafParentsAllowed} is enabled, also {@link yfiles.graph.IHierarchy#isLeaf leaf nodes} are queried. + * @param {yfiles.graph.IGroupedGraph} groupedGraph The {@link yfiles.graph.IGroupedGraph} in which to look for. + * @return {yfiles.graph.INode} A {@link yfiles.graph.INode valid target parent node} or null if no valid group was found at the drop location. + */ + getDropTargetParentNode(groupedGraph:yfiles.graph.IGroupedGraph):yfiles.graph.INode; + /** + * Gets or sets a value indicating whether nodes can be dropped on {@link yfiles.graph.IFoldedGraph#collapse collapsed} folder nodes. + * If this property is set to true, dropping nodes on collapsed folder nodes will create the node + * inside the folder node in the master graph. In that case the {@link yfiles.input.ItemDropInputMode#addItemCreatedListener ItemCreated} and + * {@link yfiles.input.NodeDropInputMode#addNodeCreatedListener NodeCreated} event will yield the node in the {@link yfiles.graph.IFoldingManager#masterGraph master graph}. + * The node will not be {@link yfiles.graph.IGraph#contains contained} in the currently visible graph. + * By default this feature is disabled. + * In any case the {@link yfiles.input.NodeDropInputMode#isValidParentPredicate} will be queried additionally if the node is a valid parent. + * Value: + * true if folder node parents are allowed; otherwise, false. + */ + folderNodeParentsAllowed:boolean; + /** + * Gets or sets a value indicating whether nodes can be dropped onto {@link yfiles.graph.IHierarchy#isLeaf leave nodes}. + * If this property is enabled, dropping a node on a leaf node will effectively convert the leaf node to a + * real group node. + * By default this feature is disabled. + * In any case the {@link yfiles.input.NodeDropInputMode#isValidParentPredicate} will be queried additionally if the node is a valid parent. + * Value: + * true if leaf parents are allowed as valid drop targets; otherwise, false. + */ + leafParentsAllowed:boolean; + /** + * Called whenever a new node is created. + * Note that if {@link yfiles.input.NodeDropInputMode#folderNodeParentsAllowed} is set to true, the node + * can actually be part of the {@link yfiles.graph.IFoldedGraph master graph}. + */ + onNodeCreated(args:yfiles.model.ItemEventArgs):void; + /** + * Cleans up the item preview. + */ + cleanupPreview():void; + /** + * Subclasses shall update the {@link yfiles.input.ItemDropInputMode#getPreviewGraph preview graph} + * so the dragged item is displayed at the specified dragLocation. + * @param {yfiles.graph.IGraph} previewGraph The preview graph to update. + * @param {yfiles.geometry.PointD} dragLocation The current drag location. + */ + updatePreview(previewGraph:yfiles.graph.IGraph,newLocation:yfiles.geometry.PointD):void; + /** + * Calculates the layout of the new node. In this implementation the mouse location + * is used as center of the node. Can be overridden in child class to implement a different layout. + * @param {yfiles.geometry.PointD} mouseLocation Current mouse position + * @param {yfiles.geometry.SizeD} size Size of the node + * @return {yfiles.geometry.RectD} a {@link yfiles.geometry.RectD} with the given size and the mouse location as center. + */ + getNodeLayout(mouseLocation:yfiles.geometry.PointD,size:yfiles.geometry.SizeD):yfiles.geometry.RectD; + /** + * Callback registered on the {@link yfiles.input.SnapContext} that collects {@link yfiles.input.SnapResult}s for the + * dragged element. + * The default implementation doesn't collect any snap results. + * @param {Object} source The {@link yfiles.input.SnapContext} this callback is registered at. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The arguments describing the movement {@link yfiles.input.SnapResult}s shall be collected for. + */ + collectSnapResults(source:Object,args:yfiles.input.CollectSnapResultsEventArgs):void; + /** + * Callback registered on the {@link yfiles.input.SnapContext} that collects {@link yfiles.input.SnapResult}s for the + * dragged node. + * This method does use the {@link yfiles.input.INodeSnapResultProvider} registered in the node's lookup or + * {@link yfiles.input.NodeSnapResultProvider#INSTANCE} if no such provider could be found. + * @param {Object} source The {@link yfiles.input.SnapContext} this callback is registered at. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The arguments describing the movement {@link yfiles.input.SnapResult}s shall be collected for. + */ + collect(source:Object,args:yfiles.input.CollectSnapResultsEventArgs):void; + } + var NodeDropInputMode:{ + $class:yfiles.lang.Class; + /** + * Constructs a new instance of class {@link yfiles.input.DropInputMode} for the + * expected data type. Not used in this class since data type is always {@link yfiles.graph.INode}. + * This constructor only exists for usage in child class. + */ + WithType:{ + new (expectedType:yfiles.lang.Class):yfiles.input.NodeDropInputMode; + }; + /** + * Constructs a new instance of class {@link yfiles.input.NodeDropInputMode} for the type {@link yfiles.graph.INode}. + */ + new ():yfiles.input.NodeDropInputMode; + }; + /** + * Simple default implementation of {@link yfiles.input.IReparentNodeHandler} + * that treats shift key presses as reparent gestures and allows + * for reparenting all nodes. + */ + export interface ReparentNodeHandler extends Object,yfiles.input.IReparentNodeHandler{ + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} + * that will be queried to determine whether the gesture is a reparent gesture. + * The default is {@link yfiles.input.KeyEvents#SHIFT_PRESSED} + * @see {@link yfiles.input.ReparentNodeHandler#isReparentGesture} + */ + reparentRecognizer:yfiles.input.IEventRecognizer; + /** + * Determines whether the current gesture that can be determined through the + * context is a reparent gesture. + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.INode} node The node that will possibly be reparented. + * @return {boolean} Whether this is a reparenting gesture. + * @see Specified by {@link yfiles.input.IReparentNodeHandler#isReparentGesture}. + */ + isReparentGesture(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode):boolean; + /** + * Determines whether the user may detach the given node from its current parent in + * order to reparent it. + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.INode} node The node that is about to be detached from its current parent. + * @return {boolean} Whether the node may be detached and reparented. + * @see Specified by {@link yfiles.input.IReparentNodeHandler#canReparent}. + */ + canReparent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode):boolean; + /** + * Determines whether the provided node may be reparented to a newParent. + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.INode} node The node that will be reparented. + * @param {yfiles.graph.INode} newParent The potential new parent or {@link yfiles.graph.IHierarchy#root}. Can be a group or a + * non-group node. + * @return {boolean} Whether newParent is a valid new parent for node. + * @see Specified by {@link yfiles.input.IReparentNodeHandler#isValidParent}. + */ + isValidParent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,newParent:yfiles.graph.INode):boolean; + /** + * Performs the actual reparenting after the reparent gesture has been finalized. + * Implementations should {@link yfiles.graph.IHierarchy#setParent set the parent} of node + * to newParent. + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.INode} node The node that will be reparented. + * @param {yfiles.graph.INode} newParent The potential new parent or {@link yfiles.graph.IHierarchy#root}. Can be a group or a + * non-group node. + * @see Specified by {@link yfiles.input.IReparentNodeHandler#reparent}. + */ + reparent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,newParent:yfiles.graph.INode):void; + } + var ReparentNodeHandler:{ + $class:yfiles.lang.Class; + new ():yfiles.input.ReparentNodeHandler; + }; + /** + * Simple implementation of the {@link yfiles.input.ISnapLineProvider} interface that can be used to + * add snap lines for orthogonally routed {@link yfiles.graph.IEdge}s. + * This implementation can be put into the {@link yfiles.support.ILookup#lookup} of an {@link yfiles.graph.IEdge}. + * @see {@link yfiles.graph.EdgeDecorator#snapLineProviderDecorator} + */ + export interface EdgeSnapLineProvider extends Object,yfiles.input.ISnapLineProvider{ + /** + * Adds the snap lines for the given model item to the args. + * This implementation queries the {@link yfiles.input.GraphSnapContext#getMovementInfos movement information} + * for the provided edge to determine which edge segments stay fixed. + * For each fixed segment, it will call {@link yfiles.input.EdgeSnapLineProvider#addVerticalSegmentSnapLines} or {@link yfiles.input.EdgeSnapLineProvider#addHorizontalSegmentSnapLines} + * respectively. + * @param {yfiles.input.GraphSnapContext} context The context which holds the settings for the snap lines. Note that implementations should not + * change the state of the context explicitly. + * @param {yfiles.model.IModelItem} item The item to add snap lines for. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} args The argument to use for adding snap lines. + * @see Specified by {@link yfiles.input.ISnapLineProvider#addSnapLines}. + */ + addSnapLines(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectGraphSnapLinesEventArgs,item:yfiles.model.IModelItem):void; + /** + * Adds horizontal snap lines for a horizontally oriented fixed segment snap lines. + * @param {yfiles.input.GraphSnapContext} context The context which holds the settings for the snap lines. Note that implementations should not + * change the state of the context explicitly. + * @param {yfiles.graph.IEdge} edge The edge to add snap lines for. + * @param {yfiles.geometry.PointD} segmentStart The start of the segment. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} args The argument to use for adding snap lines. + * @param {yfiles.geometry.PointD} segmentEnd The end of the segment. + * @see {@link yfiles.input.EdgeSnapLineProvider#addVerticalSegmentSnapLines} + */ + addHorizontalSegmentSnapLines(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectGraphSnapLinesEventArgs,edge:yfiles.graph.IEdge,segmentStart:yfiles.geometry.PointD,segmentEnd:yfiles.geometry.PointD):void; + /** + * Adds vertical snap lines for a vertically oriented fixed segment snap lines. + * @param {yfiles.input.GraphSnapContext} context The context which holds the settings for the snap lines. Note that implementations should not + * change the state of the context explicitly. + * @param {yfiles.graph.IEdge} edge The edge to add snap lines for. + * @param {yfiles.geometry.PointD} segmentStart The start of the segment. + * @param {yfiles.geometry.PointD} segmentEnd The end of the segment. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} args The argument to use for adding snap lines. + * @see {@link yfiles.input.EdgeSnapLineProvider#addHorizontalSegmentSnapLines} + */ + addVerticalSegmentSnapLines(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectGraphSnapLinesEventArgs,edge:yfiles.graph.IEdge,segmentStart:yfiles.geometry.PointD,segmentEnd:yfiles.geometry.PointD):void; + } + var EdgeSnapLineProvider:{ + $class:yfiles.lang.Class; + }; + /** + * A simple interface that can be used to simulate simple + * buttons for {@link yfiles.drawing.INodeStyle}s etc. + * {@link yfiles.input.GraphEditorInputMode} will query + * the {@link yfiles.model.IModelItem}'s {@link yfiles.support.ILookup#lookup} + * method for this interface if it has detected {@link yfiles.input.GraphEditorInputMode#click}s. + * If the item yields an instance of this interface and the click was + * inside the {@link yfiles.input.IActionButtonProvider#getButtonBounds}, then the associated + * action is {@link yfiles.input.IActionButtonProvider#invokeAction invoked}. + * @see {@link yfiles.input.GraphEditorInputMode} + * @see {@link yfiles.drawing.CollapsibleNodeStyleDecorator} + */ + export interface IActionButtonProvider extends Object{ + /** + * Gets a {@link yfiles.drawing.IHitTestable} that can be used to query the button bounds. + * @return {yfiles.drawing.IHitTestable} A hit testable that can determine whether the button has been hit by a given click. + * @see Specified by {@link yfiles.input.IActionButtonProvider#getButtonBounds}. + */ + getButtonBounds():yfiles.drawing.IHitTestable; + /** + * Called by the framework to indicate that the button has been clicked by the user + * at the specified location. + * This method is called by {@link yfiles.input.GraphEditorInputMode#click} for + * the {@link yfiles.model.IModelItem}s that yielded an instance of this interface. + * @param {yfiles.input.IInputModeContext} context The context to use for the click operation. + * @param {yfiles.geometry.PointD} location The location of the click + * @see Specified by {@link yfiles.input.IActionButtonProvider#invokeAction}. + */ + invokeAction(context:yfiles.input.IInputModeContext,location:yfiles.geometry.PointD):void; + } + var IActionButtonProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface for classes that can yield {@link yfiles.input.IHandle} implementations for the + * {@link yfiles.graph.IEdge#sourcePort source} and {@link yfiles.graph.IEdge#targetPort target} + * ends of an {@link yfiles.graph.IEdge}. + * This interface will be queried by the default implementation of the {@link yfiles.input.IHandleProvider} + * that is in the lookup of an {@link yfiles.graph.IEdge}. It is recommended to use this interface instead of + * the more generic {@link yfiles.input.IHandleProvider} interface, because other generic code can then use this interface + * to gain access to a specific {@link yfiles.input.IHandle} more easily. + */ + export interface IEdgePortHandleProvider extends Object{ + /** + * Gets an {@link yfiles.input.IHandle} implementation for one end of the provided edge. + * @param {yfiles.input.IInputModeContext} context The context in which the handle will be used. + * @param {yfiles.graph.IEdge} edge The edge for which an handle is needed. + * @param {boolean} sourceHandle if set to true the handle for the source side/port should be returned. + * @return {yfiles.input.IHandle} The handle to use for the provided side or null. + * @see Specified by {@link yfiles.input.IEdgePortHandleProvider#getHandle}. + */ + getHandle(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourceHandle:boolean):yfiles.input.IHandle; + } + var IEdgePortHandleProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An implementation of the {@link yfiles.input.ISnapLineProvider} interface that provides + * {@link yfiles.input.OrthogonalSnapLine}s for {@link yfiles.graph.INode}s. + * This implementation uses the {@link yfiles.input.GraphSnapContext} to create snap lines + * around the geometric border of the node. + */ + export interface NodeSnapLineProvider extends Object,yfiles.input.ISnapLineProvider{ + /** + * Called by the {@link yfiles.input.GraphSnapContext} when a {@link yfiles.input.GraphSnapContext#initializeDrag drag} + * is about to start. + * This means that the provided item, which can be cast to {@link yfiles.graph.INode} will not be moved + * during the edit and thus can contribute to the set of fixed snap lines. + * This implementation delegates to {@link yfiles.input.NodeSnapLineProvider#addFixedNodeBorderSnapLines}, {@link yfiles.input.NodeSnapLineProvider#addPortSnapLines}, + * {@link yfiles.input.NodeSnapLineProvider#addNodeToNodeSnapLines}, and {@link yfiles.input.NodeSnapLineProvider#addCenterSnapLines}. + * @param {yfiles.input.GraphSnapContext} context The context which holds the settings for the snap lines. Note that implementations should not + * change the state of the context explicitly. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} args The argument to use for adding snap lines. + * @param {yfiles.model.IModelItem} item The item to add snap lines for. + * @see Specified by {@link yfiles.input.ISnapLineProvider#addSnapLines}. + */ + addSnapLines(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectGraphSnapLinesEventArgs,item:yfiles.model.IModelItem):void; + /** + * Callback method that is called by {@link yfiles.input.NodeSnapLineProvider#addSnapLines} the collect snap lines to snap ports to at the provided node. + * This method is called by {@link yfiles.input.NodeSnapLineProvider#addSnapLines} + * @param {yfiles.input.GraphSnapContext} context The context which holds the settings for the snap lines. Note that implementations should not + * change the state of the context explicitly. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} args The argument to use for adding snap lines. + * @param {yfiles.graph.INode} node The node to add snap lines for. + * @param {yfiles.geometry.RectD} layout The layout of the node to use for adding the snap lines. + */ + addPortSnapLines(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.RectD):void; + /** + * Callback method that adds the fixed snap lines around the border of the nodes' layout. + * This method is called by {@link yfiles.input.NodeSnapLineProvider#addSnapLines} + * @param {yfiles.input.GraphSnapContext} context The context which holds the settings for the snap lines. Note that implementations should not + * change the state of the context explicitly. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} args The argument to use for adding snap lines. + * @param {yfiles.graph.INode} node The node to add snap lines for. + * @param {yfiles.geometry.RectD} layout The layout of the node to use for adding the snap lines. + */ + addFixedNodeBorderSnapLines(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.RectD):void; + /** + * Callback method that is called by {@link yfiles.input.NodeSnapLineProvider#addSnapLines} the collect snap lines for the centers of the node. + * This method is called by {@link yfiles.input.NodeSnapLineProvider#addSnapLines} and by default used the {@link yfiles.input.NodeSnapLineProvider#createCenterSnapLine} to + * add them to the {@link yfiles.input.CollectGraphSnapLinesEventArgs#addFixedNodeSnapLine fixed node} and + * {@link yfiles.input.CollectGraphSnapLinesEventArgs#addFixedSegmentSnapLine fixed segment} collections + * @param {yfiles.input.GraphSnapContext} context The context which holds the settings for the snap lines. Note that implementations should not + * change the state of the context explicitly. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} args The argument to use for adding snap lines. + * @param {yfiles.graph.INode} node The node to add snap lines for. + * @param {yfiles.geometry.RectD} layout The layout of the node to use for adding the snap lines. + */ + addCenterSnapLines(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.RectD):void; + /** + * Convenience method that creates a snap line for the center of nodes. + * @param {yfiles.input.GraphSnapContext} context The context which holds the settings for the snap lines. Note that implementations should not + * change the state of the context explicitly. + * @param {yfiles.graph.INode} node The node to add snap lines for. + * @param {yfiles.input.SnapLineOrientation} snapLineOrientation The snap line orientation. + * @param {yfiles.geometry.PointD} location The location of the snap line. + * @return {yfiles.input.OrthogonalSnapLine} A snap line that other centers can snap to. + */ + createCenterSnapLine(context:yfiles.input.GraphSnapContext,node:yfiles.graph.INode,snapLineOrientation:yfiles.input.SnapLineOrientation,location:yfiles.geometry.PointD):yfiles.input.OrthogonalSnapLine; + /** + * Callback method that adds the fixed snap lines around the node for edge segments to snap to. + * This method is called by {@link yfiles.input.NodeSnapLineProvider#addSnapLines} and uses the {@link yfiles.input.GraphSnapContext#nodeToEdgeDistance} + * to determine the location of the segments to add around the layout. + * @param {yfiles.input.GraphSnapContext} context The context which holds the settings for the snap lines. Note that implementations should not + * change the state of the context explicitly. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} args The argument to use for adding snap lines. + * @param {yfiles.graph.INode} node The node to add snap lines for. + * @param {yfiles.geometry.RectD} layout The layout of the node to use for adding the snap lines. + */ + addNodeToSegmentSnapLines(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.RectD):void; + /** + * Callback method that adds the fixed snap lines around the node for other nodes to snap to using the {@link yfiles.input.GraphSnapContext#nodeToNodeDistance}. + * This method is called by {@link yfiles.input.NodeSnapLineProvider#addSnapLines} and uses the {@link yfiles.input.GraphSnapContext#nodeToNodeDistance} + * to determine the location of the segments to add around the layout. + * @param {yfiles.input.GraphSnapContext} context The context which holds the settings for the snap lines. Note that implementations should not + * change the state of the context explicitly. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} args The argument to use for adding snap lines. + * @param {yfiles.graph.INode} node The node to add snap lines for. + * @param {yfiles.geometry.RectD} layout The layout of the node to use for adding the snap lines. + */ + addNodeToNodeSnapLines(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectGraphSnapLinesEventArgs,node:yfiles.graph.INode,layout:yfiles.geometry.RectD):void; + } + var NodeSnapLineProvider:{ + $class:yfiles.lang.Class; + }; + /** + * A complex {@link yfiles.input.IInputMode} that can be used in a {@link yfiles.canvas.CanvasControl} + * or {@link yfiles.input.GraphEditorInputMode#graphControl} to edit an {@link yfiles.graph.IGraph} instance. + * This class delegates most of the work to minor {@link yfiles.input.IInputMode} implementations. + * However it contains a number of properties that influence the general behavior, too. + *
    + *
  • + * {@link yfiles.input.GraphEditorInputMode#marqueeSelectableItems} + * Determines the type of the items that can + * be selected with the {@link yfiles.input.MarqueeSelectionInputMode marquee} + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#clickSelectableItems} + * Determines the type of the items that can + * be selected with the {@link yfiles.input.ClickInputMode mouse} + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#detailSelectionRecognizer} + * Determines when to use a detail click selection mode, which allows for + * selecting the item that is directly under the mouse without taking into account the + * {@link yfiles.input.GraphEditorInputMode#clickHitTestOrder}. + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#clickHitTestOrder} + * Determines the priorities for hit tests during + * {@link yfiles.input.GraphEditorInputMode#onClickInputModeClicked mouse clicks} to determine which items should be + * {@link yfiles.input.MainInputMode#setSelected selected}. + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#doubleClickHitTestOrder} + * Determines the priorities for hit tests when + * {@link yfiles.input.GraphEditorInputMode#addItemDoubleClickedListener double-clicking items}. + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#movableItems} + * Determines the type of the items that can + * be moved with the mouse. + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#showHandleItems} + * Determines the type of the items whose {@link yfiles.input.IHandle}s + * should be shown and movable by the {@link yfiles.input.HandleInputMode} + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#deletableItems} + * Determines the type of the items that can + * be deleted by {@link yfiles.input.GraphEditorInputMode#deleteSelection} + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#labelEditableItems} + * Determines the type of the items that can + * have their {@link yfiles.input.GraphEditorInputMode#editLabel labels edited.} + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#groupSelectionAllowed} + * Determines whether this input mode should allow + * {@link yfiles.input.GraphEditorInputMode#groupSelection grouping the current selection.} + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#ungroupSelectionAllowed} + * Determines whether this input mode should allow + * {@link yfiles.input.GraphEditorInputMode#ungroupSelection ungrouping the current selection.} + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#clearSelectionAllowed} + * Determines whether this input mode should allow + * {@link yfiles.input.MainInputMode#clearSelection clearing the selection.} + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#clipboardOperationsAllowed} + * Determines whether this input mode should enable + * {@link yfiles.graph.GraphClipboard graph clipboard operations.} + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#duplicateAllowed} + * Determines whether this input mode should enable + * {@link yfiles.graph.GraphClipboard graph clipboard's.} {@link yfiles.graph.GraphClipboard#duplicate} operation. + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#labelEditingAllowed} + * Determines whether this input mode should allow + * {@link yfiles.input.GraphEditorInputMode#editLabel editing labels.} + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#reparentNodesAllowed} + * Determines whether this input mode should allow + * {@link yfiles.input.IReparentNodeHandler reparenting nodes to other groups.} + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#nodeCreationAllowed} + * Determines whether this input mode should allow + * {@link yfiles.input.GraphEditorInputMode#nodeCreator creating new nodes} via simple mouse clicks. + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#edgeCreationAllowed} + * Determines whether the {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} should be + * {@link yfiles.input.IConcurrentInputMode#enabled} to allow for creating new edges. + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#doubleClickLabelEditingAllowed} + * Determines whether the labels should be + * editable on otherwise unhandled double clicks. + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#edgeReversalAllowed} + * Determines whether edges can be reversed. + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#bendCreationAllowed} + * Determines whether the {@link yfiles.input.GraphEditorInputMode#createBendInputMode} should be + * {@link yfiles.input.IConcurrentInputMode#enabled} to allow for creating new bends. + *
  • + *
  • + * {@link yfiles.input.NavigationInputMode#enteringGroupsAllowed} + * Determines whether the mode allows for {@link yfiles.input.NavigationInputMode#enterGroup entering} + * group nodes in {@link yfiles.graph.IFoldedGraph} views. + *
  • + *
  • + * {@link yfiles.input.NavigationInputMode#exitingGroupAllowed} + * Determines whether the mode allows for {@link yfiles.input.NavigationInputMode#exitGroup exiting} + * the current group node in {@link yfiles.graph.IFoldedGraph} views. + *
  • + *
  • + * {@link yfiles.input.NavigationInputMode#collapsingGroupsAllowed} + * Determines whether the mode allows for {@link yfiles.input.NavigationInputMode#collapseGroup collapsing} + * group nodes in {@link yfiles.graph.IFoldedGraph} views. + *
  • + *
  • + * {@link yfiles.input.NavigationInputMode#expandingGroupsAllowed} + * Determines whether the mode allows for {@link yfiles.input.NavigationInputMode#expandGroup expanding} + * group nodes in {@link yfiles.graph.IFoldedGraph} views. + *
  • + *
  • + * {@link yfiles.input.ItemHoverInputMode#hoverItems} + * Determines which items should be reported as being hovered through the + * {@link yfiles.input.ItemHoverInputMode#addHoveredItemChangedListener corresponding event} in this instance's + * {@link yfiles.input.GraphEditorInputMode#itemHoverInputMode}. + *
  • + *
  • + * {@link yfiles.input.GraphEditorInputMode#shouldInstallCommand} + * Determines which of the built-in {@link yfiles.system.ICommand}s this input mode should + * provide and install. + *
  • + *
+ *

+ * Also this instance can be instructed to automatically {@link yfiles.input.GraphEditorInputMode#adjustContentRect adjust the content rectangle} + * of the CanvasControl whenever the graph is changed using gestures. + * This class contains a number of public methods that can be used to programmatically perform + * the corresponding actions, too. + * Setting the {@link yfiles.input.GraphEditorInputMode#nodeCreator} to another instance or null changes the way nodes are created. + * Also the various minor {@link yfiles.input.IInputMode} instances can be {@link yfiles.input.IConcurrentInputMode#enabled disabled}, + * to change the behavior, too. + *

+ *

+ * To enable single selection mode, disable {@link yfiles.input.MainInputMode#marqueeSelectionInputMode} and + * set {@link yfiles.input.GraphEditorInputMode#multiSelectionRecognizer} to EventRecognizers.create(EventRecognizers.NEVER). + * Remove {@link yfiles.system.ApplicationCommands#SELECT_ALL} and {@link yfiles.input.GraphCommands#TOGGLE_ITEM_SELECTION_COMMAND} + * from {@link yfiles.input.GraphEditorInputMode#availableCommands} and + * {@link yfiles.system.ComponentCommands#EXTEND_SELECTION_LEFT}, {@link yfiles.system.ComponentCommands#EXTEND_SELECTION_RIGHT}, + * {@link yfiles.system.ComponentCommands#EXTEND_SELECTION_UP}, {@link yfiles.system.ComponentCommands#EXTEND_SELECTION_DOWN}, + * {@link yfiles.system.ComponentCommands#SELECT_TO_PAGE_UP} and {@link yfiles.system.ComponentCommands#SELECT_TO_PAGE_DOWN} + * from {@link yfiles.input.GraphEditorInputMode#navigationInputMode}.{@link yfiles.input.NavigationInputMode#availableCommands}. + * An example can be found in demo.yfiles.input.singleselection. + *

+ *
+ * Related Information in the Developers Guide: + *

+ * An overview of this input mode is given + * in the section User Interaction. + * Additionally, specific support for graph hierarchies is discussed in + * Chapter 3, Graph Hierarchies. + *

+ * @see {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} + * @see {@link yfiles.input.GraphEditorInputMode#createBendInputMode} + * @see {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} + * @see {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode} + */ + export interface GraphEditorInputMode extends yfiles.input.MainInputMode{ + /** + * Gets the list of commands that are available in this instance. + * By default, all supported commands are available + *

+ * Removing commands from this collection also removes the command bindings + * registered by this instance. + *

+ *

+ * Add supported commands to make them available in this instance. + *

+ *

+ * Supported commands are + *

    + *
  • {@link yfiles.input.GraphCommands#SELECT_ITEM_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#DESELECT_ITEM_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#TOGGLE_ITEM_SELECTION_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#GROUP_SELECTION_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#ADJUST_GROUP_NODE_SIZE_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#UNGROUP_SELECTION_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#EDIT_LABEL_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#ADD_LABEL_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#DESELECT_ALL_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#REVERSE_EDGE_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#DUPLICATE_COMMAND}
  • + *
  • {@link yfiles.canvas.CanvasControl#UPDATE_CONTENT_RECT_COMMAND}
  • + *
  • {@link yfiles.system.ApplicationCommands#CUT}
  • + *
  • {@link yfiles.system.ApplicationCommands#COPY}
  • + *
  • {@link yfiles.system.ApplicationCommands#PASTE}
  • + *
  • {@link yfiles.system.ApplicationCommands#UNDO}
  • + *
  • {@link yfiles.system.ApplicationCommands#REDO}
  • + *
  • {@link yfiles.system.ApplicationCommands#SELECT_ALL}
  • + *
  • {@link yfiles.system.ApplicationCommands#DEL}
  • + *
+ *

+ */ + availableCommands:yfiles.collections.ICollection; + /** + * Gets or sets the orthogonal edge editing context. + * The default value is null. + * Value: The orthogonal edge editing context. + */ + orthogonalEdgeEditingContext:yfiles.input.OrthogonalEdgeEditingContext; + /** + * Gets or sets a value indicating whether an orthogonal edge should stay + * orthogonal after removing bends. + * By default this feature is turned off. + * @see {@link yfiles.input.GraphEditorInputMode#orthogonalEdgeEditingContext} + */ + orthogonalBendRemoval:boolean; + /** + * Snaps the node to the grid using the {@link yfiles.input.IGridConstraintProvider} for + * {@link yfiles.graph.INode}s queried from the given context. + * This method is called by this instance whenever new nodes are created using the UI. + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.graph.INode} node + * @see {@link yfiles.input.MultiplexingInputMode#createChildInputModeContext} + */ + snapToGrid(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode):void; + /** + * Callback method that will be used by the {@link yfiles.input.MultiplexingInputMode#createChildInputModeContext child context's} {@link yfiles.support.ILookup#lookup} method. + * @param {yfiles.lang.Class} type The type argument passed to {@link yfiles.support.ILookup#lookup}. + * @return {Object} The result of the lookup query, or null. + * @see {@link yfiles.input.MultiplexingInputMode#createChildInputModeContext} + */ + childInputModeContextLookup(type:yfiles.lang.Class):Object; + /** + * Gets or sets the ReparentNodeHandler property. + * This handler will be delegated to by an implementation of the + * {@link yfiles.input.IReparentNodeHandler} interface that this class + * puts into the {@link yfiles.input.GraphEditorInputMode#childInputModeContextLookup}. + * The child input modes will query this interface to perform node reparenting operations + * if the graph is an {@link yfiles.graph.IGroupedGraph}. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphEditorInputMode#createReparentNodeHandler} will be called. + * Upon change the {@link yfiles.input.GraphEditorInputMode#onReparentNodeHandlerChanged} method will be called. + * @see {@link yfiles.input.GraphEditorInputMode#reparentNodesAllowed} + * @see {@link yfiles.input.ReparentNodeHandler} + */ + reparentNodeHandler:yfiles.input.IReparentNodeHandler; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} property value changes + * and after initialization of the field. + * @param {yfiles.input.IReparentNodeHandler} oldReparentNodeHandler the old value, which may be null the first time + * @param {yfiles.input.IReparentNodeHandler} newReparentNodeHandler the new value + */ + onReparentNodeHandlerChanged(oldReparentNodeHandler:yfiles.input.IReparentNodeHandler,newReparentNodeHandler:yfiles.input.IReparentNodeHandler):void; + /** + * Factory method for the ReparentNodeHandler property. This method will be called + * upon first access to the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} property. + * @return {yfiles.input.IReparentNodeHandler} a new instance of {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} + */ + createReparentNodeHandler():yfiles.input.IReparentNodeHandler; + /** + * Gets or sets the HitTestEnumerator property. + * The enumerator will be queried for hit tests if the user clicks on the canvas. + */ + hitTestEnumerator:yfiles.drawing.IHitTestEnumerator; + /** + * Determines which types of + * items should be selected during {@link yfiles.input.GraphEditorInputMode#marqueeSelectElements marquee selections}. + * The default is a combination of + * {@link yfiles.graph.GraphItemTypes#NODE}, + * {@link yfiles.graph.GraphItemTypes#EDGE}, + * and {@link yfiles.graph.GraphItemTypes#BEND}. + * @see {@link yfiles.input.MainInputMode#shouldBeMarqueeSelectable} + * @see {@link yfiles.input.MainInputMode#setSelected} + */ + marqueeSelectableItems:yfiles.graph.GraphItemTypes; + /** + * Determines which types of + * items should be selected after {@link yfiles.input.GraphEditorInputMode#paste} or {@link yfiles.input.GraphEditorInputMode#duplicateSelection}. + * The default is {@link yfiles.graph.GraphItemTypes#ALL}. + * @see {@link yfiles.input.GraphEditorInputMode#shouldBeSelectedAfterPaste} + * @see {@link yfiles.input.GraphEditorInputMode#smartPasteSelection} + * @see {@link yfiles.input.MainInputMode#setSelected} + */ + pasteSelectableItems:yfiles.graph.GraphItemTypes; + /** + * Determines whether nodes, edges, labels, and ports + * should only be selected after {@link yfiles.input.GraphEditorInputMode#paste} or {@link yfiles.input.GraphEditorInputMode#duplicateSelection} + * if they were selected when they were initially copied into the clipboard. + * The default is true. Disabling this feature will select all {@link yfiles.input.GraphEditorInputMode#pasteSelectableItems} + * after a paste or duplicate operation. + * @see {@link yfiles.input.GraphEditorInputMode#shouldBeSelectedAfterPaste} + * @see {@link yfiles.input.GraphEditorInputMode#pasteSelectableItems} + * @see {@link yfiles.input.MainInputMode#setSelected} + */ + smartPasteSelection:boolean; + /** + * Determines which types of + * items should be selectable through {@link yfiles.input.GraphEditorInputMode#onClickInputModeClicked mouse clicks.}. + * The default is {@link yfiles.graph.GraphItemTypes#ALL}. + * @see {@link yfiles.input.GraphEditorInputMode#shouldBeClickSelected} + * @see {@link yfiles.input.MainInputMode#setSelected} + */ + clickSelectableItems:yfiles.graph.GraphItemTypes; + /** + * Determines which types of + * items should be reported through the {@link yfiles.input.GraphEditorInputMode#addItemClickedListener item click events}. + * The default is {@link yfiles.graph.GraphItemTypes#ALL}. + * @see {@link yfiles.input.GraphEditorInputMode#shouldBeClicked} + */ + clickableItems:yfiles.graph.GraphItemTypes; + /** + * Determines which types of + * items should be selectable at all. + * The default is {@link yfiles.graph.GraphItemTypes#ALL}. + * @see {@link yfiles.input.MainInputMode#setSelected} + */ + selectableItems:yfiles.graph.GraphItemTypes; + /** + * Determines which types of + * items should be movable using the {@link yfiles.input.MoveInputMode} + * or {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} respectively in case of labels. + * The default is {@link yfiles.graph.GraphItemTypes#ALL}. + * @see {@link yfiles.input.GraphEditorInputMode#shouldBeMovable} + */ + movableItems:yfiles.graph.GraphItemTypes; + /** + * Determines which types of + * items may be deleted using the {@link yfiles.input.GraphEditorInputMode#deleteSelection} action. + * The default is {@link yfiles.graph.GraphItemTypes#ALL}. + * @see {@link yfiles.input.GraphEditorInputMode#shouldBeDeleted} + */ + deletableItems:yfiles.graph.GraphItemTypes; + /** + * Determines which types of + * items may have their {@link yfiles.input.GraphEditorInputMode#onEditLabel labels edited}. + * The default is {@link yfiles.graph.GraphItemTypes#LABELED_ITEM}|{@link yfiles.graph.GraphItemTypes#LABEL}, + * which allows for editing the labels of {@link yfiles.graph.ILabeledItem}s, and existing {@link yfiles.graph.ILabel}s. + * @see {@link yfiles.input.GraphEditorInputMode#shouldLabelBeEdited} + */ + labelEditableItems:yfiles.graph.GraphItemTypes; + /** + * Determines which types of + * items should have their {@link yfiles.input.IHandle}s + * shown. + * The default is {@link yfiles.graph.GraphItemTypes#ALL}. + * @see {@link yfiles.input.GraphEditorInputMode#shouldShowHandles} + */ + showHandleItems:yfiles.graph.GraphItemTypes; + /** + * Called when the {@link yfiles.input.MainInputMode#handleInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.HandleInputMode} oldHandleInputMode the old value, which may be null the first time + * @param {yfiles.input.HandleInputMode} newHandleInputMode the new value + */ + onHandleInputModeChanged(oldHandleInputMode:yfiles.input.HandleInputMode,newHandleInputMode:yfiles.input.HandleInputMode):void; + /** + * Called when the keyboard input mode changed. + * @param {yfiles.input.KeyboardInputMode} oldKeyboardInputMode The old keyboard input mode. + * @param {yfiles.input.KeyboardInputMode} newKeyboardInputMode The new keyboard input mode. + */ + onKeyboardInputModeChanged(oldKeyboardInputMode:yfiles.input.KeyboardInputMode,newKeyboardInputMode:yfiles.input.KeyboardInputMode):void; + /** + * Callback method that is used by {@link yfiles.input.GraphEditorInputMode#onKeyboardInputModeChanged} + * to determine which of the built-in {@link yfiles.system.ICommand}s to install. + * This implementation unconditionally returns true, subclasses + * may override this method to adjust the behavior. + * @param {yfiles.system.ICommand} command The command to install. + * @return {boolean} Whether to install this command. + */ + shouldInstallCommand(command:yfiles.system.ICommand):boolean; + /** + * Predicate that determines whether a label may be added interactively to item. + * This is overridden if the item has a {@link yfiles.input.IEditLabelHelper} that returns false for its {@link yfiles.input.IEditLabelHelper#addLabel} + * method. + * @param {yfiles.model.IModelItem} item The item to query + * @return {boolean} true iff a label may be added + */ + shouldLabelBeAdded(item:yfiles.model.IModelItem):boolean; + /** + * Gets or sets a value indicating whether to use the {@link yfiles.canvas.GraphControl#currentItem} + * as a fallback for the commands if no item is provided in the parameter and the current selection + * is empty. + * This applies to the following commands: + *
    + *
  • {@link yfiles.input.GraphCommands#ADD_LABEL_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#EDIT_LABEL_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#ADJUST_GROUP_NODE_SIZE_COMMAND}
  • + *
+ * Value: + * true if the current item should be used as a fallback; otherwise, false, which is the default. + */ + useCurrentItemForCommands:boolean; + /** + * {@link yfiles.graph.GroupedGraphExtensions#adjustGroupNodeBounds Adjusts the size} of the selected group nodes. + * @see {@link yfiles.input.GraphEditorInputMode#adjustGroupNodeSize} + * @see {@link yfiles.input.GraphCommands#ADJUST_GROUP_NODE_SIZE_COMMAND} + */ + adjustGroupNodeSizes():void; + /** + * {@link yfiles.graph.GroupedGraphExtensions#adjustGroupNodeBounds Adjusts the size} of the group nodes in the enumerable. + * This action is executed in response to the {@link yfiles.input.GraphCommands#ADJUST_GROUP_NODE_SIZE_COMMAND} + * if {@link yfiles.input.GraphEditorInputMode#adjustGroupNodeSizeAllowed} is set to true. + * @param {yfiles.collections.IEnumerable.} nodes The nodes to adjust their sizes. + */ + adjustGroupNodeSize(nodes:yfiles.collections.IEnumerable):void; + /** + * Pastes the current clipboard contents. + * @see {@link yfiles.input.GraphEditorInputMode#pasteAtLocation} + */ + paste():void; + /** + * Pastes the current clipboard contents at the given location. + * The location is at the center of the bounds of the items that are pasted. + * This method reconfigures {@link yfiles.graph.GraphClipboard#pasteDelta} + * and calls {@link yfiles.input.GraphEditorInputMode#paste}. + * @param {yfiles.geometry.PointD} location The location at which the center of the clipboard's contents should be positioned. + */ + pasteAtLocation(location:yfiles.geometry.PointD):void; + /** + * Duplicates the selected elements. + */ + duplicateSelection():void; + /** + * The offset for paste operation if clipboard operations are enabled. + * Default is (15, 15). + */ + pasteDelta:yfiles.geometry.PointD; + /** + * Cuts and inserts the currently selected elements to the clipboard. + */ + cut():void; + /** + * Copies the currently selected elements to the clipboard. + */ + copy():void; + /** + * Delegates to the {@link yfiles.input.GraphEditorInputMode#graph}'s {@link yfiles.support.UndoEngine}'s + * {@link yfiles.support.UndoEngine#undo} method. + */ + undo():void; + /** + * Delegates to the {@link yfiles.input.GraphEditorInputMode#graph}'s {@link yfiles.support.UndoEngine}'s + * {@link yfiles.support.UndoEngine#redo} method. + */ + redo():void; + /** + * Makes each of the currently selected nodes a direct child of the root group (if not already). + * This implementation will delegate the actual re-parenting of nodes to the {@link yfiles.input.GraphEditorInputMode#graph}'s + * {@link yfiles.graph.IGroupedGraph}'s {@link yfiles.graph.IGroupedGraph#setParent} implementation + * found in the {@link yfiles.support.ILookup#lookup} of the graph. + * By default, this method will be called in response to a Ctrl-U-key press recognized + * by {@link yfiles.input.MainInputMode#keyboardInputMode}. + */ + ungroupSelection():void; + /** + * Creates a new group for all of the currently selected elements. + * This implementation will delegate the actual creation of the group to the {@link yfiles.input.GraphEditorInputMode#graph}'s + * {@link yfiles.graph.IGroupedGraph}'s {@link yfiles.graph.GroupedGraphExtensions#groupNodes} implementation + * found in the {@link yfiles.support.ILookup#lookup} of the graph. + * By default, this method will be called in response to a Ctrl-G-key press recognized + * by {@link yfiles.input.MainInputMode#keyboardInputMode}. + * This method will also clear the selection and select the newly created group node. + * @return {yfiles.graph.INode} The newly created group node or null. + * @see {@link yfiles.input.MainInputMode#clearSelection} + * @see {@link yfiles.input.MainInputMode#setSelected} + */ + groupSelection():yfiles.graph.INode; + /** + * Clears the current selection and selects all nodes and bends in this graph. + * By default, this method will be called in response to a Ctrl+A key press recognized + * by {@link yfiles.input.MainInputMode#keyboardInputMode}. + * @see {@link yfiles.input.MainInputMode#clearSelection} + * @see {@link yfiles.input.MainInputMode#setSelected} + * @see {@link yfiles.system.ApplicationCommands#SELECT_ALL} + * @see {@link yfiles.input.GraphEditorInputMode#selectableItems} + * @see {@link yfiles.input.GraphEditorInputMode#voidStylesIgnored} + */ + selectAll():void; + /** + * Gets or sets the LabelEditingAllowed property that determines whether the label editor + * will be automatically invoked if the F2 key is pressed. + * If this flag is set to true pressing F2 will start the label editor. + * By default this feature is enabled. + * @see {@link yfiles.input.GraphEditorInputMode#editLabel} + * @see {@link yfiles.input.GraphEditorInputMode#onEditLabel} + */ + labelEditingAllowed:boolean; + /** + * Gets or sets a property that determines whether the label editor + * will be automatically invoked if a labelled item or label is double-clicked. + * If this flag is set to true double clicking an item will automatically trigger the {@link yfiles.input.GraphCommands#EDIT_LABEL_COMMAND}. + * By default this feature is enabled. + * Setting {@link yfiles.input.GraphEditorInputMode#labelEditingAllowed} to false effectively disables this feature in the default + * configuration. + * @see {@link yfiles.input.GraphEditorInputMode#labelEditingAllowed} + */ + doubleClickLabelEditingAllowed:boolean; + /** + * Gets or sets the LabelAddingAllowed property that determines whether the label editor + * will be automatically invoked if the Shift+F2 key is pressed. + * If this flag is set to true pressing Shift+F2 will start the label editor. + * By default this feature is enabled. + * @see {@link yfiles.input.GraphEditorInputMode#createLabel} + */ + labelAddingAllowed:boolean; + /** + * Callback that is invoked if the F2 key is pressed and {@link yfiles.input.GraphEditorInputMode#labelEditingAllowed} is + * set to true. + * This method determines the label to edit and delegates to either {@link yfiles.input.GraphEditorInputMode#editLabel} + * or {@link yfiles.input.GraphEditorInputMode#createLabel} if no label could be found. + */ + onEditLabel():boolean; + /** + * Callback that is invoked if the shift+F2 key is pressed and {@link yfiles.input.GraphEditorInputMode#labelAddingAllowed} is + * set to true. + * This method determines the label owner to add to and delegates to {@link yfiles.input.GraphEditorInputMode#createLabel}. + */ + onAddLabel():boolean; + /** + * Interactively creates a new label for the provided labeled item. + * This method will invoke the text editor that will let the user edit the text of the label. + * If the user commits the label text the label will be added to the labeled item. + * The text that the user enters may be {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener validated} before the label is actually added. + * @param {yfiles.graph.ILabeledItem} labeledItem The item to create a new label for. + * @return {yfiles.support.Future.} + * A future of the label that will be notified of the newly created label or a null if the creation was canceled. + */ + createLabel(labeledItem:yfiles.graph.ILabeledItem):yfiles.support.Future; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelAddedListener LabelAdded} event. + * @param {yfiles.model.ItemEventArgs.} args The {@link yfiles.model.ItemEventArgs} instance that contains the {@link yfiles.graph.ILabel} that + * has been added. + */ + onLabelAdded(args:yfiles.model.ItemEventArgs):void; + /** + * Occurs when this mode has triggered the addition of an {@link yfiles.graph.ILabel}, e.g. in response to {@link yfiles.input.GraphEditorInputMode#createLabel}. + */ + addLabelAddedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Occurs when this mode has triggered the addition of an {@link yfiles.graph.ILabel}, e.g. in response to {@link yfiles.input.GraphEditorInputMode#createLabel}. + */ + removeLabelAddedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Callback method to create a custom label configuration when a new label should be created. + * @param {yfiles.graph.ILabeledItem} labeledItem The item to create a label for. + * @param {yfiles.graph.ILabelModelParameter} param The model parameter to use for the creation. + * @param {yfiles.drawing.ILabelStyle} style The style to use for the created label. + * @param {yfiles.geometry.SizeD} preferredSize The preferred size to use. May be null to indicate that the size + * should be determined automatically after the creation of the label. + */ + createDefaultLabelConfiguration(labeledItem:yfiles.graph.ILabeledItem,param:{value:yfiles.graph.ILabelModelParameter;},style:{value:yfiles.drawing.ILabelStyle;},preferredSize:{value:yfiles.geometry.SizeD;}):void; + /** + * Triggers the editing of the given label. + * This implementation uses the {@link yfiles.input.TextEditorInputMode} + * to display an editor to edit the label. + * The text that the user enters may be {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener validated} before the label is actually edited. + * @see {@link yfiles.input.GraphEditorInputMode#onLabelTextEdited} + * @param {yfiles.graph.ILabel} label The label to edit. + */ + editLabel(label:yfiles.graph.ILabel):void; + /** + * Event that is raised when the actual label editing process is about to start. + * This allows to customize the actual label editing process further. + * @see {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener ValidateLabelText} + */ + addLabelTextEditingStartedListener(value:(sender:Object,e:yfiles.graph.LabelEventArgs)=> void):void; + /** + * Event that is raised when the actual label editing process is about to start. + * This allows to customize the actual label editing process further. + * @see {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener ValidateLabelText} + */ + removeLabelTextEditingStartedListener(value:(sender:Object,e:yfiles.graph.LabelEventArgs)=> void):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelTextEditingStartedListener LabelTextEditingStarted} event. + * @param {yfiles.graph.LabelEventArgs} args The {@link yfiles.graph.LabelEventArgs} instance containing the event data. + */ + onLabelTextEditingStarted(args:yfiles.graph.LabelEventArgs):void; + /** + * Event that is raised when the actual label editing process is canceled. + * This allows to unconfigure temporary customizations for the actual label editing process. + * @see {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener ValidateLabelText} + */ + addLabelTextEditingCanceledListener(value:(sender:Object,e:yfiles.graph.LabelEventArgs)=> void):void; + /** + * Event that is raised when the actual label editing process is canceled. + * This allows to unconfigure temporary customizations for the actual label editing process. + * @see {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener ValidateLabelText} + */ + removeLabelTextEditingCanceledListener(value:(sender:Object,e:yfiles.graph.LabelEventArgs)=> void):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelTextEditingCanceledListener LabelTextEditingCanceled} event. + * @param {yfiles.graph.LabelEventArgs} args The {@link yfiles.graph.LabelEventArgs} instance containing the event data. + */ + onLabelTextEditingCanceled(args:yfiles.graph.LabelEventArgs):void; + /** + * Called when the text of a label has been {@link yfiles.input.GraphEditorInputMode#editLabel edited}. + * This method {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener validates the label text} and + * if successful calls {@link yfiles.input.GraphEditorInputMode#setLabelText}. + * @param {yfiles.graph.ILabel} label The label that was edited. + * @param {string} text The new text. + */ + onLabelTextEdited(label:yfiles.graph.ILabel,text:string):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener ValidateLabelText} event. + * @param {yfiles.input.LabelTextValidatingEventArgs} args The {@link yfiles.input.LabelTextValidatingEventArgs} instance containing the event data. + */ + onValidateLabelText(args:yfiles.input.LabelTextValidatingEventArgs):void; + /** + * Event that can be used to validate the label text for a label that is about to be {@link yfiles.input.GraphEditorInputMode#addLabel added} + * or {@link yfiles.input.GraphEditorInputMode#editLabel edited}. + * Note that in the case of {@link yfiles.input.GraphEditorInputMode#addLabel} the {@link yfiles.input.LabelTextValidatingEventArgs#label} is not part + * of the current graph but only a dummy instance. + * @see {@link yfiles.input.GraphEditorInputMode#onValidateLabelText} + */ + addValidateLabelTextListener(value:(sender:Object,e:yfiles.input.LabelTextValidatingEventArgs)=> void):void; + /** + * Event that can be used to validate the label text for a label that is about to be {@link yfiles.input.GraphEditorInputMode#addLabel added} + * or {@link yfiles.input.GraphEditorInputMode#editLabel edited}. + * Note that in the case of {@link yfiles.input.GraphEditorInputMode#addLabel} the {@link yfiles.input.LabelTextValidatingEventArgs#label} is not part + * of the current graph but only a dummy instance. + * @see {@link yfiles.input.GraphEditorInputMode#onValidateLabelText} + */ + removeValidateLabelTextListener(value:(sender:Object,e:yfiles.input.LabelTextValidatingEventArgs)=> void):void; + /** + * Adds a new label to the given item interactively. + * This will activate the {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} to let the user interactively enter the label's + * text and unless the user cancels label creation the returned {@link yfiles.support.Future} will + * contain the label. + * The text that the user enters may be {@link yfiles.input.GraphEditorInputMode#addValidateLabelTextListener validated} before the label is actually added. + * @param {yfiles.graph.ILabeledItem} item The item. + * @return {yfiles.support.Future.} + * A future of the label that will be notified of the newly created label or a null if the creation was canceled. + */ + addLabel(item:yfiles.graph.ILabeledItem):yfiles.support.Future; + /** + * Closes the label editor if it is currently open. + * @param {boolean} cancel Whether to cancel the editor and discard changes. + */ + closeLabelEditor(cancel:boolean):void; + /** + * Callback that is used by this instance to {@link yfiles.input.NavigationInputMode#setCurrentItem set the current item} + * on the {@link yfiles.canvas.GraphControl#currentItem}. + * @param {yfiles.model.IModelItem} currentItem The item to set as the new "current" item. + */ + setCurrentItem(currentItem:yfiles.model.IModelItem):void; + /** + * Sets the label's text after it has been {@link yfiles.input.GraphEditorInputMode#editLabel edited}. + * Depending on {@link yfiles.input.GraphEditorInputMode#autoRemoveEmptyLabels} it will + * either set the label's text or remove it from the graph. + * Also this method will query the label's {@link yfiles.graph.ILabel#owner} + * for an {@link yfiles.input.ISizeConstraintProvider} if the owner is + * an {@link yfiles.graph.INode} and will make sure that the size constraints + * are still kept if the {@link yfiles.graph.ILabel#preferredSize} + * changes due to the edit by calling {@link yfiles.input.GraphEditorInputMode#adjustToSizeConstraints}. + * @param {yfiles.graph.ILabel} label The label to set the text or remove. + * @param {string} text The new text. + */ + setLabelText(label:yfiles.graph.ILabel,text:string):void; + /** + * Occurs when this mode has triggered the edit of an {@link yfiles.graph.ILabel}, e.g. in response to {@link yfiles.input.GraphEditorInputMode#editLabel}. + */ + addLabelTextChangedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Occurs when this mode has triggered the edit of an {@link yfiles.graph.ILabel}, e.g. in response to {@link yfiles.input.GraphEditorInputMode#editLabel}. + */ + removeLabelTextChangedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addLabelTextChangedListener LabelTextChanged} event. + * @param {yfiles.model.ItemEventArgs.} args The {@link yfiles.model.ItemEventArgs} instance that contains the {@link yfiles.graph.ILabel} that + * has changed the text. + */ + onLabelTextChanged(args:yfiles.model.ItemEventArgs):void; + /** + * Adjusts the node's {@link yfiles.graph.INode#layout} + * to adhere to possible {@link yfiles.input.ISizeConstraintProvider size constraints}. + * This method will use the {@link yfiles.input.ISizeConstraintProvider} + * for {@link yfiles.graph.INode} that can be found in their {@link yfiles.support.ILookup} + * to make sure they are still valid. The actual work of this method will be delegated to + * {@link yfiles.input.GraphEditorInputMode#setNodeBounds}. + * @param {yfiles.graph.INode} node The node to possibly adjust the size of. + */ + adjustToSizeConstraints(node:yfiles.graph.INode):void; + /** + * Updates the bounds of the node. + * This method differs from a simple call to {@link yfiles.graph.IGraph#setBounds} in a number of ways: + *
    + *
  • An undo unit is enqueued.
  • + *
  • + * The node is reshaped interactively using the {@link yfiles.input.IReshapeHandler} implementation found in its + * lookup. This enables correctly adjusting e.g. affected orthogonal edges and parent group nodes. + *
  • + *
  • {@link yfiles.input.GraphEditorInputMode#adjustContentRect} is called.
  • + *
+ * @param {yfiles.graph.INode} node The node to reshape. + * @param {yfiles.geometry.RectD} newBounds The new bounds. + */ + setNodeBounds(node:yfiles.graph.INode,newBounds:yfiles.geometry.RectD):void; + /** + * This method deletes the currently selected elements. + * If the {@link yfiles.input.MainInputMode#selectionModel} is non-empty + * this implementation triggers the {@link yfiles.input.GraphEditorInputMode#addDeletingSelectionListener DeletingSelection} event, possibly a number of {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} events, and + * a final {@link yfiles.input.GraphEditorInputMode#deleteSelection} event. + * Note that {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} will not be called for items that are removed implicitly, e.g. if the event is triggered for a node, + * its labels, ports, and adjacent edges will not be reported separately. + * @see {@link yfiles.input.GraphEditorInputMode#addDeletingSelectionListener DeletingSelection} + * @see {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} + * @see {@link yfiles.input.GraphEditorInputMode#addDeletedSelectionListener DeletedSelection} + */ + deleteSelection():void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addDeletingSelectionListener DeletingSelection} event. + * @param {yfiles.input.InputModeEventArgs} args The {@link yfiles.input.InputModeEventArgs} instance containing the event data. + */ + onDeletingSelection(args:yfiles.input.InputModeEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} event. + * @param {yfiles.model.ItemEventArgs.} args The instance containing the event data. + */ + onDeletedItem(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addDeletedSelectionListener DeletedSelection} event. + * @param {yfiles.input.InputModeEventArgs} args The {@link yfiles.input.InputModeEventArgs} instance containing the event data. + */ + onDeletedSelection(args:yfiles.input.InputModeEventArgs):void; + /** + * Occurs just before the {@link yfiles.input.GraphEditorInputMode#deleteSelection} method starts its work and will be followed + * by any number of {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} events and finalized by a {@link yfiles.input.GraphEditorInputMode#addDeletedSelectionListener DeletedSelection} event. + * @see {@link yfiles.input.GraphEditorInputMode#deleteSelection} + */ + addDeletingSelectionListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.input.GraphEditorInputMode#deleteSelection} method starts its work and will be followed + * by any number of {@link yfiles.input.GraphEditorInputMode#addDeletedItemListener DeletedItem} events and finalized by a {@link yfiles.input.GraphEditorInputMode#addDeletedSelectionListener DeletedSelection} event. + * @see {@link yfiles.input.GraphEditorInputMode#deleteSelection} + */ + removeDeletingSelectionListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Occurs when an item has been deleted interactively by this mode. + * Note that this event will not be triggered for items that are removed implicitly, e.g. if the event is triggered for a node, + * its labels, ports, and adjacent edges will not necessarily be reported separately. + * In order to be notified of any removal events, the {@link yfiles.graph.IGraph} events should be used instead. + */ + addDeletedItemListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Occurs when an item has been deleted interactively by this mode. + * Note that this event will not be triggered for items that are removed implicitly, e.g. if the event is triggered for a node, + * its labels, ports, and adjacent edges will not necessarily be reported separately. + * In order to be notified of any removal events, the {@link yfiles.graph.IGraph} events should be used instead. + */ + removeDeletedItemListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.input.GraphEditorInputMode#deleteSelection} method has deleted the selection after all selected items have been removed. + * @see {@link yfiles.input.GraphEditorInputMode#deleteSelection} + */ + addDeletedSelectionListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.input.GraphEditorInputMode#deleteSelection} method has deleted the selection after all selected items have been removed. + * @see {@link yfiles.input.GraphEditorInputMode#deleteSelection} + */ + removeDeletedSelectionListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Callback method that determines whether the given item should be + * deleted during {@link yfiles.input.GraphEditorInputMode#deleteSelection}. + * @param {yfiles.model.IModelItem} item The item. + * @return {boolean} Whether to delete that item. + */ + shouldBeDeleted(item:yfiles.model.IModelItem):boolean; + /** + * Callback method that determines whether the label or the labels of the + * provided item should be edited in response to + * {@link yfiles.input.GraphEditorInputMode#onEditLabel} or {@link yfiles.input.GraphEditorInputMode#onAddLabel}. + * @param {yfiles.model.IModelItem} item The item. + * @return {boolean} Whether to edit the label or the labels for that item. + */ + shouldLabelBeEdited(item:yfiles.model.IModelItem):boolean; + /** + * Called when the {@link yfiles.input.MainInputMode#moveInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.MoveInputMode} oldMoveInputMode the old value, which may be null the first time + * @param {yfiles.input.MoveInputMode} newMoveInputMode the new value + */ + onMoveInputModeChanged(oldMoveInputMode:yfiles.input.MoveInputMode,newMoveInputMode:yfiles.input.MoveInputMode):void; + /** + * Helper method that can be used to create a {@link yfiles.input.MoveInputMode} + * instance that can be used to move unselected model items. + * In order to use this mode, the created instance should be installed in a {@link yfiles.input.MainInputMode} + * like this but using a smaller {@link yfiles.input.MultiplexingInputMode#addConcurrentWithPriority priority} + * value than the {@link yfiles.input.MainInputMode#moveModePriority priority of the mode that is installed by default.} + * @param {yfiles.input.IEventRecognizer} modifierRecognizer Use this instance to make this mode work under certain conditions only. null + * for default behavior, one of the {@link yfiles.input.KeyEvents} constants, e.g. for alternate behavior. + * @return {yfiles.input.MoveInputMode} A {@link yfiles.input.MainInputMode#moveInputMode} instance that uses the {@link yfiles.input.IPositionHandler} instances of + * the items that are hit at the position of the cursor, regardless of their selection state. + */ + createMoveUnselectedInputMode(modifierRecognizer:yfiles.input.IEventRecognizer):yfiles.input.MoveInputMode; + /** + * Gets or sets a property that determines whether this instance should + * automatically adjust the {@link yfiles.canvas.CanvasControl#contentRect} + * if the graph changes. + * The {@link yfiles.input.GraphEditorInputMode#adjustContentRect} method is called whenever the content. + * The default is {@link yfiles.input.AdjustContentRectPolicy#UNION}. + */ + adjustContentRectPolicy:yfiles.input.AdjustContentRectPolicy; + /** + * Updates the {@link yfiles.canvas.CanvasControl#contentRect} using + * {@link yfiles.canvas.CanvasControl#updateContentRect} and + * {@link yfiles.input.GraphEditorInputMode#contentRectMargins}. + * This method is called whenever the content changes + * and takes the {@link yfiles.input.GraphEditorInputMode#adjustContentRectPolicy} into account. + */ + adjustContentRect():void; + /** + * Gets or sets the margins to use for {@link yfiles.canvas.CanvasControl#updateContentRectWithMargins} + * in {@link yfiles.input.GraphEditorInputMode#adjustContentRect} calls. + */ + contentRectMargins:yfiles.geometry.InsetsD; + /** + * Creates the {@link yfiles.model.InputModeController} that will + * be used to coordinate the selection and the handles, etc. + * The input mode controller is an helper object that collects {@link yfiles.input.IHandle}s, + * provides meta-{@link yfiles.geometry.IMovable}, {@link yfiles.geometry.IReshapeable}, and + * {@link yfiles.drawing.IHitTestable} instances that depend on the current + * selection and collection model. + * @return {yfiles.model.InputModeController.} + * An instance of {@link yfiles.input.GraphInputModeController} + * @see Overrides {@link yfiles.input.MainInputMode#createInputModeController} + */ + createInputModeController():yfiles.model.InputModeController; + /** + * Returns the {@link yfiles.input.MainInputMode#selectionModel} + * as an {@link yfiles.graph.IGraphSelection}. + */ + graphSelection:yfiles.graph.IGraphSelection; + /** + * Gets the Graph this mode is acting upon. + */ + graph:yfiles.graph.IGraph; + /** + * Gets the GraphControl this mode is working on or null. + * This property is set by {@link yfiles.input.GraphEditorInputMode#setGraphControl} which is + * triggered if this mode is {@link yfiles.input.GraphEditorInputMode#install}ed in + * a {@link yfiles.input.GraphEditorInputMode#graphControl}. + */ + graphControl:yfiles.canvas.GraphControl; + /** + * Sets the {@link yfiles.input.GraphEditorInputMode#graphControl} that is associated + * with this instance. + * This will register a listener for the {@link yfiles.canvas.GraphControl#addGraphChangedListener GraphChanged} + * and {@link yfiles.canvas.GraphControl#addSelectionChangedListener SelectionChanged} event + * to update the {@link yfiles.input.GraphEditorInputMode#graph} and {@link yfiles.input.GraphEditorInputMode#graphSelection} + * property accordingly. + * @param {yfiles.canvas.GraphControl} graphControl The control to set. + * @see {@link yfiles.input.GraphEditorInputMode#onGraphChanged} + * @see {@link yfiles.input.GraphEditorInputMode#onGraphSelectionChanged} + */ + setGraphControl(graphControl:yfiles.canvas.GraphControl):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#graphControl} property changes. + * This code will {@link yfiles.input.GraphEditorInputMode#setGraphCore update the graph reference} + * and the {@link yfiles.input.GraphEditorInputMode#setGraphSelection selection reference} from the + * graph control. + *

+ * This will update the internal state of the modes. + *

+ * @param {yfiles.canvas.GraphControl} oldControl The old control. + * @param {yfiles.canvas.GraphControl} newControl The new control. + * @see {@link yfiles.input.GraphEditorInputMode#setGraphControl} + */ + onGraphControlChanged(oldControl:yfiles.canvas.GraphControl,newControl:yfiles.canvas.GraphControl):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#graphSelection} property changes. + * This will update the internal state of the modes. + * @param {yfiles.graph.IGraphSelection} oldSelection The old selection instance. + * @param {yfiles.graph.IGraphSelection} newSelection The new selection instance. + */ + onGraphSelectionChanged(oldSelection:yfiles.graph.IGraphSelection,newSelection:yfiles.graph.IGraphSelection):void; + /** + * Set a new {@link yfiles.graph.IGraphSelection} for this mode. + * Triggers {@link yfiles.input.GraphEditorInputMode#onGraphSelectionChanged}. + * @param {yfiles.graph.IGraphSelection} newSelection The new selection. + */ + setGraphSelection(newSelection:yfiles.graph.IGraphSelection):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#graph} property changes. + * This will update the internal state of the modes. + * @param {yfiles.graph.IGraph} oldGraph The old graph instance. + * @param {yfiles.graph.IGraph} newGraph The new graph instance. + */ + onGraphChanged(oldGraph:yfiles.graph.IGraph,newGraph:yfiles.graph.IGraph):void; + /** + * Set a new Graph for this mode. + * Triggers {@link yfiles.input.GraphEditorInputMode#onGraphChanged}. + * @param {yfiles.graph.IGraph} newGraph The new selection. + */ + setGraphCore(newGraph:yfiles.graph.IGraph):void; + /** + * Installs this mode into the provided context. + * Calls {@link yfiles.input.GraphEditorInputMode#setGraphControl} if the context's {@link yfiles.input.IInputModeContext#canvasControl} + * is a {@link yfiles.input.GraphEditorInputMode#graphControl}. Otherwise tries to {@link yfiles.input.GraphEditorInputMode#setGraphCore set the graph} + * and the {@link yfiles.input.GraphEditorInputMode#setGraphSelection selection} as obtained from the {@link yfiles.support.ILookup#lookup context's lookup.} + * @param {yfiles.input.IInputModeContext} context The context to install this mode in and retrieve the graph and selection instance from. + * @see Overrides {@link yfiles.input.MainInputMode#install} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Called when the {@link yfiles.input.AbstractConcurrentInputMode#enabled} property changes to false. + * This implementation sets the {@link yfiles.input.AbstractConcurrentInputMode#preferredCursor} property to null + * and {@link yfiles.input.AbstractConcurrentInputMode#releaseMutex releases} the mutex if the mutex is currently owned + * by this instance. + */ + onDisabled():void; + /** + * Called when the {@link yfiles.input.AbstractConcurrentInputMode#enabled} property changes to true. + * This implementation does nothing. + */ + onEnabled():void; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Gets the {@link yfiles.input.GraphInputModeController} + * that is used by this instance. + * This is a convenience method that casts the current {@link yfiles.input.MainInputMode#inputModeController} + * to a GraphInputModeController. + */ + graphInputModeController:yfiles.input.GraphInputModeController; + /** + * The {@link yfiles.input.LabelSnapContext} instance that handles interactive snapping of {@link yfiles.graph.ILabel}s + * to their owner during drag operations like movements. + * Setting this property to {@link yfiles.input.SnapContext#VOID_INSTANCE} will disable snapping, whereas setting it + * to null will make the child modes use the context from their {@link yfiles.input.IInputModeContext}s, if + * available. Upon change the {@link yfiles.input.GraphEditorInputMode#onLabelSnapContextChanged} method is called, which will as a side effect + * configure the snap context to display the {@link yfiles.input.SnapResult}s in the {@link yfiles.canvas.CanvasControl}. Default is + * null. + */ + labelSnapContext:yfiles.input.SnapContext; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#labelSnapContext} property context changed. + * @param {yfiles.input.SnapContext} oldLabelSnapContext The old snap context. + * @param {yfiles.input.SnapContext} newLabelSnapContext The new snap context. + */ + onLabelSnapContextChanged(oldLabelSnapContext:yfiles.input.SnapContext,newLabelSnapContext:yfiles.input.SnapContext):void; + /** + * Gets or sets the MoveLabelInputMode property. + * This mode is responsible for moving labels to another candidate position. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphEditorInputMode#createMoveLabelInputMode} will be called. + * Upon change the {@link yfiles.input.GraphEditorInputMode#onMoveLabelInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + * @see {@link yfiles.input.GraphEditorInputMode#shouldBeMovable} + */ + moveLabelInputMode:yfiles.input.MoveLabelInputMode; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.MoveLabelInputMode} oldMoveLabelInputMode the old value, which may be null the first time + * @param {yfiles.input.MoveLabelInputMode} newMoveLabelInputMode the new value + */ + onMoveLabelInputModeChanged(oldMoveLabelInputMode:yfiles.input.MoveLabelInputMode,newMoveLabelInputMode:yfiles.input.MoveLabelInputMode):void; + /** + * Factory method for the {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} property. + * This method will be called + * upon first access to the {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} property. + * @return {yfiles.input.MoveLabelInputMode} a new instance of {@link yfiles.input.MoveLabelInputMode} + */ + createMoveLabelInputMode():yfiles.input.MoveLabelInputMode; + /** + * Gets or sets the NavigationInputMode property. + * This mode is responsible for navigating and traversing the elements in the {@link yfiles.graph.IGraph}. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphEditorInputMode#createNavigationInputMode} will be called. + * Upon change the {@link yfiles.input.GraphEditorInputMode#onNavigationInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + navigationInputMode:yfiles.input.NavigationInputMode; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#navigationInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.NavigationInputMode} oldNavigationInputMode the old value, which may be null the first time + * @param {yfiles.input.NavigationInputMode} newNavigationInputMode the new value + */ + onNavigationInputModeChanged(oldNavigationInputMode:yfiles.input.NavigationInputMode,newNavigationInputMode:yfiles.input.NavigationInputMode):void; + /** + * Factory method for the NavigationInputMode property. + * This method will be called + * upon first access to the {@link yfiles.input.GraphEditorInputMode#navigationInputMode} property. + * @return {yfiles.input.NavigationInputMode} a new instance of NavigationInputMode + */ + createNavigationInputMode():yfiles.input.NavigationInputMode; + /** + * This method will marquee select the items in the graph. + * @param {yfiles.geometry.RectD} marqueeRectangle The selection rectangle + * @see Overrides {@link yfiles.input.MainInputMode#marqueeSelectElements} + */ + marqueeSelectElements(marqueeRectangle:yfiles.geometry.RectD):void; + /** + * Overridden to take {@link yfiles.input.GraphEditorInputMode#marqueeSelectableItems} and {@link yfiles.input.GraphEditorInputMode#shouldSelect} into account. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether to possibly marquee select the item. + * @see Overrides {@link yfiles.input.MainInputMode#shouldBeMarqueeSelectable} + */ + shouldBeMarqueeSelectable(item:yfiles.model.IModelItem):boolean; + /** + * Can be overridden to determine which items should be selected after {@link yfiles.input.GraphEditorInputMode#paste} or {@link yfiles.input.GraphEditorInputMode#duplicateSelection}. + * This implementation returns true for the {@link yfiles.input.GraphEditorInputMode#pasteSelectableItems} items. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether to select the item after {@link yfiles.input.GraphEditorInputMode#paste} or {@link yfiles.input.GraphEditorInputMode#duplicateSelection}. + */ + shouldBeSelectedAfterPaste(item:yfiles.model.IModelItem):boolean; + /** + * Determines whether Ctrl-G-presses should result in calls to {@link yfiles.input.GraphEditorInputMode#groupSelection}. + * By default, this feature is enabled. + */ + groupSelectionAllowed:boolean; + /** + * Determines whether Ctrl-Shift-G-presses should result in calls to {@link yfiles.input.GraphEditorInputMode#adjustGroupNodeSize}. + * By default, this feature is enabled. + */ + adjustGroupNodeSizeAllowed:boolean; + /** + * Determines whether Ctrl-U-presses should result in calls to {@link yfiles.input.GraphEditorInputMode#ungroupSelection}. + * By default, this feature is enabled. + */ + ungroupSelectionAllowed:boolean; + /** + * Gets or sets a property that determines whether pressing Ctrl-D + * triggers a call to {@link yfiles.input.MainInputMode#clearSelection}. + * By default this feature is enabled. + */ + clearSelectionAllowed:boolean; + /** + * Gets or sets a property that determines whether clipboard operations with the usual shortcuts are enabled on the canvas. + * Default value is true + */ + clipboardOperationsAllowed:boolean; + /** + * Determines whether pasting with the usual shortcut is enabled on the canvas. + * To be able to paste, both this property and {@link yfiles.input.GraphEditorInputMode#clipboardOperationsAllowed} must be true. Default value is true + */ + pasteAllowed:boolean; + /** + * Determines whether duplicating selected items with the usual shortcut is enabled on the canvas. + * To be able to duplicate items, both this property and {@link yfiles.input.GraphEditorInputMode#clipboardOperationsAllowed} must be true. Default value is true + */ + duplicateAllowed:boolean; + /** + * Gets or sets a property that determines whether undo/redo operations with the usual shortcuts are enabled on the canvas. + * Note that even if this feature is enabled, an {@link yfiles.support.UndoEngine undo engine} needs to be available in the {@link yfiles.input.AbstractInputMode#inputModeContext}in order to work. + *

+ * Default value is true. + *

+ */ + undoOperationsAllowed:boolean; + /** + * Specifies whether the user may reparent nodes using a move gesture. + * This setting is only of relevance if the graph is an {@link yfiles.graph.IGroupedGraph}. + * This setting overrides the currently set {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} if set to false. + * The default is true + * @see {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} + * @see {@link yfiles.graph.IGroupedGraph} + */ + reparentNodesAllowed:boolean; + /** + * Specifies whether the user may reparent nodes to leave nodes (non-group nodes). + *

+ * If {@link yfiles.input.GraphEditorInputMode#reparentNodesAllowed reparenting nodes is allowed} in general and this property + * is enabled, users may reparent nodes not only to groups and folders but also to leaf nodes. Still, + * the decision about the final acceptance of the reparenting and the actual execution are delegated + * to the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler}. + *

+ *

+ * The default is false. + *

+ */ + reparentToLeavesAllowed:boolean; + /** + * Occurs when a node has been reparented interactively. + * This is triggered whenever the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler}'s {@link yfiles.input.IReparentNodeHandler#reparent} + * method has been called to reparent a node interactively. + * @see {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} + */ + addNodeReparentedListener(value:(sender:Object,e:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Occurs when a node has been reparented interactively. + * This is triggered whenever the {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler}'s {@link yfiles.input.IReparentNodeHandler#reparent} + * method has been called to reparent a node interactively. + * @see {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} + */ + removeNodeReparentedListener(value:(sender:Object,e:yfiles.graph.HierarchyEventArgs)=> void):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addNodeReparentedListener NodeReparented} event. + * @param {yfiles.graph.HierarchyEventArgs.} args The {@link yfiles.graph.HierarchyEventArgs} instance containing the event data. + * @see {@link yfiles.input.GraphEditorInputMode#reparentNodeHandler} + */ + onNodeReparented(args:yfiles.graph.HierarchyEventArgs):void; + /** + * Callback used by {@link yfiles.input.MarqueeSelectionInputMode} if the user + * has finished creating the marquee selection. + * This method delegates its work to {@link yfiles.input.GraphEditorInputMode#marqueeSelectElements} unless {@link yfiles.input.GraphEditorInputMode#marqueeSelectableItems} + * is set to {@link yfiles.graph.GraphItemTypes#NONE}> + * @see Overrides {@link yfiles.input.MainInputMode#onMarqueeSelectionInputModeMarqueeSelected} + */ + onMarqueeSelectionInputModeMarqueeSelected(sender:Object,e:yfiles.system.EventArgs):void; + /** + * . + * Overrides the base implementation to {@link yfiles.input.ClickInputMode#activeButtons activate} + * both {@link yfiles.system.MouseButtons#LEFT} and {@link yfiles.system.MouseButtons#RIGHT} + * @return {yfiles.input.ClickInputMode} + * @see Overrides {@link yfiles.input.MainInputMode#createClickInputMode} + */ + createClickInputMode():yfiles.input.ClickInputMode; + /** + * Called when the mouse has been clicked at a given location. + * This implementation will use {@link yfiles.input.GraphEditorInputMode#findItemFilteredWithContext} + * method using a combination of both the {@link yfiles.input.GraphEditorInputMode#shouldBeClicked} + * and {@link yfiles.input.GraphEditorInputMode#shouldBeClickSelected} methods as the predicate to determine what has been + * clicked and then invoke {@link yfiles.input.GraphEditorInputMode#click} if {@link yfiles.input.GraphEditorInputMode#clickSelectableItems} or {@link yfiles.input.GraphEditorInputMode#clickableItems} + * is set to values other than {@link yfiles.graph.GraphItemTypes#NONE}. If nothing has been hit, it will + * {@link yfiles.input.MainInputMode#clearSelection clear the selection} if there has been a selection. + * Otherwise it will call {@link yfiles.input.GraphEditorInputMode#createNode}. + * @param {Object} sender The sender of the event, which is the {@link yfiles.input.MainInputMode#clickInputMode}. + * @param {yfiles.input.ClickEventArgs} e The {@link yfiles.input.ClickEventArgs} instance containing the event data. + * @see Overrides {@link yfiles.input.MainInputMode#onClickInputModeClicked} + */ + onClickInputModeClicked(sender:Object,e:yfiles.input.ClickEventArgs):void; + /** + * Called when the mouse has been double clicked at a given location. + * This implementation will use {@link yfiles.input.GraphEditorInputMode#findItemFilteredWithContext} + * method using the {@link yfiles.input.GraphEditorInputMode#shouldBeDoubleClicked} + * method as the predicate to determine what has been + * clicked and then invoke {@link yfiles.input.GraphEditorInputMode#doubleClick} if {@link yfiles.input.GraphEditorInputMode#clickableItems} + * is set to values other than {@link yfiles.graph.GraphItemTypes#NONE}. + * @param {Object} sender The sender of the event, which is the {@link yfiles.input.MainInputMode#clickInputMode}. + * @param {yfiles.input.ClickEventArgs} e The {@link yfiles.input.ClickEventArgs} instance containing the event data. + * @see Overrides {@link yfiles.input.MainInputMode#onClickInputModeDoubleClicked} + */ + onClickInputModeDoubleClicked(sender:Object,e:yfiles.input.ClickEventArgs):void; + /** + * Called when the touch pointer has been tapped at a given location. + * This implementation will use {@link yfiles.input.GraphEditorInputMode#findItemFilteredWithContext} + * method using a combination of both the {@link yfiles.input.GraphEditorInputMode#shouldBeClicked} + * and {@link yfiles.input.GraphEditorInputMode#shouldBeClickSelected} methods as the predicate to determine what has been + * clicked and then invoke {@link yfiles.input.GraphEditorInputMode#click} if {@link yfiles.input.GraphEditorInputMode#clickSelectableItems} or {@link yfiles.input.GraphEditorInputMode#clickableItems} + * is set to values other than {@link yfiles.graph.GraphItemTypes#NONE}. If nothing has been hit, it will + * {@link yfiles.input.MainInputMode#clearSelection clear the selection} if there has been a selection. + * Otherwise it will call {@link yfiles.input.GraphEditorInputMode#createNode}. + * @param {Object} sender The sender of the event, which is the {@link yfiles.input.MainInputMode#tapInputMode}. + * @param {yfiles.input.TapEventArgs} e The {@link yfiles.input.TapEventArgs} instance containing the event data. + * @see Overrides {@link yfiles.input.MainInputMode#onTapInputModeTapped} + */ + onTapInputModeTapped(sender:Object,e:yfiles.input.TapEventArgs):void; + /** + * Called when the touch pointer has been double tapped at a given location. + * This implementation will use {@link yfiles.input.GraphEditorInputMode#findItemFilteredWithContext} + * method using the {@link yfiles.input.GraphEditorInputMode#shouldBeDoubleClicked} + * method as the predicate to determine what has been + * clicked and then invoke {@link yfiles.input.GraphEditorInputMode#doubleClick} if {@link yfiles.input.GraphEditorInputMode#clickableItems} + * is set to values other than {@link yfiles.graph.GraphItemTypes#NONE}. + * @param {Object} sender The sender of the event, which is the {@link yfiles.input.MainInputMode#tapInputMode}. + * @param {yfiles.input.TapEventArgs} e The {@link yfiles.input.TapEventArgs} instance containing the event data. + * @see Overrides {@link yfiles.input.MainInputMode#onTapInputModeDoubleTapped} + */ + onTapInputModeDoubleTapped(sender:Object,e:yfiles.input.TapEventArgs):void; + /** + * Gets or sets a value indicating whether void styles ({@link yfiles.drawing.common.VoidNodeStyle}, {@link yfiles.drawing.common.VoidEdgeStyle}, + * {@link yfiles.drawing.common.VoidLabelStyle}, and {@link yfiles.drawing.common.VoidPortStyle}) should be ignored when selecting or focusing items. + * Value: + * true if void styles should be ignored for selection and focus; false + * otherwise. Default is true. + */ + voidStylesIgnored:boolean; + /** + * Callback predicate method that is used as a broad classification whether an item can generally be selected. + * This implementation uses and honors the {@link yfiles.input.GraphEditorInputMode#selectableItems} and {@link yfiles.input.GraphEditorInputMode#voidStylesIgnored} + * properties. This method is by default also called for {@link yfiles.input.GraphEditorInputMode#shouldBeClickSelected} and + * {@link yfiles.input.GraphEditorInputMode#shouldBeMarqueeSelectable}, so turning selection off here also turns it off in other places. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} true if the item is selectable in general, false if not. + */ + shouldSelect(item:yfiles.model.IModelItem):boolean; + /** + * Callback predicate method that is used by {@link yfiles.input.GraphEditorInputMode#onClickInputModeClicked} + * to determine whether the given item should be selected when {@link yfiles.input.GraphEditorInputMode#click clicked with + * the primary mouse button}. + * This implementation uses the {@link yfiles.input.GraphEditorInputMode#clickSelectableItems} value to determine whether + * the item should be selected. + * Note that this method will not be called by {@link yfiles.input.GraphEditorInputMode#onClickInputModeClicked} + * for items that don't match {@link yfiles.input.GraphEditorInputMode#clickSelectableItems} and {@link yfiles.input.GraphEditorInputMode#selectableItems} + * for performance reasons. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether the item should be selected in response to a + * {@link yfiles.input.GraphEditorInputMode#onClickInputModeClicked detected mouse click with the primary button}. + */ + shouldBeClickSelected(item:yfiles.model.IModelItem):boolean; + /** + * Callback predicate method that is used by {@link yfiles.input.GraphEditorInputMode#onClickInputModeClicked} + * to determine whether the given item can be {@link yfiles.input.GraphEditorInputMode#click clicked}. + * This implementation uses the {@link yfiles.input.GraphEditorInputMode#clickableItems} value to determine whether + * the item should be clicked. + * Note that this method will not be called by {@link yfiles.input.GraphEditorInputMode#onClickInputModeClicked} + * for items that don't match {@link yfiles.input.GraphEditorInputMode#clickableItems} + * for performance reasons. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether the item should be {@link yfiles.input.GraphEditorInputMode#click clicked} in response to + * a {@link yfiles.input.GraphEditorInputMode#onClickInputModeClicked detected mouse click}. + */ + shouldBeClicked(item:yfiles.model.IModelItem):boolean; + /** + * Callback predicate method that is used by {@link yfiles.input.GraphEditorInputMode#onClickInputModeDoubleClicked} + * to determine whether the given item can be {@link yfiles.input.GraphEditorInputMode#doubleClick double clicked}. + * This implementation uses the {@link yfiles.input.GraphEditorInputMode#shouldBeClicked} method to determine whether + * the item should be double clicked. + * Note that this method will not be called by {@link yfiles.input.GraphEditorInputMode#onClickInputModeClicked} + * for items that don't match {@link yfiles.input.GraphEditorInputMode#clickableItems} + * for performance reasons. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether the item should be {@link yfiles.input.GraphEditorInputMode#doubleClick double clicked} in response to + * a {@link yfiles.input.GraphEditorInputMode#onClickInputModeDoubleClicked detected mouse click}. + */ + shouldBeDoubleClicked(item:yfiles.model.IModelItem):boolean; + /** + * Used as a callback to find the hit item underneath a certain point. + * This implementation delegates to {@link yfiles.input.GraphEditorInputMode#findItemFilteredWithContext} + * to determine the hit item. + * @param {yfiles.geometry.PointD} location The location to test. + * @param {yfiles.graph.GraphItemTypes[]} tests An array of {@link yfiles.graph.GraphItemTypes} values that + * encode for which model items the hit test should be performed. + * @return {yfiles.model.IModelItem} The item that has been found for the location or null. + * @see {@link yfiles.input.GraphEditorInputMode#findItemFilteredWithContext} + */ + findItem(location:yfiles.geometry.PointD,tests:yfiles.graph.GraphItemTypes[]):yfiles.model.IModelItem; + /** + * Used as a callback to find the hit item underneath a certain point. + * This implementation uses the {@link yfiles.input.GraphEditorInputMode#hitTestEnumerator} + * to determine the hit item. + * @param {yfiles.geometry.PointD} location The location to test. + * @param {yfiles.graph.GraphItemTypes[]} tests An array of {@link yfiles.graph.GraphItemTypes} values that + * encode for which model items the hit test should be performed. + * @param {function(yfiles.model.IModelItem):boolean} predicate The predicate that can be used to filter the results. May be null. + * @return {yfiles.model.IModelItem} The item that has been found for the location or null. + * @see {@link yfiles.input.GraphEditorInputMode#findItem} + */ + findItemFiltered(location:yfiles.geometry.PointD,tests:yfiles.graph.GraphItemTypes[],predicate:(obj:yfiles.model.IModelItem)=>boolean):yfiles.model.IModelItem; + /** + * Used as a callback to find the hit item underneath a certain point. + * This implementation uses the {@link yfiles.input.GraphEditorInputMode#hitTestEnumerator} + * to determine the hit item. + * @param {yfiles.geometry.PointD} location The location to test. + * @param {yfiles.graph.GraphItemTypes[]} tests An array of {@link yfiles.graph.GraphItemTypes} values that + * encode for which model items the hit test should be performed. + * @param {function(yfiles.model.IModelItem):boolean} predicate The predicate that can be used to filter the results. May be null. + * @param {yfiles.input.IInputModeContext} hitTestContext The context to use for to the {@link yfiles.drawing.IHitTestable#isHit} callback. + * @return {yfiles.model.IModelItem} The item that has been found for the location or null. + * @see {@link yfiles.input.GraphEditorInputMode#findItem} + */ + findItemFilteredWithContext(location:yfiles.geometry.PointD,tests:yfiles.graph.GraphItemTypes[],predicate:(obj:yfiles.model.IModelItem)=>boolean,hitTestContext:yfiles.input.IInputModeContext):yfiles.model.IModelItem; + /** + * Used as a callback to find the items hit underneath a certain point. + * This implementation uses the {@link yfiles.input.GraphEditorInputMode#hitTestEnumerator} + * to determine the hit items. + * @param {yfiles.geometry.PointD} location The location to test. + * @param {yfiles.graph.GraphItemTypes[]} tests An array of {@link yfiles.graph.GraphItemTypes} values that + * encode for which model items the hit test should be performed for prioritizing. + * @param {function(yfiles.model.IModelItem):boolean} predicate The predicate that can be used to filter the results. May be null. + * @return {yfiles.collections.IEnumerable.} An enumerable over the items that have been found for the location. + * @see {@link yfiles.input.GraphEditorInputMode#findItem} + */ + findItems(location:yfiles.geometry.PointD,tests:yfiles.graph.GraphItemTypes[],predicate:(obj:yfiles.model.IModelItem)=>boolean):yfiles.collections.IEnumerable; + /** + * Used as a callback to find the items hit underneath a certain point. + * This implementation uses the {@link yfiles.input.GraphEditorInputMode#hitTestEnumerator} + * to determine the hit items. + * @param {yfiles.geometry.PointD} location The location to test. + * @param {yfiles.graph.GraphItemTypes[]} tests An array of {@link yfiles.graph.GraphItemTypes} values that + * encode for which model items the hit test should be performed for prioritizing. + * @param {function(yfiles.model.IModelItem):boolean} predicate The predicate that can be used to filter the results. May be null. + * @param {yfiles.input.IInputModeContext} hitTestContext The context to use for to the {@link yfiles.drawing.IHitTestable#isHit} callback. + * @return {yfiles.collections.IEnumerable.} An enumerable over the items that have been found for the location. + * @see {@link yfiles.input.GraphEditorInputMode#findItem} + */ + findItemsWithContext(location:yfiles.geometry.PointD,tests:yfiles.graph.GraphItemTypes[],predicate:(obj:yfiles.model.IModelItem)=>boolean,hitTestContext:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Creates a node given a certain click point. + * This implementation delegates to the current {@link yfiles.input.NodeCreationCallback} + * or simply returns null if there is no such callback or {@link yfiles.input.GraphEditorInputMode#nodeCreationAllowed} + * yields false. Finally, it tries to {@link yfiles.input.GraphEditorInputMode#setCurrentItem set the node as the current item}. + * @param {yfiles.geometry.PointD} clickPoint The point where the mouse had been clicked. + * @return {yfiles.graph.INode} The newly created node or null. + * @see {@link yfiles.input.GraphEditorInputMode#onNodeCreated} + * @see {@link yfiles.input.GraphEditorInputMode#setCurrentItem} + */ + createNode(clickPoint:yfiles.geometry.PointD):yfiles.graph.INode; + /** + * Callback that determines whether the provided {@link yfiles.model.IModelItem} + * should be {@link yfiles.input.GraphEditorInputMode#setCurrentItem set to the current item}. + * This implementation uses the {@link yfiles.input.GraphEditorInputMode#focusableItems} + * property to determine whether the item can be set to the current item. + * It also honors the {@link yfiles.input.GraphEditorInputMode#voidStylesIgnored} property. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether to set the item as the current item. + */ + shouldSetToCurrentItem(item:yfiles.model.IModelItem):boolean; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addNodeCreatedListener NodeCreated} event. + * Note that if {@link yfiles.input.NodeDropInputMode#folderNodeParentsAllowed} is set to true, the reported node + * can actually be part of the {@link yfiles.graph.IFoldedGraph master graph}. + * @param {yfiles.model.ItemEventArgs.} args The {@link yfiles.model.ItemEventArgs} instance containing the created node. + */ + onNodeCreated(args:yfiles.model.ItemEventArgs):void; + /** + * Occurs when this mode has created a node in response to user interaction. + * This event is triggered if the node is created using a click gesture via {@link yfiles.input.GraphEditorInputMode#createNode}, or via + * a drag and drop operation that was completed by {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode}. + * Note that if {@link yfiles.input.NodeDropInputMode#folderNodeParentsAllowed} is set to true, the reported node + * can actually be part of the {@link yfiles.graph.IFoldedGraph master graph}. + * @see {@link yfiles.input.GraphEditorInputMode#createNode} + */ + addNodeCreatedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Occurs when this mode has created a node in response to user interaction. + * This event is triggered if the node is created using a click gesture via {@link yfiles.input.GraphEditorInputMode#createNode}, or via + * a drag and drop operation that was completed by {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode}. + * Note that if {@link yfiles.input.NodeDropInputMode#folderNodeParentsAllowed} is set to true, the reported node + * can actually be part of the {@link yfiles.graph.IFoldedGraph master graph}. + * @see {@link yfiles.input.GraphEditorInputMode#createNode} + */ + removeNodeCreatedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Gets or sets a property that determines whether {@link yfiles.input.GraphEditorInputMode#createNode node creation}operations + * using the click gesture is allowed. + * Default value is true. In order to disable node creation via + * drag and drop gestures, the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode} should be disabled, too. However this is the default. + * @see {@link yfiles.input.GraphEditorInputMode#nodeCreator} + * @see {@link yfiles.input.GraphEditorInputMode#createNode} + */ + nodeCreationAllowed:boolean; + /** + * Gets or sets a property that determines whether {@link yfiles.input.GraphEditorInputMode#createBendInputMode bend creation}operation + * should be {@link yfiles.input.IConcurrentInputMode#enabled enabled}. + * This implementation delegates to the {@link yfiles.input.IConcurrentInputMode#enabled Enabled property} of + * the {@link yfiles.input.GraphEditorInputMode#createBendInputMode}. + *

+ * Default value is true. + *

+ */ + bendCreationAllowed:boolean; + /** + * Gets or sets a property that determines whether {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode edge creation}operation + * should be {@link yfiles.input.IConcurrentInputMode#enabled enabled}. + * This implementation delegates to the {@link yfiles.input.IConcurrentInputMode#enabled Enabled property} of + * the {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode}. + *

+ * Default value is true. + *

+ */ + edgeCreationAllowed:boolean; + /** + * Reverses the selected edges. + * This implementation invokes {@link yfiles.input.GraphEditorInputMode#reverseEdges} providing the {@link yfiles.input.GraphEditorInputMode#graphSelection selected edges}. + *

+ * The edges will only be reversed if {@link yfiles.input.GraphEditorInputMode#shouldBeReversed} returns + * true for each edge. + *

+ *

+ * For each edge an {@link yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener EdgePortsChanged} event will be dispatched. + *

+ */ + reverseSelectedEdges():void; + /** + * Reverses the given edges. + *

+ * The edges will only be reversed if {@link yfiles.input.GraphEditorInputMode#edgeReversalAllowed} is set to true and {@link yfiles.input.GraphEditorInputMode#shouldBeReversed} returns + * true for the edge. + *

+ *

+ * For each edge a {@link yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener EdgePortsChanged} event will be dispatched. + *

+ * @see {@link yfiles.input.GraphCommands#REVERSE_EDGE_COMMAND} + */ + reverseEdges(edges:yfiles.collections.IEnumerable):void; + /** + * Reverses the given edges. + * The edge will only be reversed if {@link yfiles.input.GraphEditorInputMode#edgeReversalAllowed} is set to true and {@link yfiles.input.GraphEditorInputMode#shouldBeReversed} returns + * true for the edge. A {@link yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener EdgePortsChanged} event will be dispatched after the edge has been reversed. + */ + reverseEdge(edge:yfiles.graph.IEdge):void; + /** + * Callback which determines whether the given edge should be reversed by {@link yfiles.input.GraphEditorInputMode#reverseEdge}, {@link yfiles.input.GraphEditorInputMode#reverseEdges}, or {@link yfiles.input.GraphEditorInputMode#reverseEdges}. + * This implementation returns the value of {@link yfiles.input.GraphEditorInputMode#edgeReversalAllowed}. + * @param {yfiles.graph.IEdge} edge The edge which should be reversed. + * @return {boolean} true if the edge should be reversed. + */ + shouldBeReversed(edge:yfiles.graph.IEdge):boolean; + /** + * Whether to generally allow to reverse edges with the help of this input mode. + * If set to false the methods {@link yfiles.input.GraphEditorInputMode#reverseEdge}, {@link yfiles.input.GraphEditorInputMode#reverseEdges}, and {@link yfiles.input.GraphEditorInputMode#reverseSelectedEdges} do nothing. + * Also, the {@link yfiles.input.GraphCommands#REVERSE_EDGE_COMMAND} is disabled. + * Default value is true + */ + edgeReversalAllowed:boolean; + /** + * Callback to be invoked after an edge's source and/or target ports have been changed as the result of an input gesture. + * Dispatches the {@link yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener EdgePortsChanged} event. + * @param {yfiles.graph.EdgeEventArgs} args The {@link yfiles.graph.EdgeEventArgs} for the {@link yfiles.input.GraphEditorInputMode#addEdgePortsChangedListener EdgePortsChanged}. + */ + onEdgePortsChanged(args:yfiles.graph.EdgeEventArgs):void; + /** + * Event which is dispatched after an edge's source and/or target ports have been changed as the result of an input gesture. + * @see {@link yfiles.graph.EdgeEventArgs} + * @see {@link yfiles.input.GraphEditorInputMode#reverseSelectedEdges} + * @see {@link yfiles.input.GraphEditorInputMode#reverseEdges} + * @see {@link yfiles.input.GraphEditorInputMode#reverseEdge} + */ + addEdgePortsChangedListener(value:(sender:Object,e:yfiles.graph.EdgeEventArgs)=> void):void; + /** + * Event which is dispatched after an edge's source and/or target ports have been changed as the result of an input gesture. + * @see {@link yfiles.graph.EdgeEventArgs} + * @see {@link yfiles.input.GraphEditorInputMode#reverseSelectedEdges} + * @see {@link yfiles.input.GraphEditorInputMode#reverseEdges} + * @see {@link yfiles.input.GraphEditorInputMode#reverseEdge} + */ + removeEdgePortsChangedListener(value:(sender:Object,e:yfiles.graph.EdgeEventArgs)=> void):void; + /** + * Gets or sets the callback that is responsible for creating a new node, e.g. + * in response to a mouse click. + * A null value will effectively disable node creation using mouse clicks. + * @see {@link yfiles.input.GraphEditorInputMode#createNode} + */ + nodeCreator:(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,location:yfiles.geometry.PointD)=>yfiles.graph.INode; + /** + * Clears the selection on click if {@link yfiles.canvas.CanvasControl#lastMouse2DEvent the click} + * is not recognized by {@link yfiles.input.GraphEditorInputMode#multiSelectionRecognizer}. + *

This method is only called if no item has been hit and at least one item + * is currently selected.

+ *

+ * This will use the {@link yfiles.input.MainInputMode#clearSelection} method to deselect all items. + *

+ * @param {yfiles.input.IInputModeContext} context The context where the click appeared + * @return {boolean} Whether the selection has been cleared by this method. + */ + clickClearSelection(context:yfiles.input.IInputModeContext):boolean; + /** + * Specifies whether a node should be created by {@link yfiles.input.GraphEditorInputMode#onClickInputModeClicked}. + * This implementation returns false when {@link yfiles.input.ContextMenuInputMode#swallowCloseClick} + * is true and the click has closed a context menu. + * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.PointD} clickPoint The location of the click. + * @return {boolean} Whether {@link yfiles.input.GraphEditorInputMode#clickCreateNode} should be called to create a node. + * @see {@link yfiles.input.GraphEditorInputMode#clickCreateNode} + */ + shouldClickCreateNode(context:yfiles.input.IInputModeContext,clickPoint:yfiles.geometry.PointD):boolean; + /** + * Creates a node on click. + * This method is only called if no item has been hit and {@link yfiles.input.GraphEditorInputMode#clickClearSelection} + * returned false. + * @param {yfiles.input.IInputModeContext} context The input mode context. + * @param {yfiles.geometry.PointD} clickPoint The location of the click. + * @return {boolean} + * true if a node was successfully created, otherwise false. + * @see {@link yfiles.input.GraphEditorInputMode#shouldClickCreateNode} + */ + clickCreateNode(context:yfiles.input.IInputModeContext,clickPoint:yfiles.geometry.PointD):boolean; + /** + * Actually performs the click operation on the given item for the current context. + * This will use the {@link yfiles.input.GraphEditorInputMode#onItemClicked} method to trigger the {@link yfiles.input.GraphEditorInputMode#addItemClickedListener ItemClicked} + * event and unless the event is handled by any of the event handlers this + * will ultimately {@link yfiles.input.MainInputMode#setSelected select} the item + * and possibly the {@link yfiles.input.GraphEditorInputMode#autoSelectSelfloopBends self loop bends} and optionally + * {@link yfiles.input.MainInputMode#clearSelection clear the current selection}, unless + * the {@link yfiles.input.GraphEditorInputMode#multiSelectionRecognizer} is triggered. + * @param {yfiles.input.IInputModeContext} context The context where the click appeared + * @param {yfiles.model.IModelItem} item The item that has been clicked. + * @return {boolean} Whether the click has been handled by this method. + */ + click(context:yfiles.input.IInputModeContext,item:yfiles.model.IModelItem):boolean; + /** + * Actually performs the double-click operation on the given item for the current context. + * This will use the {@link yfiles.input.GraphEditorInputMode#onItemLeftDoubleClicked} and {@link yfiles.input.GraphEditorInputMode#onItemRightDoubleClicked} methods respectively + * and the {@link yfiles.input.GraphEditorInputMode#onItemDoubleClicked} to trigger the respective events. + * @param {yfiles.input.IInputModeContext} context The context where the double click appeared + * @param {yfiles.model.IModelItem} item The item that has been double clicked. + * @return {boolean} Whether the double click has been handled by this method. + */ + doubleClick(context:yfiles.input.IInputModeContext,item:yfiles.model.IModelItem):boolean; + /** + * Called by {@link yfiles.input.GraphEditorInputMode#click} to query the item + * for a {@link yfiles.input.IActionButtonProvider} in its {@link yfiles.support.ILookup#lookup} + * and handle it appropriately. + * This method will query the {@link yfiles.input.IActionButtonProvider} and check whether + * the click occurred inside the {@link yfiles.input.IActionButtonProvider#getButtonBounds button's bounds}, + * and if so, will {@link yfiles.input.IActionButtonProvider#invokeAction invoke the action} + * and return true. + * @param {yfiles.input.IInputModeContext} context The context for the click. + * @param {yfiles.model.IModelItem} item The item that has been clicked. + * @return {boolean} Whether the action has been invoked and handling should be stopped. + * @see {@link yfiles.input.IActionButtonProvider} + * @see {@link yfiles.input.GraphEditorInputMode#click} + */ + handleActionButtonProvider(context:yfiles.input.IInputModeContext,item:yfiles.model.IModelItem):boolean; + /** + * Gets or sets the items that can be given focus via the {@link yfiles.input.GraphEditorInputMode#setCurrentItem} method. + * The focusable items. The default is {@link yfiles.graph.GraphItemTypes#NODE} + */ + focusableItems:yfiles.graph.GraphItemTypes; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addItemClickedListener ItemClicked} event. + * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.support.ItemInputEventArgs#handled} + * property to true. + * @param {yfiles.support.ItemInputEventArgs.} args The {@link yfiles.support.ItemInputEventArgs} instance that contains the item that has been clicked. + */ + onItemClicked(args:yfiles.support.ItemInputEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addItemLeftClickedListener ItemLeftClicked} event. + * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.support.ItemInputEventArgs#handled} + * property to true. + * @param {yfiles.support.ItemInputEventArgs.} args The {@link yfiles.support.ItemInputEventArgs} instance that contains the item that has been clicked. + */ + onItemLeftClicked(args:yfiles.support.ItemInputEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addItemRightClickedListener ItemRightClicked} event. + * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.support.ItemInputEventArgs#handled} + * property to true. + * @param {yfiles.support.ItemInputEventArgs.} args The {@link yfiles.support.ItemInputEventArgs} instance that contains the item that has been clicked. + */ + onItemRightClicked(args:yfiles.support.ItemInputEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addItemDoubleClickedListener ItemDoubleClicked} event. + * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.support.ItemInputEventArgs#handled} + * property to true. + * @param {yfiles.support.ItemInputEventArgs.} args The {@link yfiles.support.ItemInputEventArgs} instance that contains the item that has been double clicked. + */ + onItemDoubleClicked(args:yfiles.support.ItemInputEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} event. + * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.support.ItemInputEventArgs#handled} + * property to true. + * @param {yfiles.support.ItemInputEventArgs.} args The {@link yfiles.support.ItemInputEventArgs} instance that contains the item that has been double clicked. + */ + onItemLeftDoubleClicked(args:yfiles.support.ItemInputEventArgs):void; + /** + * Starts label editing by executing {@link yfiles.input.GraphCommands#EDIT_LABEL_COMMAND}. + * The method should return whether the request was satisfied. + * @param {yfiles.model.IModelItem} item The item whose label or the label itself that should be edited upon the double click gesture. + * @return {boolean} true iff the request was handled. + * @see {@link yfiles.input.GraphEditorInputMode#doubleClick} + * @see {@link yfiles.input.GraphEditorInputMode#doubleClickLabelEditingAllowed} + */ + editLabelOnDoubleClick(item:yfiles.model.IModelItem):boolean; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} event. + * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.support.ItemInputEventArgs#handled} + * property to true. + * @param {yfiles.support.ItemInputEventArgs.} args The {@link yfiles.support.ItemInputEventArgs} instance that contains the item that has been double clicked. + */ + onItemRightDoubleClicked(args:yfiles.support.ItemInputEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addCanvasClickedListener CanvasClicked} event. + * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ClickEventArgs#handled} + * property to true. + * @param {yfiles.input.ClickEventArgs} args The {@link yfiles.input.ClickEventArgs} instance that contains the information about the click. + */ + onCanvasClicked(args:yfiles.input.ClickEventArgs):void; + /** + * Occurs when an item has been clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphEditorInputMode#clickableItems} + * @see {@link yfiles.input.GraphEditorInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemLeftClickedListener ItemLeftClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemRightClickedListener ItemRightClicked} + */ + addItemClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphEditorInputMode#clickableItems} + * @see {@link yfiles.input.GraphEditorInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemLeftClickedListener ItemLeftClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemRightClickedListener ItemRightClicked} + */ + removeItemClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been left clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphEditorInputMode#clickableItems} + * @see {@link yfiles.input.GraphEditorInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemClickedListener ItemClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemRightClickedListener ItemRightClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} + */ + addItemLeftClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been left clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphEditorInputMode#clickableItems} + * @see {@link yfiles.input.GraphEditorInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemClickedListener ItemClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemRightClickedListener ItemRightClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} + */ + removeItemLeftClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been right clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphEditorInputMode#clickableItems} + * @see {@link yfiles.input.GraphEditorInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemClickedListener ItemClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemLeftClickedListener ItemLeftClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} + */ + addItemRightClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been right clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphEditorInputMode#clickableItems} + * @see {@link yfiles.input.GraphEditorInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemClickedListener ItemClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemLeftClickedListener ItemLeftClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} + */ + removeItemRightClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been double clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphEditorInputMode#addItemClickedListener ItemClicked} + * @see {@link yfiles.input.GraphEditorInputMode#clickableItems} + * @see {@link yfiles.input.GraphEditorInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} + */ + addItemDoubleClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been double clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphEditorInputMode#addItemClickedListener ItemClicked} + * @see {@link yfiles.input.GraphEditorInputMode#clickableItems} + * @see {@link yfiles.input.GraphEditorInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} + */ + removeItemDoubleClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been left double clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphEditorInputMode#clickableItems} + * @see {@link yfiles.input.GraphEditorInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} + */ + addItemLeftDoubleClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been left double clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphEditorInputMode#clickableItems} + * @see {@link yfiles.input.GraphEditorInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} + */ + removeItemLeftDoubleClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been right double clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphEditorInputMode#clickableItems} + * @see {@link yfiles.input.GraphEditorInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} + */ + addItemRightDoubleClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been right double clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphEditorInputMode#clickableItems} + * @see {@link yfiles.input.GraphEditorInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphEditorInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} + */ + removeItemRightDoubleClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when the empty canvas area has been clicked. + * If one of the event handlers sets the {@link yfiles.input.ClickEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphEditorInputMode#addItemClickedListener ItemClicked} + */ + addCanvasClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * Occurs when the empty canvas area has been clicked. + * If one of the event handlers sets the {@link yfiles.input.ClickEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphEditorInputMode#addItemClickedListener ItemClicked} + */ + removeCanvasClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * Selects the node and possible bends of selfloop edges. + * This method delegates to {@link yfiles.input.MainInputMode#setSelected} for the node + * and all adjacent self loop bends. + * @param {yfiles.graph.INode} node The node to select. + */ + selectNodeAndSelfloopBends(node:yfiles.graph.INode):void; + /** + * Performs one-time initialization of this instance. This method should not + * be invoked by subclasses. This will be done automatically upon first + * {@link yfiles.input.AbstractInputMode#install installation} of this mode. + * This code will be executed only once per instance. The {@link yfiles.input.AbstractInputMode#canvas} property + * and {@link yfiles.input.AbstractInputMode#inputModeContext} property + * will be null when this code is executed. This method should not + * be used to install this mode into a specific canvas. + * Subclasses should always call base.Initialize() first. + * @see {@link yfiles.input.AbstractInputMode#install} + */ + initialize():void; + /** + * Gets or sets the keyboard navigation mode priority. + * The default is 55. + * Value: The keyboard navigation mode priority. + */ + navigationModePriority:number; + /** + * Gets or sets the CreateEdgeInputModePriority property. + * The default value is 45. + */ + createEdgeModePriority:number; + /** + * Gets or sets the CreateBendInputModePriority property. + * The default is 42. + * Value: The create bend mode priority. + */ + createBendModePriority:number; + /** + * Gets or sets the TextEditorInputModePriority property. + * The default is 100. + */ + textEditorInputModePriority:number; + /** + * Gets or sets the TextEditorInputMode property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphEditorInputMode#createTextEditorInputMode} will be called. + * Upon change the {@link yfiles.input.GraphEditorInputMode#onTextEditorInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + textEditorInputMode:yfiles.input.TextEditorInputMode; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.TextEditorInputMode} oldTextEditorInputMode the old value, which may be null the first time + * @param {yfiles.input.TextEditorInputMode} newTextEditorInputMode the new value + */ + onTextEditorInputModeChanged(oldTextEditorInputMode:yfiles.input.TextEditorInputMode,newTextEditorInputMode:yfiles.input.TextEditorInputMode):void; + /** + * Factory method for the TextEditorInputMode property. + * This method will be called + * upon first access to the {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} property. + * @return {yfiles.input.TextEditorInputMode} a new instance of TextEditorInputMode + */ + createTextEditorInputMode():yfiles.input.TextEditorInputMode; + /** + * Gets or sets the CreateEdgeInputMode property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphEditorInputMode#createCreateEdgeInputMode} will be called. + * Upon change the {@link yfiles.input.GraphEditorInputMode#onCreateEdgeInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + createEdgeInputMode:yfiles.input.CreateEdgeInputMode; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.CreateEdgeInputMode} oldCreateEdgeInputMode the old value, which may be null the first time + * @param {yfiles.input.CreateEdgeInputMode} newCreateEdgeInputMode the new value + */ + onCreateEdgeInputModeChanged(oldCreateEdgeInputMode:yfiles.input.CreateEdgeInputMode,newCreateEdgeInputMode:yfiles.input.CreateEdgeInputMode):void; + /** + * Factory method for the CreateEdgeInputMode property. + * This method will be called + * upon first access to the {@link yfiles.input.GraphEditorInputMode#createEdgeInputMode} property. + * @return {yfiles.input.CreateEdgeInputMode} a new instance of CreateEdgeInputMode + */ + createCreateEdgeInputMode():yfiles.input.CreateEdgeInputMode; + /** + * Gets or sets a value indicating whether this mode should automatically + * {@link yfiles.graph.IGraph#removeLabel remove labels} from the graph + * when a label text has been edited and the label text is empty. + * Value: + * true if empty labels should be removed after text editing; otherwise, false. + */ + autoRemoveEmptyLabels:boolean; + /** + * Gets or sets a property that determines whether clicking on a node + * should automatically select all bends of self loops adjacent to that node. + * The default value is true. + */ + autoSelectSelfloopBends:boolean; + /** + * Gets or sets a property that determines whether the label should be hidden while it is edited. + * If enabled, any selection, focus, and highlight visualizations of the label are hidden along with the label + * visualization itself. + *

+ * Even if enabled, the label text is still visible in the + * {@link yfiles.input.TextEditorInputMode#textBox}. + *

+ *

+ * The default value is true. + *

+ */ + hideLabelDuringEditing:boolean; + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} + * instance that will be queried to decide if a click is deemed a multi selection gesture. + * The default is {@link yfiles.input.KeyEvents#CONTROL_PRESSED}. + */ + multiSelectionRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the order of the types of items that should be used to determine what + * item has been clicked during {@link yfiles.input.GraphEditorInputMode#onClickInputModeClicked}. + *

+ * Change this field to adjust which items will be {@link yfiles.input.MainInputMode#setSelected selected} + * if there are multiple items at a given location. + * The default order is + *

+ *
    + *
  • + * {@link yfiles.graph.GraphItemTypes#BEND} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#EDGE_LABEL} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#EDGE} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#NODE} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#NODE_LABEL} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#PORT} + *
  • + *
+ * @see {@link yfiles.input.GraphEditorInputMode#clickSelectableItems} + * @see {@link yfiles.input.GraphEditorInputMode#selectableItems} + * @see {@link yfiles.input.GraphEditorInputMode#findItemFilteredWithContext} + */ + clickHitTestOrder:yfiles.graph.GraphItemTypes[]; + /** + * Gets or sets the order of the types of items that should be used to determine what + * item has been double-clicked during {@link yfiles.input.GraphEditorInputMode#onClickInputModeClicked}. + *

+ * Change this field to adjust which items will be considered when {@link yfiles.input.GraphEditorInputMode#addItemDoubleClickedListener double-clicked} + * if there are multiple items at a given location. + * The default order is + *

+ *
    + *
  • + * {@link yfiles.graph.GraphItemTypes#BEND} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#EDGE_LABEL} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#EDGE} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#NODE} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#NODE_LABEL} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#PORT} + *
  • + *
+ * @see {@link yfiles.input.GraphEditorInputMode#clickSelectableItems} + * @see {@link yfiles.input.GraphEditorInputMode#selectableItems} + * @see {@link yfiles.input.GraphEditorInputMode#findItemFilteredWithContext} + */ + doubleClickHitTestOrder:yfiles.graph.GraphItemTypes[]; + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} + * instance that will be queried to decide if a click should select the item that + * is currently visible under the mouse cursor, without giving more important items + * higher priority. + * If the value {@link yfiles.input.IEventRecognizer#isRecognized recognizes} that + * the user wanted to use the detail clicking behavior, the {@link yfiles.input.GraphEditorInputMode#hitTestEnumerator} + * will be queried for the given item and the first item that is returned will be + * considered a hit. Otherwise all hit items are examined and are prioritized by item type. + * E.g. by default clicking on a node will select the node, even if there is a node label which + * has been clicked at the same point. If detail selection is recognized, the label will + * be selected. + *

+ * The default is {@link yfiles.input.KeyEvents#SHIFT_PRESSED}. + *

+ */ + detailSelectionRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} + * instance that will be queried to decide if a click should cycle through all the items that + * are currently under the mouse cursor. + * If the value {@link yfiles.input.IEventRecognizer#isRecognized recognizes} that + * the user wanted to use the cyclic click selection behavior, the {@link yfiles.input.GraphEditorInputMode#hitTestEnumerator} + * will be queried for the given item and previously reported items will be ignored. + * E.g. if multiple nodes are overlapping each other, clicking on them will report the first item + * for the first click, the second one for the second click and so on. If all elements have been reported previously, + * the first one is going to be reported again. + * If the order of the elements at the clicked location changes, the cyclic selection is restarted anew. + *

+ * The default is {@link yfiles.input.KeyEvents#ALT_PRESSED}. + *

+ */ + cyclicSelectionRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the CreateBendInputMode property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphEditorInputMode#createCreateBendInputMode} will be called. + * Upon change the {@link yfiles.input.GraphEditorInputMode#onCreateBendInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + createBendInputMode:yfiles.input.CreateBendInputMode; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#createBendInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.CreateBendInputMode} oldCreateBendInputMode the old value, which may be null the first time + * @param {yfiles.input.CreateBendInputMode} newCreateBendInputMode the new value + */ + onCreateBendInputModeChanged(oldCreateBendInputMode:yfiles.input.CreateBendInputMode,newCreateBendInputMode:yfiles.input.CreateBendInputMode):void; + /** + * Callback that is called as soon as {@link yfiles.input.CreateBendInputMode} + * created a new bend. + * This method selects the bend and starts + * the {@link yfiles.input.MainInputMode#handleInputMode} using the handle + * for the newly created bend. + * The bend is created using the hit edge's {@link yfiles.input.IBendCreator} + * implementation, as obtained from the edge's {@link yfiles.support.ILookup#lookup} and + * calls {@link yfiles.input.GraphEditorInputMode#dragBend}. If the subsequent drag is canceled by the user, + * this call will remove the bend again. + */ + onCreateBendInputModeBendCreated(sender:Object,e:yfiles.model.ItemEventArgs):void; + /** + * Initiates the {@link yfiles.input.MainInputMode#handleInputMode} to drag the given bend. + * @param {yfiles.graph.IBend} bend The bend to drag. + * @see {@link yfiles.input.GraphEditorInputMode#onCreateBendInputModeBendCreated} + */ + dragBend(bend:yfiles.graph.IBend):void; + /** + * Factory method for the {@link yfiles.input.GraphEditorInputMode#createBendInputMode} property. + * This method will be called + * upon first access to the {@link yfiles.input.GraphEditorInputMode#createBendInputMode} property. + * @return {yfiles.input.CreateBendInputMode} a new instance of CreateBendInputMode + */ + createCreateBendInputMode():yfiles.input.CreateBendInputMode; + /** + * Gets or sets the item hover input mode priority. + * The default is 55. + * Value: The item hover input mode priority. + */ + itemHoverModePriority:number; + /** + * Gets or sets the {@link yfiles.input.GraphEditorInputMode#itemHoverInputMode} that is provided by this instance + * for those who need to make use of it. + *

+ * Note that initially the {@link yfiles.input.ItemHoverInputMode#hoverItems} property is set + * to {@link yfiles.graph.GraphItemTypes#NONE}, which effectively disables the functionality of the mode initially. + * In order to get the mode to fire events, the property should be set to a corresponding value. + *

+ *

+ * If the backing field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphEditorInputMode#createItemHoverInputMode} will be called. + * Upon change the {@link yfiles.input.GraphEditorInputMode#onItemHoverInputModeChanged} method will be called. + *

+ * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + itemHoverInputMode:yfiles.input.ItemHoverInputMode; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#itemHoverInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.ItemHoverInputMode} oldItemHoverInputMode the old value, which may be null the first time + * @param {yfiles.input.ItemHoverInputMode} newItemHoverInputMode the new value + */ + onItemHoverInputModeChanged(oldItemHoverInputMode:yfiles.input.ItemHoverInputMode,newItemHoverInputMode:yfiles.input.ItemHoverInputMode):void; + /** + * Factory method for the ItemHoverInputMode property. This method will be called + * upon first access to the {@link yfiles.input.GraphEditorInputMode#itemHoverInputMode} property. + * @return {yfiles.input.ItemHoverInputMode} a new instance of {@link yfiles.input.GraphEditorInputMode#itemHoverInputMode} with the {@link yfiles.input.ItemHoverInputMode#hoverItems} property set to + * {@link yfiles.graph.GraphItemTypes#NONE}. + */ + createItemHoverInputMode():yfiles.input.ItemHoverInputMode; + /** + * Gets or sets the priority for the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode}. + * Value: The node drop input mode priority. The default is 70. + */ + nodeDropInputModePriority:number; + /** + * Gets or sets the NodeDropInputMode property that is responsible for + * handling drag and drop operations of nodes onto the Canvas. + * The mode by default is {@link yfiles.input.IConcurrentInputMode#enabled disabled} + * and needs to be enabled to work, first. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphEditorInputMode#createNodeDropInputMode} will be called. + * Upon change the {@link yfiles.input.GraphEditorInputMode#onNodeDropInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + nodeDropInputMode:yfiles.input.NodeDropInputMode; + /** + * Factory method that creates the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode} lazily the first time the property + * is accessed. + * @return {yfiles.input.NodeDropInputMode} A plain new instance of the {@link yfiles.input.NodeDropInputMode} type, which is initially + * {@link yfiles.input.IConcurrentInputMode#enabled disabled}. + */ + createNodeDropInputMode():yfiles.input.NodeDropInputMode; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.NodeDropInputMode} oldNodeDropInputMode the old value, which may be null the first time + * @param {yfiles.input.NodeDropInputMode} newNodeDropInputMode the new value + */ + onNodeDropInputModeChanged(oldNodeDropInputMode:yfiles.input.NodeDropInputMode,newNodeDropInputMode:yfiles.input.NodeDropInputMode):void; + /** + * Called when the {@link yfiles.input.GraphEditorInputMode#nodeDropInputMode}'s {@link yfiles.input.NodeDropInputMode#addNodeCreatedListener NodeCreated} event + * is triggered. + * This implementation {@link yfiles.input.GraphEditorInputMode#adjustContentRect adjusts the content rect}, + * triggers the {@link yfiles.input.GraphEditorInputMode#addNodeCreatedListener NodeCreated} event and tries to set the newly created node + * as the {@link yfiles.input.GraphEditorInputMode#setCurrentItem current item}. + * @param {Object} sender The sender. + * @param {yfiles.model.ItemEventArgs.} e The event argument instance containing the event data. + */ + onNodeDropInputModeNodeCreated(sender:Object,e:yfiles.model.ItemEventArgs):void; + /** + * Determines whether to show the {@link yfiles.input.HandleInputMode handles} for the given item. + * @param {yfiles.model.IModelItem} item The item to check + * @return {boolean} Whether to show the item based on the setting of the corresponding {@link yfiles.input.GraphEditorInputMode#showHandleItems}, + * property. + * @see Overrides {@link yfiles.input.MainInputMode#shouldShowHandles} + */ + shouldShowHandles(item:yfiles.model.IModelItem):boolean; + /** + * Determines whether or not moving the item is allowed. + *

+ * This predicate determines whether an item can be moved by any + * appropriate input mode, e.g by default it also evaluates to true + * for {@link yfiles.graph.ILabel}s which are moved by {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} instead + * of {@link yfiles.input.MoveInputMode}. + * To determine whether an item may be moved specifically by {@link yfiles.input.MoveInputMode}, the predicate + * {@link yfiles.input.GraphEditorInputMode#shouldBeMovableForMoveInputMode} is used. + *

+ *

+ * This implementation returns the result of the {@link yfiles.input.GraphEditorInputMode#movableItems} + * property for the given item. + *

+ * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether or not moving the item is allowed. + * @see {@link yfiles.input.GraphEditorInputMode#movableItems} + * @see {@link yfiles.input.GraphEditorInputMode#shouldBeMovableForMoveInputMode} + * @see {@link yfiles.input.MoveInputMode} + * @see {@link yfiles.input.GraphEditorInputMode#moveLabelInputMode} + * @see Overrides {@link yfiles.input.MainInputMode#shouldBeMovable} + */ + shouldBeMovable(item:yfiles.model.IModelItem):boolean; + /** + * Determines whether or not moving the item using {@link yfiles.input.MoveInputMode} is allowed. + *

+ * This predicate determines whether an item can be moved specifically by {@link yfiles.input.MoveInputMode}. + * To determine whether an item may be moved at all, the predicate + * {@link yfiles.input.GraphEditorInputMode#shouldBeMovable} is used. + *

+ *

+ * Returns false if {@link yfiles.input.GraphEditorInputMode#shouldBeMovable}returns + * false or if the item is a {@link yfiles.graph.GraphItemTypes#LABEL label}. + * Otherwise, true. + *

+ * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether or not moving the item using {@link yfiles.input.MoveInputMode} is allowed. + * @see {@link yfiles.input.GraphEditorInputMode#shouldBeMovable} + * @see {@link yfiles.input.MoveInputMode} + */ + shouldBeMovableForMoveInputMode(item:yfiles.model.IModelItem):boolean; + /** + * Overridden to {@link yfiles.input.GraphEditorInputMode#findItemsWithContext find the items}, that are {@link yfiles.input.GraphEditorInputMode#toolTipItems}, + * so that the {@link yfiles.input.GraphEditorInputMode#addQueryItemToolTipListener QueryItemToolTip} event can be triggered to serve the request. + * @param {Object} src The source of the event. + * @param {yfiles.input.ToolTipQueryEventArgs} args The event arguments. + * @see Overrides {@link yfiles.input.MainInputMode#onMouseHoverInputModeQueryToolTip} + */ + onMouseHoverInputModeQueryToolTip(src:Object,args:yfiles.input.ToolTipQueryEventArgs):void; + /** + * Overridden to {@link yfiles.input.GraphEditorInputMode#findItemsWithContext find the items}, that are {@link yfiles.input.GraphEditorInputMode#contextMenuItems}, + * so that the {@link yfiles.input.GraphEditorInputMode#addPopulateItemContextMenuListener PopulateItemContextMenu} event can be triggered to serve the request. + * @param {Object} src The source of the event. + * @param {yfiles.input.PopulateContextMenuEventArgs} args The event arguments. + * @see Overrides {@link yfiles.input.MainInputMode#onContextMenuInputModePopulateContextMenu} + */ + onContextMenuInputModePopulateContextMenu(src:Object,args:yfiles.input.PopulateContextMenuEventArgs):void; + /** + * Gets the types of the items that should be queried a context menu for. + * The items for which a context menu should be {@link yfiles.input.GraphEditorInputMode#addPopulateItemContextMenuListener queried}. + * The default value is {@link yfiles.graph.GraphItemTypes#NODE}|{@link yfiles.graph.GraphItemTypes#EDGE}. + */ + contextMenuItems:yfiles.graph.GraphItemTypes; + /** + * Determines whether for the given item a context menu should be queried. + * This implementation uses the {@link yfiles.input.GraphEditorInputMode#contextMenuItems} property to determine whether a context menu + * should be queried for the given item. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether to raise a {@link yfiles.input.GraphEditorInputMode#addPopulateItemContextMenuListener PopulateItemContextMenu} event for the given item. + */ + shouldPopulateContextMenu(item:yfiles.model.IModelItem):boolean; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addPopulateItemContextMenuListener PopulateItemContextMenu} event. + * @param {yfiles.input.PopulateItemContextMenuEventArgs.} args The {@link yfiles.input.PopulateItemContextMenuEventArgs} instance containing the event data. + */ + onPopulateItemContextMenu(args:yfiles.input.PopulateItemContextMenuEventArgs):void; + /** + * Occurs when the {@link yfiles.input.ContextMenuInputMode context menu} over an item is about to be opened. + * Listeners for this event can populate the context menu with item-specific entries since the item is + * available to them via the event args. + *

+ * This method will only be called for items that match the {@link yfiles.input.GraphEditorInputMode#contextMenuItems} type. + *

+ */ + addPopulateItemContextMenuListener(value:(sender:Object,e:yfiles.input.PopulateItemContextMenuEventArgs)=> void):void; + /** + * Occurs when the {@link yfiles.input.ContextMenuInputMode context menu} over an item is about to be opened. + * Listeners for this event can populate the context menu with item-specific entries since the item is + * available to them via the event args. + *

+ * This method will only be called for items that match the {@link yfiles.input.GraphEditorInputMode#contextMenuItems} type. + *

+ */ + removePopulateItemContextMenuListener(value:(sender:Object,e:yfiles.input.PopulateItemContextMenuEventArgs)=> void):void; + /** + * Gets the types of the items that should be queried a tool tip for. + * The items for which a tool tip text should be {@link yfiles.input.GraphEditorInputMode#addQueryItemToolTipListener queried}. + * The default value is {@link yfiles.graph.GraphItemTypes#NODE}|{@link yfiles.graph.GraphItemTypes#EDGE}|{@link yfiles.graph.GraphItemTypes#LABEL}|{@link yfiles.graph.GraphItemTypes#PORT}|. + */ + toolTipItems:yfiles.graph.GraphItemTypes; + /** + * Determines whether for the given item a tool tip should be queried. + * This implementation uses the {@link yfiles.input.GraphEditorInputMode#toolTipItems} property to determine whether tool tip should be queried + * for the given item. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether to raise a {@link yfiles.input.GraphEditorInputMode#addQueryItemToolTipListener QueryItemToolTip} event for the given item. + */ + shouldQueryToolTip(item:yfiles.model.IModelItem):boolean; + /** + * Raises the {@link yfiles.input.GraphEditorInputMode#addQueryItemToolTipListener QueryItemToolTip} event. + * @param {yfiles.input.QueryItemToolTipEventArgs.} args The {@link yfiles.input.QueryItemToolTipEventArgs} instance containing the event data. + */ + onQueryItemToolTip(args:yfiles.input.QueryItemToolTipEventArgs):void; + /** + * Occurs when the mouse is {@link yfiles.input.MouseHoverInputMode hovering} over an item to determine the + * tool tip to display. + * This method will only be called for items that match the {@link yfiles.input.GraphEditorInputMode#toolTipItems} type. + */ + addQueryItemToolTipListener(value:(sender:Object,e:yfiles.input.QueryItemToolTipEventArgs)=> void):void; + /** + * Occurs when the mouse is {@link yfiles.input.MouseHoverInputMode hovering} over an item to determine the + * tool tip to display. + * This method will only be called for items that match the {@link yfiles.input.GraphEditorInputMode#toolTipItems} type. + */ + removeQueryItemToolTipListener(value:(sender:Object,e:yfiles.input.QueryItemToolTipEventArgs)=> void):void; + } + var GraphEditorInputMode:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that is not bound to an existing graph or selection, initially. + * The {@link yfiles.input.GraphEditorInputMode#graph} and {@link yfiles.input.GraphEditorInputMode#graphSelection} instances are obtained later + * from the {@link yfiles.input.IInputModeContext} once this mode gets {@link yfiles.input.GraphEditorInputMode#install installed} + * in a suitable canvas control. + */ + new ():yfiles.input.GraphEditorInputMode; + /** + * Creates a new instance of the {@link yfiles.input.GraphEditorInputMode} class. + * This constructor is useful if the mode is used without being {@link yfiles.input.GraphEditorInputMode#install installed} into a + * corresponding context. Otherwise the provided parameters are obtained from the context during installation. + * @param {yfiles.graph.IGraph} graph The graph to operate on. + * @param {yfiles.graph.IGraphSelection} selectionModel The selection model used for the graph. + */ + ForGraphAndSelection:{ + new (graph:yfiles.graph.IGraph,selectionModel:yfiles.graph.IGraphSelection):yfiles.input.GraphEditorInputMode; + }; + }; + /** + * Provides convenience implementations for {@link yfiles.input.IInputMode}s + * that deal with {@link yfiles.graph.IGraph}s. + * @see {@link yfiles.model.InputModeController} + */ + export interface GraphInputModeController extends yfiles.model.InputModeController{ + /** + * Gets or sets the graph this instance works on. + */ + graph:yfiles.graph.IGraph; + /** + * Gets the UnselectedEdgesHitTestable property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphInputModeController#createUnselectedEdgesHitTestable} will be called. + */ + unselectedEdgesHitTestable:yfiles.drawing.IHitTestable; + /** + * Factory method for the UnselectedEdgesHitTestable property. This method will be called + * upon first access to the {@link yfiles.input.GraphInputModeController#unselectedEdgesHitTestable} property. + * @return {yfiles.drawing.IHitTestable} a new instance of IHitTestable + */ + createUnselectedEdgesHitTestable():yfiles.drawing.IHitTestable; + /** + * Gets the NodesHitTestable property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphInputModeController#createNodesHitTestable} will be called. + */ + nodesHitTestable:yfiles.drawing.IHitTestable; + /** + * Factory method for the NodesHitTestable property. This method will be called + * upon first access to the {@link yfiles.input.GraphInputModeController#nodesHitTestable} property. + * @return {yfiles.drawing.IHitTestable} a new instance of IHitTestable + */ + createNodesHitTestable():yfiles.drawing.IHitTestable; + /** + * Gets the EdgesHitTestable property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphInputModeController#createEdgesHitTestable} will be called. + */ + edgesHitTestable:yfiles.drawing.IHitTestable; + /** + * Factory method for the EdgesHitTestable property. This method will be called + * upon first access to the {@link yfiles.input.GraphInputModeController#edgesHitTestable} property. + * @return {yfiles.drawing.IHitTestable} a new instance of IHitTestable + */ + createEdgesHitTestable():yfiles.drawing.IHitTestable; + /** + * Gets the UnselectedNodesHitTestable property. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphInputModeController#createUnselectedNodesHitTestable} will be called. + */ + unselectedNodesHitTestable:yfiles.drawing.IHitTestable; + /** + * Factory method for the UnselectedNodesHitTestable property. This method will be called + * upon first access to the {@link yfiles.input.GraphInputModeController#unselectedNodesHitTestable} property. + * @return {yfiles.drawing.IHitTestable} a new instance of IHitTestable + */ + createUnselectedNodesHitTestable():yfiles.drawing.IHitTestable; + } + var GraphInputModeController:{ + $class:yfiles.lang.Class; + /** + * Creates an instance using the provided graph and selection. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.model.ISelectionModel.} selectionModel The selection. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context to use for queries that need the context. + */ + new (graph:yfiles.graph.IGraph,selectionModel:yfiles.model.ISelectionModel,inputModeContext:yfiles.input.IInputModeContext):yfiles.input.GraphInputModeController; + }; + export enum EdgeSegmentDirection{ + /** + * The edge segment is going into north direction. + */ + NORTH, + /** + * The edge segment is going into east direction. + */ + EAST, + /** + * The edge segment is going into south direction. + */ + SOUTH, + /** + * The edge segment is going into west direction. + */ + WEST + } + /** + * A specialized {@link yfiles.input.IInputMode} used for creating edges between nodes + * in an {@link yfiles.graph.IGraph} displayed in a {@link yfiles.canvas.CanvasControl}. + * This class provides factory methods and callbacks, as well as a couple of options + * to tweak the edge gesture creation. + * This class uses {@link yfiles.input.IPortCandidateProvider} instances found in the {@link yfiles.support.ILookup} + * of the {@link yfiles.graph.INode nodes} in the graph to display port candidates and to finally + * create the edges. + */ + export interface CreateEdgeInputMode extends yfiles.input.StateMachineInputMode{ + /** + * Sets the cursor that indicates a valid place to begin an edge creation. + */ + validBeginCursor:yfiles.canvas.ICanvasCursor; + /** + * Sets the cursor that indicates a valid place to create a bend. + */ + validBendCursor:yfiles.canvas.ICanvasCursor; + /** + * Sets the cursor that indicates a valid place to finish creation. + */ + validEndCursor:yfiles.canvas.ICanvasCursor; + /** + * Gets or sets {@link yfiles.input.IEventRecognizer} that temporarily disables snapping. + * Value: The disable snapping recognizer. The default is {@link yfiles.input.KeyEvents#CTRL_DOWN} + */ + disableSnappingRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets {@link yfiles.input.IEventRecognizer} that reenables temporarily disabled snapping. + * Value: The disable snapping recognizer. The default is {@link yfiles.input.KeyEvents#CTRL_UP} + * @see {@link yfiles.input.CreateEdgeInputMode#disableSnappingRecognizer} + */ + enableSnappingRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} that toggles the orientation of the + * first orthogonally created segment. + * Value: The recognizer instances that identifies the event that toggles the orientation of the first segment. + * The default instance recognizes if the user presses the space key. + * @see {@link yfiles.input.CreateEdgeInputMode#orthogonalEdgeCreation} + */ + toggleSegmentOrientationRecognizer:yfiles.input.IEventRecognizer; + /** + * The event recognizer that recognizes the finishing gesture that + * is used to end the edge creation on the target node. + * The default is a combination of {@link yfiles.input.Mouse2DEvents#MOUSE_LEFT_PRESSED} and {@link yfiles.input.Mouse2DEvents#MOUSE_LEFT_RELEASED}. + */ + finishRecognizer:yfiles.input.IEventRecognizer; + /** + * The event recognizer that recognizes the starting gesture that + * is used to prepare the edge creation on the source node. + * The default is {@link yfiles.input.Mouse2DEvents#MOUSE_LEFT_PRESSED}. + */ + prepareRecognizer:yfiles.input.IEventRecognizer; + /** + * The event recognizer that recognizes the initial dragging gesture that + * is used to initiate the creation after the preparation. + * The default is {@link yfiles.input.Mouse2DEvents#MOUSE_DRAGGED}. + */ + draggedRecognizer:yfiles.input.IEventRecognizer; + /** + * The event recognizer that recognizes the movement of + * the end point of the edge. + * The default is {@link yfiles.input.Mouse2DEvents#MOUSE_MOVED_OR_DRAGGED}. + */ + movedOrDraggedRecognizer:yfiles.input.IEventRecognizer; + /** + * The event recognizer that recognizes the creation + * of a bend. + * The default is {@link yfiles.input.Mouse2DEvents#MOUSE_LEFT_RELEASED}. + */ + createBendRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the property that determines cancel events. + */ + cancelRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the property that determines bend removal events. + */ + removeBendRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the event recognizer that detects changes to the {@link yfiles.input.CreateEdgeInputMode#isPortCandidateResolutionEnabled} property. + */ + portCandidateResolutionRecognizer:yfiles.input.IEventRecognizer; + /** + * The event recognizer that recognizes the finishing gesture that + * is used to end the edge creation on the target node by a touch gesture. + * The default is a combination of {@link yfiles.input.Touch2DEvents#TOUCH_UP_PRIMARY}. + */ + finishRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * The event recognizer that recognizes the starting gesture that + * is used to prepare the edge creation on the source node via touch. + * The default is {@link yfiles.input.Touch2DEvents#TOUCH_LONG_PRESSED_PRIMARY}. + */ + prepareRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * The event recognizer that recognizes the initial dragging gesture that + * is used to initiate the creation after the preparation via touch. + * The default is {@link yfiles.input.Touch2DEvents#TOUCH_MOVED_PRIMARY}. + */ + draggedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * The event recognizer that recognizes the creation + * of a bend via touch. + * The default is {@link yfiles.input.Touch2DEvents#TOUCH_UP_PRIMARY}. + */ + createBendRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the property that determines cancel events via touch. + * The default is {@link yfiles.input.Touch2DEvents#TOUCH_MULTI_TAPPED_SECONDARY}. + */ + cancelRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the property that determines bend removal events via touch. + * The default is {@link yfiles.input.Touch2DEvents#TOUCH_LONG_PRESSED_SECONDARY}. + */ + removeBendRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Determines whether or not to display possible port candidates during the creation of the edge. + * The default is true. + */ + showPortCandidates:boolean; + /** + * Determines whether or not edges are allowed to connect to other edges. + * The default is false. + */ + edgeToEdgeConnectionsAllowed:boolean; + /** + * Gets or sets the distance in the view coordinate system that + * determines how far the mouse should be snapped to + * a port candidate if {@link yfiles.input.CreateEdgeInputMode#snapToTargetCandidate} is enabled. + * The default value is 20. + */ + snapDistance:number; + /** + * The {@link yfiles.input.CreateEdgeInputMode#snapContext} which manages snapping model items to certain coordinates (e.g. other items). + * If set to null (the default) this input mode tries to obtain the {@link yfiles.input.CreateEdgeInputMode#snapContext} + * from the {@link yfiles.input.IInputModeContext}. To explicitly disable snapping, a {@link yfiles.input.CreateEdgeInputMode#snapContext} implementation that does nothing + * has to be set to this instance. + */ + snapContext:yfiles.input.SnapContext; + /** + * Gets or sets the {@link yfiles.canvas.ICanvasObjectDescriptor} that is used for visualizing the + * {@link yfiles.input.IPortCandidate}s in the canvas during the edit. + * This descriptor is queried for the {@link yfiles.drawing.IVisualCreator} to obtain the visualizations + * for the candidates that are not currently closest. + * By default an instance of {@link yfiles.graph.DefaultPortCandidateDescriptor} is used. + * @see {@link yfiles.input.CreateEdgeInputMode#closestCandidateDescriptor} + */ + candidateDescriptor:yfiles.canvas.ICanvasObjectDescriptor; + /** + * Gets or sets the {@link yfiles.canvas.ICanvasObjectDescriptor} that is used for visualizing the + * closest {@link yfiles.input.IPortCandidate} in the canvas during the edit. + * This descriptor is queried for the {@link yfiles.drawing.IVisualCreator} to obtain the visualization + * for the currently closest candidate. + * By default an instance of {@link yfiles.graph.DefaultPortCandidateDescriptor} is used. + * @see {@link yfiles.input.CreateEdgeInputMode#candidateDescriptor} + */ + closestCandidateDescriptor:yfiles.canvas.ICanvasObjectDescriptor; + /** + * Gets or sets the distance in the view coordinate system that + * determines how far the mouse should be snapped to + * a horizontal or vertical line. + * The default value is 5. + */ + orthogonalSnapDistance:number; + /** + * Gets or sets a property that determines whether this mode allows + * connecting to {@link yfiles.input.IPortCandidate}s only. + * If this property is set to true and no candidates + * can be found for both the source and target node, no edge will be created. + * Otherwise this mode will {@link yfiles.graph.GraphExtensions#createEdge create the edge} + * using the {@link yfiles.input.CreateEdgeInputMode#getSourceNode source node} and {@link yfiles.input.CreateEdgeInputMode#getTargetNode target node} + * without port information. + * The default is false. + */ + connectToCandidatesOnly:boolean; + /** + * Gets or sets a property that determines whether the mouse should + * be forced to snap to the nearest valid port candidate if the mouse hovers + * over a target node. + * If the nearest port candidate is farther away than {@link yfiles.input.CreateEdgeInputMode#snapDistance} + * and the mouse hovers over a valid {@link yfiles.input.CreateEdgeInputMode#getTargetNode target node}, + * this property will cause the mouse to snap to the nearest valid candidate. + * The default is true. + */ + forceSnapToCandidate:boolean; + /** + * Gets or sets a property that determines whether this mode should + * use only the {@link yfiles.input.CreateEdgeInputMode#getTargetPortCandidates target port candidates} + * of the node the mouse currently hovers over. + * The default is true. + * @see {@link yfiles.input.CreateEdgeInputMode#showPortCandidates} + * @see {@link yfiles.input.CreateEdgeInputMode#getTargetNode} + * @see {@link yfiles.input.CreateEdgeInputMode#getTargetPortCandidates} + */ + useHitNodeTargetCandidatesOnly:boolean; + /** + * Gets or sets the property that enforces creation of orthogonal edges. + */ + orthogonalEdgeCreation:boolean; + /** + * Defines the preferred minimal distance of orthogonal edges. This + * information is needed when deciding which way to route the first + * segment of an orthogonal edge. + */ + preferredMinimalEdgeDistance:number; + /** + * Gets or sets a value indicating whether {@link yfiles.input.PortCandidateValidity#DYNAMIC} ports + * that are part of the {@link yfiles.input.CreateEdgeInputMode#getSourcePortCandidate source port candidates} should be resolved + * for the current mouse location. + * By default this feature is enabled and the {@link yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer} is configured so that + * the resolution mechanism is used if the user holds the shift modifier during the gesture. + * @see {@link yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer} + * @see {@link yfiles.input.CreateEdgeInputMode#resolveCandidates} + */ + resolveSourcePortCandidates:boolean; + /** + * Gets or sets a value indicating whether {@link yfiles.input.PortCandidateValidity#DYNAMIC} ports + * that are part of the {@link yfiles.input.CreateEdgeInputMode#getTargetPortCandidates target port candidates} should be resolved + * for the current mouse location. + * By default this feature is enabled and the {@link yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer} is configured so that + * the resolution mechanism is used if the user holds the shift modifier during the gesture. + * @see {@link yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer} + * @see {@link yfiles.input.CreateEdgeInputMode#resolveCandidates} + */ + resolveTargetPortCandidates:boolean; + /** + * This method is called to determine whether {@link yfiles.input.PortCandidateValidity#DYNAMIC} ports + * should be resolved or discarded. + * This implementation delegates to {@link yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer} and passes the + * {@link yfiles.input.StateMachineInputMode#lastMouse2DEventArgs} as the arguments. + * @return {boolean} + * true if dynamic port candidates are resolved for the current mouse location; otherwise, false. + * @see {@link yfiles.input.CreateEdgeInputMode#portCandidateResolutionRecognizer} + * @see {@link yfiles.input.CreateEdgeInputMode#resolveSourcePortCandidates} + * @see {@link yfiles.input.CreateEdgeInputMode#resolveTargetPortCandidates} + * @see {@link yfiles.input.CreateEdgeInputMode#resolveCandidates} + */ + isPortCandidateResolutionEnabled():boolean; + /** + * Defines the width of a node's border which is taken into account + * when deciding which way to route the first segment of an orthogonal edge. + * An edge starting in a border is always pointing away from it. + */ + nodeBorderWidthRatio:number; + /** + * Installs all necessary listeners to trigger the {@link yfiles.input.StateMachineInputMode#run} method. + * This implementation registers for all mouse events, keyboard events, and + * the {@link yfiles.canvas.CanvasControl#addEditableChangedListener EditableChanged} event. + */ + installListeners():void; + /** + * Removes all listeners from the canvas that have been registered in {@link yfiles.input.StateMachineInputMode#installListeners}. + */ + uninstallListeners():void; + /** + * Gets or sets the node based edge creation callback. + * Value: The node based edge creation callback that will be used during {@link yfiles.input.CreateEdgeInputMode#createEdgeBetweenNodes}. + * The default creator will simply delegate to {@link yfiles.graph.GraphExtensions#createEdgeWithNodesAndStyle} + * @throws {yfiles.system.ArgumentNullException} If the argument is null + */ + nodeBasedEdgeCreator:(ctx:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,sourceNode:yfiles.graph.INode,targetNode:yfiles.graph.INode,style:yfiles.drawing.IEdgeStyle)=>yfiles.graph.IEdge; + /** + * Gets or sets the ports based edge creation callback. + * Value: The ports based edge creation callback that will be used during {@link yfiles.input.CreateEdgeInputMode#createEdgeForCandidates}. + * The default creator will simply delegate to {@link yfiles.graph.GraphExtensions#createEdgeWithPortsAndStyle}. + * @throws {yfiles.system.ArgumentNullException} If the argument is null + */ + portBasedEdgeCreator:(ctx:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort,style:yfiles.drawing.IEdgeStyle)=>yfiles.graph.IEdge; + /** + * Retrieves the nodes from the graph in the order of their importance. + * This implementation uses the hierarchy of the nodes if it is available. + * @return {yfiles.collections.IEnumerable.} + */ + getNodes():yfiles.collections.IEnumerable; + /** + * Retrieves the port owners from the graph in the order of their importance. + * This implementation delegates to {@link yfiles.input.CreateEdgeInputMode#getNodes} unless + * {@link yfiles.input.CreateEdgeInputMode#edgeToEdgeConnectionsAllowed} is set to true, in which case + * all edges are added to the enumerable. + * @return {yfiles.collections.IEnumerable.} An enumerable over all {@link yfiles.graph.IPortOwner}s in this graph + */ + getPortOwners():yfiles.collections.IEnumerable; + /** + * Determines whether or not to allow the creation of self loops. + * The default is true, which enables that an edge is connected + * to a {@link yfiles.graph.IEdge#sourcePort} and {@link yfiles.graph.IEdge#targetPort} that have + * the same {@link yfiles.graph.IPort#owner}. + */ + selfloopCreationAllowed:boolean; + /** + * Determines whether it is allowed to currently create a bend. + */ + isValidBend(source:Object,args:yfiles.system.EventArgs):boolean; + /** + * Determines whether or not to allow the creation of bends. + * The default is true. + */ + bendCreationAllowed:boolean; + /** + * Gets or sets the dummy edge instance that will be used to render a preview of the edge + * to be created. + * This instance will be used for rendering the edge during the gesture. + */ + dummyEdge:yfiles.graph.IEdge; + /** + * Gets or sets the candidate for the {@link yfiles.graph.IEdge#sourcePort} + * of the edge to be created. + */ + sourcePortCandidate:yfiles.input.IPortCandidate; + /** + * Gets or sets the current candidate for the {@link yfiles.graph.IEdge#targetPort} + * of the edge to be created. + */ + targetPortCandidate:yfiles.input.IPortCandidate; + /** + * Factory method for the {@link yfiles.input.CreateEdgeInputMode#startPoint} property. + * This implementation returns a simple new {@link yfiles.geometry.Point}. + */ + createStartPoint():yfiles.geometry.IMutablePoint; + /** + * Factory method for the {@link yfiles.input.CreateEdgeInputMode#dragPoint} property. + * This implementation returns a simple new {@link yfiles.geometry.Point}. + */ + createDragPoint():yfiles.geometry.IMutablePoint; + /** + * Creates a {@link yfiles.drawing.IVisualCreator} that creates Visuals for the port candidates. + * @see {@link yfiles.input.CreateEdgeInputMode#visuals} + */ + createVisuals():yfiles.drawing.IVisualCreator; + /** + * Determines whether the edge gesture may end at this state. + * This method will yield false if {@link yfiles.input.CreateEdgeInputMode#isBendCreationEnforced} + * yields true. + */ + isValidEnd(source:Object,args:yfiles.system.EventArgs):boolean; + /** + * Synthetically starts the interactive edge creation process using the provided + * {@link yfiles.input.IPortCandidate} as the source port. + * This instance needs to be {@link yfiles.input.AbstractInputMode#installed} and + * {@link yfiles.input.AbstractConcurrentInputMode#enabled} and it needs to be able to + * {@link yfiles.input.AbstractConcurrentInputMode#canRequestMutex request the input mutex} + * in order to proceed. If any of these conditions are not satisfied, this method will + * throw an {@link yfiles.system.InvalidOperationException}. + * @param {yfiles.input.IPortCandidate} sourcePortCandidate The source port candidate to use for the edge creation. + */ + doStartEdgeCreation(sourcePortCandidate:yfiles.input.IPortCandidate):void; + /** + * Determines the edge style to {@link yfiles.input.CreateEdgeInputMode#assignEdgeStyle assign to the dummy edge}. + * This method is called at the beginning of the edge creation to determine the style to use + * during the gesture. This implementation uses the {@link yfiles.input.CreateEdgeInputMode#edgeStyle} property + * or the {@link yfiles.graph.IGraph#edgeDefaults} if the former is null. + * @return {yfiles.drawing.IEdgeStyle} The edge style to {@link yfiles.input.CreateEdgeInputMode#assignEdgeStyle assign}. + */ + determineEdgeStyle():yfiles.drawing.IEdgeStyle; + /** + * Determines whether the current mouse state is valid for + * beginning the edge creation gesture. + * If {@link yfiles.input.CreateEdgeInputMode#connectToCandidatesOnly} is set to true, this method + * will only yield true if a valid {@link yfiles.input.CreateEdgeInputMode#getSourcePortCandidate source + * port candidate} is found for the current {@link yfiles.input.CreateEdgeInputMode#getSourceNode source node}. + */ + isValidBegin(source:Object,args:yfiles.system.EventArgs):boolean; + /** + * Finds the source {@link yfiles.graph.IPortOwner port owner} at the specified location. + * This always is the source {@link yfiles.graph.INode node} + * if {@link yfiles.input.CreateEdgeInputMode#edgeToEdgeConnectionsAllowed} is set to false. + * @param {yfiles.geometry.PointD} sourcePoint The location of the mouse at the beginning of the gesture. + * @return {yfiles.graph.IPortOwner} The port owner to use for the source node or null. + */ + getSourcePortOwner(sourcePoint:yfiles.geometry.PointD):yfiles.graph.IPortOwner; + /** + * Callback that decides whether at the current state of the gesture + * the user wants to enforce the creation of a bend rather than finish + * the edge creation. + * This implementation yields true if during the last mouse + * event the {@link yfiles.input.ModifierKeys#CONTROL} key had been pressed and {@link yfiles.input.CreateEdgeInputMode#bendCreationAllowed} is + * set to true. + * @return {boolean} Whether to enforce the creation of a bend. + */ + isBendCreationEnforced():boolean; + /** + * Callback at the end of the edge creation process. + * This method will actually create the edge using the {@link yfiles.input.CreateEdgeInputMode#createEdgeForCandidates} + * or {@link yfiles.input.CreateEdgeInputMode#createEdgeBetweenNodes} method. + * If successful, this method will {@link yfiles.graph.GraphExtensions#clearBends clear the bends} and + * call {@link yfiles.input.CreateEdgeInputMode#assignBends} to assign the bends created during the gesture to the resulting edge. + * This method will ultimately call {@link yfiles.input.CreateEdgeInputMode#onEdgeCreated}. + * @return {yfiles.graph.IEdge} The edge created or null. + */ + createEdge(controlPoints:yfiles.model.IListEnumerable):yfiles.graph.IEdge; + /** + * Gets or sets whether after calls to {@link yfiles.input.CreateEdgeInputMode#createEdgeForCandidates} + * or {@link yfiles.input.CreateEdgeInputMode#createEdgeBetweenNodes} the current undo edit should be canceled if any of these methods returns null. + * This should be set to false if you want to perform some undoable actions in these methods and/or in the {@link yfiles.input.CreateEdgeInputMode#portBasedEdgeCreator} or {@link yfiles.input.CreateEdgeInputMode#nodeBasedEdgeCreator} + * callbacks, but need to return null from any of these methods. Default value is true, meaning that returning null results in + * canceling the composite undo entry. + */ + cancelEditImplicitly:boolean; + /** + * Called by {@link yfiles.input.CreateEdgeInputMode#createEdge} + * after the edge has been finalized. + * This method will trigger the {@link yfiles.input.CreateEdgeInputMode#addEdgeCreatedListener EdgeCreated} event. + * @param {yfiles.model.ItemEventArgs.} args The event argument holding the edge. + */ + onEdgeCreated(args:yfiles.model.ItemEventArgs):void; + /** + * Event that is triggered after an edge has been created by this mode. + * @see {@link yfiles.input.CreateEdgeInputMode#onEdgeCreated} + */ + addEdgeCreatedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is triggered after an edge has been created by this mode. + * @see {@link yfiles.input.CreateEdgeInputMode#onEdgeCreated} + */ + removeEdgeCreatedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Callback used by {@link yfiles.input.CreateEdgeInputMode#createEdge} if both {@link yfiles.input.CreateEdgeInputMode#sourcePortCandidate} + * and {@link yfiles.input.CreateEdgeInputMode#targetPortCandidate} have been set. + * This method will create the edge and connect them to the port candidates. + * @param {yfiles.graph.IGraph} graph The graph to create the edge for. + * @param {yfiles.input.IPortCandidate} sourcePortCandidate The candidate to use for the source. + * @param {yfiles.input.IPortCandidate} targetPortCandidate The candidate to use for the target. + * @return {yfiles.graph.IEdge} The edge created or null. + */ + createEdgeForCandidates(graph:yfiles.graph.IGraph,sourcePortCandidate:yfiles.input.IPortCandidate,targetPortCandidate:yfiles.input.IPortCandidate):yfiles.graph.IEdge; + /** + * Raises the {@link yfiles.input.CreateEdgeInputMode#addPortAddedListener PortAdded} event if the mode has {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag added a port} + * for the source or target node to complete the edge creation. + * @param {yfiles.model.ItemEventArgs.} args The {@link yfiles.model.ItemEventArgs} instance containing the port that has been added. + * @see {@link yfiles.input.CreateEdgeInputMode#addPortAddedListener PortAdded} + */ + onPortAdded(args:yfiles.model.ItemEventArgs):void; + /** + * Occurs when this instance {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag adds a port} to the source or target node during completion of the edge + * creation gesture. + */ + addPortAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Occurs when this instance {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag adds a port} to the source or target node during completion of the edge + * creation gesture. + */ + removePortAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Assigns the given bend points to the newly created edge. + * @param {yfiles.graph.IGraph} graph The graph that contains the edge. + * @param {yfiles.graph.IEdge} edge The edge. + * @param {yfiles.model.IListEnumerable.} pointList The list of points including the source and target point. + */ + assignBends(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,pointList:yfiles.model.IListEnumerable):void; + /** + * Called at the beginning of the edge creation gesture. + * This method {@link yfiles.input.CreateEdgeInputMode#determineEdgeStyle determines} and {@link yfiles.input.CreateEdgeInputMode#assignEdgeStyle assigns the edge style} + * to the {@link yfiles.input.CreateEdgeInputMode#dummyEdge} and resets the port candidates. + * @see {@link yfiles.input.CreateEdgeInputMode#updateTargetPortOwner} + * @see {@link yfiles.input.CreateEdgeInputMode#assignSourcePortPosition} + * @see {@link yfiles.input.CreateEdgeInputMode#getSourcePortCandidateProvider} + * @see {@link yfiles.input.CreateEdgeInputMode#getSourcePortCandidate} + */ + startCreateEdge():void; + /** + * Finds the best matching source port {@link yfiles.input.IPortCandidate} given a provider + * and the current location. + * The resolveCandidates parameter determines whether dynamic port candidates should + * be {@link yfiles.input.CreateEdgeInputMode#resolveCandidates resolved} with respect to location or simply be + * discarded. + * @param {yfiles.input.IPortCandidateProvider} provider The provider for the candidates. + * @param {yfiles.geometry.PointD} location The location where the gesture was initiated. + * @param {boolean} resolveCandidates Determines whether {@link yfiles.input.PortCandidateValidity#DYNAMIC} ports should be resolved + * with respect to the location or not. + * @return {yfiles.input.IPortCandidate} The candidate to use or null. + * @see {@link yfiles.input.CreateEdgeInputMode#resolveSourcePortCandidates} + * @see {@link yfiles.input.CreateEdgeInputMode#isPortCandidateResolutionEnabled} + */ + getSourcePortCandidate(provider:yfiles.input.IPortCandidateProvider,location:yfiles.geometry.PointD,resolveCandidates:boolean):yfiles.input.IPortCandidate; + /** + * Returns an enumerable over the given candidates where no instance has {@link yfiles.input.PortCandidateValidity#DYNAMIC} + * {@link yfiles.input.IPortCandidate#validity}. + * If the location has a value, method {@link yfiles.input.IPortCandidate#getPortCandidateAt} + * is used to resolve the dynamic candidate to a real candidate, otherwise that candidate is discarded. + * @param {yfiles.collections.IEnumerable.} candidates The candidates to possibly resolve. + * @param {yfiles.geometry.PointD} location The location to resolve dynamic candidates against or null if they should be discarded instead. + * @return {yfiles.collections.IEnumerable.} An enumerable of non-{@link yfiles.input.PortCandidateValidity#DYNAMIC} port candidates. + */ + resolveCandidates(candidates:yfiles.collections.IEnumerable,location:yfiles.geometry.PointD):yfiles.collections.IEnumerable; + /** + * Returns the input mode context that will be passed to implementations that are called by this instance + * and require a context. + * This method caches the context for the current edge creation and creates a new instance + * using {@link yfiles.input.CreateEdgeInputMode#createEdgeCreationInputModeContext} + * @return {yfiles.input.IInputModeContext} A context to use for the implementations that are called by this instance. + */ + getChildInputModeContext():yfiles.input.IInputModeContext; + /** + * Creates an {@link yfiles.input.IInputModeContext} for use + * with the port candidates queries for the upcoming + * edge creation operation and the actual edge creation. + * @return {yfiles.input.IInputModeContext} An instance of {@link yfiles.input.IInputModeContext} + * that is configured for this mode. + */ + createEdgeCreationInputModeContext():yfiles.input.IInputModeContext; + /** + * Assigns the port position and owner to the {@link yfiles.input.CreateEdgeInputMode#dummyEdge}. + * This method is a callback used by {@link yfiles.input.CreateEdgeInputMode#startCreateEdge}. + * @param {yfiles.graph.IPortOwner} portOwner The owner to use for the source side. + * @param {yfiles.graph.IPortLocationModelParameter} locationModelParameter The location of the port to use. + */ + assignSourcePortPosition(portOwner:yfiles.graph.IPortOwner,locationModelParameter:yfiles.graph.IPortLocationModelParameter):void; + /** + * Assigns the style to the {@link yfiles.input.CreateEdgeInputMode#dummyEdge} to use during the gesture. + * @param {yfiles.drawing.IEdgeStyle} style The style to assign. + */ + assignEdgeStyle(style:yfiles.drawing.IEdgeStyle):void; + /** + * Gets or sets the {@link yfiles.drawing.IEdgeStyle} to use for newly created edges. + * The default is null, which will make the instance use {@link yfiles.graph.IGraph#edgeDefaults} instead. + * Value: The edge style to use or null, if the {@link yfiles.graph.IGraph#edgeDefaults} should be used instead. + */ + edgeStyle:yfiles.drawing.IEdgeStyle; + /** + * Creates the dummy edge that will be displayed by the input mode during the creation. + * This method delegates to {@link yfiles.input.CreateEdgeInputMode#createDummyTargetNode} to create the target node + * that is used to move the anchor during the gesture. + * @return {yfiles.graph.IEdge} An {@link yfiles.graph.IEdge} implementation that can be used as a dummy. + */ + createDummyEdge():yfiles.graph.IEdge; + /** + * Factory method that initially creates the dummy node that will be used to drag around the dummy edge's end. + * @return {yfiles.graph.SimpleNode} A + */ + createDummyTargetNode():yfiles.graph.SimpleNode; + /** + * Callback that creates the edge if no {@link yfiles.input.CreateEdgeInputMode#targetPortCandidate} and {@link yfiles.input.CreateEdgeInputMode#sourcePortCandidate} + * have been determined but a {@link yfiles.input.CreateEdgeInputMode#getSourceNode source node} and a {@link yfiles.input.CreateEdgeInputMode#getTargetNode target node.}. + * @param {yfiles.graph.IGraph} graph The graph instance to create the edge for. + * @param {yfiles.graph.INode} sourceNode The source node of the edge. + * @param {yfiles.graph.INode} targetNode The target node of the edge. + * @return {yfiles.graph.IEdge} The edge created or null if the edge could not be created. + */ + createEdgeBetweenNodes(graph:yfiles.graph.IGraph,sourceNode:yfiles.graph.INode,targetNode:yfiles.graph.INode):yfiles.graph.IEdge; + /** + * Finds the target {@link yfiles.graph.IPortOwner port owner} at the specified location. + * This always is the target {@link yfiles.graph.INode node} + * if {@link yfiles.input.CreateEdgeInputMode#edgeToEdgeConnectionsAllowed} is set to false. + * @param {yfiles.geometry.PointD} targetPoint The location of the mouse at the beginning of the gesture. + * @return {yfiles.graph.IPortOwner} The port owner or null. + */ + getTargetPortOwner(targetPoint:yfiles.geometry.PointD):yfiles.graph.IPortOwner; + /** + * Finds the target node for a given point in world coordinates. + * This method simply delegates to {@link yfiles.input.CreateEdgeInputMode#getNode}. + * @param {yfiles.geometry.PointD} targetPoint The location of the mouse at the end of the gesture. + * @return {yfiles.graph.INode} The node to use for the target node or null. + */ + getTargetNode(targetPoint:yfiles.geometry.PointD):yfiles.graph.INode; + /** + * Finds the source node for a given point in world coordinates. + * This method simply delegates to {@link yfiles.input.CreateEdgeInputMode#getNode}. + * @param {yfiles.geometry.PointD} sourcePoint The location of the mouse at the beginning of the gesture. + * @return {yfiles.graph.INode} The node to use for the source node or null. + */ + getSourceNode(sourcePoint:yfiles.geometry.PointD):yfiles.graph.INode; + /** + * Retrieves the {@link yfiles.input.IPortCandidateProvider} instance that provides + * the possible candidates for the target of the edge given the current source candidate. + * This implementation queries all nodes in the graph for + * {@link yfiles.input.CreateEdgeInputMode#getTargetPortCandidateProvider their provider} + * and returns a composite unless {@link yfiles.input.CreateEdgeInputMode#useHitNodeTargetCandidatesOnly} is set to true + * in which case the {@link yfiles.input.CreateEdgeInputMode#getTargetPortCandidateProvider} + * is queried using the current {@link yfiles.input.CreateEdgeInputMode#getTargetNode target node}. + * @param {yfiles.input.IPortCandidate} sourceCandidate The source candidate that has been chosen for the edge creation. + * @param {yfiles.geometry.PointD} dragPoint The location of the mouse. + * @return {yfiles.input.IPortCandidateProvider} The provider to get the port candidates from. + */ + getTargetPortCandidateProviderForLocation(sourceCandidate:yfiles.input.IPortCandidate,dragPoint:yfiles.geometry.PointD):yfiles.input.IPortCandidateProvider; + /** + * Finds the closest target candidate given a number of {@link yfiles.input.IPortCandidate}s and + * a location in world coordinates. + * @param {yfiles.collections.IEnumerable.} candidates The candidates to find the closest from. + * @param {yfiles.geometry.PointD} dragPoint The location of the mouse in world coordinates. + * @return {yfiles.input.IPortCandidate} The candidate to use or null if no candidate satisfies the needs or + * {@link yfiles.input.CreateEdgeInputMode#isBendCreationEnforced} yields true. + */ + getClosestTargetCandidate(candidates:yfiles.collections.IEnumerable,dragPoint:yfiles.geometry.PointD):yfiles.input.IPortCandidate; + /** + * Finds the closest candidate given a number of {@link yfiles.input.IPortCandidate}s and + * a location in world coordinates. + * @param {yfiles.collections.IEnumerable.} candidates The candidates to find the closest from. + * @param {yfiles.geometry.PointD} location The location of the mouse in world coordinates. + * @return {yfiles.input.IPortCandidate} The candidate to use or null if no candidate satisfies the needs + */ + getClosestSourceCandidate(candidates:yfiles.collections.IEnumerable,location:yfiles.geometry.PointD):yfiles.input.IPortCandidate; + /** + * Finds the closest {@link yfiles.input.PortCandidateValidity#VALID} candidate given a number of {@link yfiles.input.IPortCandidate}s and + * a location in world coordinates. + * @param {yfiles.collections.IEnumerable.} candidates The candidates to find the closest from. + * @param {yfiles.geometry.PointD} dragPoint The location of the mouse in world coordinates. + * @return {yfiles.input.IPortCandidate} The candidate to use or null if no candidate satisfies the needs + */ + getClosestCandidate(candidates:yfiles.collections.IEnumerable,dragPoint:yfiles.geometry.PointD):yfiles.input.IPortCandidate; + /** + * Retrieves the port candidate provider instance given a source port candidate and a possible target item. + * This implementations uses the targetItem's {@link yfiles.support.ILookup#lookup} + * to retrieve an {@link yfiles.input.IPortCandidateProvider} implementation. + * @param {yfiles.input.IPortCandidate} sourceCandidate The current source port candidate. + * @param {yfiles.graph.IPortOwner} targetItem The {@link yfiles.graph.IPortOwner} to find the candidates for. + * @param {yfiles.geometry.PointD} dragPoint The location of the mouse. + * @return {yfiles.input.IPortCandidateProvider} A provider instance or null. + */ + getTargetPortCandidateProvider(sourceCandidate:yfiles.input.IPortCandidate,targetItem:yfiles.graph.IPortOwner,dragPoint:yfiles.geometry.PointD):yfiles.input.IPortCandidateProvider; + /** + * Retrieves the port candidate provider instance given a source port owner. + * This implementations uses the sourcePortOwner's {@link yfiles.support.ILookup#lookup} + * to retrieve an {@link yfiles.input.IPortCandidateProvider} implementation. + * @param {yfiles.graph.IPortOwner} sourcePortOwner The {@link yfiles.graph.IPortOwner} to find the candidates for. + * @return {yfiles.input.IPortCandidateProvider} A provider instance or null. + */ + getSourcePortCandidateProvider(sourcePortOwner:yfiles.graph.IPortOwner):yfiles.input.IPortCandidateProvider; + /** + * Retrieves the node at a given position in world coordinates. + * If there is a {@link yfiles.drawing.IHitTestEnumerator} for type {@link yfiles.graph.INode} in + * the lookup of this mode's {@link yfiles.input.AbstractInputMode#inputModeContext} + * then this instance will be used for the query. + * Otherwise this implementation calls the {@link yfiles.drawing.IStyleRenderer#getHitTestable} method + * of the nodes to find hit nodes and uses the {@link system.collections.Comparer} to determine the + * first hit node. + * @param {yfiles.geometry.PointD} location The position in world coordinates. + * @return {yfiles.graph.INode} The node or null if no suitable node was found. + */ + getNode(location:yfiles.geometry.PointD):yfiles.graph.INode; + /** + * Retrieves the port owner at a given position in world coordinates. + * If there is a {@link yfiles.drawing.IHitTestEnumerator} for type {@link yfiles.graph.INode} in + * the lookup of this mode's {@link yfiles.input.AbstractInputMode#inputModeContext} + * then this instance will be used for the query. + * Otherwise this implementation calls the {@link yfiles.drawing.IStyleRenderer#getHitTestable} method + * of the nodes to find hit nodes and uses the {@link system.collections.Comparer} to determine the + * first hit node. + * @param {yfiles.geometry.PointD} location The position in world coordinates. + * @return {yfiles.graph.IPortOwner} The node or null if no suitable node was found. + */ + getPortOwner(location:yfiles.geometry.PointD):yfiles.graph.IPortOwner; + /** + * Determines whether or not the edge's end point should snap to the current target port candidate + * during the creation of the edge. + * This will make the edge's end point point to the position of the target port candidate. + * However the path will end at the candidate and will not be cropped by the + * node. In order to show how the edge will look like after creation, turn the {@link yfiles.input.CreateEdgeInputMode#snapToTargetCandidateOwner} + * property on, too. + * @see {@link yfiles.input.CreateEdgeInputMode#snapToTargetCandidateOwner} + */ + snapToTargetCandidate:boolean; + /** + * Determines whether or not the edge's port should snap to the current target port candidate owner + * during the creation of the edge. + * This will make the edge appear cropped at the node bounds if the edge is snapped to a port candidate. + * The default is false + * @see {@link yfiles.input.CreateEdgeInputMode#snapToTargetCandidateOwner} + */ + snapToTargetCandidateOwner:boolean; + /** + * Gets or sets a {@link yfiles.drawing.IHitTestable} that determines, whether it is valid to start + * an edge creation gesture here. + * The default implementation returns true if {@link yfiles.input.CreateEdgeInputMode#getSourceNode} yields a + * non-null value. + * @see {@link yfiles.input.CreateEdgeInputMode#isValidBegin} + */ + beginHitTestable:yfiles.drawing.IHitTestable; + /** + * Gets or sets a {@link yfiles.drawing.IHitTestable} that determines, whether it is valid to finish + * an edge creation gesture here. + * The default implementation returns true if there is a node at the given location. + * @see {@link yfiles.input.CreateEdgeInputMode#isValidEnd} + */ + endHitTestable:yfiles.drawing.IHitTestable; + /** + * Gets or sets a {@link yfiles.drawing.IHitTestable} that determines, whether it is valid to create a + * bend here. + * The default implementation returns always true. + * @see {@link yfiles.input.CreateEdgeInputMode#isValidBend} + */ + validBendHitTestable:yfiles.drawing.IHitTestable; + /** + * Gets the starting point for the edge creation. + */ + startPoint:yfiles.geometry.IMutablePoint; + /** + * Gets the dragging point for the edge creation. + */ + dragPoint:yfiles.geometry.IMutablePoint; + /** + * Gets the visuals that paints the port candidates. + * @see {@link yfiles.input.CreateEdgeInputMode#createVisuals} + * @see {@link yfiles.input.CreateEdgeInputMode#installDummyEdge} + */ + visuals:yfiles.drawing.IVisualCreator; + /** + * Retrieves the target port candidates for a given location in world coordinates. + * The resolveCandidates parameter determines whether dynamic port candidates should + * be {@link yfiles.input.CreateEdgeInputMode#resolveCandidates resolved} with respect to dragPoint or simply be + * discarded. + * This implementation delegates to {@link yfiles.input.CreateEdgeInputMode#getTargetPortCandidateProviderForLocation} + * or returns an empty enumerable if no provider has been found. + * @param {yfiles.geometry.PointD} dragPoint The location of the mouse in world coordinates. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumeration over all target port candidates. + * @see {@link yfiles.input.CreateEdgeInputMode#sourcePortCandidate} + * @param {boolean} resolveCandidates Determines whether {@link yfiles.input.PortCandidateValidity#DYNAMIC} ports should be resolved + * with respect to the dragPoint or not. + * @see {@link yfiles.input.CreateEdgeInputMode#resolveTargetPortCandidates} + * @see {@link yfiles.input.CreateEdgeInputMode#isPortCandidateResolutionEnabled} + */ + getTargetPortCandidates(dragPoint:yfiles.geometry.PointD,resolveCandidates:boolean):yfiles.collections.IEnumerable; + /** + * Updates the visual representation and port candidates. + * This method delegates to {@link yfiles.input.CreateEdgeInputMode#getTargetPortCandidates} and + * {@link yfiles.input.CreateEdgeInputMode#getClosestTargetCandidate} and eventually to {@link yfiles.input.CreateEdgeInputMode#updateTargetPortOwner}. + * @param {yfiles.geometry.PointD} dragPoint + */ + onTargetLocationChanged(dragPoint:yfiles.geometry.PointD):void; + /** + * Updates the {@link yfiles.input.CreateEdgeInputMode#dummyEdge} to reflect the current target port candidate. + * This implementation creates a self loop of the dummy edge if the newOwner + * is the same as the owner of the {@link yfiles.input.CreateEdgeInputMode#sourcePortCandidate}. + * @param {yfiles.graph.IPortOwner} oldOwner The old owner instance. + * @param {yfiles.graph.IPortOwner} newOwner The new owner instance. + */ + updateTargetPortOwner(oldOwner:yfiles.graph.IPortOwner,newOwner:yfiles.graph.IPortOwner):void; + /** + * Called to initialize the state machine. + * This implementation does nothing. + * @param {yfiles.support.StateMachine} machine The machine to initialize and configure + * @param {yfiles.support.State} startState The start state to use. + * @param {yfiles.support.State} canceledState The canceled state to use. + * @param {yfiles.support.State} stoppedState The stopped state to use. + * @param {yfiles.support.State} finishedState The finished state to use. + */ + initializeStateMachine(machine:yfiles.support.StateMachine,startState:yfiles.support.State,canceledState:yfiles.support.State,stoppedState:yfiles.support.State,finishedState:yfiles.support.State):void; + /** + * Determines whether the current event cancels the gesture. + */ + isCancelGesture(eventSource:Object,eventArg:yfiles.system.EventArgs):boolean; + /** + * Determines whether the current event indicates the dragging inside the source node + * is finished. + */ + isSourceNodeDraggingFinished(eventSource:Object,eventArg:yfiles.system.EventArgs):boolean; + /** + * Determines whether the current event removes the last bend. + */ + isRemoveBendEvent(eventSource:Object,eventArg:yfiles.system.EventArgs):boolean; + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(c:yfiles.input.IInputModeContext):void; + /** + * Gets or sets the canvas object group provider this mode should render the + * visual representations of the dummy edge in. + * The default is an instance of {@link yfiles.model.CanvasGroupProviders#createTopGroupProvider}. + */ + canvasGroupProvider:yfiles.model.ICanvasGroupProvider; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(c:yfiles.input.IInputModeContext):void; + /** + * Determines whether currently an edge creation is in progress. + * This property yields true after the edge creation has been started and before + * it has been {@link yfiles.input.CreateEdgeInputMode#cancelWithTransition cancelled} or finalized. + */ + isCreationInProgress:boolean; + /** + * {@link yfiles.model.IInstallerContext#addInstalled Installs} the {@link yfiles.canvas.ICanvasObject}s for the dummy edge using the provided context. + * This method is called when the gesture is started to add the dummy edge visualization to the canvas. + * The adorners and decorators for rendering port candidates will be installed separately using the {@link yfiles.input.CreateEdgeInputMode#visuals} property. + * This implementation simply delegates to the {@link yfiles.model.IModelItemInstaller#install} method of the {@link yfiles.input.CreateEdgeInputMode#dummyEdge}'s style. + * @param {yfiles.model.IInstallerContext} installerContext The context to use for the installation + * @see {@link yfiles.input.CreateEdgeInputMode#visuals} + */ + installDummyEdge(installerContext:yfiles.model.IInstallerContext):void; + /** + * Event that will be triggered before the gesture will be finished. + */ + addGestureFinishingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the gesture will be finished. + */ + removeGestureFinishingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the gesture has been finished. + */ + addGestureFinishedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the gesture has been finished. + */ + removeGestureFinishedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the gesture is starting. + */ + addGestureStartingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the gesture is starting. + */ + removeGestureStartingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the gesture is initialized and has started. + */ + addGestureStartedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the gesture is initialized and has started. + */ + removeGestureStartedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the start of every drag or move. + */ + addMovingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the start of every drag or move. + */ + removeMovingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the end of every drag or move. + */ + addMovedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the end of every drag or move. + */ + removeMovedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered when the gesture has been canceled. + */ + addGestureCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered when the gesture has been canceled. + */ + removeGestureCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the gesture will be canceled. + */ + addGestureCancelingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the gesture will be canceled. + */ + removeGestureCancelingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureStartingListener GestureStarting} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onGestureStarting(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureStartedListener GestureStarted} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onGestureStarted(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the start of each drag. + * This method triggers the {@link yfiles.input.CreateEdgeInputMode#addMovingListener Moving} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onMoving(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the end of each drag. + * This method triggers the {@link yfiles.input.CreateEdgeInputMode#addMovedListener Moved} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onMoved(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered once the drag has been finalized. + * This method triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureFinishedListener GestureFinished} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onGestureFinished(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered before the drag will be finalized. + * This method triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureFinishingListener GestureFinishing} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onGestureFinishing(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureCanceledListener GestureCanceled} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onGestureCanceled(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.CreateEdgeInputMode#addGestureCancelingListener GestureCanceling} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onGestureCanceling(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Gets the snap lines lines that are induced by the current dummy edge. + * @param {yfiles.input.GraphSnapContext} graphSnapContext The graph snap context. + * @param {yfiles.input.ISnapLineProvider} dummyEdgeSegmentSnapLineProvider The dummy edge segment snap line provider. + * @return {yfiles.collections.IEnumerable.} The snap lines induced by the current dummy edge. + */ + getDummyEdgeSnapLines(graphSnapContext:yfiles.input.GraphSnapContext,dummyEdgeSegmentSnapLineProvider:yfiles.input.ISnapLineProvider):yfiles.collections.IEnumerable; + /** + * Calculates direction of first edge segment of the DummyNode. + * An edge starting in an border will always be orthogonal to the border's outer line. + * An edge starting in a corner will point the way the user dragged the mouse. + * An edge starting in the inner of the node will be directed the way dragged unless another edge that + * is close to the new edge ({@link yfiles.input.CreateEdgeInputMode#preferredMinimalEdgeDistance}) already went that way. + * @param {yfiles.geometry.PointD} dragVector The drag vector. Last mouse location - SourcePort location + * @return {yfiles.input.EdgeSegmentDirection} A {@link yfiles.input.EdgeSegmentDirection} defining the direction of the first edge segment. + */ + getFirstSegmentDirection(dragVector:yfiles.geometry.PointD):yfiles.input.EdgeSegmentDirection; + /** + * Raises the {@link yfiles.input.CreateEdgeInputMode#addEdgeCreationStartedListener EdgeCreationStarted} event when the gesture for creating an edge has been initialized. + * @param {yfiles.model.ItemEventArgs.} args The {@link yfiles.model.ItemEventArgs} instance containing the dummy edge that will be used during edge creation. + */ + onEdgeCreationStarted(args:yfiles.model.ItemEventArgs):void; + /** + * Occurs when the edge creation started has started. + * The edge that is stored in the {@link yfiles.model.ItemEventArgs#item} property is the {@link yfiles.input.CreateEdgeInputMode#dummyEdge} + * that is used during creation. + */ + addEdgeCreationStartedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Occurs when the edge creation started has started. + * The edge that is stored in the {@link yfiles.model.ItemEventArgs#item} property is the {@link yfiles.input.CreateEdgeInputMode#dummyEdge} + * that is used during creation. + */ + removeEdgeCreationStartedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Callback that clears the dummy edge's bends. + */ + clearDummyEdgeBends():void; + /** + * Updates the drag point. + * @param {yfiles.geometry.PointD} location The new coordinates. + */ + setDragPoint(location:yfiles.geometry.PointD):void; + /** + * Transition that cleans up everything that has been built until now. + */ + cancelWithTransition(t:yfiles.support.Transition):void; + /** + * Adds another bend to the edge's path. + * @param {yfiles.support.Transition} t + */ + createBendWithTransition(t:yfiles.support.Transition):void; + /** + * Actually creates the bend at the given location. + * @param {yfiles.geometry.PointD} location The coordinates to create the bend at. + */ + createBend(location:yfiles.geometry.PointD):yfiles.graph.IBend; + /** + * Adds a bend to the dummy edge. + * @param {yfiles.geometry.PointD} location The location of the bend. + * @see {@link yfiles.input.CreateEdgeInputMode#dummyEdge} + * @return {yfiles.graph.IBend} The newly created bend. + */ + addDummyEdgeBend(location:yfiles.geometry.PointD):yfiles.graph.IBend; + /** + * Actually removes the last bend. + */ + removeLastBend():void; + /** + * Callback that sets the location of the bend of the current dummy edge at the given index. + * @param {number} index The index of the bend. + * @param {yfiles.geometry.PointD} location The new bend location. + */ + setBendLocation(index:number,location:yfiles.geometry.PointD):void; + /** + * Callback that sets the location of the bend of the current dummy edge at the given index. + * @param {yfiles.graph.IBend} bend The bend. + * @param {yfiles.geometry.PointD} location The new bend location. + */ + setBendLocationForBend(bend:yfiles.graph.IBend,location:yfiles.geometry.PointD):void; + /** + * Gets or sets the IComparer<INode> instance that is used in {@link yfiles.input.CreateEdgeInputMode#getNode} + * to determine the hit order and which node is hit first. + * By default the instance retrieved from the {@link yfiles.input.IInputModeContext}'s + * {@link yfiles.support.ILookup#lookup} is used. + * If none is found, the {@link yfiles.input.CreateEdgeInputMode#portOwnerComparer} is used instead. + * If all fails the first found node will be used. + */ + nodeComparer:yfiles.collections.IComparer; + /** + * Gets or sets the IComparer<IPortOwner> instance that is used in {@link yfiles.input.CreateEdgeInputMode#getPortOwner} + * to determine the hit order and which item is hit first. + * By default the instance retrieved from the {@link yfiles.input.IInputModeContext}'s + * {@link yfiles.support.ILookup#lookup} is used + * If this is null the first found item will be used. + */ + portOwnerComparer:yfiles.collections.IComparer; + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} + * instance that will be queried to decide if bend creation is enforced. + * The default is {@link yfiles.input.KeyEvents#CONTROL_PRESSED}. + */ + enforceBendCreationRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets the Graph this mode is acting upon. + */ + graph:yfiles.graph.IGraph; + /** + * Called when the {@link yfiles.input.CreateEdgeInputMode#graph} property changes. + * @param {yfiles.graph.IGraph} oldGraph The old graph instance. + * @param {yfiles.graph.IGraph} newGraph The new graph instance. + */ + onGraphChanged(oldGraph:yfiles.graph.IGraph,newGraph:yfiles.graph.IGraph):void; + /** + * Set a new Graph for this mode. + * Normally the graph is retrieved from this instance's {@link yfiles.input.AbstractInputMode#inputModeContext}. + * If the instance needs to be overridden, this method can be used. + * Triggers {@link yfiles.input.CreateEdgeInputMode#onGraphChanged}. + * @param {yfiles.graph.IGraph} newGraph The new graph. + */ + setGraphCore(newGraph:yfiles.graph.IGraph):void; + } + var CreateEdgeInputMode:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that will use the IGraph from the {@link yfiles.input.AbstractInputMode#inputModeContext} + * to create edges in. + * @see {@link yfiles.input.CreateEdgeInputMode#graph} + */ + new ():yfiles.input.CreateEdgeInputMode; + /** + * Creates a new instance using the given graph to create the edges in. + * It is recommended to use the parameterless constructor and let the instance retrieve the graph instance + * from the context. + * @param {yfiles.graph.IGraph} graph The graph to create the edge in and query the nodes from. + * @see {@link yfiles.input.CreateEdgeInputMode#graph} + */ + ForGraph:{ + new (graph:yfiles.graph.IGraph):yfiles.input.CreateEdgeInputMode; + }; + }; + export enum AdjustContentRectPolicy{ + /** + * The content rect should never be adjusted automatically in response to user input. + */ + NEVER, + /** + * The content rect should be recalculated as the union of the former content rect and the + * new {@link yfiles.canvas.GraphControl#fitGraphBounds} in response to user input. + */ + UNION, + /** + * The content rect should be recalculated using the + * {@link yfiles.canvas.GraphControl#fitGraphBounds} method in response to user input. + */ + ALWAYS + } + /** + * An implementation of {@link yfiles.input.IPositionHandler} + * that shows the various label position candidates + * and lets the user move a label to one of those candidate positions. + */ + export interface LabelPositionHandler extends Object,yfiles.input.IPositionHandler,yfiles.geometry.IPoint{ + /** + * Gets or sets the pen to use for drawing the rectangle in the view coordinate system. + */ + candidateTemplate:yfiles.drawing.DataTemplate; + /** + * Gets or sets the pen to use for drawing the rectangle in the view coordinate system. + */ + highlightTemplate:yfiles.drawing.DataTemplate; + /** + * Gets the graph instance. + */ + graph:yfiles.graph.IGraph; + /** + * Gets the label instance. + * Value: The label. + */ + label:yfiles.graph.ILabel; + /** + * Gets or sets the input mode canvas group. + * This group will be used by the position handler instances to + * paint the candidate boxes in. + */ + inputModeCanvasGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Called by clients to set the position to the given coordinates. + * It is up to the implementation to decide how the position of the element in + * question should be interpreted. This may be the upper left corner of the element, + * its center or anything else. The implementation may decide to not use the values + * provided or use different values internally. + * @param {yfiles.geometry.PointD} location The new location. + * @see {@link yfiles.input.IDragHandler#location} + * @see Specified by {@link yfiles.input.IPositionHandler#setPosition}. + */ + setPosition(location:yfiles.geometry.PointD):void; + /** + * Returns a view of the location of the item. + * The point describes the current world coordinate of the element that can + * be modified by this handler. + * @see Specified by {@link yfiles.input.IDragHandler#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Called by clients to indicate that the element is going to be dragged. + * This call will be followed by one or more calls to {@link yfiles.input.IDragHandler#handleMove}, + * and a final {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. + */ + initializeDrag(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Callback method that gets the candidates for the given graph and label. + * @param {yfiles.graph.IGraph} graph The graph. + * @param {yfiles.graph.ILabel} label The label. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over possible label parameter candidates. + */ + getParameterCandidates(graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel):yfiles.collections.IEnumerable; + /** + * Creates an {@link yfiles.canvas.ICanvasObjectDescriptor} to display the given candidate position. + * @param {yfiles.input.IInputModeContext} context The context for which the descriptor is created. + * @param {boolean} highlight Whether to highlight the paintable. This will be true for + * the current position and false for the others. + * @return {yfiles.canvas.ICanvasObjectDescriptor} An implementation that will render the given candidate. + */ + createCandidateDescriptor(context:yfiles.input.IInputModeContext,highlight:boolean):yfiles.canvas.ICanvasObjectDescriptor; + /** + * Actually applies the given parameter at the end of the gesture. + * @param {yfiles.graph.ILabel} label The label to set the parameter for. + * @param {yfiles.graph.ILabelModelParameter} parameter The new parameter. + */ + setLabelModelParameter(label:yfiles.graph.ILabel,parameter:yfiles.graph.ILabelModelParameter):void; + /** + * Called by clients to indicate that the element has been dragged and its position + * should be updated. + * This method may be called more than once after an initial {@link yfiles.input.IDragHandler#initializeDrag} + * and will the final call will be followed by either one + * {@link yfiles.input.IDragHandler#dragFinished} or one {@link yfiles.input.IDragHandler#cancelDrag} call. + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @return {boolean} Whether the move had any visual effect. This is a hint to the engine to optimize invalidation. + * @see Specified by {@link yfiles.input.IDragHandler#handleMove}. + */ + handleMove(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):boolean; + /** + * Determines whether to use a {@link yfiles.graph.ILabelModelParameterFinder} to + * find the best candidate. + * This implementation returns true if the {@link yfiles.input.LabelPositionHandler#useFinder} + * property is true and the control key is pressed. + * @param {yfiles.input.IInputModeContext} ctx The context that is currently being used - may be null if + * the method is called without context. + * @return {boolean} + */ + useParameterFinder(ctx:yfiles.input.IInputModeContext):boolean; + /** + * Gets or sets a property that determines whether the handler may use a + * {@link yfiles.graph.ILabelModelParameterFinder} to assign arbitrary positions. + * The default value is true + * @see {@link yfiles.input.LabelPositionHandler#useParameterFinder} + */ + useFinder:boolean; + /** + * Calculates a distance value between a candidate rectangle and the mouse location. + * @param {yfiles.geometry.IOrientedRectangle} rectangle The rectangle candidate. + * @param {yfiles.geometry.PointD} location The mouse location. + * @return {number} A value indicating the closeness of the mouse to the rectangle. + */ + getDistance(rectangle:yfiles.geometry.IOrientedRectangle,location:yfiles.geometry.PointD):number; + /** + * Called by clients to indicate that the dragging has been canceled by the user. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Implementations should reset the position of the items they modify to their initial state. + * Alternatively to this method the {@link yfiles.input.IDragHandler#dragFinished} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} originalLocation The value of the coordinate of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#cancelDrag}. + */ + cancelDrag(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * Called by clients to indicate that the repositioning has just been finished. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Alternatively to this method the {@link yfiles.input.IDragHandler#cancelDrag} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * This is the same value as delivered in the last invocation of {@link yfiles.input.IDragHandler#handleMove} + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#dragFinished}. + */ + dragFinished(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + } + var LabelPositionHandler:{ + $class:yfiles.lang.Class; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.drawing.DataTemplate} + * that will be used to represent the rectangular selection. + */ + CANDIDATE_TEMPLATE_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that will be used to find the {@link yfiles.drawing.DataTemplate} + * that will be used to represent the rectangular selection. + */ + HIGHLIGHT_TEMPLATE_KEY:yfiles.system.ResourceKey; + /** + * Initializes a new instance of the {@link yfiles.input.LabelPositionHandler} class. + * @param {yfiles.graph.ILabel} label The label that shall be moved. + */ + FromLabel:{ + new (label:yfiles.graph.ILabel):yfiles.input.LabelPositionHandler; + }; + /** + * Initializes a new instance of the {@link yfiles.input.LabelPositionHandler} class. + * @param {yfiles.graph.IGraph} graph The graph that contains the label. + * @param {yfiles.graph.ILabel} label The label that shall be moved. + */ + new (graph:yfiles.graph.IGraph,label:yfiles.graph.ILabel):yfiles.input.LabelPositionHandler; + }; + /** + * The default label snap context helper that provides the snap lines and the snap results to the + * {@link yfiles.input.LabelSnapContext} during dragging of labels. + * @see {@link yfiles.input.LabelSnapContext} + * @see {@link yfiles.graph.LabelDecorator#labelSnapContextHelperDecorator} + */ + export interface LabelSnapContextHelper extends Object,yfiles.input.ILabelSnapContextHelper{ + /** + * Called during {@link yfiles.input.IDragHandler#initializeDrag initialization} of a label dragging to + * add + * {@link yfiles.input.SnapLine snap lines} to which the label can potentially snap to the + * context. + * @param {yfiles.input.LabelSnapContext} context + * The snap context which manages the snap lines and the settings. Note that implementations should not change the state + * of the context explicitly. + * @param {yfiles.input.IInputModeContext} inputContext The context of the input mode that handles the dragging. + * @param {yfiles.graph.ILabel} label The label that is dragged. + * @see Specified by {@link yfiles.input.ILabelSnapContextHelper#addSnapLines}. + */ + addSnapLines(context:yfiles.input.LabelSnapContext,inputContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):void; + /** + * Adds two snap line for the initial center location of the label, one in the direction of the up vector, the other + * orthogonal to that direction. + * This method is called by {@link yfiles.input.LabelSnapContextHelper#addSnapLines} to add the snap lines for the initial position label location. + * @param {yfiles.input.LabelSnapContext} context + * The snap context which manages the snap lines and the settings. Note that implementations should not change the state + * of the context explicitly. + * @param {yfiles.input.IInputModeContext} inputContext The context of the input mode that handles the dragging. + * @param {yfiles.graph.ILabel} label The label that is dragged. + */ + addInitialLocationSnapLines(context:yfiles.input.LabelSnapContext,inputContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):void; + /** + * Adds snap lines to the context that are parallel to the owner node's border at particular + * distances. + * The corresponding settings of the context specify which snap lines are actually created. + * @param {yfiles.input.LabelSnapContext} context + * The snap context which manages the snap lines and the settings. Note that implementations should not change the state + * of the context explicitly. + * @param {yfiles.input.IInputModeContext} inputContext The context of the input mode that handles the dragging. + * @param {yfiles.graph.ILabel} label The node label that is dragged. + */ + addNodeShapeSnapLines(context:yfiles.input.LabelSnapContext,inputContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):void; + /** + * Adds snap lines to the context that are parallel to the path segments of the owner edge at + * particular distances. + * The corresponding settings of the context specify which snap lines are actually created. + * @param {yfiles.input.LabelSnapContext} context + * The snap context which manages the snap lines and the settings. Note that implementations should not change the state + * of the context explicitly. + * @param {yfiles.input.IInputModeContext} inputContext The context of the input mode that handles the dragging. + * @param {yfiles.graph.ILabel} label The edge label that is dragged. + */ + addEdgePathSnapLines(context:yfiles.input.LabelSnapContext,inputContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):void; + /** + * Adds snap lines to the context that are parallel to the path segments of the owner edge at + * the given distance. + * This method is not used by this class to create its snap lines. Instead, it can be called by custom sub-classes + * to create this kind of snap lines. + * @param {yfiles.input.LabelSnapContext} context + * The snap context which manages the snap lines and the settings. Note that implementations should not change the state + * of the context explicitly. + * @param {yfiles.input.IInputModeContext} inputContext The context of the input mode that handles the dragging. + * @param {yfiles.graph.ILabel} label The edge label that is dragged. + * @param {number} distance The distance of the added snap lines from the edge path. + */ + addEdgePathSnapLinesWithDistance(context:yfiles.input.LabelSnapContext,inputContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel,distance:number):void; + /** + * Called while the given label is {@link yfiles.input.IDragHandler#handleMove dragged} to add + * {@link yfiles.input.SnapResult snap results} + * for the {@link yfiles.input.SnapLine snap lines} provided by the context. + * @param {yfiles.input.LabelSnapContext} context The snap context which manages the snap lines and the settings. + * @param {yfiles.input.CollectSnapResultsEventArgs} args + * The event argument to obtain the necessary information from and + * {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult add results to}. + * @param {yfiles.geometry.IOrientedRectangle} suggestedLayout + * The {@link yfiles.graph.ILabel#layout layout} of the label that would be used without snapping. + * @param {yfiles.graph.ILabel} label The label that is dragged. + * @see Specified by {@link yfiles.input.ILabelSnapContextHelper#collectSnapResults}. + */ + collectSnapResults(context:yfiles.input.LabelSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.IOrientedRectangle,label:yfiles.graph.ILabel):void; + } + var LabelSnapContextHelper:{ + $class:yfiles.lang.Class; + /** + * Returns the static shared instance of this class. + * Since this implementation does not carry any state, this instance can safely be used even in multi-threaded + * environments. + */ + INSTANCE:yfiles.input.LabelSnapContextHelper; + }; + /** + * A {@link yfiles.input.DropInputMode} providing a preview of the dragged item. + * A dragged {@link yfiles.model.IModelItem} is visualized during the drag operation. + * The input mode does also support snapping of the dragged {@link yfiles.model.IModelItem} via the {@link yfiles.input.SnapContext} + * and highlighting the {@link yfiles.input.ItemDropInputMode#dropTarget}. + */ + export interface ItemDropInputMode extends yfiles.input.DropInputMode{ + /** + * Fired if a new item gets created by this input mode. + */ + addItemCreatedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Fired if a new item gets created by this input mode. + */ + removeItemCreatedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Determines whether a preview of the dragged element is displayed during the drag. + */ + showPreview:boolean; + /** + * Switches snapping on and off. + */ + snappingEnabled:boolean; + /** + * Gets or sets {@link yfiles.input.IEventRecognizer} that temporarily disables snapping. + * Value: The disable snapping recognizer. The default recognizer checks for a pressed + * using {@link yfiles.system.DragDropKeyStates#CONTROL_KEY ControlKey}. + */ + disableSnappingRecognizer:yfiles.input.IEventRecognizer; + /** + * Switches highlighting the drop target on and off. + */ + highlightDropTarget:boolean; + /** + * The {@link yfiles.input.ItemDropInputMode#snapContext} which is used to snap the dragged element during the drag. + * If set to null (the default) this input mode tries to obtain the {@link yfiles.input.ItemDropInputMode#snapContext} + * from the {@link yfiles.input.IInputModeContext}. To explicitly disable snapping, a {@link yfiles.input.ItemDropInputMode#snapContext} implementation that does nothing + * has to be set to this instance. + */ + snapContext:yfiles.input.SnapContext; + /** + * Gets the current snapped mouse position during drag operations. + * The position is returned in world coordinates according to the + * {@link yfiles.canvas.CanvasControl} into which this input mode is installed. + * If {@link yfiles.input.ItemDropInputMode#snappingEnabled} is false, this value corresponds with {@link yfiles.input.DropInputMode#mousePosition}. + */ + snappedMousePosition:yfiles.geometry.PointD; + /** + * Gets the drop target at {@link yfiles.input.ItemDropInputMode#snappedMousePosition}. + * @see {@link yfiles.input.ItemDropInputMode#highlightDropTarget} + */ + dropTarget:yfiles.model.IModelItem; + /** + * Gets or sets the callback for item creation. + * Called by method {@link yfiles.input.ItemDropInputMode#onDragDropped}. + */ + itemCreator:(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,dropTarget:yfiles.model.IModelItem,dropLocation:yfiles.geometry.PointD)=>T; + /** + * Called once a drag has entered the canvas. + * Calls {@link yfiles.input.ItemDropInputMode#initializeSnapContext}, {@link yfiles.input.ItemDropInputMode#initializePreview} + * and {@link yfiles.input.ItemDropInputMode#initializeDropTarget}. + * @see Overrides {@link yfiles.input.DropInputMode#onDragEntered} + */ + onDragEntered(e:yfiles.system.DragEventArgs):void; + /** + * Initializes the snapping context. + * This method is called by {@link yfiles.input.ItemDropInputMode#onDragEntered} + */ + initializeSnapContext(e:yfiles.system.DragEventArgs):void; + /** + * Initializes the item preview. + * This method is called by {@link yfiles.input.ItemDropInputMode#onDragEntered}. + * If a preview {@link yfiles.input.ItemDropInputMode#showPreview shall be displayed}, + * the {@link yfiles.input.ItemDropInputMode#getPreviewGraph preview graph} is initialized + * and {@link yfiles.input.ItemDropInputMode#populatePreviewGraph} is called. + */ + initializePreview(e:yfiles.system.DragEventArgs):void; + /** + * Initializes the drop target. + */ + initializeDropTarget(e:yfiles.system.DragEventArgs):void; + /** + * Returns the graph displayed as item preview. + * @return {yfiles.graph.IGraph} The preview graph or null if no preview is displayed at the moment. + */ + getPreviewGraph():yfiles.graph.IGraph; + /** + * Subclasses shall fill the specified graph that is used to preview the dragged item. + * @param {yfiles.graph.IGraph} previewGraph The preview graph to fill. + */ + populatePreviewGraph(previewGraph:yfiles.graph.IGraph):void; + /** + * Subclasses shall update the {@link yfiles.input.ItemDropInputMode#getPreviewGraph preview graph} + * so the dragged item is displayed at the specified dragLocation. + * @param {yfiles.graph.IGraph} previewGraph The preview graph to update. + * @param {yfiles.geometry.PointD} dragLocation The current drag location. + */ + updatePreview(previewGraph:yfiles.graph.IGraph,dragLocation:yfiles.geometry.PointD):void; + /** + * Calls {@link yfiles.input.ItemDropInputMode#getDropTarget} for {@link yfiles.input.ItemDropInputMode#snappedMousePosition} and + * sets the returned item as {@link yfiles.input.ItemDropInputMode#dropTarget}. + * If {@link yfiles.input.ItemDropInputMode#highlightDropTarget} is enabled, the highlight is updated as well. + * @param {yfiles.geometry.PointD} dragLocation The location to update the drop target for. + */ + updateDropTarget(dragLocation:yfiles.geometry.PointD):void; + /** + * Returns the drop target at the specified location. + * The drop target is highlighted, if {@link yfiles.input.ItemDropInputMode#highlightDropTarget} is enabled. + * Per default, null is returned. + * @param {yfiles.geometry.PointD} dragLocation The location to return the drop target for. + * @return {yfiles.model.IModelItem} The drop target at the specified location or null if no drop target can be found. + */ + getDropTarget(dragLocation:yfiles.geometry.PointD):yfiles.model.IModelItem; + /** + * Called whenever a drag is over the canvas. + */ + onDraggedOver(e:yfiles.system.DragEventArgs):void; + /** + * Called once a drag has left the canvas. + * @param {yfiles.system.DragEventArgs} e the drag event arguments. + */ + onDragLeft(e:yfiles.system.DragEventArgs):void; + /** + * Called once a drag has been dropped on the canvas. + */ + onDragDropped(e:yfiles.system.DragEventArgs):void; + /** + * Called whenever a new item is created. + */ + onItemCreated(args:yfiles.model.ItemEventArgs):void; + /** + * Callback registered on the {@link yfiles.input.SnapContext} that collects {@link yfiles.input.SnapResult}s for the + * dragged element. + * The default implementation doesn't collect any snap results. + * @param {Object} source The {@link yfiles.input.SnapContext} this callback is registered at. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The arguments describing the movement {@link yfiles.input.SnapResult}s shall be collected for. + */ + collectSnapResults(source:Object,args:yfiles.input.CollectSnapResultsEventArgs):void; + /** + * Sets the {@link yfiles.input.DropInputMode#setDragLocation drag location} and calls {@link yfiles.input.ItemDropInputMode#updatePreview} + * to update the layout of item preview based on the + * mouse coordinates and the results of the {@link yfiles.input.ItemDropInputMode#snapContext}. + * @see Overrides {@link yfiles.input.DropInputMode#setDragLocation} + */ + setDragLocation(coordinates:yfiles.geometry.PointD):void; + /** + * Called by the client to unconditionally cancel all editing. + * This will be called prior to the uninstalling of this instance. + * In order to stop an active input mode manually, client code should use + * the following idiom: + *

+      * if (!mode.stop()){
+      *   mode.cancel();
+      * }
+      * 
+ * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Cleans up the item preview. + */ + cleanupPreview():void; + /** + * Cleans up the snap context. + */ + cleanupSnapContext():void; + /** + * Cleans up the drop target and its highlighting. + */ + cleanupDropTarget():void; + } + var ItemDropInputMode:{ + $class:yfiles.lang.Class; + /** + * Constructs a new instance of class {@link yfiles.input.DropInputMode} for the + * expected data type. + * This constructor only exists for usage in child class. + */ + WithType:{ + new (expectedType:yfiles.lang.Class):yfiles.input.ItemDropInputMode; + }; + }; + /** + * An {@link yfiles.input.ItemDropInputMode} specialized to drag 'n' drop {@link yfiles.graph.IStripe}s. + * A dragged {@link yfiles.graph.IStripe} is optionally visualized during the drag operation. + */ + export interface StripeDropInputMode extends yfiles.input.ItemDropInputMode{ + /** + * Determines whether a preview of the dragged stripe is displayed during the drag. + */ + showStripePreview:boolean; + /** + * Called by the client to unconditionally cancel all editing. + * This will be called prior to the uninstalling of this instance. + * In order to stop an active input mode manually, client code should use + * the following idiom: + *

+      * if (!mode.stop()){
+      *   mode.cancel();
+      * }
+      * 
+ * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Create a new stripe as a result of gesture. + * @return {yfiles.graph.IStripe} a newly created stripe. + */ + createStripe(context:yfiles.input.IInputModeContext,newParent:yfiles.graph.IStripe,movedStripe:yfiles.graph.IStripe,index:number,gesture:yfiles.input.ReparentGesture):yfiles.graph.IStripe; + /** + * Called once a drag has been dropped on the canvas. + */ + onDragDropped(e:yfiles.system.DragEventArgs):void; + /** + * Cleans up the item preview. + */ + cleanupPreview():void; + /** + * Called once a drag has left the canvas. + * @param {yfiles.system.DragEventArgs} e the drag event arguments. + */ + onDragLeft(e:yfiles.system.DragEventArgs):void; + /** + * Gets the currently dragged {@link yfiles.graph.IStripe} instance. + * This implementation simply tries to cast the {@link yfiles.input.DropInputMode#dropData} to {@link yfiles.graph.IStripe}. + */ + getDraggedStripe():yfiles.graph.IStripe; + /** + * Called once a drag has entered the canvas. + */ + onDragEntered(e:yfiles.system.DragEventArgs):void; + /** + * Subclasses shall fill the specified graph that is used to preview the dragged item. + * @param {yfiles.graph.IGraph} previewGraph The preview graph to fill. + */ + populatePreviewGraph(previewGraph:yfiles.graph.IGraph):void; + /** + * Called whenever a drag is over the canvas. + */ + onDraggedOver(e:yfiles.system.DragEventArgs):void; + /** + * Create a preview version of the table that is temporarily used to show the dragged stripe. + */ + createPreviewTable():yfiles.graph.ITable; + /** + * This method updates the {@link yfiles.input.DropInputMode#mousePosition} according to the coordinates passed in. + * It is called prior to the {@link yfiles.input.DropInputMode#onDragEntered}, {@link yfiles.input.DropInputMode#onDraggedOver}, {@link yfiles.input.DropInputMode#onDragDropped} + * and {@link yfiles.input.DropInputMode#onDragLeft} methods. + * @param {yfiles.geometry.PointD} coordinates The current location of the mouse in world coordinates. + */ + setDragLocation(coordinates:yfiles.geometry.PointD):void; + /** + * Called whenever a new stripe is created. + */ + onStripeCreated(args:yfiles.model.ItemEventArgs):void; + /** + * Fired if a new stripe gets created by this input mode. + */ + addStripeCreatedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Fired if a new stripe gets created by this input mode. + */ + removeStripeCreatedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Subclasses shall update the {@link yfiles.input.ItemDropInputMode#getPreviewGraph preview graph} + * so the dragged item is displayed at the specified dragLocation. + * @param {yfiles.graph.IGraph} previewGraph The preview graph to update. + * @param {yfiles.geometry.PointD} dragLocation The current drag location. + */ + updatePreview(previewGraph:yfiles.graph.IGraph,newLocation:yfiles.geometry.PointD):void; + /** + * Calculates the layout of the new table. In this implementation the mouse location + * is used as center of the table. Can be overridden in child class to implement a different layout. + * @param {yfiles.geometry.PointD} mouseLocation Current mouse position + * @param {yfiles.geometry.SizeD} size Size of the table + * @return {yfiles.geometry.RectD} a {@link yfiles.geometry.RectD} with the given size and the mouse location as center. + */ + getPreviewTableLayout(mouseLocation:yfiles.geometry.PointD,size:yfiles.geometry.SizeD):yfiles.geometry.RectD; + } + var StripeDropInputMode:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this input mode. + */ + new ():yfiles.input.StripeDropInputMode; + }; + /** + * Specialized input mode that is used to reparent a stripe inside an {@link yfiles.graph.ITable} structure. + * This implementation delegates most work to an instance of {@link yfiles.input.ReparentStripePositionHandler} + */ + export interface ReparentStripeInputMode extends yfiles.input.MoveInputMode{ + /** + * Called when the users cancels the dragging of the handle. + * @see {@link yfiles.input.MoveInputMode#onDragCanceled} + */ + cancelDrag(t:yfiles.support.Transition):void; + /** + * Callback used by the state machine to initialize the dragging. + * This method will {@link yfiles.input.AbstractConcurrentInputMode#requestMutex request the input mutex}. + * @see {@link yfiles.input.MoveInputMode#onDragStarting} + */ + beginDrag(t:yfiles.support.Transition):void; + /** + * Called by the state machine to end the dragging. + * This method will delegate the actual cleanup work to the {@link yfiles.input.MoveInputMode#movable} + * and {@link yfiles.input.MoveInputMode#positionHandler}. + * @see {@link yfiles.input.MoveInputMode#onDragFinished} + */ + endDrag(t:yfiles.support.Transition):void; + } + var ReparentStripeInputMode:{ + $class:yfiles.lang.Class; + new ():yfiles.input.ReparentStripeInputMode; + }; + /** + * Input mode that can be used to interactively edit a table. + * This mode can either be used as a stand alone input mode, or as a child mode of {@link yfiles.input.GraphEditorInputMode}. In that case, + * some child modes of this implementation are disabled: + *
    + *
  • {@link yfiles.input.TableEditorInputMode#clickInputMode}
  • + *
  • {@link yfiles.input.TableEditorInputMode#textEditorInputMode}
  • + *
  • {@link yfiles.input.TableEditorInputMode#keyboardInputMode}
  • + *
+ * In addition, the {@link yfiles.input.TableEditorInputMode#stripeSelection stripe selection} is optionally synchronized with the {@link yfiles.input.GraphEditorInputMode#graphSelection}. + */ + export interface TableEditorInputMode extends yfiles.input.MultiplexingInputMode{ + /** + * Gets or sets the {@link yfiles.input.TableEditorInputMode#resizeStripeInputMode} that is used to change the size of a stripe interactively. + * The mode by default is {@link yfiles.input.IConcurrentInputMode#enabled enabled} + * with a priority of {@link yfiles.input.TableEditorInputMode#resizeStripeInputModePriority}. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.TableEditorInputMode#createResizeStripeInputMode} will be called. + * Upon change the {@link yfiles.input.TableEditorInputMode#onResizeStripeInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + resizeStripeInputMode:yfiles.input.ResizeStripeInputMode; + /** + * Called when the {@link yfiles.input.TableEditorInputMode#resizeStripeInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.ResizeStripeInputMode} oldResizeStripeInputMode the old value, which may be null the first time + * @param {yfiles.input.ResizeStripeInputMode} newResizeStripeInputMode the new value + */ + onResizeStripeInputModeChanged(oldResizeStripeInputMode:yfiles.input.ResizeStripeInputMode,newResizeStripeInputMode:yfiles.input.ResizeStripeInputMode):void; + /** + * Factory method that creates the {@link yfiles.input.TableEditorInputMode#resizeStripeInputMode} lazily the first time the property + * is accessed. + * @return {yfiles.input.ResizeStripeInputMode} A plain new instance of the {@link yfiles.input.TableEditorInputMode#resizeStripeInputMode} type, which is initially + * {@link yfiles.input.IConcurrentInputMode#enabled enabled}. + */ + createResizeStripeInputMode():yfiles.input.ResizeStripeInputMode; + /** + * Gets or sets the ResizeStripeInputModePriority property. + * The default is 0. + */ + resizeStripeInputModePriority:number; + /** + * Callback method that will be used by the {@link yfiles.input.MultiplexingInputMode#createChildInputModeContext child context's} {@link yfiles.support.ILookup#lookup} method. + * @param {yfiles.lang.Class} type The type argument passed to {@link yfiles.support.ILookup#lookup}. + * @return {Object} The result of the lookup query, or null. + * @see {@link yfiles.input.MultiplexingInputMode#createChildInputModeContext} + */ + childInputModeContextLookup(type:yfiles.lang.Class):Object; + /** + * Gets or sets the {@link yfiles.input.TableEditorInputMode#reparentStripeHandler} property. + * This handler will be delegated to by an implementation of the + * {@link yfiles.input.IReparentStripeHandler} interface that this class + * puts into the {@link yfiles.input.TableEditorInputMode#childInputModeContextLookup}. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.TableEditorInputMode#createReparentStripeHandler} will be called. + * Upon change the {@link yfiles.input.TableEditorInputMode#onReparentStripeHandlerChanged} method will be called. + * @see {@link yfiles.input.ReparentStripeHandler} + */ + reparentStripeHandler:yfiles.input.IReparentStripeHandler; + /** + * Called when the {@link yfiles.input.TableEditorInputMode#reparentStripeHandler} property value changes + * and after initialization of the field. + * @param {yfiles.input.IReparentStripeHandler} oldReparentStripeHandler the old value, which may be null the first time + * @param {yfiles.input.IReparentStripeHandler} newReparentStripeHandler the new value + */ + onReparentStripeHandlerChanged(oldReparentStripeHandler:yfiles.input.IReparentStripeHandler,newReparentStripeHandler:yfiles.input.IReparentStripeHandler):void; + /** + * Factory method for the {@link yfiles.input.TableEditorInputMode#reparentStripeHandler} property. This method will be called + * upon first access to the {@link yfiles.input.TableEditorInputMode#reparentStripeHandler} property. + * @return {yfiles.input.IReparentStripeHandler} a new instance of {@link yfiles.input.IReparentStripeHandler} + */ + createReparentStripeHandler():yfiles.input.IReparentStripeHandler; + /** + * Gets or sets the {@link yfiles.input.TableEditorInputMode#reparentStripeInputModePriority} that is used to change a stripes position in the table hierarchy. + * The mode by default is {@link yfiles.input.IConcurrentInputMode#enabled enabled} + * with a priority of {@link yfiles.input.TableEditorInputMode#resizeStripeInputModePriority}. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.TableEditorInputMode#createReparentStripeInputMode} will be called. + * Upon change the {@link yfiles.input.TableEditorInputMode#onReparentStripeInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + reparentStripeInputMode:yfiles.input.ReparentStripeInputMode; + /** + * Called when the {@link yfiles.input.TableEditorInputMode#reparentStripeInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.ReparentStripeInputMode} oldReparentStripeInputMode the old value, which may be null the first time + * @param {yfiles.input.ReparentStripeInputMode} newReparentStripeInputMode the new value + */ + onReparentStripeInputModeChanged(oldReparentStripeInputMode:yfiles.input.ReparentStripeInputMode,newReparentStripeInputMode:yfiles.input.ReparentStripeInputMode):void; + /** + * Factory method that creates the {@link yfiles.input.TableEditorInputMode#reparentStripeInputMode} lazily the first time the property + * is accessed. + * @return {yfiles.input.ReparentStripeInputMode} A plain new instance of the {@link yfiles.input.TableEditorInputMode#reparentStripeInputMode} type, which is initially + * {@link yfiles.input.IConcurrentInputMode#enabled enabled}. + */ + createReparentStripeInputMode():yfiles.input.ReparentStripeInputMode; + /** + * Gets or sets the ReparentStripeInputModePriority property. + * The default is 0. + */ + reparentStripeInputModePriority:number; + /** + * Gets or sets the priority for the {@link yfiles.input.TableEditorInputMode#stripeDropInputMode}. + * Value: The stripe drop input mode priority. The default is 70. + */ + stripeDropInputModePriority:number; + /** + * Gets or sets the {@link yfiles.input.TableEditorInputMode#stripeDropInputMode} property that is responsible for + * handling drag and drop operations of stripes onto the Canvas. + * The mode by default is {@link yfiles.input.IConcurrentInputMode#enabled disabled} + * and needs to be enabled to work, first. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.TableEditorInputMode#createStripeDropInputMode} will be called. + * Upon change the {@link yfiles.input.TableEditorInputMode#onStripeDropInputModeChanged} method will be called. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + stripeDropInputMode:yfiles.input.StripeDropInputMode; + /** + * Factory method that creates the {@link yfiles.input.TableEditorInputMode#stripeDropInputMode} lazily the first time the property + * is accessed. + * @return {yfiles.input.StripeDropInputMode} A plain new instance of the {@link yfiles.input.TableEditorInputMode#stripeDropInputMode} type, which is initially + * {@link yfiles.input.IConcurrentInputMode#enabled disabled}. + */ + createStripeDropInputMode():yfiles.input.StripeDropInputMode; + /** + * Called when the {@link yfiles.input.TableEditorInputMode#stripeDropInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.StripeDropInputMode} oldStripeDropInputMode the old value, which may be null the first time + * @param {yfiles.input.StripeDropInputMode} newStripeDropInputMode the new value + */ + onStripeDropInputModeChanged(oldStripeDropInputMode:yfiles.input.StripeDropInputMode,newStripeDropInputMode:yfiles.input.StripeDropInputMode):void; + /** + * Gets or sets the keyboard input mode. + * /// If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.TableEditorInputMode#createKeyboardInputMode} will be called. + * Upon change the {@link yfiles.input.TableEditorInputMode#onKeyboardInputModeChanged} method will be called. + * If the parent {@link yfiles.input.TableEditorInputMode} instance is installed as child mode of a {@link yfiles.input.GraphEditorInputMode} instance, this mode is not used, since all work is delegated to the parent's + * {@link yfiles.input.MainInputMode#keyboardInputMode} instance. This implies that all modifications made to the property value have no effect as long as the parent mode + * is child of a {@link yfiles.input.GraphEditorInputMode} instance. + * Value: The keyboard input mode. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + keyboardInputMode:yfiles.input.KeyboardInputMode; + /** + * Factory method that creates the keyboard input mode instance. + */ + createKeyboardInputMode():yfiles.input.KeyboardInputMode; + /** + * Called when the keyboard input mode changed. + * @param {yfiles.input.KeyboardInputMode} oldKeyboardInputMode The old keyboard input mode. + * @param {yfiles.input.KeyboardInputMode} newKeyboardInputMode The new keyboard input mode. + */ + onKeyboardInputModeChanged(oldKeyboardInputMode:yfiles.input.KeyboardInputMode,newKeyboardInputMode:yfiles.input.KeyboardInputMode):void; + /** + * Callback method that is used by {@link yfiles.input.TableEditorInputMode#onKeyboardInputModeChanged} + * to determine which of the built-in {@link yfiles.system.ICommand}s to install. + * This implementation unconditionally returns true, subclasses + * may override this method to adjust the behavior. + * @param {yfiles.system.ICommand} command The command to install. + * @return {boolean} Whether to install this command. + */ + shouldInstallCommand(command:yfiles.system.ICommand):boolean; + /** + * Gets or sets the text editor input mode. + * /// If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.TableEditorInputMode#createTextEditorInputMode} will be called. + * Upon change the {@link yfiles.input.TableEditorInputMode#onTextEditorInputModeChanged} method will be called. + * If the parent {@link yfiles.input.TableEditorInputMode} instance is installed as child mode of a {@link yfiles.input.GraphEditorInputMode} instance, this mode is not used, since all work is delegated to the parent's + * {@link yfiles.input.GraphEditorInputMode#textEditorInputMode} instance. This implies that all modifications made to the property value have no effect as long as the parent mode + * is child of a {@link yfiles.input.GraphEditorInputMode} instance. + * Value: The text editor input mode. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + textEditorInputMode:yfiles.input.TextEditorInputMode; + /** + * Called when the {@link yfiles.input.TableEditorInputMode#textEditorInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.TextEditorInputMode} oldTextEditorInputMode the old value, which may be null the first time + * @param {yfiles.input.TextEditorInputMode} newTextEditorInputMode the new value + */ + onTextEditorInputModeChanged(oldTextEditorInputMode:yfiles.input.TextEditorInputMode,newTextEditorInputMode:yfiles.input.TextEditorInputMode):void; + /** + * Factory method for the {@link yfiles.input.TableEditorInputMode#textEditorInputMode} property. + * This method will be called + * upon first access to the {@link yfiles.input.TableEditorInputMode#textEditorInputMode} property. + * @return {yfiles.input.TextEditorInputMode} a new instance of {@link yfiles.input.TextEditorInputMode} + */ + createTextEditorInputMode():yfiles.input.TextEditorInputMode; + /** + * Gets or sets the TextEditorInputModePriority property. + * The default is 100. + */ + textEditorInputModePriority:number; + /** + * Callback that is invoked if the F2 key is pressed and {@link yfiles.input.TableEditorInputMode#labelEditingAllowed} is + * set to true. + * This method determines the label to edit and delegates to either {@link yfiles.input.TableEditorInputMode#editLabel} + * or {@link yfiles.input.TableEditorInputMode#createLabel} if no label could be found. + */ + onEditLabel():boolean; + /** + * Callback that is invoked if the shift+F2 key is pressed and {@link yfiles.input.TableEditorInputMode#labelAddingAllowed} is + * set to true. + * This method determines the label owner to add to and delegates to {@link yfiles.input.TableEditorInputMode#createLabel}. + */ + onAddLabel():boolean; + /** + * Gets or set a property that determines which types of + * items may have their {@link yfiles.input.TableEditorInputMode#editLabel labels edited}. + * The default is {@link yfiles.graph.StripeTypes#ALL} + * which allows for editing the labels of all {@link yfiles.graph.ILabeledItem}s, and existing {@link yfiles.graph.ILabel}s. + * @see {@link yfiles.input.TableEditorInputMode#shouldLabelBeEdited} + */ + labelEditableItems:yfiles.graph.StripeTypes; + /** + * Predicate that determines whether a label may be added interactively to item. + * This is overridden if the item has a {@link yfiles.input.IEditLabelHelper} that returns false for its {@link yfiles.input.IEditLabelHelper#addLabel} + * method. + * @param {yfiles.model.IModelItem} item The item to query + * @return {boolean} true iff a label may be added + */ + shouldLabelBeAdded(item:yfiles.model.IModelItem):boolean; + /** + * Callback method that determines whether the label or the labels of the + * provided item should be edited in response to a command or explicit method call to + * {@link yfiles.input.TableEditorInputMode#editLabel} or {@link yfiles.input.TableEditorInputMode#createLabel}. + * @param {yfiles.model.IModelItem} item The item. + * @return {boolean} Whether to edit the label or the labels for that item. + */ + shouldLabelBeEdited(item:yfiles.model.IModelItem):boolean; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addLabelAddedListener LabelAdded} event. + * @param {yfiles.model.ItemEventArgs.} args The {@link yfiles.model.ItemEventArgs} instance that contains the {@link yfiles.graph.ILabel} that + * has been added. + */ + onLabelAdded(args:yfiles.model.ItemEventArgs):void; + /** + * Occurs when this mode has triggered the addition of an {@link yfiles.graph.ILabel}, e.g. in response to {@link yfiles.input.TableEditorInputMode#createLabel}. + */ + addLabelAddedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Occurs when this mode has triggered the addition of an {@link yfiles.graph.ILabel}, e.g. in response to {@link yfiles.input.TableEditorInputMode#createLabel}. + */ + removeLabelAddedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Occurs when this mode has triggered the edit of an {@link yfiles.graph.ILabel}, e.g. in response to {@link yfiles.input.TableEditorInputMode#editLabel}. + */ + addLabelTextChangedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Occurs when this mode has triggered the edit of an {@link yfiles.graph.ILabel}, e.g. in response to {@link yfiles.input.TableEditorInputMode#editLabel}. + */ + removeLabelTextChangedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addLabelTextChangedListener LabelTextChanged} event. + * @param {yfiles.model.ItemEventArgs.} args The {@link yfiles.model.ItemEventArgs} instance that contains the {@link yfiles.graph.ILabel} that + * has changed the text. + */ + onLabelTextChanged(args:yfiles.model.ItemEventArgs):void; + /** + * Called when the text of a label has been {@link yfiles.input.TableEditorInputMode#editLabel edited}. + * This method {@link yfiles.input.TableEditorInputMode#addValidateLabelTextListener validates the label text} and + * if successful sets the label text. + * @param {yfiles.graph.ILabel} label The label that was edited. + * @param {string} text The new text. + */ + onLabelTextEdited(label:yfiles.graph.ILabel,text:string):void; + /** + * Event that is raised when the actual label editing process is about to start. + * This allows to customize the actual label editing process further. + * @see {@link yfiles.input.TableEditorInputMode#onValidateLabelText} + */ + addLabelTextEditingStartedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is raised when the actual label editing process is about to start. + * This allows to customize the actual label editing process further. + * @see {@link yfiles.input.TableEditorInputMode#onValidateLabelText} + */ + removeLabelTextEditingStartedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Raises the {@link LabelTextEditingStarted} event. + * @param {yfiles.graph.LabelEventArgs} args The {@link yfiles.graph.LabelEventArgs} instance containing the event data. + */ + onLabelTextEditingStarted(args:yfiles.graph.LabelEventArgs):void; + /** + * Event that is raised when the actual label editing process is canceled. + * This allows to unconfigure temporary customizations for the actual label editing process. + * @see {@link yfiles.input.TableEditorInputMode#onValidateLabelText} + */ + addLabelTextEditingCanceledListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that is raised when the actual label editing process is canceled. + * This allows to unconfigure temporary customizations for the actual label editing process. + * @see {@link yfiles.input.TableEditorInputMode#onValidateLabelText} + */ + removeLabelTextEditingCanceledListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Raises the {@link LabelTextEditingCanceled} event. + * @param {yfiles.graph.LabelEventArgs} args The {@link yfiles.graph.LabelEventArgs} instance containing the event data. + */ + onLabelTextEditingCanceled(args:yfiles.graph.LabelEventArgs):void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addValidateLabelTextListener ValidateLabelText} event. + * @param {yfiles.input.LabelTextValidatingEventArgs} args The {@link yfiles.input.LabelTextValidatingEventArgs} instance containing the event data. + */ + onValidateLabelText(args:yfiles.input.LabelTextValidatingEventArgs):void; + /** + * Event that can be used to validate the label text for a label that is about to be added + * or edited. + * Note that the {@link yfiles.input.LabelTextValidatingEventArgs#label} may only a dummy instance, i.e. not bound to a live stripe instance. + * @see {@link yfiles.input.TableEditorInputMode#onValidateLabelText} + */ + addValidateLabelTextListener(value:(sender:Object,e:yfiles.input.LabelTextValidatingEventArgs)=> void):void; + /** + * Event that can be used to validate the label text for a label that is about to be added + * or edited. + * Note that the {@link yfiles.input.LabelTextValidatingEventArgs#label} may only a dummy instance, i.e. not bound to a live stripe instance. + * @see {@link yfiles.input.TableEditorInputMode#onValidateLabelText} + */ + removeValidateLabelTextListener(value:(sender:Object,e:yfiles.input.LabelTextValidatingEventArgs)=> void):void; + /** + * Gets or sets a value indicating whether this mode should automatically + * {@link yfiles.graph.ITable#removeLabel remove labels} from the table + * when a label text has been edited and the label text is empty. + * If the {@link yfiles.input.TableEditorInputMode} instance is installed as child mode of a {@link yfiles.input.GraphEditorInputMode} instance, + * auto removal is only enabled allowed if both the value of this property and the value of {@link yfiles.input.GraphEditorInputMode#autoRemoveEmptyLabels} are true. + * Value: + * true if empty labels should be removed after text editing; otherwise, false. + */ + autoRemoveEmptyLabels:boolean; + /** + * Gets or sets the keyboard mode priority. + * Value: The keyboard mode priority. + * The default is 0. + */ + keyboardModePriority:number; + /** + * Gets or sets the click input mode. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.TableEditorInputMode#createClickInputMode} will be called. + * Upon change the {@link yfiles.input.TableEditorInputMode#onClickInputModeChanged} method will be called. + * If the parent {@link yfiles.input.TableEditorInputMode} instance is installed as child mode of a {@link yfiles.input.GraphEditorInputMode} instance, this mode is not used, since all work is delegated to the parent's + * {@link yfiles.input.MainInputMode#clickInputMode} instance. This implies that all modifications made to the property value have no effect as long as the parent mode + * is child of a {@link yfiles.input.GraphEditorInputMode} instance. + * Value: The text editor input mode. + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + clickInputMode:yfiles.input.ClickInputMode; + /** + * Called when the {@link yfiles.input.TableEditorInputMode#clickInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.ClickInputMode} oldClickInputMode the old value, which may be null the first time + * @param {yfiles.input.ClickInputMode} newClickInputMode the new value + */ + onClickInputModeChanged(oldClickInputMode:yfiles.input.ClickInputMode,newClickInputMode:yfiles.input.ClickInputMode):void; + /** + * Factory method that creates the keyboard input mode instance. + */ + createClickInputMode():yfiles.input.ClickInputMode; + /** + * Callback that gets triggered once {@link yfiles.input.TableEditorInputMode#clickInputMode} + * triggers the {@link yfiles.input.ClickInputMode#addClickedListener Clicked} + * event. + */ + onClickInputModeClicked(sender:Object,e:yfiles.input.ClickEventArgs):void; + /** + * Clears the current selection. + * @see {@link yfiles.input.TableEditorInputMode#selectableItems} + */ + clearSelection():void; + /** + * Clears the current selection and selects all stripes in all table instances. + * By default, this method will be called in response to a Ctrl-A-key press recognized + * by {@link yfiles.input.TableEditorInputMode#keyboardInputMode}. + * @see {@link yfiles.system.ApplicationCommands#SELECT_ALL} + * @see {@link yfiles.input.TableEditorInputMode#selectableItems} + */ + selectAll():void; + /** + * This method deletes the currently selected stripes. + * If the {@link yfiles.input.TableEditorInputMode#stripeSelection} is non-empty + * this implementation triggers the {@link yfiles.input.TableEditorInputMode#addDeletingSelectionListener DeletingSelection} event, possibly a number of {@link yfiles.input.TableEditorInputMode#addDeletedItemListener DeletedItem} events, and + * a final {@link yfiles.input.TableEditorInputMode#deleteSelection} event. + * @see {@link yfiles.input.TableEditorInputMode#addDeletingSelectionListener DeletingSelection} + * @see {@link yfiles.input.TableEditorInputMode#addDeletedItemListener DeletedItem} + * @see {@link yfiles.input.TableEditorInputMode#addDeletedSelectionListener DeletedSelection} + */ + deleteSelection():void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addDeletingSelectionListener DeletingSelection} event. + * @param {yfiles.input.InputModeEventArgs} args The {@link yfiles.input.InputModeEventArgs} instance containing the event data. + */ + onDeletingSelection(args:yfiles.input.InputModeEventArgs):void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addDeletedItemListener DeletedItem} event. + * @param {yfiles.model.ItemEventArgs.} args The instance containing the event data. + */ + onDeletedItem(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.TableEditorInputMode#addDeletedSelectionListener DeletedSelection} event. + * @param {yfiles.input.InputModeEventArgs} args The {@link yfiles.input.InputModeEventArgs} instance containing the event data. + */ + onDeletedSelection(args:yfiles.input.InputModeEventArgs):void; + /** + * Occurs just before the {@link yfiles.input.TableEditorInputMode#deleteSelection} method starts its work and will be followed + * by any number of {@link yfiles.input.TableEditorInputMode#addDeletedItemListener DeletedItem} events and finalized by a {@link yfiles.input.TableEditorInputMode#addDeletedSelectionListener DeletedSelection} event. + * @see {@link yfiles.input.TableEditorInputMode#deleteSelection} + */ + addDeletingSelectionListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.input.TableEditorInputMode#deleteSelection} method starts its work and will be followed + * by any number of {@link yfiles.input.TableEditorInputMode#addDeletedItemListener DeletedItem} events and finalized by a {@link yfiles.input.TableEditorInputMode#addDeletedSelectionListener DeletedSelection} event. + * @see {@link yfiles.input.TableEditorInputMode#deleteSelection} + */ + removeDeletingSelectionListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Occurs when an item has been deleted interactively by this mode. + */ + addDeletedItemListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Occurs when an item has been deleted interactively by this mode. + */ + removeDeletedItemListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.input.TableEditorInputMode#deleteSelection} method has deleted the selection after all selected items have been removed. + * @see {@link yfiles.input.TableEditorInputMode#deleteSelection} + */ + addDeletedSelectionListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Occurs just before the {@link yfiles.input.TableEditorInputMode#deleteSelection} method has deleted the selection after all selected items have been removed. + * @see {@link yfiles.input.TableEditorInputMode#deleteSelection} + */ + removeDeletedSelectionListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Deletes a single stripe. + * @param {yfiles.graph.IStripe} item The stripe to delete. + */ + deleteStripe(item:yfiles.graph.IStripe):void; + /** + * Gets or set a property that determines which types of + * items may be deleted using the {@link yfiles.input.TableEditorInputMode#deleteSelection} action. + * The default is {@link yfiles.graph.GraphItemTypes#ALL}. + * @see {@link yfiles.input.TableEditorInputMode#shouldBeDeleted} + */ + deletableItems:yfiles.graph.StripeTypes; + /** + * Callback method that determines whether the given item should be + * deleted during {@link yfiles.input.TableEditorInputMode#deleteSelection}. + * This implementation deletes an item if it is of one of the {@link yfiles.input.TableEditorInputMode#deletableItems} type and if it is not the last stripe + * of a given type in the table (e.g. the only row or the only column). + * @param {yfiles.graph.IStripe} item The item. + * @return {boolean} Whether to delete that item. + */ + shouldBeDeleted(item:yfiles.graph.IStripe):boolean; + /** + * Gets or set a property that determines which types of + * items should be selectable at all. + * The default is {@link yfiles.graph.StripeTypes#ALL}. + * @see {@link yfiles.input.MainInputMode#setSelected} + */ + selectableItems:yfiles.graph.StripeTypes; + /** + * Gets or set a property that determines which types of + * items should be selectable through {@link yfiles.input.TableEditorInputMode#onClickInputModeClicked mouse clicks.}. + * The default is {@link yfiles.graph.StripeTypes#ALL}. + * @see {@link yfiles.input.MainInputMode#setSelected} + */ + clickSelectableItems:yfiles.graph.StripeTypes; + /** + * Callback that gets triggered once {@link yfiles.input.TableEditorInputMode#clickInputMode} + * triggers the {@link yfiles.input.ClickInputMode#addDoubleClickedListener DoubleClicked} + * event. + */ + onClickInputModeDoubleClicked(sender:Object,e:yfiles.input.ClickEventArgs):void; + /** + * Gets or sets the priority for the {@link yfiles.input.TableEditorInputMode#clickInputMode}. + * The default is 0. + */ + clickInputModePriority:number; + /** + * Gets or sets the LabelEditingAllowed property that determines whether the label editor + * will be automatically invoked if the F2 key is pressed. + * If the {@link yfiles.input.TableEditorInputMode} instance is installed as child mode of a {@link yfiles.input.GraphEditorInputMode} instance, + * editing a label is only allowed if both the value of this property and the value of {@link yfiles.input.GraphEditorInputMode#labelEditingAllowed} are true. + * If label editing is allowed, pressing F2 will start the label editor. + * By default this feature is enabled. + * @see {@link yfiles.input.TableEditorInputMode#editLabel} + */ + labelEditingAllowed:boolean; + /** + * Triggers the editing of the given label. + * The label must be bound to an {@link yfiles.graph.IStripe} instance for this call to succeed. + * This implementation uses the {@link yfiles.input.TableEditorInputMode#textEditorInputMode} + * to display an editor to edit the label. + * The text that the user enters may be {@link yfiles.input.TableEditorInputMode#addValidateLabelTextListener validated} before the label is actually edited. + * @see {@link yfiles.input.TableEditorInputMode#onLabelTextEdited} + * @param {yfiles.graph.ILabel} label The label to edit. + */ + editLabel(label:yfiles.graph.ILabel):void; + /** + * Gets or sets the LabelAddingAllowed property that determines whether the label editor + * will be automatically invoked if the Shift+F2 key is pressed. + * If the {@link yfiles.input.TableEditorInputMode} instance is installed as child mode of a {@link yfiles.input.GraphEditorInputMode} instance, + * adding a label is only allowed if both the value of this property and the value of {@link yfiles.input.GraphEditorInputMode#labelAddingAllowed} are true. + * If label adding is allowed, true pressing Shift+F2 will start the label editor. + * By default this feature is enabled. + * @see {@link yfiles.input.TableEditorInputMode#createLabel} + */ + labelAddingAllowed:boolean; + /** + * Interactively creates a new label for the provided stripe. + * This method will invoke the text editor that will let the user edit the text of the label. + * If the user commits the label text the label will be added to the labeled item. + * The text that the user enters may be {@link yfiles.input.TableEditorInputMode#addValidateLabelTextListener validated} before the label is actually added. + * @param {yfiles.graph.IStripe} stripe The item to create a new label for. + * @return {yfiles.support.Future.} + * A future of the label that will be notified of the newly created label or a null if the creation was canceled. + */ + createLabel(stripe:yfiles.graph.IStripe):yfiles.support.Future; + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} + * instance that will be queried to decide if a click is deemed a multi selection gesture. + * The default is {@link yfiles.input.KeyEvents#CONTROL_PRESSED}. If the {@link yfiles.input.TableEditorInputMode} instance is installed as child mode of a {@link yfiles.input.GraphEditorInputMode} instance, + * the value of {@link yfiles.input.GraphEditorInputMode#multiSelectionRecognizer} is used instead. + */ + multiSelectionRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets clicks on which {@link yfiles.graph.StripeSubregion}(s) should toggle a stripe selection state. + * This is independent to {@link yfiles.input.TableEditorInputMode#clickSelectableItems}. By default, only clicks on a stripe {@link yfiles.graph.StripeSubregion#HEADER} are handled. + */ + clickSelectableRegions:yfiles.graph.StripeSubregion; + /** + * Whether {@link yfiles.input.TableEditorInputMode#stripeSelection} should be synchronized with the {@link yfiles.input.GraphEditorInputMode#graphSelection} if this + * instance is installed as a child of a {@link yfiles.input.GraphEditorInputMode} instance. + * By default, this feature is enabled. + */ + synchronizeWithGraphSelection:boolean; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Returns the {@link yfiles.input.MainInputMode#selectionModel} + * as an {@link yfiles.graph.IStripeSelection}. + */ + stripeSelection:yfiles.graph.IStripeSelection; + /** + * Create a new instance of {@link yfiles.graph.IStripeSelection} the first time property {@link yfiles.input.TableEditorInputMode#stripeSelection} is accessed. + * By default, the {@link yfiles.graph.IStripeSelection#mixedSelectionAllowed} property is false. + * @return {yfiles.graph.IStripeSelection} A new {@link yfiles.graph.IStripeSelection} instance. + */ + createStripeSelection():yfiles.graph.IStripeSelection; + /** + * Used as a callback to find the hit item underneath a certain point. + * This implementation delegates to {@link yfiles.input.TableEditorInputMode#findStripeFiltered} + * to determine the hit item. + * @param {yfiles.geometry.PointD} location The location to test. + * @param {yfiles.graph.StripeTypes} stripeTypes An enumeration value of {@link yfiles.graph.StripeTypes} to specify the stripe type. + * @param {yfiles.graph.StripeSubregion} subregions An enumeration value of {@link yfiles.graph.StripeSubregion} to further restrict the stripe region. + * @return {yfiles.graph.StripeSubregionDescriptor} The stripe subregion that has been found for the location or null. + * @see {@link yfiles.input.TableEditorInputMode#findStripeFiltered} + */ + findStripe(location:yfiles.geometry.PointD,stripeTypes:yfiles.graph.StripeTypes,subregions:yfiles.graph.StripeSubregion):yfiles.graph.StripeSubregionDescriptor; + /** + * Used as a callback to find the items hit underneath a certain point. + * This implementation delegates to {@link yfiles.input.TableEditorInputMode#findStripesFiltered} + * to determine the hit item. + * @param {yfiles.geometry.PointD} location The location to test. + * @param {yfiles.graph.StripeTypes} stripeTypes An enumeration value of {@link yfiles.graph.StripeTypes} to specify the stripe type. + * @param {yfiles.graph.StripeSubregion} subregions An enumeration value of {@link yfiles.graph.StripeSubregion} to further restrict the stripe region. + * @return {yfiles.collections.IEnumerable.} The stripe subregion that has been found for the location or null. + * @see {@link yfiles.input.TableEditorInputMode#findStripesFiltered} + */ + findStripes(location:yfiles.geometry.PointD,stripeTypes:yfiles.graph.StripeTypes,subregions:yfiles.graph.StripeSubregion):yfiles.collections.IEnumerable; + /** + * Used as a callback to find the items underneath a certain point. + * @param {yfiles.geometry.PointD} location The location to test. + * @param {yfiles.graph.StripeTypes} stripeTypes An enumeration value of {@link yfiles.graph.StripeTypes} to specify the stripe type. + * @param {yfiles.graph.StripeSubregion} subregions An enumeration value of {@link yfiles.graph.StripeSubregion} to further restrict the stripe region. + * @param {function(yfiles.graph.StripeSubregionDescriptor):boolean} predicate Additional predicate to further restrict the hit test results. + * @return {yfiles.graph.StripeSubregionDescriptor} The stripe subregions that have been found for the location or null. + */ + findStripeFiltered(location:yfiles.geometry.PointD,stripeTypes:yfiles.graph.StripeTypes,subregions:yfiles.graph.StripeSubregion,predicate:(obj:yfiles.graph.StripeSubregionDescriptor)=>boolean):yfiles.graph.StripeSubregionDescriptor; + /** + * Used as a callback to find the items underneath a certain point. + * @param {yfiles.geometry.PointD} location The location to test. + * @param {yfiles.graph.StripeTypes} stripeTypes An enumeration value of {@link yfiles.graph.StripeTypes} to specify the stripe type. + * @param {yfiles.graph.StripeSubregion} subregions An enumeration value of {@link yfiles.graph.StripeSubregion} to further restrict the stripe region. + * @param {function(yfiles.graph.StripeSubregionDescriptor):boolean} predicate Additional predicate to further restrict the hit test results. + * @return {yfiles.collections.IEnumerable.} The stripe subregions that have been found for the location. + */ + findStripesFiltered(location:yfiles.geometry.PointD,stripeTypes:yfiles.graph.StripeTypes,subregions:yfiles.graph.StripeSubregion,predicate:(obj:yfiles.graph.StripeSubregionDescriptor)=>boolean):yfiles.collections.IEnumerable; + /** + * Convenience method that inserts a new stripe as child of owner. + * This method automatically resizes the table node and moves all content in neighboring stripes accordingly. The stripe is created with the + * default settings of the table where owner belongs to. + * @param {yfiles.graph.IStripe} owner The parent of the new stripe. + * @param {number} index The index where to insert the new stripe. + * @return {yfiles.graph.IStripe} A new stripe at the given index. + */ + insertChild(owner:yfiles.graph.IStripe,index:number):yfiles.graph.IStripe; + /** + * Convenience method that inserts a new stripe as child of owner. + * This method automatically resizes the table node and moves all content in neighboring stripes accordingly. The stripe is created with an initial size + * and otherwise the default settings of the table where owner belongs to. + * @param {yfiles.graph.IStripe} owner The parent of the new stripe. + * @param {number} index The index where to insert the new stripe. + * @param {number} size The initial size of the stripe + * @return {yfiles.graph.IStripe} A new stripe at the given index. + */ + insertChildWithOwnerIndexAndSize(owner:yfiles.graph.IStripe,index:number,size:number):yfiles.graph.IStripe; + /** + * Performs one-time initialization of this instance. This method should not + * be invoked by subclasses. This will be done automatically upon first + * {@link yfiles.input.AbstractInputMode#install installation} of this mode. + * This code will be executed only once per instance. The {@link yfiles.input.AbstractInputMode#canvas} property + * and {@link yfiles.input.AbstractInputMode#inputModeContext} property + * will be null when this code is executed. This method should not + * be used to install this mode into a specific canvas. + * Subclasses should always call base.Initialize() first. + * @see {@link yfiles.input.AbstractInputMode#install} + */ + initialize():void; + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + } + var TableEditorInputMode:{ + $class:yfiles.lang.Class; + /** + * Default constructor. + */ + new ():yfiles.input.TableEditorInputMode; + }; + /** + * Customized {@link yfiles.input.IPositionHandler} implementation that moves a stripe in the table hierarchy when the stripe is dragged. + * This class is used by default by both {@link yfiles.input.ReparentStripeInputMode} and {@link yfiles.input.StripeDropInputMode} to perform the actual reparenting and insertion. + */ + export interface ReparentStripePositionHandler extends Object,yfiles.input.IPositionHandler,yfiles.geometry.IPoint{ + /** + * Returns a view of the location of the item. + * The point describes the current world coordinate of the element that can + * be modified by this handler. + * @see Specified by {@link yfiles.input.IDragHandler#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Allows to query the moved stripe. + */ + movedStripe:yfiles.graph.IStripe; + /** + * Called by clients to indicate that the element is going to be dragged. + * This call will be followed by one or more calls to {@link yfiles.input.IDragHandler#handleMove}, + * and a final {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. + */ + initializeDrag(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Create a visualization for the target region of the reparent gesture. + * The default implementation + * uses the return value of {@link yfiles.graph.IStripeInputVisualizationHelper#getVisualCreator} with type {@link yfiles.graph.StripeVisualizationType#DROP_TARGET}. + * @param {yfiles.input.IInputModeContext} inputModeContext The current input mode context + * @param {yfiles.graph.IStripe} stripe The stripe for which the visualization should be created. + * @return {yfiles.canvas.ICanvasObject} A canvas object that is used to visualize the target region. + * @see {@link yfiles.input.ReparentStripePositionHandler#updateTargetVisualization} + */ + createTargetGhostVisualization(inputModeContext:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe):yfiles.canvas.ICanvasObject; + /** + * Create a visualization for the source region of the reparent gesture. + * The default implementation + * uses the return value of {@link yfiles.graph.IStripeInputVisualizationHelper#getVisualCreator} with type {@link yfiles.graph.StripeVisualizationType#DRAG_SOURCE}. + * @param {yfiles.input.IInputModeContext} inputModeContext The current input mode context + * @return {yfiles.canvas.ICanvasObject} A canvas object that is used to visualize the target region. + * @see {@link yfiles.input.ReparentStripePositionHandler#updateSourceVisualization} + */ + createSourceGhostVisualization(inputModeContext:yfiles.input.IInputModeContext):yfiles.canvas.ICanvasObject; + /** + * Called by clients to indicate that the element has been dragged and its position + * should be updated. + * This method may be called more than once after an initial {@link yfiles.input.IDragHandler#initializeDrag} + * and will the final call will be followed by either one + * {@link yfiles.input.IDragHandler#dragFinished} or one {@link yfiles.input.IDragHandler#cancelDrag} call. + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @return {boolean} Whether the move had any visual effect. This is a hint to the engine to optimize invalidation. + * @see Specified by {@link yfiles.input.IDragHandler#handleMove}. + */ + handleMove(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):boolean; + /** + * Modifies the target visualization itself. + * The default implementation only hides targetVisualization iff reparentGesture is {@link yfiles.input.ReparentGesture#INVALID}. + * @param {yfiles.canvas.ICanvasObject} targetVisualization The canvas object for the target visualization + * @param {yfiles.graph.IStripe} targetStripe The target for the reparent gesture + * @param {yfiles.input.ReparentGesture} reparentGesture The gesture + * @param {yfiles.input.IInputModeContext} inputModeContext The current input mode context. + * @param {yfiles.geometry.RectD} targetBounds The current visualization bounds that have been computed with {@link yfiles.input.ReparentStripePositionHandler#updateTargetVisualizationBounds} + */ + updateTargetVisualization(targetVisualization:yfiles.canvas.ICanvasObject,targetStripe:yfiles.graph.IStripe,reparentGesture:yfiles.input.ReparentGesture,targetBounds:yfiles.geometry.RectD,inputModeContext:yfiles.input.IInputModeContext):yfiles.canvas.ICanvasObject; + /** + * Modifies the source visualization itself. + * The default does not change targetVisualization. + * @param {yfiles.canvas.ICanvasObject} targetVisualization The canvas object for the target visualization + * @param {yfiles.graph.IStripe} targetStripe The target for the reparent gesture + * @param {yfiles.input.ReparentGesture} reparentGesture The gesture + * @param {yfiles.input.IInputModeContext} inputModeContext The current input mode context. + */ + updateSourceVisualization(targetVisualization:yfiles.canvas.ICanvasObject,targetStripe:yfiles.graph.IStripe,reparentGesture:yfiles.input.ReparentGesture,inputModeContext:yfiles.input.IInputModeContext):yfiles.canvas.ICanvasObject; + /** + * Find the target stripe subregion at newLocation and its associated owner node. + * @param {yfiles.geometry.PointD} newLocation The hit location. + * @param {yfiles.graph.INode} targetTableNode The node where the found table region is associated to. + * @return {yfiles.graph.StripeSubregionDescriptor} A {@link yfiles.graph.StripeSubregionDescriptor} that lies at newLocation, or null if no such region could be found. + */ + getTargetSubregion(newLocation:yfiles.geometry.PointD,targetTableNode:{value:yfiles.graph.INode;}):yfiles.graph.StripeSubregionDescriptor; + /** + * Updates the visualization bounds for the target visualization depending on the provided values. + * @param {yfiles.geometry.RectD} originalTargetBounds The target bounds prior to this method call. + * @param {yfiles.input.ReparentGesture} gesture The reparent gesture. + * @param {yfiles.graph.IStripe} targetStripe The target stripe which has been determined by the input mode. + * @return {yfiles.geometry.RectD} Updated bounds for the target visualization. + */ + updateTargetVisualizationBounds(originalTargetBounds:yfiles.geometry.RectD,gesture:yfiles.input.ReparentGesture,targetStripe:yfiles.graph.IStripe):yfiles.geometry.RectD; + /** + * Determine the reparent gesture that would result from the given parameters. + * The target region has already been determined by {@link yfiles.input.ReparentStripePositionHandler#getTargetSubregion} + * @param {yfiles.input.IInputModeContext} inputModeContext The current input mode context + * @param {yfiles.geometry.IPoint} newLocation The current drag location + * @param {yfiles.graph.IStripe} sourceStripe The stripe that is moved + * @param {yfiles.graph.StripeSubregionDescriptor} targetDescriptor The stripe subregion for the target. + * @param {yfiles.geometry.RectD} targetBounds The target bounds + * @return {yfiles.input.ReparentGesture} An enumeration value of {@link yfiles.input.ReparentGesture} that encodes the operation to perform. + */ + determineGesture(inputModeContext:yfiles.input.IInputModeContext,newLocation:yfiles.geometry.IPoint,sourceStripe:yfiles.graph.IStripe,targetDescriptor:yfiles.graph.StripeSubregionDescriptor,targetBounds:yfiles.geometry.RectD):yfiles.input.ReparentGesture; + /** + * Called by clients to indicate that the dragging has been canceled by the user. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Implementations should reset the position of the items they modify to their initial state. + * Alternatively to this method the {@link yfiles.input.IDragHandler#dragFinished} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} originalLocation The value of the coordinate of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#cancelDrag}. + */ + cancelDrag(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * Called by clients to indicate that the repositioning has just been finished. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Alternatively to this method the {@link yfiles.input.IDragHandler#cancelDrag} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * This is the same value as delivered in the last invocation of {@link yfiles.input.IDragHandler#handleMove} + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#dragFinished}. + */ + dragFinished(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + /** + * The current {@link yfiles.input.IInputModeContext}. + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Called by clients to set the position to the given coordinates. + * It is up to the implementation to decide how the position of the element in + * question should be interpreted. This may be the upper left corner of the element, + * its center or anything else. The implementation may decide to not use the values + * provided or use different values internally. + * @param {yfiles.geometry.PointD} location The new location. + * @see {@link yfiles.input.IDragHandler#location} + * @see Specified by {@link yfiles.input.IPositionHandler#setPosition}. + */ + setPosition(location:yfiles.geometry.PointD):void; + /** + * Called whenever a change in the table hierarchy occurs through this position handler. + */ + onStripeChanged(args:yfiles.model.ItemEventArgs):void; + /** + * Fired if a stripe state is changed by this input mode. + */ + addStripeChangedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Fired if a stripe state is changed by this input mode. + */ + removeStripeChangedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + } + var ReparentStripePositionHandler:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this position handler which moves movedStripe. + * @param {yfiles.graph.IStripe} movedStripe + */ + new (movedStripe:yfiles.graph.IStripe):yfiles.input.ReparentStripePositionHandler; + }; + /** + * Specialized input mode that is used to resize a stripe by dragging one of its borders. + * By default, adjacent stripes are moved. To redistribute the space instead, use {@link yfiles.input.ResizeStripeInputMode#resizeNeighborsRecognizer}. Also, by default the content of the stripes + * is either moved or constrains the minimum available sizes for the stripe resize operations. To completely ignore all content nodes, use {@link yfiles.input.ResizeStripeInputMode#ignoreContentRecognizer}. + */ + export interface ResizeStripeInputMode extends yfiles.input.StateMachineInputMode{ + /** + * Gets or sets the "pressed" state recognizer for touch input. + * This recognizer instance will be used to determine when the user begins + * to move a handle. + * Value: The "pressed" recognizer for touch events. + */ + pressedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "dragged" recognizer for touch input. + * This recognizer instance determines when the user is moving a handle. + * Value: The "dragged" recognizer for touch events. + */ + draggedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "released" recognizer for touch input. + * This instance determines when the user has finished moving the handle. + * Value: The "released" recognizer for touch events. + */ + releasedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "pressed" state recognizer. + * This recognizer instance will be used to determine when the user begins + * to resize the stripe. + * Value: The "pressed" recognizer. + */ + pressedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "dragged" recognizer. + * This recognizer instance determines when the user is dragging the mouse to resize the stripe. + * Value: The "dragged" recognizer. + */ + draggedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "cancel" recognizer. + * This recognizer recognizes a cancel action during the resize operation. + * Value: The "cancel" recognizer. + */ + cancelRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "released" recognizer. + * This instance determines when the user has finished the resize operation. + * Value: The "released" recognizer. + */ + releasedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the recognizer that changes the behavior to resize adjacent stripes instead of moving them. + * If this recognizer recognizes its gesture, the behavior will be to resize adjacent stripes instead of moving them (which is the default). + */ + resizeNeighborsRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the recognizer that changes the behavior to ignore the content of all stripes instead of moving them or considering for minimum sizes. + * If this recognizer recognizes its gesture, the behavior will be to completely ignore all stripe contents. + */ + ignoreContentRecognizer:yfiles.input.IEventRecognizer; + /** + * Called to initialize the state machine. + * This implementation does nothing. + * @param {yfiles.support.StateMachine} machine The machine to initialize and configure + * @param {yfiles.support.State} startState The start state to use. + * @param {yfiles.support.State} canceledState The canceled state to use. + * @param {yfiles.support.State} stoppedState The stopped state to use. + * @param {yfiles.support.State} finishedState The finished state to use. + */ + initializeStateMachine(machine:yfiles.support.StateMachine,startState:yfiles.support.State,canceledState:yfiles.support.State,stoppedState:yfiles.support.State,finishedState:yfiles.support.State):void; + /** + * Called to determine whether it is valid to begin the gesture. + * This implementation checks whether a stripe border has been hit at {@link yfiles.input.StateMachineInputMode#lastMouse2DEventArgs} + * @param {Object} source + * @param {yfiles.system.EventArgs} args + * @return {boolean} true iff a stripe border has been hit at {@link yfiles.input.StateMachineInputMode#lastMouse2DEventArgs} + */ + isValidBegin(source:Object,args:yfiles.system.EventArgs):boolean; + /** + * Event that will be triggered before the drag will be finished. + */ + addDragFinishingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be finished. + */ + removeDragFinishingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag has been finished. + */ + addDragFinishedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag has been finished. + */ + removeDragFinishedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is starting. + */ + addDragStartingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is starting. + */ + removeDragStartingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is initialized and has started. + */ + addDragStartedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is initialized and has started. + */ + removeDragStartedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the start of every drag. + */ + addDraggingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the start of every drag. + */ + removeDraggingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the end of every drag. + */ + addDraggedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the end of every drag. + */ + removeDraggedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered when the drag has been canceled. + */ + addDragCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered when the drag has been canceled. + */ + removeDragCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be canceled. + */ + addDragCancelingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be canceled. + */ + removeDragCancelingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Triggers the {@link yfiles.input.ResizeStripeInputMode#addDragStartingListener DragStarting} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragStarting(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.ResizeStripeInputMode#addDragStartedListener DragStarted} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragStarted(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the start of each drag. + * This method triggers the {@link yfiles.input.ResizeStripeInputMode#addDraggingListener Dragging} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragging(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the end of each drag. + * This method triggers the {@link yfiles.input.ResizeStripeInputMode#addDraggedListener Dragged} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragged(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered once the drag has been finalized. + * This method triggers the {@link yfiles.input.ResizeStripeInputMode#addDragFinishedListener DragFinished} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragFinished(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered before the drag will be finalized. + * This method triggers the {@link yfiles.input.ResizeStripeInputMode#addDragFinishingListener DragFinishing} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragFinishing(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.ResizeStripeInputMode#addDragCanceledListener DragCanceled} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragCanceled(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.ResizeStripeInputMode#addDragCancelingListener DragCanceling} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragCanceling(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(c:yfiles.input.IInputModeContext):void; + /** + * Creates the resize visualization. + * @param {yfiles.graph.IStripe} tableItem The table item. + * @param {yfiles.input.IInputModeContext} ctx The current input mode context. + * @return {yfiles.drawing.IVisualCreator} A visual creator that visualizes the resize gesture + * @see {@link yfiles.graph.IStripeInputVisualizationHelper} + */ + createResizeVisualization(tableItem:yfiles.graph.IStripe,ctx:yfiles.input.IInputModeContext):yfiles.drawing.IVisualCreator; + } + var ResizeStripeInputMode:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this input mode. + */ + new ():yfiles.input.ResizeStripeInputMode; + }; + /** + * A simple implementation of an {@link yfiles.input.IHandleProvider} + * that returns all handles in the lookup of the ports + * owned by the given owner. + * Using this class to display port handles will result in exceptions if the + * underlying port instances are removed from the graph while the handles are + * displayed. This can happen, for example, through + * Undo or if ports are removed programmatically with + * {@link yfiles.graph.IGraph#removePort}. In that case, + * you need to query the handles again before interacting with the graph, for + * example by temporarily unselecting and reselecting the port-owning nodes. + */ + export interface PortsHandleProvider extends Object,yfiles.input.IHandleProvider{ + /** + * The owner of the ports. + */ + portOwner:yfiles.graph.IPortOwner; + /** + * Returns a collection of zero or more {@link yfiles.input.IHandle} implementations + * that are associated with the ports of this context. + * @return {yfiles.collections.ICollection.} A collection of handles. + * @see Specified by {@link yfiles.input.IHandleProvider#getHandles}. + */ + getHandles(inputModeContext:yfiles.input.IInputModeContext):yfiles.collections.ICollection; + /** + * Retrieves the handle implementation from the port's lookup. + */ + getHandle(port:yfiles.graph.IPort):yfiles.input.IHandle; + } + var PortsHandleProvider:{ + $class:yfiles.lang.Class; + /** + * Creates an instance using the given owner as the provider for the ports. + * @param {yfiles.graph.IPortOwner} portOwner + */ + new (portOwner:yfiles.graph.IPortOwner):yfiles.input.PortsHandleProvider; + }; + /** + * Default implementation of the {@link yfiles.input.IReparentStripeHandler} interface. + * This implementation allows to specify a maximal nesting depth for reparent operations. + */ + export interface ReparentStripeHandler extends Object,yfiles.input.IReparentStripeHandler{ + /** + * Determines whether the user may detach the given stripe from its current parent in + * order to reparent it. + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.IStripe} stripe The stripe that is about to be detached from its current parent. + * @return {boolean} This implementation returns always true. + * @see Specified by {@link yfiles.input.IReparentStripeHandler#canReparent}. + */ + canReparent(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe):boolean; + /** + * Checks the constraints imposed by {@link yfiles.input.ReparentStripeHandler#maxRowLevel} or {@link yfiles.input.ReparentStripeHandler#maxColumnLevel} for a valid gesture. + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.IStripe} stripe The stripe that will be reparented. + * @param {yfiles.graph.IStripe} newParent The potential new parent. + * @param {number} index The index where the stripe would be {@link yfiles.input.ReparentStripeHandler#reparent reparented} + * @param {yfiles.input.ReparentGesture} gesture The gesture that would be used for the {@link yfiles.input.ReparentStripeHandler#reparent} operation. + * @return {boolean} true iff the resulting nesting depth is smaller than {@link yfiles.input.ReparentStripeHandler#maxRowLevel} or {@link yfiles.input.ReparentStripeHandler#maxColumnLevel}, or if the nesting depth + * would not increase by the operation. + * @see Specified by {@link yfiles.input.IReparentStripeHandler#isValidParent}. + */ + isValidParent(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,index:number,gesture:yfiles.input.ReparentGesture):boolean; + /** + * Performs the actual reparenting after the reparent gesture has been finalized. + * This implementation adjusts the size of the moved and/or the target stripe by calling {@link yfiles.input.ReparentStripeHandler#adjustSize} . + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.IStripe} movedStripe The stripe that will be reparented. + * @param {yfiles.graph.IStripe} newParent The potential new parent. + * @param {number} index The index where the stripe should be inserted. + * @param {yfiles.input.ReparentGesture} gesture The gesture that triggered the reparent operation. + * @see Specified by {@link yfiles.input.IReparentStripeHandler#reparent}. + */ + reparent(context:yfiles.input.IInputModeContext,movedStripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,index:number,gesture:yfiles.input.ReparentGesture):void; + /** + * Adjust the size of the source or the target stripe. + * This implementation adjusts the size of movedStripe to Math.Max(originalStripeSize, originalParentSize) + * if gesture is an {@link yfiles.input.ReparentGesture#ADD_CHILD} operation + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.IStripe} movedStripe The stripe that will be reparented. + * @param {yfiles.graph.IStripe} newParent The potential new parent. + * @param {number} index The index where the stripe should be inserted. + * @param {yfiles.input.ReparentGesture} gesture The gesture that triggered the reparent operation. + * @param {number} originalStripeSize The original size of movedStripe + * @param {number} originalParentSize The original size of newParent + */ + adjustSize(context:yfiles.input.IInputModeContext,movedStripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,gesture:yfiles.input.ReparentGesture,index:number,originalStripeSize:number,originalParentSize:number):void; + /** + * The maximum nesting level the row hierarchy may acquire during a reparent gesture. + * Note that it is always possible to decrease the nesting depth, even if the resulting depth would still be too high. This allows to interactively + * reduce an invalid nesting depth in multiple steps. + * The default value is {@link Number#yfiles.system.Math#Int32MaxValue}, which effectively means an unlimited nesting depth. + */ + maxRowLevel:number; + /** + * The maximum nesting level the column hierarchy may acquire during a reparent gesture. + * Note that it is always possible to decrease the nesting depth, even if the resulting depth would still be too high. This allows to interactively + * reduce an invalid nesting depth in multiple steps. + * The default value is {@link Number#yfiles.system.Math#Int32MaxValue}, which effectively means an unlimited nesting depth. + */ + maxColumnLevel:number; + } + var ReparentStripeHandler:{ + $class:yfiles.lang.Class; + new ():yfiles.input.ReparentStripeHandler; + }; + /** + * Interface used for implementations that recognize, approve and disapprove stripe + * reparenting gestures, as well as actually performs the reparenting. + * @see {@link yfiles.input.ReparentStripePositionHandler} + */ + export interface IReparentStripeHandler extends Object{ + /** + * Determines whether the user may detach the given stripe from its current parent in + * order to reparent it. + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.IStripe} stripe The stripe that is about to be detached from its current parent. + * @return {boolean} Whether the stripe may be detached and reparented. + * @see Specified by {@link yfiles.input.IReparentStripeHandler#canReparent}. + */ + canReparent(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe):boolean; + /** + * Determines whether the provided node may be reparented to a newParent. + * This method is called to determine whether a {@link yfiles.input.IReparentStripeHandler#reparent} operation should actually be executed. + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.IStripe} stripe The stripe that will be reparented. + * @param {yfiles.graph.IStripe} newParent The potential new parent. + * @param {number} index The index where the stripe would be {@link yfiles.input.IReparentStripeHandler#reparent reparented} + * @param {yfiles.input.ReparentGesture} gesture The gesture that would be used for the {@link yfiles.input.IReparentStripeHandler#reparent} operation. + * @return {boolean} Whether newParent is a valid new parent for stripe for the given index and gesture. + * @see Specified by {@link yfiles.input.IReparentStripeHandler#isValidParent}. + */ + isValidParent(context:yfiles.input.IInputModeContext,stripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,index:number,gesture:yfiles.input.ReparentGesture):boolean; + /** + * Performs the actual reparenting after the reparent gesture has been finalized. + * Implementations should use {@link yfiles.graph.ITable#setColumnParentAtIndex} + * or {@link yfiles.graph.ITable#setRowParentAtIndex} to set the parent of movedStripe + * to newParent. + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.IStripe} movedStripe The stripe that will be reparented. + * @param {yfiles.graph.IStripe} newParent The potential new parent. + * @param {number} index The index where the stripe should be inserted. + * @param {yfiles.input.ReparentGesture} gesture The gesture that triggered the reparent operation. + * @see Specified by {@link yfiles.input.IReparentStripeHandler#reparent}. + */ + reparent(context:yfiles.input.IInputModeContext,movedStripe:yfiles.graph.IStripe,newParent:yfiles.graph.IStripe,index:number,gesture:yfiles.input.ReparentGesture):void; + } + var IReparentStripeHandler:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The event arguments used by {@link yfiles.input.GraphSnapContext} to collect + * the various snap lines for each drag. + * @see {@link yfiles.input.GraphSnapContext#addCollectSnapLinesListener CollectSnapLines} + */ + export interface CollectGraphSnapLinesEventArgs extends yfiles.input.InputModeEventArgs{ + /** + * Add another fixed node snap line. + * @param {yfiles.input.OrthogonalSnapLine} snapLine The snap line to add to the list of lines that nodes snap to by default. + * @see {@link yfiles.input.GraphSnapContext#fixedNodeSnapLines} + */ + addFixedNodeSnapLine(snapLine:yfiles.input.OrthogonalSnapLine):void; + /** + * Add another snap line where nodes snap to. + * @param {yfiles.input.OrthogonalSnapLine} snapLine The snap line to add to the list of lines that segments snap to by default. + * @see {@link yfiles.input.GraphSnapContext#fixedSegmentSnapLines} + */ + addFixedSegmentSnapLine(snapLine:yfiles.input.OrthogonalSnapLine):void; + /** + * Add another fixed node snap line. + * @param {yfiles.input.OrthogonalSnapLine} snapLine The snap line to add to the list of lines that nodes snap to by default. + * @see {@link yfiles.input.GraphSnapContext#fixedPortSnapLines} + */ + addPortSnapLine(snapLine:yfiles.input.OrthogonalSnapLine):void; + /** + * Add another additional snap line to which both nodes and segments can snap to. + * @param {yfiles.input.OrthogonalSnapLine} snapLine The snap line to add to the list of lines that all elements snap to by default. + * @see {@link yfiles.input.GraphSnapContext#additionalSnapLines} + */ + addAdditionalSnapLine(snapLine:yfiles.input.OrthogonalSnapLine):void; + } + var CollectGraphSnapLinesEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.CollectGraphSnapLinesEventArgs} class. + * @param {yfiles.input.IInputModeContext} context The context where the event is being used in. + * @param {yfiles.collections.ICollection.} fixedNodeSnapLines The fixed node snap lines collection to add to. + * @param {yfiles.collections.ICollection.} fixedSegmentSnapLines The fixed segment snap lines collection to add to. + * @param {yfiles.collections.ICollection.} fixedPortSnapLines The fixed port snap lines collection to add to. + * @param {yfiles.collections.ICollection.} additionalSnapLines The additional snap lines collection to add to. + */ + new (context:yfiles.input.IInputModeContext,fixedNodeSnapLines:yfiles.collections.ICollection,fixedSegmentSnapLines:yfiles.collections.ICollection,fixedPortSnapLines:yfiles.collections.ICollection,additionalSnapLines:yfiles.collections.ICollection):yfiles.input.CollectGraphSnapLinesEventArgs; + }; + /** + * Event argument base class that is used by events that are triggered by {@link yfiles.input.IInputMode} implementations. + */ + export interface InputModeEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the context for the current event. + * Value: The context. + */ + context:yfiles.input.IInputModeContext; + } + var InputModeEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.InputModeEventArgs} class. + * @param {yfiles.input.IInputModeContext} context The context to initialize the {@link yfiles.input.InputModeEventArgs#context} property with. + */ + new (context:yfiles.input.IInputModeContext):yfiles.input.InputModeEventArgs; + }; + /** + * Interface for an object that can handle the position of an item + * displayed in a {@link yfiles.canvas.CanvasControl}. + * The point as indicated by {@link yfiles.input.IDragHandler#location} + * describes the current world coordinate position of the element. + * It is up to the implementation how this position is interpreted. + * The values returned by that instance will be used for the "originalLocation" parameter + * in the {@link yfiles.input.IDragHandler#handleMove}, {@link yfiles.input.IDragHandler#cancelDrag} and {@link yfiles.input.IDragHandler#dragFinished} + * methods. + * Items can be dragged with the mouse and an instance of this class will modify their position + * accordingly. + * Typically client code will use the {@link yfiles.input.IDragHandler#location}'s coordinates + * to determine the current position of the elements. + * A drag will trigger the invocation of + * {@link yfiles.input.IDragHandler#initializeDrag}, zero or more {@link yfiles.input.IDragHandler#handleMove} calls, and finalized + * by either {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. + * @see {@link yfiles.input.IDragHandler} + * @see {@link yfiles.input.IHandle} + * @see {@link yfiles.input.MoveInputMode} + */ + export interface IPositionHandler extends Object,yfiles.input.IDragHandler{ + /** + * Called by clients to set the position to the given coordinates. + * It is up to the implementation to decide how the position of the element in + * question should be interpreted. This may be the upper left corner of the element, + * its center or anything else. The implementation may decide to not use the values + * provided or use different values internally. + * @param {yfiles.geometry.PointD} location The new location. + * @see {@link yfiles.input.IDragHandler#location} + * @see Specified by {@link yfiles.input.IPositionHandler#setPosition}. + */ + setPosition(location:yfiles.geometry.PointD):void; + } + var IPositionHandler:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * {@link yfiles.input.IReshapeHandler} implementation that constrains node resizes so that minimum size constraints of an associated + * {@link yfiles.graph.ITable} are satisfied and which resizes the outer {@link yfiles.graph.IStripe}s of such a table when the node is resized. + * The constraints are applied in addition to any constraints imposed by the {@link yfiles.input.IReshapeHandler} which is wrapped by this implementation. + */ + export interface TableReshapeHandler extends Object,yfiles.input.IReshapeHandler{ + /** + * Returns a view of the bounds of the item. + * The rectangle describes the current world coordinate of the element that can + * be modified by this handler. + * @see Specified by {@link yfiles.input.IReshapeHandler#bounds}. + */ + bounds:yfiles.geometry.IRectangle; + /** + * Called by clients to indicate that the element is going to be reshaped. + * This call will be followed by one or more calls to {@link yfiles.input.IReshapeHandler#handleReshape}, + * and a final {@link yfiles.input.IReshapeHandler#reshapeFinished} or {@link yfiles.input.IReshapeHandler#cancelReshape}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @see Specified by {@link yfiles.input.IReshapeHandler#initializeReshape}. + */ + initializeReshape(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Called by clients to indicate that the element has been dragged and its position + * should be updated. + * This method may be called more than once after an initial {@link yfiles.input.IReshapeHandler#initializeReshape} + * and will the final call will be followed by either one + * {@link yfiles.input.IReshapeHandler#reshapeFinished} or one {@link yfiles.input.IReshapeHandler#cancelReshape} call. + * @param {yfiles.geometry.RectD} originalBounds The value of the {@link yfiles.input.IReshapeHandler#bounds} property at the time of {@link yfiles.input.IReshapeHandler#initializeReshape}. + * @param {yfiles.geometry.RectD} newBounds The coordinates of the bounds in the world coordinate system that the client wants the shape to be at. + * Depending on the implementation the {@link yfiles.input.IReshapeHandler#bounds} may or may not be modified to reflect the new value. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the reshaping from. + * @return {boolean} Whether the reshaping had any visual effect. This is a hint to the engine to optimize invalidation. + * @see Specified by {@link yfiles.input.IReshapeHandler#handleReshape}. + */ + handleReshape(inputModeContext:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.RectD,newBounds:yfiles.geometry.RectD):boolean; + /** + * Called by clients to indicate that the reshaping has been canceled by the user. + * This method may be called after the initial {@link yfiles.input.IReshapeHandler#initializeReshape} and zero or + * more invocations of {@link yfiles.input.IReshapeHandler#handleReshape}. + * Implementations should reset the bounds of the items they modify to their initial state. + * Alternatively to this method the {@link yfiles.input.IReshapeHandler#reshapeFinished} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the reshaping from. + * @param {yfiles.geometry.RectD} originalBounds The value of the coordinate of the {@link yfiles.input.IReshapeHandler#bounds} property at the time of {@link yfiles.input.IReshapeHandler#initializeReshape}. + * @see Specified by {@link yfiles.input.IReshapeHandler#cancelReshape}. + */ + cancelReshape(inputModeContext:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.RectD):void; + /** + * Called by clients to indicate that the reshaping has just been finished. + * This method may be called after the initial {@link yfiles.input.IReshapeHandler#initializeReshape} and zero or + * more invocations of {@link yfiles.input.IReshapeHandler#handleReshape}. + * Alternatively to this method the {@link yfiles.input.IReshapeHandler#cancelReshape} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.RectD} newBounds The coordinates of the bounds in the world coordinate system that the client wants the shape to be at. + * Depending on the implementation the {@link yfiles.input.IReshapeHandler#bounds} may or may not be modified to reflect the new value. + * This is the same value as delivered in the last invocation of {@link yfiles.input.IReshapeHandler#handleReshape} + * @param {yfiles.geometry.RectD} originalBounds The value of the coordinate of the {@link yfiles.input.IReshapeHandler#bounds} property at the time of {@link yfiles.input.IReshapeHandler#initializeReshape}. + * @see Specified by {@link yfiles.input.IReshapeHandler#reshapeFinished}. + */ + reshapeFinished(inputModeContext:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.RectD,newBounds:yfiles.geometry.RectD):void; + } + var TableReshapeHandler:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this Handler which wraps an existing instance of coreHandler and uses table + * for additional constraints. In addition, table's outer stripes are resized if necessary. + * table should be associated to tableNode + * @param {yfiles.input.IReshapeHandler} coreHandler The handler that is wrapped by this instance. + * @param {yfiles.graph.INode} tableNode The node for which this handler is used + * @param {yfiles.graph.ITable} table The table that is used for additional constraints. + */ + new (coreHandler:yfiles.input.IReshapeHandler,tableNode:yfiles.graph.INode,table:yfiles.graph.ITable):yfiles.input.TableReshapeHandler; + }; + /** + * The GraphCommands class exposes a standard set of {@link yfiles.graph.IGraph}-related editing and navigation + * {@link yfiles.system.RoutedUICommand commands}. + * The commands in this class are abstract, i.e. they cannot be executed on their own. Instead + * {@link yfiles.input.IInputMode}s for {@link yfiles.canvas.GraphControl} provide implementations ({@link yfiles.system.CommandBinding}s) + * for these commands. + * For more information on commands and commanding, see {@link yfiles.system.ICommand} and {@link yfiles.system.RoutedUICommand}. + * @see {@link yfiles.input.GraphEditorInputMode} + * @see {@link yfiles.input.GraphViewerInputMode} + * @see {@link yfiles.input.NavigationInputMode} + */ + export interface GraphCommands extends Object{ + } + var GraphCommands:{ + $class:yfiles.lang.Class; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * select the item that is specified by the {@link yfiles.system.ExecutedRoutedEventArgs#parameter}. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + SELECT_ITEM_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * toggle the selection state of the item that is specified by the {@link yfiles.system.ExecutedRoutedEventArgs#parameter}. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + TOGGLE_ITEM_SELECTION_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * deselect the item that is specified by the {@link yfiles.system.ExecutedRoutedEventArgs#parameter}. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + DESELECT_ITEM_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * {@link yfiles.input.GraphEditorInputMode#editLabel edit the label} that is specified by the {@link yfiles.system.ExecutedRoutedEventArgs#parameter}. + * If no {@link yfiles.system.ExecutedRoutedEventArgs#parameter} is set, this will trigger the {@link yfiles.input.GraphEditorInputMode#onEditLabel} + * if {@link yfiles.input.GraphEditorInputMode} is used. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + EDIT_LABEL_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * {@link yfiles.input.GraphEditorInputMode#addLabel add another label} to the {@link yfiles.graph.ILabeledItem}that is specified by the {@link yfiles.system.ExecutedRoutedEventArgs#parameter}. + * If no {@link yfiles.system.ExecutedRoutedEventArgs#parameter} is set, this will trigger the {@link yfiles.input.GraphEditorInputMode#onAddLabel} + * if {@link yfiles.input.GraphEditorInputMode} is used. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + ADD_LABEL_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * {@link yfiles.input.GraphEditorInputMode#groupSelection group the currently selected items}. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + GROUP_SELECTION_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * {@link yfiles.input.GraphEditorInputMode#adjustGroupNodeSize adjust the size of the selected group nodes}. + * The default keyboard binding for this command is ctrl-shift-G. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + ADJUST_GROUP_NODE_SIZE_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * {@link yfiles.input.GraphEditorInputMode#ungroupSelection ungroup the currently selected items}. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + UNGROUP_SELECTION_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * {@link yfiles.model.ISelectionModel#clear clear the selection}. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + DESELECT_ALL_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * {@link yfiles.input.NavigationInputMode#expandGroup expand} group nodes. + * If the parameter to this command is null, the currently selected group nodes are expanded. + * If the parameter is an {@link yfiles.graph.INode} instance, that node will be expanded. If the parameter is an + * {@link yfiles.objectcollections.IEnumerable} instance, then all group nodes in that enumeration are expanded. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + EXPAND_GROUP_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * {@link yfiles.input.NavigationInputMode#collapseGroup collapse} group nodes. + * If the parameter to this command is null, the currently selected group nodes are collapsed. + * If the parameter is an {@link yfiles.graph.INode} instance, that group node will be collapsed. If the parameter is an + * {@link yfiles.objectcollections.IEnumerable} instance, then all group nodes in that enumeration are collapsed. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + COLLAPSE_GROUP_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * {@link yfiles.input.NavigationInputMode#toggleGroupNodeState toggle} the collapsed/expanded state of currently selected group nodes. + * If the parameter to this command is null, the currently selected group nodes are toggled. + * If the parameter is an {@link yfiles.graph.INode} instance, that group node will be toggled. If the parameter is an + * {@link yfiles.objectcollections.IEnumerable} instance, then all group nodes in that enumeration are toggled. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + TOGGLE_GROUP_STATE_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * {@link yfiles.graph.IFoldedGraph#localRoot switch the local root} of the current {@link yfiles.graph.IFoldedGraph} + * view to the given group node. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + ENTER_GROUP_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * {@link yfiles.graph.IFoldedGraph#localRoot exit the current local root} of the current {@link yfiles.graph.IFoldedGraph} + * view to the given parent view. + * @see {@link yfiles.input.KeyboardInputMode#addCommand} + */ + EXIT_GROUP_COMMAND:yfiles.system.RoutedUICommand; + /** + * This is an {@link yfiles.system.RoutedUICommand} that instances of {@link yfiles.input.CreateEdgeInputMode} + * can execute if they have been {@link yfiles.input.IInputMode#install installed} + * in a {@link yfiles.canvas.CanvasControl}. + * If this command gets executed, the {@link yfiles.system.ExecutedRoutedEventArgs#parameter} + * is inspected to see if it is set to either an {@link yfiles.input.IPortCandidate}, an {@link yfiles.graph.IPort}, + * or an {@link yfiles.graph.INode} that is an element in the currently edited graph instance. + * If so, method {@link yfiles.input.CreateEdgeInputMode.doStartEdgeCreation(yfiles.input.IPortCandidate)} will be invoked and the user can + * finish the edge creation gesture. + */ + BEGIN_EDGE_CREATION_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that can be + * {@link yfiles.system.RoutedCommand#executeOnTarget executed} from within the {@link yfiles.canvas.GraphControl} to + * {@link yfiles.graph.GraphClipboard#duplicate duplicate items} of the current {@link yfiles.graph.IGraph}. + */ + DUPLICATE_COMMAND:yfiles.system.RoutedUICommand; + /** + * A {@link yfiles.system.RoutedUICommand} that reverses the direction of edges. + * can execute this command if it is installed in a {@link yfiles.canvas.GraphControl}. + * The {@link yfiles.system.ExecutedRoutedEventArgs#parameter} specifies the edges to be reversed and can be an {@link yfiles.graph.IEdge}, an {@link yfiles.collections.IEnumerable IEnumerable<IEdge>} + * or null. If the parameter is null the currently selected edges will be reversed. + */ + REVERSE_EDGE_COMMAND:yfiles.system.RoutedUICommand; + }; + /** + * An {@link yfiles.input.IInputMode} implementation for use in a {@link yfiles.canvas.GraphControl} + * to assign to the {@link yfiles.canvas.CanvasControl#inputMode} property. + * This mode can be used in a viewer-centric application where there is no need to modify the + * {@link yfiles.graph.IGraph} but browsing of the graph should be convenient. + * This mode allows for {@link yfiles.input.GraphViewerInputMode#addItemClickedListener clicking on items using the mouse}, + * {@link yfiles.input.GraphViewerInputMode#addQueryItemToolTipListener displaying tool tips for items}, {@link yfiles.input.GraphViewerInputMode#addPopulateItemContextMenuListener showing a context menu}, + * {@link yfiles.input.GraphViewerInputMode#navigationInputMode allowing for easy navigation and traversal}, {@link yfiles.input.GraphViewerInputMode#moveViewportInputMode moving the view port}, + * and {@link yfiles.input.GraphViewerInputMode#marqueeSelectableItems optionally doing marquee selection.}. Also {@link yfiles.input.GraphViewerInputMode#itemHoverInputMode} can be used to get + * notified of the elements that the mouse is hovering over. + */ + export interface GraphViewerInputMode extends yfiles.input.MultiplexingInputMode{ + /** + * Gets or sets the order of the types of items that should be used to determine what + * item has been clicked during {@link yfiles.input.ClickInputMode#addClickedListener Clicked}. + *

+ * Change this field to adjust which items will be {@link yfiles.input.MainInputMode#setSelected selected} + * if there are multiple items at a given location. + * The default order is + *

+ *
    + *
  • + * {@link yfiles.graph.GraphItemTypes#BEND} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#EDGE_LABEL} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#EDGE} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#NODE} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#NODE_LABEL} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#PORT} + *
  • + *
  • + * {@link yfiles.graph.GraphItemTypes#ALL} + *
  • + *
+ * @see {@link yfiles.input.GraphViewerInputMode#selectableItems} + */ + clickHitTestOrder:yfiles.graph.GraphItemTypes[]; + /** + * Occurs when an item that matches the {@link yfiles.input.GraphViewerInputMode#clickableItems} type has been clicked with the mouse. + * @see {@link yfiles.input.GraphViewerInputMode#clickableItems} + * @see {@link yfiles.input.GraphViewerInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemRightClickedListener ItemRightClicked} + */ + addItemClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item that matches the {@link yfiles.input.GraphViewerInputMode#clickableItems} type has been clicked with the mouse. + * @see {@link yfiles.input.GraphViewerInputMode#clickableItems} + * @see {@link yfiles.input.GraphViewerInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemRightClickedListener ItemRightClicked} + */ + removeItemClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item that matches the {@link yfiles.input.GraphViewerInputMode#clickableItems} type has been double-clicked with the mouse. + * @see {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} + * @see {@link yfiles.input.GraphViewerInputMode#clickableItems} + * @see {@link yfiles.input.GraphViewerInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} + */ + addItemDoubleClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item that matches the {@link yfiles.input.GraphViewerInputMode#clickableItems} type has been double-clicked with the mouse. + * @see {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} + * @see {@link yfiles.input.GraphViewerInputMode#clickableItems} + * @see {@link yfiles.input.GraphViewerInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} + */ + removeItemDoubleClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * This event is triggered whenever an item has been successfully selected via the {@link yfiles.input.GraphViewerInputMode#graphSelection}. + * This will be done if the {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} event is not {@link yfiles.support.ItemInputEventArgs#handled handled} + * by any event listener and the item matches the {@link yfiles.input.GraphViewerInputMode#selectableItems} property. + */ + addItemSelectedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * This event is triggered whenever an item has been successfully selected via the {@link yfiles.input.GraphViewerInputMode#graphSelection}. + * This will be done if the {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} event is not {@link yfiles.support.ItemInputEventArgs#handled handled} + * by any event listener and the item matches the {@link yfiles.input.GraphViewerInputMode#selectableItems} property. + */ + removeItemSelectedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if a single or multi select operation has been started. + * The event is not triggered for the individual selection operations that constitute a multi selection operation. + */ + addMultiSelectionStartedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * An event that will be triggered if a single or multi select operation has been started. + * The event is not triggered for the individual selection operations that constitute a multi selection operation. + */ + removeMultiSelectionStartedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * An event that will be triggered if a single or multi select operation has been finished. + * The event is not triggered for the individual selection operations that constitute a multi selection operation. + */ + addMultiSelectionFinishedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * An event that will be triggered if a single or multi select operation has been finished. + * The event is not triggered for the individual selection operations that constitute a multi selection operation. + */ + removeMultiSelectionFinishedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Initializes this mode by {@link yfiles.input.MultiplexingInputMode#addConcurrent adding} + * all of the minor modes that are used by this mode concurrently to this instance. + * @see {@link yfiles.input.GraphViewerInputMode#clickInputMode} + * @see {@link yfiles.input.GraphViewerInputMode#tapInputMode} + * @see {@link yfiles.input.GraphViewerInputMode#marqueeSelectionInputMode} + * @see {@link yfiles.input.GraphViewerInputMode#contextMenuInputMode} + * @see {@link yfiles.input.GraphViewerInputMode#navigationInputMode} + * @see {@link yfiles.input.GraphViewerInputMode#mouseHoverInputMode} + * @see {@link yfiles.input.GraphViewerInputMode#moveViewportInputMode} + * @see Overrides {@link yfiles.input.AbstractInputMode#initialize} + */ + initialize():void; + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Callback method that will be used by the {@link yfiles.input.MultiplexingInputMode#createChildInputModeContext child context's} {@link yfiles.support.ILookup#lookup} method. + * @param {yfiles.lang.Class} type The type argument passed to {@link yfiles.support.ILookup#lookup}. + * @return {Object} The result of the lookup query, or null. + * @see {@link yfiles.input.MultiplexingInputMode#createChildInputModeContext} + */ + childInputModeContextLookup(type:yfiles.lang.Class):Object; + /** + * Callback method that is used by {@link yfiles.input.GraphViewerInputMode#install} + * to determine which of the built-in {@link yfiles.system.ICommand}s to install. + * This implementation unconditionally returns true, subclasses + * may override this method to adjust the behavior. + * @param {yfiles.system.ICommand} command The command to install. + * @return {boolean} Whether to install this command. + */ + shouldInstallCommand(command:yfiles.system.ICommand):boolean; + /** + * Clears the current selection and selects all nodes and bends in this graph. + * By default, this method will be called in response to a Ctrl+A key press recognized + * by {@link yfiles.input.MainInputMode#keyboardInputMode}. + * @see {@link yfiles.system.ApplicationCommands#SELECT_ALL} + * @see {@link yfiles.input.GraphViewerInputMode#selectableItems} + */ + selectAll():void; + /** + * Gets or sets the context menu mode priority. + * The default is 0. + * Value: The context menu mode priority. + */ + contextMenuModePriority:number; + /** + * Gets or sets the mouse hover mode priority. + * The default is 0. + * Value: The mouse hover mode priority. + */ + mouseHoverModePriority:number; + /** + * Gets or sets the wait mode priority. + * The default is 20. + * Value: The wait mode priority. + */ + waitModePriority:number; + /** + * Gets or sets the item hover input mode priority. + * The default is 19. + * Value: The item hover input mode priority. + */ + itemHoverModePriority:number; + /** + * Gets or sets the marquee selection mode priority. + * The default is 0. + * Value: The marquee selection mode priority. + */ + marqueeSelectionModePriority:number; + /** + * Gets or sets the click mode priority. + * The default is 0. + * Value: The click mode priority. + */ + clickModePriority:number; + /** + * Gets or sets the tap mode priority. + * The default is 0. + * Value: The tap mode priority. + */ + tapModePriority:number; + /** + * Gets or sets the handle mode priority. + * The default is 0. + * Value: The handle mode priority. + */ + moveViewportModePriority:number; + /** + * Gets or sets the keyboard navigation mode priority. + * The default is 0. + * Value: The keyboard navigation mode priority. + */ + navigationModePriority:number; + /** + * Gets or sets the {@link yfiles.input.ClickInputMode} that is used by this instance + * to determine clicks. + *

+ * Whenever the mode detects a {@link yfiles.input.ClickInputMode#addClickedListener click}, + * this mode will use the {@link yfiles.drawing.IHitTestEnumerator} from the {@link yfiles.input.AbstractInputMode#inputModeContext} + * to determine the items being hit. + * If they match the {@link yfiles.input.GraphViewerInputMode#clickableItems} type, the {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} event will be triggered. + * If they {@link yfiles.input.GraphViewerInputMode#shouldBeFocused}, the item will be {@link yfiles.input.GraphViewerInputMode#setCurrentItem set as the current item}. + *

+ *

+ * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphViewerInputMode#createClickInputMode} will be called. + * Upon change the {@link yfiles.input.GraphViewerInputMode#onClickInputModeChanged} method will be called. + *

+ * @see {@link yfiles.input.GraphViewerInputMode#onItemClicked} + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + clickInputMode:yfiles.input.ClickInputMode; + /** + * Called when the {@link yfiles.input.GraphViewerInputMode#clickInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.ClickInputMode} oldClickInputMode the old value, which may be null the first time + * @param {yfiles.input.ClickInputMode} newClickInputMode the new value + */ + onClickInputModeChanged(oldClickInputMode:yfiles.input.ClickInputMode,newClickInputMode:yfiles.input.ClickInputMode):void; + /** + * Factory method for the ClickInputMode property. This method will be called + * upon first access to the {@link yfiles.input.GraphViewerInputMode#clickInputMode} property. + * This implementation {@link yfiles.input.ClickInputMode#activeButtons activates} + * both {@link yfiles.system.MouseButtons#LEFT} and {@link yfiles.system.MouseButtons#RIGHT} + * @return {yfiles.input.ClickInputMode} a new instance of ClickInputMode + */ + createClickInputMode():yfiles.input.ClickInputMode; + /** + * Gets or sets the {@link yfiles.input.TapInputMode} that is used by this instance + * to determine taps. + *

+ * Whenever the mode detects a {@link yfiles.input.TapInputMode#addTappedListener tap}, + * this mode will use the {@link yfiles.drawing.IHitTestEnumerator} from the {@link yfiles.input.AbstractInputMode#inputModeContext} + * to determine the items being hit. + * If they match the {@link yfiles.input.GraphViewerInputMode#clickableItems} type, the {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} event will be triggered. + * If they {@link yfiles.input.GraphViewerInputMode#shouldBeFocused}, the item will be {@link yfiles.input.GraphViewerInputMode#setCurrentItem set as the current item}. + *

+ *

+ * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphViewerInputMode#createTapInputMode} will be called. + * Upon change the {@link yfiles.input.GraphViewerInputMode#onTapInputModeChanged} method will be called. + *

+ * @see {@link yfiles.input.GraphViewerInputMode#onItemClicked} + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + tapInputMode:yfiles.input.TapInputMode; + /** + * Called when the {@link yfiles.input.GraphViewerInputMode#tapInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.TapInputMode} oldTapInputMode the old value, which may be null the first time + * @param {yfiles.input.TapInputMode} newTapInputMode the new value + */ + onTapInputModeChanged(oldTapInputMode:yfiles.input.TapInputMode,newTapInputMode:yfiles.input.TapInputMode):void; + /** + * Factory method for the TapInputMode property. This method will be called + * upon first access to the {@link yfiles.input.GraphViewerInputMode#tapInputMode} property. + * @return {yfiles.input.TapInputMode} a new instance of TapInputMode + */ + createTapInputMode():yfiles.input.TapInputMode; + /** + * Gets or sets the {@link yfiles.input.WaitInputMode} that is provided by this instance + * for those who need to make use of it. + * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphViewerInputMode#createWaitInputMode} will be called. + * Upon change the {@link yfiles.input.GraphViewerInputMode#onWaitInputModeChanged} method will be called. + * @see {@link yfiles.input.WaitInputMode#waiting} + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + waitInputMode:yfiles.input.WaitInputMode; + /** + * Called when the {@link yfiles.input.GraphViewerInputMode#waitInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.WaitInputMode} oldWaitInputMode the old value, which may be null the first time + * @param {yfiles.input.WaitInputMode} newWaitInputMode the new value + */ + onWaitInputModeChanged(oldWaitInputMode:yfiles.input.WaitInputMode,newWaitInputMode:yfiles.input.WaitInputMode):void; + /** + * Factory method for the WaitInputMode property. This method will be called + * upon first access to the {@link yfiles.input.GraphViewerInputMode#waitInputMode} property. + * @return {yfiles.input.WaitInputMode} a new instance of {@link yfiles.input.GraphViewerInputMode#waitInputMode} + */ + createWaitInputMode():yfiles.input.WaitInputMode; + /** + * Gets or sets the {@link yfiles.input.GraphViewerInputMode#itemHoverInputMode} that is provided by this instance + * for those who need to make use of it. + *

+ * Note that initially the {@link yfiles.input.ItemHoverInputMode#hoverItems} property is set + * to {@link yfiles.graph.GraphItemTypes#NONE}, which effectively disables the functionality of the mode initially. + * In order to get the mode to fire events, the property should be set to a corresponding value. + *

+ *

+ * If the backing field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphViewerInputMode#createItemHoverInputMode} will be called. + * Upon change the {@link yfiles.input.GraphViewerInputMode#onItemHoverInputModeChanged} method will be called. + *

+ * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + itemHoverInputMode:yfiles.input.ItemHoverInputMode; + /** + * Called when the {@link yfiles.input.GraphViewerInputMode#itemHoverInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.ItemHoverInputMode} oldItemHoverInputMode the old value, which may be null the first time + * @param {yfiles.input.ItemHoverInputMode} newItemHoverInputMode the new value + */ + onItemHoverInputModeChanged(oldItemHoverInputMode:yfiles.input.ItemHoverInputMode,newItemHoverInputMode:yfiles.input.ItemHoverInputMode):void; + /** + * Factory method for the ItemHoverInputMode property. This method will be called + * upon first access to the {@link yfiles.input.GraphViewerInputMode#itemHoverInputMode} property. + * @return {yfiles.input.ItemHoverInputMode} a new instance of {@link yfiles.input.GraphViewerInputMode#itemHoverInputMode} with the {@link yfiles.input.ItemHoverInputMode#hoverItems} property set to + * {@link yfiles.graph.GraphItemTypes#NONE}. + */ + createItemHoverInputMode():yfiles.input.ItemHoverInputMode; + /** + * Gets or sets the {@link yfiles.input.MarqueeSelectionInputMode} that is used by this instance + * to recognize marquee selections. + *

+ * Whenever the mode detects a {@link yfiles.input.MarqueeSelectionInputMode#addMarqueeSelectedListener marquee selection}, + * this mode will use the {@link yfiles.input.GraphViewerInputMode#marqueeSelect} method to select items that + * match the {@link yfiles.input.GraphViewerInputMode#marqueeSelectableItems} type. + *

+ *

+ * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphViewerInputMode#createMarqueeSelectionInputMode} will be called. + * Upon change the {@link yfiles.input.GraphViewerInputMode#onMarqueeSelectionInputModeChanged} method will be called. + *

+ * @see {@link yfiles.input.GraphViewerInputMode#onItemClicked} + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + marqueeSelectionInputMode:yfiles.input.MarqueeSelectionInputMode; + /** + * Called when the {@link yfiles.input.GraphViewerInputMode#marqueeSelectionInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.MarqueeSelectionInputMode} oldMarqueeSelectionInputMode the old value, which may be null the first time + * @param {yfiles.input.MarqueeSelectionInputMode} newMarqueeSelectionInputMode the new value + */ + onMarqueeSelectionInputModeChanged(oldMarqueeSelectionInputMode:yfiles.input.MarqueeSelectionInputMode,newMarqueeSelectionInputMode:yfiles.input.MarqueeSelectionInputMode):void; + /** + * Factory method for the MarqueeSelectionInputMode property. This method will be called + * upon first access to the {@link yfiles.input.GraphViewerInputMode#marqueeSelectionInputMode} property. + * @return {yfiles.input.MarqueeSelectionInputMode} a new instance of MarqueeSelectionInputMode + */ + createMarqueeSelectionInputMode():yfiles.input.MarqueeSelectionInputMode; + /** + * Gets or sets the {@link yfiles.input.ContextMenuInputMode} that is used by this instance + * to determine the contents of a custom context menu when the user tries to open one. + *

+ * Whenever the mode detects {@link yfiles.input.ContextMenuInputMode#addPopulateContextMenuListener the opening of a context menu}, + * this mode will use the {@link yfiles.drawing.IHitTestEnumerator} from the {@link yfiles.input.AbstractInputMode#inputModeContext} + * to determine the items being hit. + * If they match the {@link yfiles.input.GraphViewerInputMode#contextMenuItems} type, the {@link yfiles.input.GraphViewerInputMode#addPopulateItemContextMenuListener PopulateItemContextMenu} event will be triggered. + *

+ *

+ * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphViewerInputMode#createContextMenuInputMode} will be called. + * Upon change the {@link yfiles.input.GraphViewerInputMode#onContextMenuInputModeChanged} method will be called. + *

+ * @see {@link yfiles.input.GraphViewerInputMode#onPopulateItemContextMenu} + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + contextMenuInputMode:yfiles.input.ContextMenuInputMode; + /** + * Called when the {@link yfiles.input.GraphViewerInputMode#contextMenuInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.ContextMenuInputMode} oldContextMenuInputMode the old value, which may be null the first time + * @param {yfiles.input.ContextMenuInputMode} newContextMenuInputMode the new value + */ + onContextMenuInputModeChanged(oldContextMenuInputMode:yfiles.input.ContextMenuInputMode,newContextMenuInputMode:yfiles.input.ContextMenuInputMode):void; + /** + * Factory method for the ContextMenuInputMode property. This method will be called + * upon first access to the {@link yfiles.input.GraphViewerInputMode#contextMenuInputMode} property. + * @return {yfiles.input.ContextMenuInputMode} a new instance of ContextMenuInputMode + */ + createContextMenuInputMode():yfiles.input.ContextMenuInputMode; + /** + * Gets or sets the {@link yfiles.input.NavigationInputMode} that is used by this instance + * to delegate the navigational actions to. + *

+ * By default the {@link yfiles.input.NavigationInputMode#collapsingGroupsAllowed} + * and {@link yfiles.input.NavigationInputMode#expandingGroupsAllowed} properties + * are set to false. + *

+ *

+ * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphViewerInputMode#createNavigationInputMode} will be called. + * Upon change the {@link yfiles.input.GraphViewerInputMode#onNavigationInputModeChanged} method will be called. + *

+ * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + navigationInputMode:yfiles.input.NavigationInputMode; + /** + * Called when the {@link yfiles.input.GraphViewerInputMode#navigationInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.NavigationInputMode} oldNavigationInputMode the old value, which may be null the first time + * @param {yfiles.input.NavigationInputMode} newNavigationInputMode the new value + */ + onNavigationInputModeChanged(oldNavigationInputMode:yfiles.input.NavigationInputMode,newNavigationInputMode:yfiles.input.NavigationInputMode):void; + /** + * Factory method for the NavigationInputMode property. + * This method will be called + * upon first access to the {@link yfiles.input.GraphViewerInputMode#navigationInputMode} property. + * @return {yfiles.input.NavigationInputMode} a new instance of NavigationInputMode + */ + createNavigationInputMode():yfiles.input.NavigationInputMode; + /** + * Gets or sets the {@link yfiles.input.MouseHoverInputMode} that is used by this instance + * to determine whenever the mouse hovers over an item to display a tool tip. + *

+ * Whenever the mode detects a {@link yfiles.input.MouseHoverInputMode#addQueryToolTipListener tool tip query}, + * this mode will use the {@link yfiles.drawing.IHitTestEnumerator} from the {@link yfiles.input.AbstractInputMode#inputModeContext} + * to determine the items being hit. + * If they match the {@link yfiles.input.GraphViewerInputMode#toolTipItems} type, the {@link yfiles.input.GraphViewerInputMode#addQueryItemToolTipListener QueryItemToolTip} event will be triggered. + *

+ *

+ * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphViewerInputMode#createMouseHoverInputMode} will be called. + * Upon change the {@link yfiles.input.GraphViewerInputMode#onMouseHoverInputModeChanged} method will be called. + *

+ * @see {@link yfiles.input.GraphViewerInputMode#onQueryItemToolTip} + * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + mouseHoverInputMode:yfiles.input.MouseHoverInputMode; + /** + * Called when the {@link yfiles.input.GraphViewerInputMode#mouseHoverInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.MouseHoverInputMode} oldMouseHoverInputMode the old value, which may be null the first time + * @param {yfiles.input.MouseHoverInputMode} newMouseHoverInputMode the new value + */ + onMouseHoverInputModeChanged(oldMouseHoverInputMode:yfiles.input.MouseHoverInputMode,newMouseHoverInputMode:yfiles.input.MouseHoverInputMode):void; + /** + * Factory method for the {@link yfiles.input.GraphViewerInputMode#mouseHoverInputMode} property. This method will be called + * upon first access to the {@link yfiles.input.GraphViewerInputMode#mouseHoverInputMode} property. + * @return {yfiles.input.MouseHoverInputMode} a new instance of {@link yfiles.input.GraphViewerInputMode#mouseHoverInputMode} + */ + createMouseHoverInputMode():yfiles.input.MouseHoverInputMode; + /** + * Gets or sets the {@link yfiles.input.MoveViewportInputMode} that is used by this instance + * to handle interactive movements of the view port using the mouse. + *

+ * Note that if the {@link yfiles.input.GraphViewerInputMode#marqueeSelectionInputMode} is enabled (by setting the {@link yfiles.input.GraphViewerInputMode#marqueeSelectableItems} + * to values other than {@link yfiles.graph.GraphItemTypes#NONE}), dragging the mouse will be interpreted as a marquee selection gesture + * instead. + *

+ *

+ * If the field has not yet been initialized upon first access, the + * factory method {@link yfiles.input.GraphViewerInputMode#createMoveViewportInputMode} will be called. + * Upon change the {@link yfiles.input.GraphViewerInputMode#onMoveViewportInputModeChanged} method will be called. + *

+ * @throws {yfiles.system.NotSupportedException} If an attempt is made to change the instance while this mode + * is {@link yfiles.input.AbstractInputMode#installed}. To exchange a mode, first {@link yfiles.input.IInputMode#uninstall}, + * then {@link yfiles.input.IInputMode#install reinstall} to ensure that all data is initialized correctly. + */ + moveViewportInputMode:yfiles.input.MoveViewportInputMode; + /** + * Called when the {@link yfiles.input.GraphViewerInputMode#moveViewportInputMode} property value changes + * and after initialization of the field. + * @param {yfiles.input.MoveViewportInputMode} oldMoveViewportInputMode the old value, which may be null the first time + * @param {yfiles.input.MoveViewportInputMode} newMoveViewportInputMode the new value + */ + onMoveViewportInputModeChanged(oldMoveViewportInputMode:yfiles.input.MoveViewportInputMode,newMoveViewportInputMode:yfiles.input.MoveViewportInputMode):void; + /** + * Factory method for the MoveViewportInputMode property. This method will be called + * upon first access to the {@link yfiles.input.GraphViewerInputMode#moveViewportInputMode} property. + * @return {yfiles.input.MoveViewportInputMode} a new instance of {@link yfiles.input.GraphViewerInputMode#moveViewportInputMode} + */ + createMoveViewportInputMode():yfiles.input.MoveViewportInputMode; + /** + * Gets or sets a value indicating whether void styles ({@link yfiles.drawing.common.VoidNodeStyle}, {@link yfiles.drawing.common.VoidEdgeStyle}, + * {@link yfiles.drawing.common.VoidLabelStyle}, and {@link yfiles.drawing.common.VoidPortStyle}) should be ignored when selecting or focusing items. + * Value: + * true if void styles should be ignored for selection and focus; false + * otherwise. + */ + voidStylesIgnored:boolean; + /** + * Gets or sets a value indicating whether clipboard commands should be enabled. + * If this property is set to true clipboard commands, i.e. Cut, Copy and Paste, are enabled. + * The default is that they are disabled. + */ + clipboardCommandsEnabled:boolean; + /** + * Called when the {@link yfiles.input.GraphViewerInputMode#clipboardCommandsEnabled} property value changes + * and after initialization of the field. + * @param {boolean} oldValue the old value + * @param {boolean} newValue the new value + */ + onClipboardCommandsEnabledChanged(oldValue:boolean,newValue:boolean):void; + /** + * Gets the types of the items that should be selectable by this instance. + * The selectable items. The default value is {@link yfiles.graph.GraphItemTypes#NODE}. + * Setting this property also sets the {@link yfiles.input.NavigationInputMode#selectableItems} property. + */ + selectableItems:yfiles.graph.GraphItemTypes; + /** + * Gets the types of the items that should be clickable by this instance. + * The clickable items. The default value is {@link yfiles.graph.GraphItemTypes#ALL}. + */ + clickableItems:yfiles.graph.GraphItemTypes; + /** + * Gets the types of the items that should be marquee selectable by this instance. + * The marquee selectable items. The default value is {@link yfiles.graph.GraphItemTypes#NONE}. Setting + * this property to different values effectively enables the {@link yfiles.input.GraphViewerInputMode#marqueeSelectionInputMode} + * and disables the {@link yfiles.input.GraphViewerInputMode#moveViewportInputMode} because of the clashing gestures. + */ + marqueeSelectableItems:yfiles.graph.GraphItemTypes; + /** + * Predicate method that determines whether an {@link yfiles.model.IModelItem} + * should be marquee selected by this mode. + * This implementation uses the {@link yfiles.input.GraphViewerInputMode#marqueeSelectableItems} and + * {@link yfiles.input.GraphViewerInputMode#voidStylesIgnored} properties to determine + * if the item should be marquee selected. + * @param {yfiles.model.IModelItem} item The item to decide. + * @return {boolean} Whether to {@link yfiles.input.GraphViewerInputMode#onItemSelected select} the item. + */ + shouldMarqueeSelect(item:yfiles.model.IModelItem):boolean; + /** + * Callback method that selects all items in the items enumeration + * using the {@link yfiles.input.GraphViewerInputMode#graphSelection}. + * This will trigger the {@link yfiles.input.GraphViewerInputMode#onItemSelected} event for each successfully selected element. + * @param {yfiles.collections.IEnumerable.} items The items to select. + * @see {@link yfiles.input.GraphViewerInputMode#shouldMarqueeSelect} + */ + marqueeSelect(items:yfiles.collections.IEnumerable):void; + /** + * Clears the selection on click if {@link yfiles.canvas.CanvasControl#lastMouse2DEvent the click} + * is not recognized by {@link yfiles.input.GraphViewerInputMode#multiSelectionRecognizer}. + *

This method is only called if no item has been hit and at least one item + * is currently selected.

+ *

+ * This will use the {@link yfiles.input.GraphViewerInputMode#deselectAll} method to deselect all items. + *

+ * @param {yfiles.input.IInputModeContext} context The context where the click appeared + * @return {boolean} Whether the selection has been cleared by this method. + */ + clickClearSelection(context:yfiles.input.IInputModeContext):boolean; + /** + * Called during a click to query the item + * for a {@link yfiles.input.IActionButtonProvider} in its {@link yfiles.support.ILookup#lookup} + * and handle it appropriately. + * This method will query the {@link yfiles.input.IActionButtonProvider} and check whether + * the click occurred inside the {@link yfiles.input.IActionButtonProvider#getButtonBounds button's bounds}, + * and if so, will {@link yfiles.input.IActionButtonProvider#invokeAction invoke the action} + * and return true. + * @param {yfiles.input.IInputModeContext} context The context for the click. + * @param {yfiles.model.IModelItem} item The item that has been clicked. + * @return {boolean} Whether the action has been invoked and handling should be stopped. + * @see {@link yfiles.input.IActionButtonProvider} + */ + handleActionButtonProvider(context:yfiles.input.IInputModeContext,item:yfiles.model.IModelItem):boolean; + /** + * Deselects all currently selected items in the {@link yfiles.input.GraphViewerInputMode#graphSelection}. + * @return {boolean} Whether anything was deselected at all. + */ + deselectAll():boolean; + /** + * Predicate method that determines whether an {@link yfiles.model.IModelItem} + * should be clickable by this mode. + * This implementation uses the {@link yfiles.input.GraphViewerInputMode#clickableItems} property to determine + * if the item should be clicked. + * @param {yfiles.model.IModelItem} item The item to decide. + * @return {boolean} Whether to {@link yfiles.input.GraphViewerInputMode#onItemClicked click} the item. + */ + shouldBeClicked(item:yfiles.model.IModelItem):boolean; + /** + * Predicate method that determines whether an {@link yfiles.model.IModelItem} + * should be double-clickable by this mode. + * This implementation uses the {@link yfiles.input.GraphViewerInputMode#shouldBeClicked} method to determine + * if the item should be double-clicked. + * @param {yfiles.model.IModelItem} item The item to decide. + * @return {boolean} Whether to {@link yfiles.input.GraphViewerInputMode#onItemDoubleClicked double-click} the item. + */ + shouldBeDoubleClicked(item:yfiles.model.IModelItem):boolean; + /** + * Predicate method that determines whether an {@link yfiles.model.IModelItem} + * should be selected by this mode. + * This implementation uses the {@link yfiles.input.GraphViewerInputMode#selectableItems} and + * {@link yfiles.input.GraphViewerInputMode#voidStylesIgnored} properties to determine if the item + * should be selected. + * @param {yfiles.model.IModelItem} item The item to decide. + * @return {boolean} Whether to select the item. + */ + shouldSelect(item:yfiles.model.IModelItem):boolean; + /** + * Actually performs the click operation on the given item for the current context. + * This will use the {@link yfiles.input.GraphViewerInputMode#onItemClicked} method to trigger the {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} + * event and unless the event is handled by any of the event handlers this + * will ultimately {@link yfiles.input.MainInputMode#setSelected select} the item + * and optionally + * {@link yfiles.input.MainInputMode#clearSelection clear the current selection}, unless + * the {@link yfiles.input.GraphViewerInputMode#multiSelectionRecognizer} is triggered. + * @param {yfiles.input.IInputModeContext} context The context where the click appeared + * @param {yfiles.model.IModelItem} item The item that has been clicked. + * @return {boolean} Whether the click has been handled by this method. + */ + click(context:yfiles.input.IInputModeContext,item:yfiles.model.IModelItem):boolean; + /** + * Gets or sets the {@link yfiles.input.IEventRecognizer} + * instance that will be queried to decide if a click is deemed a multi selection gesture. + * The default is {@link yfiles.input.KeyEvents#CONTROL_PRESSED}. + */ + multiSelectionRecognizer:yfiles.input.IEventRecognizer; + /** + * Uses the {@link yfiles.input.GraphViewerInputMode#graphSelection} to select the given item. + * @param {yfiles.model.IModelItem} item The item to set the selection state on. + * @param {boolean} selected The new selection state. + */ + setSelected(item:yfiles.model.IModelItem,selected:boolean):void; + /** + * Sets the {@link yfiles.canvas.GraphControl#currentItem} using + * the {@link yfiles.canvas.GraphControl#SET_CURRENT_ITEM_COMMAND}. + * @param {yfiles.model.IModelItem} item The item to set as the new current item. + * @see {@link yfiles.input.GraphViewerInputMode#shouldBeFocused} + */ + setCurrentItem(item:yfiles.model.IModelItem):void; + /** + * Callback method that determines upon a click on an item whether + * the item should become the new {@link yfiles.canvas.GraphControl#currentItem}. + * This implementation honors the {@link yfiles.input.GraphViewerInputMode#voidStylesIgnored} property. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether to {@link yfiles.input.GraphViewerInputMode#setCurrentItem set the item} as the new current item. + */ + shouldBeFocused(item:yfiles.model.IModelItem):boolean; + /** + * Gets or sets the items that can be given focus via the {@link yfiles.input.GraphViewerInputMode#setCurrentItem} method. + * The focusable items. The default is {@link yfiles.graph.GraphItemTypes#NODE}. + */ + focusableItems:yfiles.graph.GraphItemTypes; + /** + * Gets the graph selection from the {@link yfiles.input.AbstractInputMode#inputModeContext}. + * Value: The graph selection to use, which can be null. + */ + graphSelection:yfiles.graph.IGraphSelection; + /** + * Gets the graph instance from the {@link yfiles.input.AbstractInputMode#inputModeContext}. + * Value: The graph to use, which can be null. + */ + graph:yfiles.graph.IGraph; + /** + * Raises the {@link yfiles.input.GraphViewerInputMode#addItemSelectedListener ItemSelected} event. + * @param {yfiles.model.ItemEventArgs.} args The {@link yfiles.model.ItemEventArgs} instance containing the event data. + */ + onItemSelected(args:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} event. + * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.support.ItemInputEventArgs#handled} + * property to true. + * @param {yfiles.support.ItemInputEventArgs.} args The {@link yfiles.support.ItemInputEventArgs} instance that contains the item that has been clicked. + */ + onItemClicked(args:yfiles.support.ItemInputEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphViewerInputMode#addItemLeftClickedListener ItemLeftClicked} event. + * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.support.ItemInputEventArgs#handled} + * property to true. + * @param {yfiles.support.ItemInputEventArgs.} args The {@link yfiles.support.ItemInputEventArgs} instance that contains the item that has been clicked. + */ + onItemLeftClicked(args:yfiles.support.ItemInputEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphViewerInputMode#addItemRightClickedListener ItemRightClicked} event. + * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.support.ItemInputEventArgs#handled} + * property to true. + * @param {yfiles.support.ItemInputEventArgs.} args The {@link yfiles.support.ItemInputEventArgs} instance that contains the item that has been clicked. + */ + onItemRightClicked(args:yfiles.support.ItemInputEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphViewerInputMode#addItemDoubleClickedListener ItemDoubleClicked} event. + * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.support.ItemInputEventArgs#handled} + * property to true. + * @param {yfiles.support.ItemInputEventArgs.} args The {@link yfiles.support.ItemInputEventArgs} instance that contains the item that has been double clicked. + */ + onItemDoubleClicked(args:yfiles.support.ItemInputEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphViewerInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} event. + * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.support.ItemInputEventArgs#handled} + * property to true. + * @param {yfiles.support.ItemInputEventArgs.} args The {@link yfiles.support.ItemInputEventArgs} instance that contains the item that has been double clicked. + */ + onItemLeftDoubleClicked(args:yfiles.support.ItemInputEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphViewerInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} event. + * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.support.ItemInputEventArgs#handled} + * property to true. + * @param {yfiles.support.ItemInputEventArgs.} args The {@link yfiles.support.ItemInputEventArgs} instance that contains the item that has been double clicked. + */ + onItemRightDoubleClicked(args:yfiles.support.ItemInputEventArgs):void; + /** + * Raises the {@link yfiles.input.GraphViewerInputMode#addCanvasClickedListener CanvasClicked} event. + * This implementation will stop the event propagation as soon as an event handler has set the {@link yfiles.input.ClickEventArgs#handled} + * property to true. + * @param {yfiles.input.ClickEventArgs} args The {@link yfiles.input.ClickEventArgs} instance that contains the information about the click. + */ + onCanvasClicked(args:yfiles.input.ClickEventArgs):void; + /** + * Occurs when an item has been left clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphViewerInputMode#clickableItems} + * @see {@link yfiles.input.GraphViewerInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemRightClickedListener ItemRightClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} + */ + addItemLeftClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been left clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphViewerInputMode#clickableItems} + * @see {@link yfiles.input.GraphViewerInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemRightClickedListener ItemRightClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} + */ + removeItemLeftClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been right clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphViewerInputMode#clickableItems} + * @see {@link yfiles.input.GraphViewerInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemLeftClickedListener ItemLeftClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} + */ + addItemRightClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been right clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphViewerInputMode#clickableItems} + * @see {@link yfiles.input.GraphViewerInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemLeftClickedListener ItemLeftClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} + */ + removeItemRightClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been left double clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphViewerInputMode#clickableItems} + * @see {@link yfiles.input.GraphViewerInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} + */ + addItemLeftDoubleClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been left double clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphViewerInputMode#clickableItems} + * @see {@link yfiles.input.GraphViewerInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemRightDoubleClickedListener ItemRightDoubleClicked} + */ + removeItemLeftDoubleClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been right double clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphViewerInputMode#clickableItems} + * @see {@link yfiles.input.GraphViewerInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} + */ + addItemRightDoubleClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when an item has been right double clicked. + * If one of the event handlers sets the {@link yfiles.support.ItemInputEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphViewerInputMode#clickableItems} + * @see {@link yfiles.input.GraphViewerInputMode#addItemDoubleClickedListener ItemDoubleClicked} + * @see {@link yfiles.input.GraphViewerInputMode#addItemLeftDoubleClickedListener ItemLeftDoubleClicked} + */ + removeItemRightDoubleClickedListener(value:(sender:Object,e:yfiles.support.ItemInputEventArgs)=> void):void; + /** + * Occurs when the empty canvas area has been clicked. + * If one of the event handlers sets the {@link yfiles.input.ClickEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} + */ + addCanvasClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * Occurs when the empty canvas area has been clicked. + * If one of the event handlers sets the {@link yfiles.input.ClickEventArgs#handled} property to + * true the event will not be propagated anymore. + * @see {@link yfiles.input.GraphViewerInputMode#addItemClickedListener ItemClicked} + */ + removeCanvasClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * Raises the {@link yfiles.input.GraphViewerInputMode#addMultiSelectionStartedListener MultiSelectionStarted} event. + */ + onMultiSelectionStarted(args:yfiles.system.EventArgs):void; + /** + * Raises the {@link yfiles.input.GraphViewerInputMode#addMultiSelectionFinishedListener MultiSelectionFinished} event. + */ + onMultiSelectionFinished(args:yfiles.system.EventArgs):void; + /** + * Gets the types of the items that should be queried a context menu for. + * The items for which a context menu should be {@link yfiles.input.GraphViewerInputMode#addPopulateItemContextMenuListener queried}. + * The default value is {@link yfiles.graph.GraphItemTypes#NODE}|{@link yfiles.graph.GraphItemTypes#EDGE}. + */ + contextMenuItems:yfiles.graph.GraphItemTypes; + /** + * Determines whether for the given item a context menu should be queried. + * This implementation uses the {@link yfiles.input.GraphViewerInputMode#contextMenuItems} property to determine whether a context menu + * should be queried for the given item. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether to raise a {@link yfiles.input.GraphViewerInputMode#addPopulateItemContextMenuListener PopulateItemContextMenu} event for the given item. + */ + shouldPopulateContextMenu(item:yfiles.model.IModelItem):boolean; + /** + * Raises the {@link yfiles.input.GraphViewerInputMode#addPopulateItemContextMenuListener PopulateItemContextMenu} event. + * @param {yfiles.input.PopulateItemContextMenuEventArgs.} args The {@link yfiles.input.PopulateItemContextMenuEventArgs} instance containing the event data. + */ + onPopulateItemContextMenu(args:yfiles.input.PopulateItemContextMenuEventArgs):void; + /** + * Occurs when the {@link yfiles.input.GraphViewerInputMode#contextMenuInputMode context menu} over an item is about to be opened to determine the + * contents of the context menu. + * This method will only be called for items that match the {@link yfiles.input.GraphViewerInputMode#contextMenuItems} type. + */ + addPopulateItemContextMenuListener(value:(sender:Object,e:yfiles.input.PopulateItemContextMenuEventArgs)=> void):void; + /** + * Occurs when the {@link yfiles.input.GraphViewerInputMode#contextMenuInputMode context menu} over an item is about to be opened to determine the + * contents of the context menu. + * This method will only be called for items that match the {@link yfiles.input.GraphViewerInputMode#contextMenuItems} type. + */ + removePopulateItemContextMenuListener(value:(sender:Object,e:yfiles.input.PopulateItemContextMenuEventArgs)=> void):void; + /** + * Gets the types of the items that should be queried a tool tip for. + * The items for which a tool tip text should be {@link yfiles.input.GraphViewerInputMode#addQueryItemToolTipListener queried}. + * The default value is {@link yfiles.graph.GraphItemTypes#NODE}|{@link yfiles.graph.GraphItemTypes#EDGE}|{@link yfiles.graph.GraphItemTypes#LABEL}|{@link yfiles.graph.GraphItemTypes#PORT}|. + */ + toolTipItems:yfiles.graph.GraphItemTypes; + /** + * Determines whether for the given item a tool tip should be queried. + * This implementation uses the {@link yfiles.input.GraphViewerInputMode#toolTipItems} property to determine whether tool tip should be queried + * for the given item. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} Whether to raise a {@link yfiles.input.GraphViewerInputMode#addQueryItemToolTipListener QueryItemToolTip} event for the given item. + */ + shouldQueryToolTip(item:yfiles.model.IModelItem):boolean; + /** + * Raises the {@link yfiles.input.GraphViewerInputMode#addQueryItemToolTipListener QueryItemToolTip} event. + * @param {yfiles.input.QueryItemToolTipEventArgs.} args The {@link yfiles.input.QueryItemToolTipEventArgs} instance containing the event data. + */ + onQueryItemToolTip(args:yfiles.input.QueryItemToolTipEventArgs):void; + /** + * Occurs when the mouse is {@link yfiles.input.GraphViewerInputMode#mouseHoverInputMode hovering} over an item to determine the + * tool tip to display. + * This method will only be called for items that match the {@link yfiles.input.GraphViewerInputMode#toolTipItems} type. + */ + addQueryItemToolTipListener(value:(sender:Object,e:yfiles.input.QueryItemToolTipEventArgs)=> void):void; + /** + * Occurs when the mouse is {@link yfiles.input.GraphViewerInputMode#mouseHoverInputMode hovering} over an item to determine the + * tool tip to display. + * This method will only be called for items that match the {@link yfiles.input.GraphViewerInputMode#toolTipItems} type. + */ + removeQueryItemToolTipListener(value:(sender:Object,e:yfiles.input.QueryItemToolTipEventArgs)=> void):void; + } + var GraphViewerInputMode:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.GraphViewerInputMode} class. + */ + new ():yfiles.input.GraphViewerInputMode; + }; + /** + * A sophisticated implementation of the {@link yfiles.input.IHandle} interface + * the can be used to relocate a port. + * This class heavily relies on the implementation of the {@link yfiles.input.IEdgePortCandidateProvider} that is + * queried from the {@link yfiles.graph.IEdge} this handle is acting on. + * @see {@link yfiles.graph.EdgeDecorator#edgePortCandidateProviderDecorator} + */ + export interface EdgeEndMoveHandle extends Object,yfiles.input.IHandle,yfiles.geometry.IPoint{ + /** + * Gets a value indicating whether the source end of the edge is handled by this instance. + * Value: true if the source end is handled; otherwise, false. + */ + sourceEnd:boolean; + /** + * Gets the edge this instance acts upon. + * Value: The edge. + */ + edge:yfiles.graph.IEdge; + /** + * Gets the dummy edge this instance uses during the edit. + * Value: The dummy edge. + * @see {@link yfiles.input.EdgeEndMoveHandle#showDummyEdge} + */ + dummyEdge:yfiles.graph.SimpleEdge; + /** + * Gets or sets a property that determines whether to show a dummy edge + * during the drag operation. + * The default is true + */ + showDummyEdge:boolean; + /** + * Gets or sets the context to operate on. + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Factory method that creates the dummy edge that will + * be shown during the drag operation. + * @return {yfiles.graph.SimpleEdge} The dummy edge instance to use. + * @see {@link yfiles.input.EdgeEndMoveHandle#showDummyEdge} + */ + createDummyEdge():yfiles.graph.SimpleEdge; + /** + * Configures the dummy edge to look like the given edge. + * @param {yfiles.graph.SimpleEdge} dummy The dummy edge that should mimic the given edge. + * @param {yfiles.graph.IEdge} edge The edge to mimic. + * @see {@link yfiles.input.EdgeEndMoveHandle#showDummyEdge} + * @see {@link yfiles.input.EdgeEndMoveHandle#createDummyEdge} + */ + configureDummy(dummy:yfiles.graph.SimpleEdge,edge:yfiles.graph.IEdge):void; + /** + * Factory method that creates a dummy rendering for the + * dummy edge during the drag operation. + * @param {yfiles.graph.SimpleEdge} dummy The dummy to create a rendering for. + * @return {yfiles.drawing.IVisualCreator} A rendering that shows the dummy. + * @see {@link yfiles.input.EdgeEndMoveHandle#showDummyEdge} + */ + createDummyEdgeVisualCreator(dummy:yfiles.graph.SimpleEdge):yfiles.drawing.IVisualCreator; + /** + * Hides the original edge that during the + * drag operation. + * @param {yfiles.graph.IEdge} edge The edge to hide. + * @param {yfiles.input.IInputModeContext} context The context to get the canvas the edge should be hidden from. + * @see {@link yfiles.input.EdgeEndMoveHandle#unhideOriginalEdge} + * @see {@link yfiles.input.EdgeEndMoveHandle#showDummyEdge} + */ + hideOriginalEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):void; + /** + * Unhides the original edge that was hidden during the + * drag operation. + * @param {yfiles.graph.IEdge} edge The edge to unhide. + * @param {yfiles.canvas.CanvasControl} canvas The canvas the edge was hidden from. + * @see {@link yfiles.input.EdgeEndMoveHandle#hideOriginalEdge} + * @see {@link yfiles.input.EdgeEndMoveHandle#showDummyEdge} + */ + unhideOriginalEdge(edge:yfiles.graph.IEdge,canvas:yfiles.canvas.CanvasControl):void; + /** + * Updates the position of the handle. + * @param {yfiles.geometry.PointD} location The new location of the handle. + */ + setPosition(location:yfiles.geometry.PointD):void; + /** + * Returns a view of the location of the item. + * This implementation returns this. + * @see Specified by {@link yfiles.input.IDragHandler#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Returns the type of the handle that can be used by the rendering engine + * to render types differently. + * @see Specified by {@link yfiles.input.IHandle#type}. + */ + type:yfiles.input.HandleType; + /** + * Provides the cursor to display when the mouse hovers over or drags this + * handle. + * @see Specified by {@link yfiles.input.IHandle#cursor}. + */ + cursor:yfiles.canvas.ICanvasCursor; + /** + * Called by clients to indicate that the element is going to be dragged. + * This call will be followed by one or more calls to {@link yfiles.input.IDragHandler#handleMove}, + * and a final {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. + */ + initializeDrag(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Called by clients to indicate that the element has been dragged and its position + * should be updated. + * This method may be called more than once after an initial {@link yfiles.input.IDragHandler#initializeDrag} + * and will the final call will be followed by either one + * {@link yfiles.input.IDragHandler#dragFinished} or one {@link yfiles.input.IDragHandler#cancelDrag} call. + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @return {boolean} Whether the move had any visual effect. This is a hint to the engine to optimize invalidation. + * @see Specified by {@link yfiles.input.IDragHandler#handleMove}. + */ + handleMove(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):boolean; + /** + * Called by clients to indicate that the dragging has been canceled by the user. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Implementations should reset the position of the items they modify to their initial state. + * Alternatively to this method the {@link yfiles.input.IDragHandler#dragFinished} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} originalLocation The value of the coordinate of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#cancelDrag}. + */ + cancelDrag(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * Called by clients to indicate that the repositioning has just been finished. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Alternatively to this method the {@link yfiles.input.IDragHandler#cancelDrag} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * This is the same value as delivered in the last invocation of {@link yfiles.input.IDragHandler#handleMove} + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#dragFinished}. + */ + dragFinished(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + /** + * Gets the graph to use from the context. + * @param {yfiles.input.IInputModeContext} modeContext The input mode context. + * @return {yfiles.graph.IGraph} A graph instance or null. + */ + getGraph(modeContext:yfiles.input.IInputModeContext):yfiles.graph.IGraph; + } + var EdgeEndMoveHandle:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of the {@link yfiles.input.EdgeEndMoveHandle} class. + * @param {yfiles.graph.IGraph} graph The graph or null. If the graph is null, the handle will try to + * receive the graph from the {@link yfiles.input.IInputModeContext} it is used in during {@link yfiles.input.EdgeEndMoveHandle#initializeDrag}. + * @param {yfiles.graph.IEdge} edge The edge. + * @param {boolean} sourceEnd if set to true the source port will be subject to relocation, + * otherwise it will be the target port. + */ + new (graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,sourceEnd:boolean):yfiles.input.EdgeEndMoveHandle; + }; + /** + * Simple default implementations of the {@link yfiles.input.IBendCreator} + * interface used during the creation of bends + * in the UI. + * An instance of this class can be found in the {@link yfiles.support.ILookup#lookup} + * of an edge, e.g. + */ + export interface DefaultBendCreator extends Object,yfiles.input.IBendCreator{ + /** + * Creates a bend at the given graph for the given edge at the position supplied. + * @param {yfiles.input.IInputModeContext} context The context for which the bend should be created. + * @param {yfiles.graph.IGraph} graph The graph, the edge belongs to. + * @param {yfiles.graph.IEdge} edge The edge. + * @param {yfiles.geometry.PointD} location The preferred coordinates of the bend. + * @return {number} The index of the bend in the edges' {@link yfiles.graph.IEdge#bends} or -1 if no bend has been created. + * @see Specified by {@link yfiles.input.IBendCreator#createBend}. + */ + createBend(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,location:yfiles.geometry.PointD):number; + } + var DefaultBendCreator:{ + $class:yfiles.lang.Class; + /** + * A static instance that does not create any bends. + */ + NO_BENDS:yfiles.input.IBendCreator; + /** + * Initializes a new instance of the {@link yfiles.input.DefaultBendCreator} class for the given edge. + * @param {yfiles.graph.IEdge} edge The edge. + */ + new (edge:yfiles.graph.IEdge):yfiles.input.DefaultBendCreator; + }; + /** + * Simple implementation of a {@link yfiles.input.IHandleProvider} + * that can be used for {@link yfiles.graph.IEdge}s. + * It will return the {@link yfiles.input.IHandle}s for + * the {@link yfiles.graph.IEdge#sourcePort source} and {@link yfiles.graph.IEdge#targetPort target} ports + * using {@link yfiles.input.PortRelocationHandle}s. + * Note that this implementation also explicitly implements the {@link yfiles.input.IEdgePortHandleProvider} and + * that it is recommended to decorate the {@link yfiles.input.IEdgePortHandleProvider} interface with edges + * in order to influence the handles of the source and target port of the edge instead of directly decorating and + * implementing the {@link yfiles.input.IHandleProvider} interface. The default implementation of the {@link yfiles.input.IHandleProvider} + * interface in the lookup of the {@link yfiles.graph.IEdge}s (see {@link yfiles.graph.DefaultEdgeLookup}) will use + * the {@link yfiles.input.IEdgePortCandidateProvider} interface to collect the source and target port handles. + */ + export interface PortRelocationHandleProvider extends Object,yfiles.input.IHandleProvider,yfiles.input.IEdgePortHandleProvider{ + /** + * The graph this provider is working on. + */ + graph:yfiles.graph.IGraph; + /** + * The edge this provider is working on. + */ + edge:yfiles.graph.IEdge; + /** + * Returns a collection of zero or more {@link yfiles.input.IHandle} implementations + * that are associated with this instance. + * @return {yfiles.collections.ICollection.} A collection of handles. + * @see Specified by {@link yfiles.input.IHandleProvider#getHandles}. + */ + getHandles(inputModeContext:yfiles.input.IInputModeContext):yfiles.collections.ICollection; + /** + * Factory method that creates the a {@link yfiles.input.PortRelocationHandle}. + * @param {yfiles.graph.IGraph} graph The graph that contains the edge. + * @param {yfiles.graph.IEdge} edge The edge. + * @param {boolean} sourcePort if set to true the handle for the source port is sought. + * @return {yfiles.input.IHandle} A handle or null. + */ + createPortRelocationHandle(graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,sourcePort:boolean):yfiles.input.IHandle; + getHandle(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourceHandle:boolean):yfiles.input.IHandle; + } + var PortRelocationHandleProvider:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.PortRelocationHandleProvider} class + * using the given graph and edge. + * @param {yfiles.graph.IGraph} graph The graph or null. If the graph is null, the handles will try to + * receive the graph from the {@link yfiles.input.IInputModeContext} it is used in. + * @param {yfiles.graph.IEdge} edge The edge. + */ + new (graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge):yfiles.input.PortRelocationHandleProvider; + }; + /** + * A sophisticated implementation of the {@link yfiles.input.IHandle} interface + * that lets the user change an edge's {@link yfiles.graph.IEdge#sourcePort source} and {@link yfiles.graph.IEdge#targetPort target port}. + * This handle will move one of the edge's end points visually to another {@link yfiles.graph.IPort} or + * {@link yfiles.input.IPortCandidate} and upon finalization of the gesture will {@link yfiles.input.PortRelocationHandle#setPorts set the new ports} + * for the edge. + * This class heavily relies on the implementation of the {@link yfiles.input.IEdgePortCandidateProvider} that is + * queried from the {@link yfiles.graph.IEdge} this handle is acting on. + * @see {@link yfiles.input.PortRelocationHandle#getPortCandidates} + * @see {@link yfiles.graph.EdgeDecorator#edgePortCandidateProviderDecorator} + */ + export interface PortRelocationHandle extends yfiles.input.EdgeEndMoveHandle{ + /** + * Gets or sets a value indicating whether to show the candidates of hit {@link yfiles.graph.IPortOwner}s only. + * Value: + * true if only candidates of hit nodes and edges are shown; otherwise, false. + */ + showHitPortOwnerCandidatesOnly:boolean; + /** + * Factory method that creates the {@link yfiles.canvas.ICanvasObjectDescriptor} + * that will be used to paint the {@link yfiles.input.IPortCandidate}s. + * @return {yfiles.canvas.ICanvasObjectDescriptor} The descriptor to use for the rendering in the {@link yfiles.canvas.CanvasControl}. + */ + createPortCandidateDescriptor():yfiles.canvas.ICanvasObjectDescriptor; + /** + * Gets or sets the maximum distance the pointer may be away of a candidate in order to + * be snapped to the candidate. + * The distance is measured in view coordinates. + * The default value is 50.0. + */ + maximumSnapDistance:number; + /** + * Configures the dummy edge to look like the given edge. + * @param {yfiles.graph.SimpleEdge} dummy The dummy edge that should mimic the given edge. + * @param {yfiles.graph.IEdge} edge The edge to mimic. + * @see {@link yfiles.input.EdgeEndMoveHandle#showDummyEdge} + * @see {@link yfiles.input.EdgeEndMoveHandle#createDummyEdge} + */ + configureDummy(dummy:yfiles.graph.SimpleEdge,edge:yfiles.graph.IEdge):void; + /** + * Updates the dummy edge's visual appearance to reflect the new port candidate. + * @param {yfiles.graph.SimpleEdge} dummy The dummy edge. + * @param {boolean} source Whether to update the source or target port. + * @param {yfiles.input.IPortCandidate} candidate The new candidate to indicate. + */ + setToPortCandidate(dummy:yfiles.graph.SimpleEdge,source:boolean,candidate:yfiles.input.IPortCandidate):void; + /** + * Determines whether or not edges are allowed to connect to other edges. + * The default is true. + */ + edgeToEdgeConnectionsAllowed:boolean; + /** + * Determines whether or not cyclic port dependencies are allowed. + * If {@link yfiles.input.PortRelocationHandle#edgeToEdgeConnectionsAllowed edge to edge connections} + * are allowed by this instance, this property determines whether {@link yfiles.input.PortRelocationHandle#getClosestCandidate}s + * are will yield candidates that would result in the edge being modified would create a cyclic dependency. + * The default is false. + */ + cyclicPortDependenciesAllowed:boolean; + /** + * Gets or sets a property that determines whether the existing port should be + * available as a possible port candidate, too. + * The default is true. If this property is set to false, + * {@link yfiles.input.PortRelocationHandle#getPortCandidates} will return only the ports provided by + * the {@link yfiles.input.IPortCandidateProvider} in the node's lookup. + */ + addExistingPort:boolean; + /** + * Returns the type of the handle that can be used by the rendering engine + * to render types differently. + * @see Specified by {@link yfiles.input.IHandle#type}. + */ + type:yfiles.input.HandleType; + /** + * Provides the cursor to display when the mouse hovers over or drags this + * handle. + * @see Specified by {@link yfiles.input.IHandle#cursor}. + */ + cursor:yfiles.canvas.ICanvasCursor; + /** + * Called by clients to indicate that the element is going to be dragged. + * This call will be followed by one or more calls to {@link yfiles.input.IDragHandler#handleMove}, + * and a final {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. + */ + initializeDrag(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Gets the possible candidates for the given edge. + * This implementation uses the {@link yfiles.input.IEdgePortCandidateProvider} + * from the edge's {@link yfiles.support.ILookup#lookup} to retrieve the candidate sets. + * If {@link yfiles.input.PortRelocationHandle#addExistingPort} is enabled, the existing port will be part of the + * candidates. + * @param {yfiles.input.IInputModeContext} context The context that is used to retrieve the candidates for. + * @param {yfiles.graph.IEdge} edge The edge. + * @param {boolean} sourcePort Whether to look for source port candidates. + * @return {yfiles.collections.IEnumerable.} A non-null enumerable over the candidates. + */ + getPortCandidates(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourcePort:boolean):yfiles.collections.IEnumerable; + /** + * Factory method that creates the candidate for the existing port. + * @param {yfiles.graph.IPort} currentPort The port to create a candidate for. + * @return {yfiles.input.IPortCandidate} The candidate or null. + * @see {@link yfiles.input.PortRelocationHandle#getPortCandidates} + * @see {@link yfiles.input.PortRelocationHandle#addExistingPort} + */ + createExistingPortCandidate(currentPort:yfiles.graph.IPort):yfiles.input.IPortCandidate; + /** + * Called by clients to indicate that the element has been dragged and its position + * should be updated. + * This method may be called more than once after an initial {@link yfiles.input.IDragHandler#initializeDrag} + * and will the final call will be followed by either one + * {@link yfiles.input.IDragHandler#dragFinished} or one {@link yfiles.input.IDragHandler#cancelDrag} call. + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @return {boolean} Whether the move had any visual effect. This is a hint to the engine to optimize invalidation. + * @see Specified by {@link yfiles.input.IDragHandler#handleMove}. + */ + handleMove(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):boolean; + /** + * Updates the closest candidate for visual feedback. + */ + setClosestCandidate(closest:yfiles.input.IPortCandidate):void; + /** + * Called by clients to indicate that the dragging has been canceled by the user. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Implementations should reset the position of the items they modify to their initial state. + * Alternatively to this method the {@link yfiles.input.IDragHandler#dragFinished} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} originalLocation The value of the coordinate of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#cancelDrag}. + */ + cancelDrag(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * Called by clients to indicate that the repositioning has just been finished. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Alternatively to this method the {@link yfiles.input.IDragHandler#cancelDrag} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * This is the same value as delivered in the last invocation of {@link yfiles.input.IDragHandler#handleMove} + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#dragFinished}. + */ + dragFinished(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + /** + * Callback that is triggered by {@link yfiles.input.PortRelocationHandle#dragFinished} to actually change the port. + * @param {yfiles.input.IInputModeContext} context The context. + * @param {yfiles.graph.IEdge} edge The edge to change ports. + * @param {boolean} setSourcePort Whether to set the source port. false for target ports. + * @param {yfiles.input.IPortCandidate} portCandidate The candidate that has been chosen. + * @param {yfiles.geometry.PointD} suggestedLocation The suggested location for the port. + */ + setPort(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,setSourcePort:boolean,portCandidate:yfiles.input.IPortCandidate,suggestedLocation:yfiles.geometry.PointD):void; + /** + * Callback used during {@link yfiles.input.PortRelocationHandle#dragFinished} + * to actually get the new port from the chosen candidate. + * This implementation returns the result of {@link yfiles.input.IPortCandidate#createInstance} + * or calls {@link yfiles.graph.IGraph#addPortWithParameterStyleAndTag} if the result was null. + * @param {yfiles.input.IInputModeContext} context + * @param {yfiles.input.IPortCandidate} candidate The candidate to get a port instance from. + * @param {yfiles.geometry.PointD} suggestedLocation The suggested location for the port. + * @return {yfiles.graph.IPort} A non-null port instance. + * @see {@link yfiles.input.PortRelocationHandle#setPorts} + */ + getPort(context:yfiles.input.IInputModeContext,candidate:yfiles.input.IPortCandidate,suggestedLocation:yfiles.geometry.PointD):yfiles.graph.IPort; + /** + * Finally sets the ports for the edge to the new values. + * @param {yfiles.input.IInputModeContext} context The context in which the ports are set. + * @param {yfiles.graph.IEdge} edge The edge to set the ports for. + * @param {yfiles.graph.IPort} sourcePort The (possibly) new source port. + * @param {yfiles.graph.IPort} targetPort The (possibly) new target port. + */ + setPorts(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourcePort:yfiles.graph.IPort,targetPort:yfiles.graph.IPort):void; + /** + * Finds the closest candidate from the given set of candidates. + * @param {yfiles.input.IInputModeContext} context The context in for which the closest handle candidate is sought. + * @param {yfiles.geometry.PointD} location The location for which to find a candidate. + * @param {yfiles.collections.IEnumerable.} candidates The list of possible candidates. + * @return {yfiles.input.IPortCandidate} The closes candidate or null. + */ + getClosestCandidate(context:yfiles.input.IInputModeContext,location:yfiles.geometry.PointD,candidates:yfiles.collections.IEnumerable):yfiles.input.IPortCandidate; + /** + * Tries to {@link yfiles.input.IPortCandidate#getPortCandidateAt resolve} a dynamic port candidate + * for the given location. + * @param {yfiles.input.IInputModeContext} context The context in which the candidate is resolved. + * @param {yfiles.input.IPortCandidate} candidate The candidate. + * @param {yfiles.geometry.PointD} location The current location. + * @return {yfiles.input.IPortCandidate} A candidate. + */ + resolveCandidate(context:yfiles.input.IInputModeContext,candidate:yfiles.input.IPortCandidate,location:yfiles.geometry.PointD):yfiles.input.IPortCandidate; + /** + * Gets or sets a value indicating whether {@link yfiles.input.PortCandidateValidity#DYNAMIC} ports + * that are part of the {@link yfiles.input.PortRelocationHandle#getPortCandidates port candidates} should be resolved + * for the current mouse location. + * By default this feature is enabled and the {@link yfiles.input.PortRelocationHandle#portCandidateResolutionRecognizer} is configured so that + * the resolution mechanism is used if the user holds the shift modifier during the gesture. + * @see {@link yfiles.input.PortRelocationHandle#portCandidateResolutionRecognizer} + * @see {@link yfiles.input.PortRelocationHandle#resolveCandidate} + */ + resolvePortCandidates:boolean; + /** + * Gets or sets the event recognizer that detects changes to the {@link yfiles.input.PortRelocationHandle#isPortCandidateResolutionEnabled} property. + * By default this is set to the {@link yfiles.input.KeyEvents#SHIFT_PRESSED} recognizer. + */ + portCandidateResolutionRecognizer:yfiles.input.IEventRecognizer; + /** + * Determines whether for the current gesture {@link yfiles.input.PortRelocationHandle#resolveCandidate port candidate resolution} + * is enabled in the specified context. + * This implementation checks whether the context is provided by a {@link yfiles.input.HandleInputMode}, + * if the {@link yfiles.input.PortRelocationHandle#portCandidateResolutionRecognizer} recognizes its {@link yfiles.input.StateMachineInputMode#lastMouse2DEventArgs}, + * and the {@link yfiles.input.HandleInputMode#currentHandle}'s location is equal to this {@link yfiles.input.EdgeEndMoveHandle#location}. + * @param {yfiles.input.IInputModeContext} context The context to inspect. + * @return {boolean} + * true if port candidates may be resolved; otherwise, false. + */ + isPortCandidateResolutionEnabled(context:yfiles.input.IInputModeContext):boolean; + } + var PortRelocationHandle:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of the {@link yfiles.input.PortRelocationHandle} class. + * @param {yfiles.graph.IGraph} graph The graph or null. If the graph instance is not specified, the handle will try to + * receive the graph from the {@link yfiles.input.IInputModeContext} it is passed in during {@link yfiles.input.PortRelocationHandle#initializeDrag}. + * @param {yfiles.graph.IEdge} edge The edge. + * @param {boolean} sourceEnd if set to true the source end will be subject to relocation, + * otherwise it will be the target port. + */ + new (graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,sourceEnd:boolean):yfiles.input.PortRelocationHandle; + }; + /** + * The default implementation of the {@link yfiles.input.INodeSnapResultProvider} interface. + */ + export interface NodeSnapResultProvider extends Object,yfiles.input.INodeSnapResultProvider{ + /** + * Called when a node is {@link yfiles.input.IDragHandler#handleMove dragged} to add {@link yfiles.input.SnapResult}s + * for {@link yfiles.input.OrthogonalSnapLine}s to which this node can potentially snap. + * @param {yfiles.input.GraphSnapContext} context The snap context which manages the snap lines and the settings. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The event argument to obtain the necessary information from and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult add results to}. + * @param {yfiles.geometry.RectD} suggestedLayout The {@link yfiles.graph.INode#layout layout} of the node if the node would not snap. + * @param {yfiles.graph.INode} node The node that is being moved. + * @see Specified by {@link yfiles.input.INodeSnapResultProvider#collectSnapResults}. + */ + collectSnapResults(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.RectD,node:yfiles.graph.INode):void; + /** + * Collects the results for the given layout for all snap lines in question. + * For each snap line that could be snapped to, this method calls + * {@link yfiles.input.NodeSnapResultProvider#collectSnapResultsForSnapLine}. + * @param {yfiles.input.GraphSnapContext} context The context for which the results are being queried. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The {@link yfiles.input.CollectSnapResultsEventArgs} instance to which + * the results should be {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult added}. + * @param {yfiles.geometry.RectD} suggestedLayout The suggested layout of the node. + * @param {yfiles.graph.INode} node The node that is being dragged. + */ + collectSnapLineSnapResults(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.RectD,node:yfiles.graph.INode):void; + /** + * Verifies whether the node will snap to the given snap line. If the node will snap, a {@link yfiles.input.SnapLineSnapResult} + * will be created and added to the event argument. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The arguments to add the results to. + * @param {yfiles.input.OrthogonalSnapLine} snapLine The snap line to test snapping for. + * @param {yfiles.geometry.RectD} suggestedLayout The layout of the node if it would move without snapping. + * @param {yfiles.graph.INode} node The node that is currently being processed. + */ + collectSnapResultsForSnapLine(args:yfiles.input.CollectSnapResultsEventArgs,snapLine:yfiles.input.OrthogonalSnapLine,suggestedLayout:yfiles.geometry.RectD,node:yfiles.graph.INode):void; + /** + * Collects snap results that snap the node to a grid and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult adds them} to the argument. + * This implementation simply delegates to {@link yfiles.input.NodeSnapResultProvider#addGridSnapResult} using the center of the suggestedLayout. + * @param {yfiles.input.GraphSnapContext} context The context in which the snapping is performed. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The arguments to add the results to. + * @param {yfiles.geometry.RectD} suggestedLayout The layout of the node if it would move without snapping. + * @param {yfiles.graph.INode} node The node that is currently being processed. + */ + collectGridSnapResults(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.RectD,node:yfiles.graph.INode):void; + /** + * Calculates a {@link yfiles.input.SnapResult} and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult adds it} to the argument. + * This method delegates to {@link yfiles.input.NodeSnapResultProvider#addGridSnapResultCore} using {@link yfiles.input.GraphSnapContext#gridSnapType} and + * {@link yfiles.input.SnapPolicy#TO_NEAREST} as the additional arguments. + * This method snaps the pointInSuggestedLayout to the next grid point or grid lines that are determined by + * {@link yfiles.input.GraphSnapContext#nodeGridConstraintProvider} or obtained from the {@link yfiles.input.InputModeEventArgs#context}. + * @param {yfiles.input.GraphSnapContext} context The context in which the snapping is performed. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The arguments to add the results to. + * @param {yfiles.geometry.PointD} pointInSuggestedLayout A location in the layout of the suggested layout of the node that will be snapped to a grid point location. + * @param {yfiles.graph.INode} node The node that is currently being processed. + */ + addGridSnapResult(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,pointInSuggestedLayout:yfiles.geometry.PointD,node:yfiles.graph.INode):void; + /** + * Calculates a {@link yfiles.input.SnapResult} and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult adds it} to the argument. + * This method snaps the pointInSuggestedLayout to the next grid point or grid lines that are determined by + * {@link yfiles.input.GraphSnapContext#nodeGridConstraintProvider} or obtained from the {@link yfiles.input.InputModeEventArgs#context}. + * @param {yfiles.input.GraphSnapContext} context The context in which the snapping is performed. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The arguments to add the results to. + * @param {yfiles.geometry.PointD} pointInSuggestedLayout A location in the layout of the suggested layout of the node that will be snapped to a grid point location. + * @param {yfiles.graph.INode} node The node that is currently being processed. + * @param {yfiles.canvas.GridSnapType} gridSnapType The type of snapping that should be performed. + * @param {yfiles.input.SnapPolicy} xSnapPolicy How to snap the x coordinate. + * @param {yfiles.input.SnapPolicy} ySnapPolicy How to snap the y coordinate. + */ + addGridSnapResultCore(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,pointInSuggestedLayout:yfiles.geometry.PointD,node:yfiles.graph.INode,gridSnapType:yfiles.canvas.GridSnapType,xSnapPolicy:yfiles.input.SnapPolicy,ySnapPolicy:yfiles.input.SnapPolicy):void; + } + var NodeSnapResultProvider:{ + $class:yfiles.lang.Class; + /** + * Yields the static shared instance of this class. + */ + INSTANCE:yfiles.input.INodeSnapResultProvider; + }; + /** + * The default implementation of the {@link yfiles.input.INodeReshapeSnapResultProvider} interface. + */ + export interface NodeReshapeSnapResultProvider extends Object,yfiles.input.INodeReshapeSnapResultProvider{ + /** + * Called when a node is {@link yfiles.input.IDragHandler#handleMove dragged} to add + * {@link yfiles.input.SnapResult}s for {@link yfiles.input.OrthogonalSnapLine}s or sizes to which this node can potentially + * snap during resizing. + * This implementation delegates to the following methods in order: + *
    + *
  • {@link yfiles.input.NodeReshapeSnapResultProvider#collectGridSnapResults}
  • + *
  • {@link yfiles.input.NodeReshapeSnapResultProvider#collectSameSizeSnapResults}
  • + *
  • {@link yfiles.input.NodeReshapeSnapResultProvider#collectSnapLineResults}
  • + *
+ * @param {yfiles.input.GraphSnapContext} context The snap context which manages the snap lines and the settings. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The event argument to obtain the context from and add the results to. + * @param {yfiles.graph.INode} node The node that is being reshaped. + * @param {yfiles.input.ReshapeRectangleContext} reshapeContext Carries information about the reshape process. + * @see Specified by {@link yfiles.input.INodeReshapeSnapResultProvider#collectSnapResults}. + */ + collectSnapResults(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext):void; + /** + * Collects the snap results that makes the node's bounds snap to the {@link yfiles.input.GraphSnapContext#getFixedNodeSnapLines fixed node snap lines}. + * This method ultimately delegates to {@link yfiles.input.NodeReshapeSnapResultProvider#addSnapLineSnapResult} to add the results to the event argument. + * Method {@link yfiles.input.NodeReshapeSnapResultProvider#getSnapLines} is used to query the snap lines that will be checked by this method. + * @param {yfiles.input.GraphSnapContext} context The context in which the snapping is performed. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The {@link yfiles.input.CollectSnapResultsEventArgs} instance containing the event data. + * @param {yfiles.graph.INode} node The node that is being reshaped. + * @param {yfiles.input.ReshapeRectangleContext} reshapeContext The reshape context that contains information about the nature of the resize. + * @param {yfiles.geometry.RectD} suggestedLayout The layout of the node as it would be if the mouse location would not be snapped. + */ + collectSnapLineResults(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext,suggestedLayout:yfiles.geometry.RectD):void; + /** + * Helper method for method {@link yfiles.input.NodeReshapeSnapResultProvider#collectSnapLineResults} that gets all the {@link yfiles.input.SnapLine} that should + * be checked for the currently moved node. + * This method aggregates the {@link yfiles.input.GraphSnapContext#getFixedNodeSnapLines fixed nodes' snaplines} and the {@link yfiles.input.GraphSnapContext#getAdditionalSnapLines + * additional snap lines} that are relevant to the node. + * @param {yfiles.input.GraphSnapContext} context The context in which the snapping is performed. + * @param {yfiles.graph.INode} node The node that is being reshaped. + * @param {yfiles.input.ReshapeRectangleContext} reshapeContext The reshape context that contains information about the nature of the resize. + * @param {yfiles.geometry.RectD} suggestedLayout The layout of the node as it would be if the mouse location would not be snapped. + */ + getSnapLines(context:yfiles.input.GraphSnapContext,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext,suggestedLayout:yfiles.geometry.RectD):yfiles.collections.IEnumerable; + /** + * Adds a snap result for a location that snaps the node's bounds to a snap line. + * This method is called by {@link yfiles.input.NodeReshapeSnapResultProvider#collectSnapLineResults} for each snap line snap. + * @param {yfiles.input.GraphSnapContext} context The context in which the snapping is performed. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The {@link yfiles.input.CollectSnapResultsEventArgs} instance containing the event data. + * @param {yfiles.graph.INode} node The node that is being reshaped. + * @param {yfiles.input.OrthogonalSnapLine} snapLine The snap line to which the node can be snapped + * @param {number} delta The amount the mouse needs to be moved in order to get to the snapping location. + * @param {yfiles.geometry.PointD} snapPoint The point of interest that can be highlighted on the snap line. + */ + addSnapLineSnapResult(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,snapLine:yfiles.input.OrthogonalSnapLine,delta:number,snapPoint:yfiles.geometry.PointD):void; + /** + * Collects the snap results that make the node the same size as other elements. + * This method ultimately delegates to {@link yfiles.input.NodeReshapeSnapResultProvider#addSameSizeSnapResult} to add the results to the event argument. + * @param {yfiles.input.GraphSnapContext} context The context in which the snapping is performed. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The {@link yfiles.input.CollectSnapResultsEventArgs} instance containing the event data. + * @param {yfiles.graph.INode} node The node that is being reshaped. + * @param {yfiles.input.ReshapeRectangleContext} reshapeContext The reshape context that contains information about the nature of the resize. + * @param {yfiles.geometry.RectD} suggestedLayout The layout of the node as it would be if the mouse location would not be snapped. + */ + collectSameSizeSnapResults(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext,suggestedLayout:yfiles.geometry.RectD):void; + /** + * Collects the snap results for the grid. + * @param {yfiles.input.GraphSnapContext} context The context in which the snapping is performed. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The {@link yfiles.input.CollectSnapResultsEventArgs} instance containing the event data. + * @param {yfiles.graph.INode} node The node that is being reshaped. + * @param {yfiles.input.ReshapeRectangleContext} reshapeContext The reshape context that describes how the node's layout is reshaped. + * @param {yfiles.geometry.RectD} suggestedLayout The suggested layout of the node. + */ + collectGridSnapResults(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeContext:yfiles.input.ReshapeRectangleContext,suggestedLayout:yfiles.geometry.RectD):void; + /** + * Adds a snap result for a location that snaps to a grid line. + * This method is called by {@link yfiles.input.NodeReshapeSnapResultProvider#collectGridSnapResults} for each grid line snap. + * @param {yfiles.input.GraphSnapContext} context The context in which the snapping is performed. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The {@link yfiles.input.CollectSnapResultsEventArgs} instance containing the event data. + * @param {yfiles.graph.INode} node The node that is being reshaped. + * @param {number} delta The amount the mouse needs to be moved in order to get to the snapping location. + * @param {yfiles.geometry.PointD} snappedLocation The location of the mouse that is associated with the grid point. + * @param {yfiles.input.SnapLineSnapType} snapLineType The type of snap line. + * @param {yfiles.geometry.IPoint} snapLineLocation The point at which the snap line is anchored. + * @param {number} from Where the snap line starts. + * @param {number} to Where the snap line ends. + * @param {yfiles.geometry.PointD} snapLinePoint A point of interest on the snap line that can be highlighted. + */ + addGridLineSnapResult(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,snapLineType:yfiles.input.SnapLineSnapType,snapLineLocation:yfiles.geometry.IPoint,delta:number,snappedLocation:yfiles.geometry.PointD,from:number,to:number,snapLinePoint:yfiles.geometry.PointD):void; + /** + * Adds a snap result for a location that snaps to the grid. + * This method is called by {@link yfiles.input.NodeReshapeSnapResultProvider#collectGridSnapResults} for each grid snap. + * @param {yfiles.input.GraphSnapContext} context The context in which the snapping is performed. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The {@link yfiles.input.CollectSnapResultsEventArgs} instance containing the event data. + * @param {yfiles.graph.INode} node The node that is being reshaped. + * @param {yfiles.input.IGridConstraintProvider.} provider The provider that is associated with the grid snapping. + * @param {yfiles.geometry.PointD} gridSnappedPoint The point on the grid that should be highlighted. + * @param {yfiles.geometry.PointD} snappedLocation The location of the mouse that is associated with the grid point. + */ + addGridSnapResult(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,provider:yfiles.input.IGridConstraintProvider,gridSnappedPoint:yfiles.geometry.PointD,snappedLocation:yfiles.geometry.PointD):void; + /** + * Adds a snap result for "same size" to the collect event argument. + * This method is called by {@link yfiles.input.NodeReshapeSnapResultProvider#collectSameSizeSnapResults} for each result found. + * @param {yfiles.input.GraphSnapContext} context The context in which the snapping is performed. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The {@link yfiles.input.CollectSnapResultsEventArgs} instance containing the event data. This will be used to {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult add} the result to. + * @param {yfiles.graph.INode} node The node that is being reshaped. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the result - indicates whether width or height have been snapped. + * @param {yfiles.collections.IEnumerable.} rectangles The rectangles that have the same width or height as the node will - this does not yet includes the rectangle of the node being reshaped. + * @param {number} finalSize The target size to which the node will snap. + * @param {number} snapDelta The snap delta that the mouse needs to be moved in order to snap. + */ + addSameSizeSnapResult(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,rectangles:yfiles.collections.IEnumerable,finalSize:number,snapDelta:number):void; + } + var NodeReshapeSnapResultProvider:{ + $class:yfiles.lang.Class; + /** + * A shared singleton instance of this type. + */ + INSTANCE:yfiles.input.INodeReshapeSnapResultProvider; + }; + /** + * Trivial implementation of an {@link yfiles.input.IPortCandidateProvider} + * that always returns exactly one candidate that is centered at the node's + * {@link yfiles.graph.INode#layout}. + */ + export interface NodeCenterPortCandidateProvider extends yfiles.input.AbstractPortCandidateProvider{ + /** + * Creates an enumeration of possibly port candidates. + * This method is used as a callback by most of the getter methods in this class. + * Subclasses should override this method to provide the same candidates for all + * use-cases. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable collection of port candidates. + */ + getPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var NodeCenterPortCandidateProvider:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance for the given node. + * @param {yfiles.graph.INode} node The node to get the layout's center from. + */ + new (node:yfiles.graph.INode):yfiles.input.NodeCenterPortCandidateProvider; + }; + /** + * A generic implementation of the {@link yfiles.input.IPortCandidateProvider} interface that provides + * no candidates. + */ + export interface EmptyPortsCandidateProvider extends Object,yfiles.input.IPortCandidateProvider{ + /** + * Returns all port candidates that apply for the provided opposite port candidate. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IPortCandidate} target The opposite port candidate. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given opposite port. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidatesForTarget}. + */ + getSourcePortCandidatesForTarget(context:yfiles.input.IInputModeContext,target:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; + /** + * Returns all port candidates that apply for the provided opposite port candidate. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @param {yfiles.input.IPortCandidate} source The opposite port candidate. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given opposite port. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidatesForSource}. + */ + getTargetPortCandidatesForSource(context:yfiles.input.IInputModeContext,source:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; + /** + * Returns all port candidates that apply for source port candidates for the provided edge. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @param {yfiles.graph.IEdge} edge The edge for which source port candidates are sought. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given edge. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidatesForEdge}. + */ + getSourcePortCandidatesForEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):yfiles.collections.IEnumerable; + /** + * Returns all port candidates that apply for target port candidates for the provided edge. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @param {yfiles.graph.IEdge} edge The edge for which target port candidates are sought. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given edge. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidatesForEdge}. + */ + getTargetPortCandidatesForEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):yfiles.collections.IEnumerable; + /** + * Returns all source port candidates that belong to the context of this provider. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all source port candidates that are associated with the current context. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidates}. + */ + getSourcePortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Returns all target port candidates that belong to the context of this provider. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all target port candidates that are associated with the current context. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidates}. + */ + getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var EmptyPortsCandidateProvider:{ + $class:yfiles.lang.Class; + new ():yfiles.input.EmptyPortsCandidateProvider; + /** + * A static instance of this class. + */ + INSTANCE:yfiles.input.IPortCandidateProvider; + }; + /** + * Simple implementation of an {@link yfiles.input.IPortCandidateProvider} + * that returns unoccupied ports at a given entity. + */ + export interface UnoccupiedPortsCandidateProvider extends yfiles.input.AbstractPortCandidateProvider{ + /** + * Creates an enumeration of possibly port candidates. + * This method is used as a callback by most of the getter methods in this class. + * Subclasses should override this method to provide the same candidates for all + * use-cases. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable collection of port candidates. + */ + getPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var UnoccupiedPortsCandidateProvider:{ + $class:yfiles.lang.Class; + /** + * Creates an instance for the specified owner. + * @param {yfiles.graph.IPortOwner} portOwner The owner to query the ports from. + */ + new (portOwner:yfiles.graph.IPortOwner):yfiles.input.UnoccupiedPortsCandidateProvider; + }; + /** + * Simple implementation of an {@link yfiles.input.IPortCandidateProvider} + * that always returns a candidate that uses the default {@link yfiles.graph.IPortDefaults#locationModelParameter} + * for the corresponding {@link yfiles.graph.IPortDefaults}. + */ + export interface PortDefaultsPortCandidateProvider extends yfiles.input.AbstractPortCandidateProvider{ + /** + * Creates an enumeration of possibly port candidates. + * This method is used as a callback by most of the getter methods in this class. + * Subclasses should override this method to provide the same candidates for all + * use-cases. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable collection of port candidates. + */ + getPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var PortDefaultsPortCandidateProvider:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance for the given node. + * @param {yfiles.graph.IPortOwner} portOwner The owner to obtain the {@link yfiles.graph.GraphExtensions#getPortDefaults port defaults from}. + */ + new (portOwner:yfiles.graph.IPortOwner):yfiles.input.PortDefaultsPortCandidateProvider; + }; + /** + * An implementation of the {@link yfiles.input.IEdgePortCandidateProvider} + * interface that returns the current source and target ports. + */ + export interface CurrentEdgePortsCandidateProvider extends Object,yfiles.input.IEdgePortCandidateProvider{ + /** + * The edge to return candidates for. + */ + edge:yfiles.graph.IEdge; + /** + * Creates a candidate from the given existing port instance. + * @param {yfiles.input.IInputModeContext} context The context. + * @param {yfiles.graph.IPort} port The port + * @return {yfiles.input.DefaultPortCandidate} A candidate. + */ + createCandidate(context:yfiles.input.IInputModeContext,port:yfiles.graph.IPort):yfiles.input.DefaultPortCandidate; + /** + * Returns all source port candidates that may be used for the edge. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all source port candidates that are associated with the current context edge. + * @see Specified by {@link yfiles.input.IEdgePortCandidateProvider#getSourcePortCandidates}. + */ + getSourcePortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Returns all source port candidates that may be used for the edge. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all target port candidates that are associated with the current context edge. + * @see Specified by {@link yfiles.input.IEdgePortCandidateProvider#getTargetPortCandidates}. + */ + getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var CurrentEdgePortsCandidateProvider:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.CurrentEdgePortsCandidateProvider} class + * given the provided edge. + * @param {yfiles.graph.IEdge} edge The edge. + */ + new (edge:yfiles.graph.IEdge):yfiles.input.CurrentEdgePortsCandidateProvider; + }; + /** + * An implementation of the {@link yfiles.graph.IPortOwner} + * interface that returns the ports that exist in the + * given {@link yfiles.graph.IPortOwner#ports}'s {@link yfiles.graph.IPortOwner} + * collection. + */ + export interface ExistingPortsCandidateProvider extends Object,yfiles.input.IPortCandidateProvider{ + /** + * The owner of the ports. + */ + portOwner:yfiles.graph.IPortOwner; + /** + * Returns all port candidates that apply for the provided opposite port candidate. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IPortCandidate} target The opposite port candidate. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given opposite port. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidatesForTarget}. + */ + getSourcePortCandidatesForTarget(context:yfiles.input.IInputModeContext,target:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; + /** + * Creates the list by adding a candidate for each existing port. + * @param {yfiles.input.IInputModeContext} context The graph to use for creating a new port. + * @return {yfiles.collections.IList.} A list of port candidates, each wrapping an existing port. + */ + createList(context:yfiles.input.IInputModeContext):yfiles.collections.IList; + /** + * Factory method that creates a candidate for the given port. + * @param {yfiles.graph.IPort} port The port to create a candidate for. + * @return {yfiles.input.DefaultPortCandidate} A new instance of {@link yfiles.input.DefaultPortCandidate}. + */ + createCandidate(port:yfiles.graph.IPort):yfiles.input.DefaultPortCandidate; + /** + * Returns all port candidates that apply for the provided opposite port candidate. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @param {yfiles.input.IPortCandidate} source The opposite port candidate. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given opposite port. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidatesForSource}. + */ + getTargetPortCandidatesForSource(context:yfiles.input.IInputModeContext,source:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; + /** + * Returns all port candidates that apply for source port candidates for the provided edge. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @param {yfiles.graph.IEdge} edge The edge for which source port candidates are sought. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given edge. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidatesForEdge}. + */ + getSourcePortCandidatesForEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):yfiles.collections.IEnumerable; + /** + * Returns all port candidates that apply for target port candidates for the provided edge. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @param {yfiles.graph.IEdge} edge The edge for which target port candidates are sought. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given edge. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidatesForEdge}. + */ + getTargetPortCandidatesForEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):yfiles.collections.IEnumerable; + /** + * Returns all source port candidates that belong to the context of this provider. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all source port candidates that are associated with the current context. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidates}. + */ + getSourcePortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Returns all target port candidates that belong to the context of this provider. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all target port candidates that are associated with the current context. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidates}. + */ + getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var ExistingPortsCandidateProvider:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.ExistingPortsCandidateProvider} class + * provided the given owner. + * @param {yfiles.graph.IPortOwner} portOwner The owner of the port collection. + */ + new (portOwner:yfiles.graph.IPortOwner):yfiles.input.ExistingPortsCandidateProvider; + }; + /** + * Simple implementation of the {@link yfiles.input.IEdgePortCandidateProvider} + * interface that returns a union of all {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidates} + * or {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidates} respectively of the entities in the graph. + * This implementation can be used to allow for {@link yfiles.input.PortRelocationHandle relocating an edge's port} to + * any available source or target port in the graph. + * Note that the candidates of edges will not be returned by default unless the {@link yfiles.input.AllCandidatesEdgePortCandidateProvider#addEdgeCandidates} property is set to true + */ + export interface AllCandidatesEdgePortCandidateProvider extends Object,yfiles.input.IEdgePortCandidateProvider{ + /** + * Determines whether or not edges will be queried for candidates. + * The default is false. + */ + addEdgeCandidates:boolean; + /** + * Returns the union of all {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidates} + * of the graph's {@link yfiles.graph.IGraph#nodes}. + * @param {yfiles.input.IInputModeContext} context The context. + * @return {yfiles.collections.IEnumerable.} A collection of all source port candidates in the graph. + * @see Specified by {@link yfiles.input.IEdgePortCandidateProvider#getSourcePortCandidates}. + */ + getSourcePortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Returns the union of all {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidates} + * of the graph's {@link yfiles.graph.IGraph#nodes}. + * @param {yfiles.input.IInputModeContext} context The context. + * @return {yfiles.collections.IEnumerable.} A collection of all source port candidates in the graph. + * @see Specified by {@link yfiles.input.IEdgePortCandidateProvider#getTargetPortCandidates}. + */ + getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var AllCandidatesEdgePortCandidateProvider:{ + $class:yfiles.lang.Class; + }; + /** + * An implementation of the {@link yfiles.input.IEdgePortCandidateProvider} + * interface that returns the candidates provided by the + * source and target node's {@link yfiles.input.IPortCandidateProvider} implementations + * or the existing edge's port, if no such provider is registered. + * This instance uses the lookup mechanism of the nodes to query the providers. + */ + export interface DefaultEdgePortsCandidateProvider extends yfiles.input.CurrentEdgePortsCandidateProvider{ + /** + * Returns all source port candidates that may be used for the edge. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all source port candidates that are associated with the current context edge. + * @see Specified by {@link yfiles.input.IEdgePortCandidateProvider#getSourcePortCandidates}. + */ + getSourcePortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Returns all source port candidates that may be used for the edge. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all target port candidates that are associated with the current context edge. + * @see Specified by {@link yfiles.input.IEdgePortCandidateProvider#getTargetPortCandidates}. + */ + getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var DefaultEdgePortsCandidateProvider:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.DefaultEdgePortsCandidateProvider} class + * given the provided edge. + * @param {yfiles.graph.IEdge} edge The edge. + */ + new (edge:yfiles.graph.IEdge):yfiles.input.DefaultEdgePortsCandidateProvider; + }; + /** + * A simple mutable {@link yfiles.input.IPortCandidateProvider} implementation + * that allows for adding {@link yfiles.input.IPortCandidate}s. + */ + export interface PortCandidateProvider extends yfiles.input.AbstractPortCandidateProvider{ + /** + * Add another instance to this provider's list of candidates. + * @param {yfiles.graph.IPortOwner} owner The owner to use for the candidate. + * @param {yfiles.graph.IPortLocationModelParameter} location The location of the candidate. + * @return {yfiles.input.IPortCandidate} The candidate created. + */ + addWithOwnerAndLocation(owner:yfiles.graph.IPortOwner,location:yfiles.graph.IPortLocationModelParameter):yfiles.input.IPortCandidate; + /** + * Returns the list of candidates used by this instance. + * @see {@link yfiles.input.PortCandidateProvider#getPortCandidates} + * @see {@link yfiles.input.PortCandidateProvider#addWithOwnerAndLocation} + * @see {@link yfiles.input.PortCandidateProvider#add} + * @see {@link yfiles.input.PortCandidateProvider#addExistingPorts} + */ + portCandidates:yfiles.collections.IList; + /** + * Adds existing ports of the given instance to this instance's list. + * @param {yfiles.graph.IPortOwner} owner The owner whose ports should be added. + */ + addExistingPorts(owner:yfiles.graph.IPortOwner):void; + /** + * Adds a single candidate to this instance's list of candidates. + * @param {yfiles.input.IPortCandidate} candidate The candidate to add. + * @return {yfiles.input.IPortCandidate} The candidate added. + */ + add(candidate:yfiles.input.IPortCandidate):yfiles.input.IPortCandidate; + /** + * Returns the internally held list of the candidates. + * @return {yfiles.collections.IEnumerable.} The {@link yfiles.input.PortCandidateProvider#portCandidates} of this instance. + * @see {@link yfiles.input.PortCandidateProvider#portCandidates} + * @see Overrides {@link yfiles.input.AbstractPortCandidateProvider#getPortCandidates} + */ + getPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var PortCandidateProvider:{ + $class:yfiles.lang.Class; + new ():yfiles.input.PortCandidateProvider; + }; + /** + * A specialized {@link yfiles.input.SnapLine} that is parallel to an edge segment and stores that + * edge. + * In addition to the line itself, this class has three special nape locations the represent + * the source, center and end location of the related edge segment. All snap lines of this type have + * the {@link yfiles.input.SnapLine#snapType} {@link yfiles.input.SnapLineSnapType#CENTER} and the + * {@link yfiles.input.SnapLine#resourceKey} {@link yfiles.input.SnapLine#SNAP_LINE_EDGE_SEGMENT_KEY}. + */ + export interface EdgeSegmentSnapLine extends yfiles.input.SnapLine{ + /** + * Gets the edge that is associated with this snap line. + */ + edge:yfiles.graph.IEdge; + /** + * Gets the direction vector of this snap line. + */ + direction:yfiles.geometry.PointD; + /** + * Gets the distance of this snap line from its related edge segment. + */ + distance:number; + /** + * Gets the segment index of the related edge segment. + */ + segmentIndex:number; + /** + * Gets the location that represents the source of the related segment on this line. + */ + segmentSource:yfiles.geometry.PointD; + /** + * Gets the location that represents the target of the related segment on this line. + */ + segmentTarget:yfiles.geometry.PointD; + /** + * Gets and sets the location of the source marker of this snap line. + * If this is null, the location of the {@link yfiles.input.EdgeSegmentSnapLine#segmentSource} is marked + * instead. + */ + sourceMarker:yfiles.geometry.PointD; + /** + * Gets and sets the location of the target marker of this snap line. + * If this is null, the location of the {@link yfiles.input.EdgeSegmentSnapLine#segmentTarget} is marked + * instead. + */ + targetMarker:yfiles.geometry.PointD; + } + var EdgeSegmentSnapLine:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.PointBasedSnapLine} class. + * @param {yfiles.graph.IEdge} edge The edge to assign to {@link yfiles.input.EdgeSegmentSnapLine#edge}. + * @param {yfiles.geometry.PointD} segmentSource + * The location that represents the source of the related segment on this + * line. In addition, this location is used as {@link yfiles.input.SnapLine#from} location. + * @param {yfiles.geometry.PointD} segmentTarget + * The location that represents the target of the related segment on this + * line. In addition, this location is used as {@link yfiles.input.SnapLine#to} location. + * @param {number} distance The distance of this snap line from its related edge segment. + * @param {number} segmentIndex The segment index of the related edge segment. + */ + new (edge:yfiles.graph.IEdge,segmentSource:yfiles.geometry.PointD,segmentTarget:yfiles.geometry.PointD,distance:number,segmentIndex:number):yfiles.input.EdgeSegmentSnapLine; + /** + * Initializes a new instance of the {@link yfiles.input.PointBasedSnapLine} class. + * @param {yfiles.graph.IEdge} edge The edge to assign to {@link yfiles.input.EdgeSegmentSnapLine#edge}. + * @param {yfiles.geometry.PointD} from The first location that delimits this snap line. + * @param {yfiles.geometry.PointD} to The second location that delimits this snap line. + * @param {yfiles.geometry.PointD} segmentSource + * The location that represents the source of the related segment on this + * line. + * @param {yfiles.geometry.PointD} segmentTarget + * The location that represents the target of the related segment on this + * line. + * @param {number} distance The distance of this snap line from its related edge segment. + * @param {number} segmentIndex The segment index of the related edge segment. + * @param {Object} tag A tag that is associated with this snap line. + * @param {number} weight The weight (importance) of this snap line. + */ + WithFromAndTo:{ + new (edge:yfiles.graph.IEdge,from:yfiles.geometry.PointD,to:yfiles.geometry.PointD,segmentSource:yfiles.geometry.PointD,segmentTarget:yfiles.geometry.PointD,distance:number,segmentIndex:number,tag:Object,weight:number):yfiles.input.EdgeSegmentSnapLine; + }; + }; + export enum SnapLineOrientation{ + /** + * Constant that describes a horizontal {@link yfiles.input.SnapLineOrientation orientation} of a snap line. + */ + HORIZONTAL, + /** + * Constant that describes a vertical {@link yfiles.input.SnapLineOrientation orientation} of a snap line. + */ + VERTICAL + } + /** + * A specialized {@link yfiles.input.OrthogonalSnapLine} that stores two {@link yfiles.graph.INode nodes} as additional information + * that can be used for the visualization. + * @see {@link yfiles.input.NodePairBasedSnapLine#firstNode} + * @see {@link yfiles.input.NodePairBasedSnapLine#secondNode} + */ + export interface NodePairBasedSnapLine extends yfiles.input.OrthogonalSnapLine{ + /** + * Gets the first node that is associated with this snap line. + * Usually this is one of the instances that induced this snap line. + */ + firstNode:yfiles.graph.INode; + /** + * Gets the second node that is associated with this snap line. + * Usually this is one of the instances that induced this snap line. + */ + secondNode:yfiles.graph.INode; + } + var NodePairBasedSnapLine:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.NodePairBasedSnapLine} class. + * @param {yfiles.graph.INode} firstNode The first node to assign to {@link yfiles.input.NodePairBasedSnapLine#firstNode}. + * @param {yfiles.graph.INode} secondNode The second node to assign to {@link yfiles.input.NodePairBasedSnapLine#secondNode}. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the snap line. This is one of {@link yfiles.input.SnapLineOrientation#HORIZONTAL} or {@link yfiles.input.SnapLineOrientation#VERTICAL}. + * @param {yfiles.input.SnapLineSnapType} snapType The type of the line that describes how other items will snap to this line. + * This is one of {@link yfiles.input.SnapLineSnapType#TOP}, {@link yfiles.input.SnapLineSnapType#BOTTOM}, {@link yfiles.input.SnapLineSnapType#LEFT}, {@link yfiles.input.SnapLineSnapType#RIGHT}, + * or {@link yfiles.input.SnapLineSnapType#CENTER}. + * @param {yfiles.system.ResourceKey} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.PointD} coordinates The coordinates of the center point of the snap line. + * @param {Object} tag A tag that is associated with this snap line - see {@link yfiles.input.SnapLine#tag} for a typical use + * of this value. + * @param {number} weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one + * with the greater weight will be used. + */ + new (firstNode:yfiles.graph.INode,secondNode:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapType,resourceKey:yfiles.system.ResourceKey,coordinates:yfiles.geometry.PointD,tag:Object,weight:number):yfiles.input.NodePairBasedSnapLine; + /** + * Initializes a new instance of the {@link yfiles.input.NodePairBasedSnapLine} class. + * @param {yfiles.graph.INode} firstNode The first node to assign to {@link yfiles.input.NodePairBasedSnapLine#firstNode}. + * @param {yfiles.graph.INode} secondNode The second node to assign to {@link yfiles.input.NodePairBasedSnapLine#secondNode}. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the snap line. This is one of {@link yfiles.input.SnapLineOrientation#HORIZONTAL} or {@link yfiles.input.SnapLineOrientation#VERTICAL}. + * @param {yfiles.input.SnapLineSnapType} snapType The type of the line that describes how other items will snap to this line. + * This is one of {@link yfiles.input.SnapLineSnapType#TOP}, {@link yfiles.input.SnapLineSnapType#BOTTOM}, {@link yfiles.input.SnapLineSnapType#LEFT}, {@link yfiles.input.SnapLineSnapType#RIGHT}, + * or {@link yfiles.input.SnapLineSnapType#CENTER}. + * @param {yfiles.system.ResourceKey} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.PointD} coordinates The coordinates of the center point of the snap line. + * @param {Object} tag A tag that is associated with this snap line - see {@link yfiles.input.SnapLine#tag} for a typical use + * of this value. + * @param {number} weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one + * with the greater weight will be used. + * @param {number} from The smaller value of the coordinate that delimits this snap line. + * @param {number} to The greater value of the coordinate that delimits this snap line. + */ + WithRange:{ + new (firstNode:yfiles.graph.INode,secondNode:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapType,resourceKey:yfiles.system.ResourceKey,coordinates:yfiles.geometry.PointD,from:number,to:number,tag:Object,weight:number):yfiles.input.NodePairBasedSnapLine; + }; + }; + /** + * A specialized {@link yfiles.input.OrthogonalSnapLine} that stores a {@link yfiles.input.PointBasedSnapLine#point} instance as additional information + * that can be used for the visualization. + */ + export interface PointBasedSnapLine extends yfiles.input.OrthogonalSnapLine{ + /** + * Gets the point that is associated with this snap line. + * Usually this is the instance that induced this snap line. + */ + point:yfiles.geometry.IPoint; + } + var PointBasedSnapLine:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.PointBasedSnapLine} class. + * @param {yfiles.geometry.IPoint} point The point to assign to {@link yfiles.input.PointBasedSnapLine#point}. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the snap line. This is one of {@link yfiles.input.SnapLineOrientation#HORIZONTAL} or {@link yfiles.input.SnapLineOrientation#VERTICAL}. + * @param {yfiles.input.SnapLineSnapType} snapType The type of the line that describes how other items will snap to this line. + * This is one of {@link yfiles.input.SnapLineSnapType#TOP}, {@link yfiles.input.SnapLineSnapType#BOTTOM}, {@link yfiles.input.SnapLineSnapType#LEFT}, {@link yfiles.input.SnapLineSnapType#RIGHT}, + * or {@link yfiles.input.SnapLineSnapType#CENTER}. + * @param {yfiles.system.ResourceKey} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.PointD} coordinates The coordinates of the center point of the snap line. + * @param {Object} tag A tag that is associated with this snap line - see {@link yfiles.input.SnapLine#tag} for a typical use + * of this value. + * @param {number} weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one + * with the greater weight will be used. + */ + new (point:yfiles.geometry.IPoint,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapType,resourceKey:yfiles.system.ResourceKey,coordinates:yfiles.geometry.PointD,tag:Object,weight:number):yfiles.input.PointBasedSnapLine; + /** + * Initializes a new instance of the {@link yfiles.input.PointBasedSnapLine} class. + * @param {yfiles.geometry.IPoint} point The point to assign to {@link yfiles.input.PointBasedSnapLine#point}. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the snap line. This is one of {@link yfiles.input.SnapLineOrientation#HORIZONTAL} or {@link yfiles.input.SnapLineOrientation#VERTICAL}. + * @param {yfiles.input.SnapLineSnapType} snapType The type of the line that describes how other items will snap to this line. + * This is one of {@link yfiles.input.SnapLineSnapType#TOP}, {@link yfiles.input.SnapLineSnapType#BOTTOM}, {@link yfiles.input.SnapLineSnapType#LEFT}, {@link yfiles.input.SnapLineSnapType#RIGHT}, + * or {@link yfiles.input.SnapLineSnapType#CENTER}. + * @param {yfiles.system.ResourceKey} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.PointD} coordinates The coordinates of the center point of the snap line. + * @param {Object} tag A tag that is associated with this snap line - see {@link yfiles.input.SnapLine#tag} for a typical use + * of this value. + * @param {number} weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one + * with the greater weight will be used. + * @param {number} from The smaller value of the coordinate that delimits this snap line. + * @param {number} to The greater value of the coordinate that delimits this snap line. + */ + WithRange:{ + new (point:yfiles.geometry.IPoint,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapType,resourceKey:yfiles.system.ResourceKey,coordinates:yfiles.geometry.PointD,from:number,to:number,tag:Object,weight:number):yfiles.input.PointBasedSnapLine; + }; + }; + /** + * A snap result represents a {@link yfiles.input.SnapLine} to which the current moved item + * will potentially snap. + */ + export interface SnapLineSnapResult extends yfiles.input.SnapResult{ + /** + * The snap line associated with this result. + */ + snapLine:yfiles.input.SnapLine; + /** + * The coordinates of the end point of the snap line. + * A visual representation of a snap line is usually drawn from the + * {@link yfiles.input.SnapLine#coordinates center} to these coordinates. This may, however, depend + * on the implementation. + */ + snappedCoordinates:yfiles.geometry.PointD; + /** + * The object that is moved and would be snapped with this SnapLineSnapResult. + */ + movedObject:Object; + /** + * The value to add to the mouse coordinates to snap to that result. + */ + delta:yfiles.geometry.PointD; + /** + * Returns a visual creator which is able to create a Visual for this snap result. + * @return {yfiles.drawing.IVisualCreator} A visual creator which creates a Visual which depicts this snap result. + * @see {@link yfiles.drawing.VoidVisualCreator#INSTANCE} + */ + getVisualCreator():yfiles.drawing.IVisualCreator; + /** + * Core method that performs the actual snapping. + * This implementation performs the snapping according to the {@link yfiles.input.SnapLineSnapResult#delta}. + * @param {yfiles.geometry.PointD} unSappedCoordinates The coordinates prior to the snapping. + * @param {yfiles.input.SnapState} currentSnapState The currently snapped coordinates and the state of the snapping. This instance can be modified by subclasses. + * @see Overrides {@link yfiles.input.SnapResult#snap} + */ + snap(unSappedCoordinates:yfiles.geometry.PointD,currentSnapState:yfiles.input.SnapState):void; + /** + * Checks whether this instance is still snapped given the final mouse coordinates. + * This implementation performs the check according to the {@link yfiles.input.SnapLineSnapResult#delta}. + * @param {yfiles.geometry.PointD} unsnappedCoordinates The unsnapped coordinates. + * @param {yfiles.input.SnapState} finalSnapState The final snap state that has been used by the client. + * @return {boolean} + * Whether the coordinates are still snapped for this instance. + * @see Overrides {@link yfiles.input.SnapResult#isSnapped} + */ + isSnapped(unsnappedCoordinates:yfiles.geometry.PointD,finalSnapState:yfiles.input.SnapState):boolean; + } + var SnapLineSnapResult:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this class. + * @param {number} weight The weight of this result. The higher the weight, the more important it is. + * @param {yfiles.geometry.PointD} delta The value to add to the mouse coordinates to snap to this result. + * @param {Object} tag The tag associated with this result. If more than one result uses the same tag (not null), + * only the one with the highest {@link yfiles.input.SnapResult#weight} will be rendered. + * @param {yfiles.input.SnapLine} snapLine The snap line this class would snap to or null if it doesn't snap to a SnapLine. + * @param {yfiles.geometry.PointD} snappedCoordinates The coordinates at the moved item at which the drawn snap line should end. + * @param {Object} movedObject The moved object for which this result is created. + */ + new (weight:number,delta:yfiles.geometry.PointD,tag:Object,snapLine:yfiles.input.SnapLine,snappedCoordinates:yfiles.geometry.PointD,movedObject:Object):yfiles.input.SnapLineSnapResult; + }; + /** + * An implementation of {@link yfiles.input.IPortCandidateProvider} that + * works for {@link yfiles.graph.IPortOwner} implementations that + * have {@link yfiles.drawing.IShapeGeometry} instances in their lookup. + */ + export interface ShapeGeometryPortCandidateProvider extends yfiles.input.AbstractPortCandidateProvider{ + /** + * Gets or sets a property that determines whether + * {@link yfiles.input.AbstractPortCandidateProvider#addExistingPortsFromList existing ports should be added to the list of ports}. + * The default is false + * @see {@link yfiles.input.CompositePortCandidateProvider} + * @see {@link yfiles.input.ExistingPortsCandidateProvider} + */ + addExistingPortsEnabled:boolean; + /** + * Gets or sets the minimum length a segment needs to have in order to be used + * to add port candidates. + * The default is 10. + */ + minimumSegmentLength:number; + /** + * Creates an enumeration of possibly port candidates. + * This method is used as a callback by most of the getter methods in this class. + * Subclasses should override this method to provide the same candidates for all + * use-cases. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable collection of port candidates. + */ + getPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Creates the list of port candidates using the {@link yfiles.drawing.IShapeGeometry} + * obtained from the portOwner's lookup. + * @return {yfiles.collections.IList.} A non-empty list of candidates. + * @param {yfiles.input.IInputModeContext} context The context in which the list is queried. + * @param {yfiles.graph.IPortOwner} portOwner The owner of the ports for which to create the list of candidates. + */ + createList(context:yfiles.input.IInputModeContext,portOwner:yfiles.graph.IPortOwner):yfiles.collections.IList; + } + var ShapeGeometryPortCandidateProvider:{ + $class:yfiles.lang.Class; + /** + * Creates an instance that inserts a port candidate at the center of each straight line segment. + * @param {yfiles.graph.IPortOwner} portOwner The owner to receive the shape geometry from + */ + new (portOwner:yfiles.graph.IPortOwner):yfiles.input.ShapeGeometryPortCandidateProvider; + /** + * Creates an instance that inserts a port candidate at the given ratios of each segment + * of the shape's path. + * @param {yfiles.graph.IPortOwner} portOwner The owner to receive the shape geometry from + * @param {number[]} ratios A number of double values that are interpreted as ratio values between 0.0 and 1.0. + */ + WithRatios:{ + new (portOwner:yfiles.graph.IPortOwner,ratios:number[]):yfiles.input.ShapeGeometryPortCandidateProvider; + }; + }; + export enum SnapLineSnapType{ + /** + * Describes snap lines to which nothing will snap. + */ + NONE, + /** + * Describes snap lines to which the top sides of rectangular elements will snap. + */ + TOP, + /** + * Describes snap lines to which the bottom sides of rectangular elements will snap. + */ + BOTTOM, + /** + * Describes snap lines to which the left sides of rectangular elements will snap. + */ + LEFT, + /** + * Describes snap lines to which the right sides of rectangular elements will snap. + */ + RIGHT, + /** + * Describes snap lines to which the center of elements will snap. + */ + CENTER, + /** + * Describes vertical snap lines. + */ + VERTICAL, + /** + * Describes horizontal snap lines. + */ + HORIZONTAL, + /** + * Describes snap lines to which all elements will snap at all sides. + */ + ALL + } + /** + * Interface that is used by the {@link yfiles.input.GraphSnapContext} for {@link yfiles.graph.INode nodes} to + * collect a number of {@link yfiles.input.SnapResult}s during the move/edit operation. + * This interface is queried from the {@link yfiles.support.ILookup} of the {@link yfiles.graph.INode}s that are being moved during + * the edit. + * @see {@link yfiles.input.GraphSnapContext} + * @see {@link yfiles.graph.NodeDecorator#nodeSnapResultProviderDecorator} + */ + export interface INodeSnapResultProvider extends Object{ + /** + * Called when a node is {@link yfiles.input.IDragHandler#handleMove dragged} to add {@link yfiles.input.SnapResult}s + * for {@link yfiles.input.OrthogonalSnapLine}s to which this node can potentially snap. + * @param {yfiles.input.GraphSnapContext} context The snap context which manages the snap lines and the settings. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The event argument to obtain the necessary information from and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult add results to}. + * @param {yfiles.geometry.RectD} suggestedLayout The {@link yfiles.graph.INode#layout layout} of the node if the node would not snap. + * @param {yfiles.graph.INode} node The node that is being moved. + * @see Specified by {@link yfiles.input.INodeSnapResultProvider#collectSnapResults}. + */ + collectSnapResults(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.RectD,node:yfiles.graph.INode):void; + } + var INodeSnapResultProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that can be used to find bends at specific locations in the canvas. + * This interface is mostly provided through the {@link yfiles.support.ILookup#lookup} of + * {@link yfiles.graph.IEdge} implementations. + */ + export interface IBendSelectionTester extends Object{ + /** + * Returns the bend at the given world coordinate position or null if there + * is no such bend. + * @param {yfiles.geometry.PointD} location The coordinates of the position in the world coordinate system. + * @param {yfiles.canvas.ICanvasContext} ctx The canvas context to use for querying the position. + * @return {yfiles.graph.IBend} The bend at the position or null. + * @see Specified by {@link yfiles.input.IBendSelectionTester#getBend}. + */ + getBend(location:yfiles.geometry.PointD,ctx:yfiles.canvas.ICanvasContext):yfiles.graph.IBend; + /** + * Returns the bends for the given marquee rectangle. + * @param {yfiles.geometry.RectD} box The marquee selection box in the world coordinate system. + * @param {yfiles.canvas.ICanvasContext} ctx The canvas context to use for querying the position. + * @return {yfiles.collections.IEnumerable.} An enumerable over the bends inside the marquee selection box. + * @see Specified by {@link yfiles.input.IBendSelectionTester#getBends}. + */ + getBends(box:yfiles.geometry.RectD,ctx:yfiles.canvas.ICanvasContext):yfiles.collections.IEnumerable; + } + var IBendSelectionTester:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that is used by the {@link yfiles.input.GraphSnapContext} for {@link yfiles.graph.IBend bends} to + * collect a number of {@link yfiles.input.SnapResult}s during the move/edit operation. + * This interface is queried from the {@link yfiles.support.ILookup} of the {@link yfiles.graph.IBend}s that are being moved during + * the edit. + * @see {@link yfiles.input.GraphSnapContext} + * @see {@link yfiles.graph.BendDecorator#bendSnapResultProviderDecorator} + */ + export interface IBendSnapResultProvider extends Object{ + /** + * Called when a node is {@link yfiles.input.IDragHandler#handleMove dragged} to add {@link yfiles.input.SnapResult}s + * for {@link yfiles.input.OrthogonalSnapLine}s to which this bend can potentially snap. + * @param {yfiles.input.GraphSnapContext} context The snap context which manages the snap lines and the settings. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The event argument to obtain the necessary information from and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult add results to}. + * @param {yfiles.geometry.PointD} suggestedLocation The {@link yfiles.graph.IBend#location location} of the bend if the + * bend would not snap. + * @param {yfiles.graph.IBend} bend The bend that is being moved. + * @see Specified by {@link yfiles.input.IBendSnapResultProvider#collectSnapResults}. + */ + collectSnapResults(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,suggestedLocation:yfiles.geometry.PointD,bend:yfiles.graph.IBend):void; + } + var IBendSnapResultProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for classes that help during snapping of parts of edges. + * An implementation of this class is obtained from the lookup of the {@link yfiles.graph.IEdge}s which are being edited during + * an operation where {@link yfiles.input.GraphSnapContext graph snapping} is involved. + * @see {@link yfiles.graph.EdgeDecorator#edgeSnapResultProviderDecorator} + */ + export interface IEdgeSnapResultProvider extends Object{ + /** + * Called to initialize the upcoming snapping operation. + * This method is called after the editing itself has been {@link yfiles.input.SnapContext#addInitializedListener initialized}. Implementations + * can then perform analysis of the movementInfos to perform precalculations for later use in + * {@link yfiles.input.IEdgeSnapResultProvider#collectSnapResults}. + * @param {yfiles.input.GraphSnapContext} context The context that is using this instance. + * @param {yfiles.input.MovementInfo[]} movementInfos The movement infos that describe the edge. + * @param {yfiles.graph.IEdge} edge The edge for which the snapping should be initialized. + * @see Specified by {@link yfiles.input.IEdgeSnapResultProvider#initializeSnapping}. + */ + initializeSnapping(context:yfiles.input.GraphSnapContext,movementInfos:yfiles.input.MovementInfo[],edge:yfiles.graph.IEdge):void; + /** + * Called to during the snapping operation whenever {@link yfiles.input.SnapContext#addCollectSnapResultsListener snap results are collected}. + * This method will be called for each collection of the results. + * @param {yfiles.input.GraphSnapContext} context The context that is using this instance. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The event argument to obtain the necessary information from and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult add results to}. + * @param {yfiles.input.MovementInfo[]} movementInfos The movement infos that describe the edge. + * @param {yfiles.graph.IEdge} edge The edge for which the {@link yfiles.input.SnapResult}s should be {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult collected}. + * @see Specified by {@link yfiles.input.IEdgeSnapResultProvider#collectSnapResults}. + */ + collectSnapResults(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,movementInfos:yfiles.input.MovementInfo[],edge:yfiles.graph.IEdge):void; + /** + * Called so that the implementation can clean up any collected state that has been precalculated during {@link yfiles.input.IEdgeSnapResultProvider#initializeSnapping}. + * @param {yfiles.input.GraphSnapContext} context The context that was using this instance. + * @param {yfiles.graph.IEdge} edge The edge for which this instance was initialized. + * @see Specified by {@link yfiles.input.IEdgeSnapResultProvider#cleanupSnapping}. + */ + cleanupSnapping(context:yfiles.input.GraphSnapContext,edge:yfiles.graph.IEdge):void; + } + var IEdgeSnapResultProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A generic composite implementation for the {@link yfiles.input.IPortCandidateProvider} + * interface. + */ + export interface CompositePortCandidateProvider extends Object,yfiles.input.IPortCandidateProvider{ + /** + * Returns all port candidates that apply for the provided opposite port candidate. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IPortCandidate} target The opposite port candidate. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given opposite port. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidatesForTarget}. + */ + getSourcePortCandidatesForTarget(context:yfiles.input.IInputModeContext,target:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; + /** + * Returns all port candidates that apply for the provided opposite port candidate. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @param {yfiles.input.IPortCandidate} source The opposite port candidate. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given opposite port. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidatesForSource}. + */ + getTargetPortCandidatesForSource(context:yfiles.input.IInputModeContext,source:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; + /** + * Returns all port candidates that apply for source port candidates for the provided edge. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @param {yfiles.graph.IEdge} edge The edge for which source port candidates are sought. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given edge. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidatesForEdge}. + */ + getSourcePortCandidatesForEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):yfiles.collections.IEnumerable; + /** + * Returns all port candidates that apply for target port candidates for the provided edge. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @param {yfiles.graph.IEdge} edge The edge for which target port candidates are sought. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given edge. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidatesForEdge}. + */ + getTargetPortCandidatesForEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):yfiles.collections.IEnumerable; + /** + * Returns all source port candidates that belong to the context of this provider. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all source port candidates that are associated with the current context. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidates}. + */ + getSourcePortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Returns all target port candidates that belong to the context of this provider. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all target port candidates that are associated with the current context. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidates}. + */ + getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var CompositePortCandidateProvider:{ + $class:yfiles.lang.Class; + /** + * Creates a composite out of the given providers. + * @param {yfiles.collections.IEnumerable.} providers The providers to create the composite from. + */ + FromProviderEnumerable:{ + new (providers:yfiles.collections.IEnumerable):yfiles.input.CompositePortCandidateProvider; + }; + /** + * Creates a composite out of the given providers. + * @param {yfiles.input.IPortCandidateProvider[]} providers The providers to create the composite from. + */ + FromProviders:{ + new (providers:yfiles.input.IPortCandidateProvider[]):yfiles.input.CompositePortCandidateProvider; + }; + }; + /** + * An abstract convenience implementation of the {@link yfiles.input.IPortCandidateProvider} interface. + */ + export interface AbstractPortCandidateProvider extends Object,yfiles.input.IPortCandidateProvider{ + /** + * The owner of the port candidate. + */ + portOwnerF:yfiles.graph.IPortOwner; + /** + * Returns the owner to use for the candidates. + */ + portOwner:yfiles.graph.IPortOwner; + /** + * Gets or sets the style to use for the creation of the port in {@link yfiles.input.AbstractPortCandidateProvider#createInstance}. + * A value of null will make the implementation use the corresponding current + * default port style. + */ + style:yfiles.drawing.IPortStyle; + /** + * Convenience method for subclasses that adds all existing {@link yfiles.graph.IPortOwner#ports} + * of the {@link yfiles.input.AbstractPortCandidateProvider#portOwner} to the provided list. + * @param {yfiles.collections.IList.} list The list to add candidates for existing ports to. + */ + addExistingPortsFromList(list:yfiles.collections.IList):void; + /** + * Factory method that creates a simple candidate that will use the {@link yfiles.input.AbstractPortCandidateProvider#createInstance} + * method of this instance to delegate {@link yfiles.input.IPortCandidate#createInstance} + * queries to. + * Calling this method requires the {@link yfiles.input.AbstractPortCandidateProvider#portOwnerF} field to be set previously. + * @param {yfiles.graph.IPortLocationModelParameter} location The location of the candidate. This instance is assigned by reference to the candidate. + * @return {yfiles.input.DefaultPortCandidate} A candidate whose {@link yfiles.input.IPortCandidate#createInstance} method + * delegates to this instance's {@link yfiles.input.AbstractPortCandidateProvider#createInstance}. + */ + createCallbackPortForParameter(location:yfiles.graph.IPortLocationModelParameter):yfiles.input.DefaultPortCandidate; + /** + * Factory method that creates a simple candidate that will use the {@link yfiles.input.AbstractPortCandidateProvider#createInstance} + * method of this instance to delegate {@link yfiles.input.IPortCandidate#createInstance} + * queries to. + * @param {yfiles.geometry.IPoint} location The location of the candidate. This instance is assigned by reference to the candidate. + * @return {yfiles.input.IPortCandidate} A candidate whose {@link yfiles.input.IPortCandidate#createInstance} method + * delegates to this instance's {@link yfiles.input.AbstractPortCandidateProvider#createInstance}. + */ + createCallbackPortForLocation(location:yfiles.geometry.IPoint):yfiles.input.IPortCandidate; + /** + * Factory method that creates a simple candidate that will use the {@link yfiles.input.AbstractPortCandidateProvider#createInstance} + * method of this instance to delegate {@link yfiles.input.IPortCandidate#createInstance} + * queries to. + * @param {yfiles.graph.IPortLocationModelParameter} location The location of the candidate. This instance is assigned by reference to the candidate. + * @param {yfiles.graph.IPortOwner} owner The owner to use for the candidate. + * @return {yfiles.input.DefaultPortCandidate} A candidate whose {@link yfiles.input.IPortCandidate#createInstance} method + * delegates to this instance's {@link yfiles.input.AbstractPortCandidateProvider#createInstance}. + */ + createCallbackForOwnerAndParameter(owner:yfiles.graph.IPortOwner,location:yfiles.graph.IPortLocationModelParameter):yfiles.input.DefaultPortCandidate; + /** + * Factory method that creates a simple candidate that will use the {@link yfiles.input.AbstractPortCandidateProvider#createInstance} + * method of this instance to delegate {@link yfiles.input.IPortCandidate#createInstance} + * queries to. + * @param {yfiles.graph.IPortLocationModel} model The model to dynamically create the parameter from. + * @param {yfiles.geometry.IPoint} location The location of the candidate. This instance is assigned by reference to the candidate. + * @param {yfiles.graph.IPortOwner} owner The owner to use for the candidate. + * @return {yfiles.input.IPortCandidate} A candidate whose {@link yfiles.input.IPortCandidate#createInstance} method + * delegates to this instance's {@link yfiles.input.AbstractPortCandidateProvider#createInstance}. + */ + createCallbackPortForOwnerAndModel(owner:yfiles.graph.IPortOwner,model:yfiles.graph.IPortLocationModel,location:yfiles.geometry.IPoint):yfiles.input.IPortCandidate; + /** + * Factory method that creates a simple candidate that will use the {@link yfiles.input.AbstractPortCandidateProvider#createInstance} + * method of this instance to delegate {@link yfiles.input.IPortCandidate#createInstance} + * queries to. + * @param {yfiles.geometry.IPoint} location The location of the candidate. This instance is assigned by reference to the candidate. + * @param {yfiles.graph.IPortOwner} owner The owner to use for the candidate. + * @return {yfiles.input.IPortCandidate} A candidate whose {@link yfiles.input.IPortCandidate#createInstance} method + * delegates to this instance's {@link yfiles.input.AbstractPortCandidateProvider#createInstance}. + */ + createCallbackPortForOwnerAndLocation(owner:yfiles.graph.IPortOwner,location:yfiles.geometry.IPoint):yfiles.input.IPortCandidate; + /** + * Factory method that creates a simple candidate that will use the {@link yfiles.input.AbstractPortCandidateProvider#createInstance} + * method of this instance to delegate {@link yfiles.input.IPortCandidate#createInstance} + * queries to. + * @param {yfiles.graph.IPortLocationModel} model The model to dynamically create the parameter from, can be null, in which case the + * default for the owner type will be used. + * @param {yfiles.geometry.IPoint} location The location of the candidate. This instance is assigned by reference to the candidate. + * @param {yfiles.graph.IPortOwner} owner The owner to use for the candidate. + * @param {boolean} valid Whether the port should be {@link yfiles.input.PortCandidateValidity#VALID}. + * @return {yfiles.input.IPortCandidate} A candidate whose {@link yfiles.input.IPortCandidate#createInstance} method + * delegates to this instance's {@link yfiles.input.AbstractPortCandidateProvider#createInstance}. + */ + createCallbackPort(owner:yfiles.graph.IPortOwner,model:yfiles.graph.IPortLocationModel,location:yfiles.geometry.IPoint,valid:boolean):yfiles.input.IPortCandidate; + /** + * Callback method used by the ports created using the factory methods {@link yfiles.input.AbstractPortCandidateProvider#createCallbackPortForParameter}. + * This method can be overridden by subclasses to perform more sophisticated candidate creation logic. + * @param {yfiles.input.IInputModeContext} context The context in which the instance is created. + * @param {yfiles.input.DefaultPortCandidate} candidate The candidate to create a port for. + * @param {yfiles.geometry.PointD} suggestedLocation The location to get a candidate for. + * @return {yfiles.input.IPortCandidate} The new candidate whose {@link yfiles.input.IPortCandidate#validity} may not be {@link yfiles.input.PortCandidateValidity#DYNAMIC}. + */ + getCandidateAt(context:yfiles.input.IInputModeContext,candidate:yfiles.input.DefaultPortCandidate,suggestedLocation:yfiles.geometry.PointD):yfiles.input.IPortCandidate; + /** + * Callback method used by the ports created using the factory methods {@link yfiles.input.AbstractPortCandidateProvider#createCallbackPortForParameter}. + * This method can be overridden by subclasses to perform more sophisticated port creation logic. + * @param {yfiles.input.IInputModeContext} context The context in which the instance is created. + * @param {yfiles.input.DefaultPortCandidate} candidate The candidate to create a port for. + * @return {yfiles.graph.IPort} The new port. + */ + createInstance(context:yfiles.input.IInputModeContext,candidate:yfiles.input.DefaultPortCandidate):yfiles.graph.IPort; + /** + * The tag to assign to the port in {@link yfiles.input.AbstractPortCandidateProvider#createInstance}. + */ + tag:Object; + /** + * Convenience implementation that simply delegates to {@link yfiles.input.AbstractPortCandidateProvider#getPortCandidates}. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidatesForTarget}. + */ + getSourcePortCandidatesForTarget(context:yfiles.input.IInputModeContext,target:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; + /** + * Convenience implementation that simply delegates to {@link yfiles.input.AbstractPortCandidateProvider#getPortCandidates}. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidatesForSource}. + */ + getTargetPortCandidatesForSource(context:yfiles.input.IInputModeContext,source:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; + /** + * Convenience implementation that simply delegates to {@link yfiles.input.AbstractPortCandidateProvider#getPortCandidates}. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidatesForEdge}. + */ + getSourcePortCandidatesForEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):yfiles.collections.IEnumerable; + /** + * Convenience implementation that simply delegates to {@link yfiles.input.AbstractPortCandidateProvider#getPortCandidates}. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidatesForEdge}. + */ + getTargetPortCandidatesForEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):yfiles.collections.IEnumerable; + /** + * Convenience implementation that simply delegates to {@link yfiles.input.AbstractPortCandidateProvider#getPortCandidates}. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidates}. + */ + getSourcePortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Convenience implementation that simply delegates to {@link yfiles.input.AbstractPortCandidateProvider#getPortCandidates}. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidates}. + */ + getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Creates an enumeration of possibly port candidates. + * This method is used as a callback by most of the getter methods in this class. + * Subclasses should override this method to provide the same candidates for all + * use-cases. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable collection of port candidates. + */ + getPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var AbstractPortCandidateProvider:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.AbstractPortCandidateProvider} class. + */ + new ():yfiles.input.AbstractPortCandidateProvider; + /** + * Initializes a new instance of the {@link yfiles.input.AbstractPortCandidateProvider} class. + * Populates the {@link yfiles.input.AbstractPortCandidateProvider#portOwnerF} field using the provided argument. + * @param {yfiles.graph.IPortOwner} portOwner The port owner used for {@link yfiles.input.AbstractPortCandidateProvider#portOwnerF}. + */ + AbstractPortCandidateProvider:{ + new (portOwner:yfiles.graph.IPortOwner):yfiles.input.AbstractPortCandidateProvider; + }; + }; + /** + * Callback interface for instances that can create bends for a given edge and graph. + * Implementations of this interface may be found in the {@link yfiles.support.ILookup#lookup} + * of {@link yfiles.graph.IEdge} instances. + * This interface is used by {@link yfiles.input.GraphEditorInputMode} to create new bends + * for an edge as soon as the user performs the bend creation gesture. + * @see {@link yfiles.input.GraphEditorInputMode#onCreateBendInputModeBendCreated} + */ + export interface IBendCreator extends Object{ + /** + * Creates a bend at the given graph for the given edge at the position supplied. + * @param {yfiles.input.IInputModeContext} context The context for which the bend should be created. + * @param {yfiles.graph.IGraph} graph The graph, the edge belongs to. + * @param {yfiles.graph.IEdge} edge The edge. + * @param {yfiles.geometry.PointD} location The preferred coordinates of the bend. + * @return {number} The index of the bend in the edges' {@link yfiles.graph.IEdge#bends} or -1 if no bend has been created. + * @see Specified by {@link yfiles.input.IBendCreator#createBend}. + */ + createBend(context:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge,location:yfiles.geometry.PointD):number; + } + var IBendCreator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A simple default implementation of an {@link yfiles.input.IPortCandidate}. + * Subclasses need to override {@link yfiles.input.DefaultPortCandidate#createInstanceWithParameterAndStyle} if they + * don't {@link yfiles.input.DefaultPortCandidate#setInstance set} a port instance. + */ + export interface DefaultPortCandidate extends Object,yfiles.input.IPortCandidate{ + /** + * Determines whether this candidate is a valid one depending on the context it has + * been obtained from. + * @see Specified by {@link yfiles.input.IPortCandidate#validity}. + */ + validity:yfiles.input.PortCandidateValidity; + /** + * Gets or set the tag for this candidate. + * The interpretation of this value is implementation dependent + * and may be used for visual feedback or interactive behavior. + * @see Specified by {@link yfiles.input.IPortCandidate#candidateTag}. + */ + candidateTag:Object; + /** + * Gets or sets the port tag to create the port with. + * Value: The port tag to use when the port is created. + */ + portTag:Object; + /** + * Gets or sets the model parameter that will be used for the {@link yfiles.graph.IPort#locationModelParameter} + * if this candidate is chosen. + * The parameter which may not be null. + * @see Specified by {@link yfiles.input.IPortCandidate#locationModelParameter}. + */ + locationModelParameter:yfiles.graph.IPortLocationModelParameter; + /** + * The model that will be used by this instance to determine the new {@link yfiles.input.DefaultPortCandidate#locationModelParameter} + * if the {@link yfiles.input.DefaultPortCandidate#getPortCandidateAt} is called and the {@link yfiles.input.DefaultPortCandidate#validity} is set to + * {@link yfiles.input.PortCandidateValidity#DYNAMIC}. + */ + model:yfiles.graph.IPortLocationModel; + /** + * Gets or sets the style to use for the newly created port. + * Value: The style. If this property is null, the current default in the graph will be used. + */ + style:yfiles.drawing.IPortStyle; + /** + * Gets or sets the owner of the port to be created. + * @see Specified by {@link yfiles.input.IPortCandidate#owner}. + */ + owner:yfiles.graph.IPortOwner; + /** + * Returns the instance provided to the constructor or to the {@link yfiles.input.DefaultPortCandidate#setInstance setter}. + * @return {yfiles.graph.IPort} + * The instance to use or null otherwise. + * @see {@link yfiles.input.DefaultPortCandidate#createInstance} + * @see Specified by {@link yfiles.input.IPortCandidate#getInstance}. + */ + getInstance():yfiles.graph.IPort; + /** + * Returns a candidate that is derived from this instance that best fits the provided location. + * The returned implementation will finally call {@link yfiles.input.DefaultPortCandidate#createInstanceWithParameterAndStyle} + * using the newly calculated {@link yfiles.input.DefaultPortCandidate#locationModelParameter}. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context for which a concrete candidate is queried. + * @param {yfiles.geometry.PointD} location The location for which a candidate should be returned. + * @return {yfiles.input.IPortCandidate} + * A {@link yfiles.input.IPortCandidate} implementation whose {@link yfiles.input.DefaultPortCandidate#validity} is guaranteed to + * be non-{@link yfiles.input.PortCandidateValidity#DYNAMIC}. + * @see {@link yfiles.input.DefaultPortCandidate#validity} + * @see Specified by {@link yfiles.input.IPortCandidate#getPortCandidateAt}. + */ + getPortCandidateAt(inputModeContext:yfiles.input.IInputModeContext,location:yfiles.geometry.PointD):yfiles.input.IPortCandidate; + /** + * Sets the instance that will be returned by {@link yfiles.input.DefaultPortCandidate#getInstance} and {@link yfiles.input.DefaultPortCandidate#createInstance}. + * @param {yfiles.graph.IPort} port A port that already exists in the graph or null. + */ + setInstance(port:yfiles.graph.IPort):void; + /** + * This implementation will throw a {@link yfiles.system.NotSupportedException} if the validity is {@link yfiles.input.PortCandidateValidity#DYNAMIC}. + * This implementation will delegate to the + * {@link yfiles.input.DefaultPortCandidate#createInstanceWithParameterAndStyle} + * method. + * @see Specified by {@link yfiles.input.IPortCandidate#createInstance}. + */ + createInstance(inputModeContext:yfiles.input.IInputModeContext):yfiles.graph.IPort; + /** + * Actually creates the {@link yfiles.graph.IPort} instance. + * This method is called in response to a call to {@link yfiles.input.DefaultPortCandidate#createInstance} on this instance + * and the instances created by {@link yfiles.input.DefaultPortCandidate#getPortCandidateAt}. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context. + * @param {yfiles.graph.IGraph} graph The graph to add the port to. + * @param {yfiles.graph.IPortLocationModelParameter} parameter The parameter to use. + * @param {yfiles.drawing.IPortStyle} style The style to use. + * @param {Object} tag The tag to use. + * @return {yfiles.graph.IPort} The newly created port. + */ + createInstanceWithParameterAndStyle(inputModeContext:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,parameter:yfiles.graph.IPortLocationModelParameter,style:yfiles.drawing.IPortStyle,tag:Object):yfiles.graph.IPort; + } + var DefaultPortCandidate:{ + $class:yfiles.lang.Class; + /** + * Creates a candidate that uses the defaults that are declared for the current graph. + * @param {yfiles.graph.IPortOwner} owner The owner to use. + */ + new (owner:yfiles.graph.IPortOwner):yfiles.input.DefaultPortCandidate; + /** + * Constructor for instance-less implementations. + * @param {yfiles.graph.IPortOwner} owner The owner. + * @param {yfiles.graph.IPortLocationModelParameter} location The location. + */ + FromOwnerAndParameter:{ + new (owner:yfiles.graph.IPortOwner,location:yfiles.graph.IPortLocationModelParameter):yfiles.input.DefaultPortCandidate; + }; + /** + * Constructor for instance-less implementations. + * @param {yfiles.graph.IPortOwner} owner The owner. + * @param {yfiles.graph.IPortLocationModel} model The model. + */ + FromOwnerAndModel:{ + new (owner:yfiles.graph.IPortOwner,model:yfiles.graph.IPortLocationModel):yfiles.input.DefaultPortCandidate; + }; + /** + * Creates a candidate using the given port as the template. + * @param {yfiles.graph.IPort} port The port to use. + */ + FromPort:{ + new (port:yfiles.graph.IPort):yfiles.input.DefaultPortCandidate; + }; + }; + /** + * Interface that is used by the {@link yfiles.input.GraphSnapContext} for {@link yfiles.graph.IPort port} to + * collect a number of {@link yfiles.input.SnapResult}s during the move/edit operation. + * This interface is queried from the {@link yfiles.support.ILookup} of the {@link yfiles.graph.IPort}s that are being moved during + * the edit. + * @see {@link yfiles.input.GraphSnapContext} + * @see {@link yfiles.graph.PortDecorator#portSnapResultProviderDecorator} + */ + export interface IPortSnapResultProvider extends Object{ + /** + * Called when a node is {@link yfiles.input.IDragHandler#handleMove dragged} to add {@link yfiles.input.SnapResult}s + * for {@link yfiles.input.OrthogonalSnapLine}s to which this bend can potentially snap. + * @param {yfiles.input.GraphSnapContext} context The snap context which manages the snap lines and the settings. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The event argument to obtain the necessary information from and {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult add results to}. + * @param {yfiles.geometry.PointD} suggestedLocation The {@link yfiles.graph.IBend#location location} of the bend if the + * bend would not snap. + * @param {yfiles.graph.IPort} port The port that is being moved + * @see Specified by {@link yfiles.input.IPortSnapResultProvider#collectSnapResults}. + */ + collectSnapResults(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,suggestedLocation:yfiles.geometry.PointD,port:yfiles.graph.IPort):void; + } + var IPortSnapResultProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface can be used to query {@link yfiles.input.IPortCandidate}s + * for a specific existing {@link yfiles.graph.IEdge}. + * Implementations of this interface can be queried using the {@link yfiles.support.ILookup#lookup} + * method of an {@link yfiles.graph.IEdge}implementation. + * This interface provides alternative candidates for the {@link yfiles.graph.IEdge#sourcePort} or + * {@link yfiles.graph.IEdge#targetPort} of an edge. + */ + export interface IEdgePortCandidateProvider extends Object{ + /** + * Returns all source port candidates that may be used for the edge. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all source port candidates that are associated with the current context edge. + * @see Specified by {@link yfiles.input.IEdgePortCandidateProvider#getSourcePortCandidates}. + */ + getSourcePortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Returns all source port candidates that may be used for the edge. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all target port candidates that are associated with the current context edge. + * @see Specified by {@link yfiles.input.IEdgePortCandidateProvider#getTargetPortCandidates}. + */ + getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var IEdgePortCandidateProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface can be used to query {@link yfiles.input.IPortCandidate}s + * for a specific {@link yfiles.graph.IPortOwner} with respect to a given + * opposite {@link yfiles.input.IPortCandidate} or {@link yfiles.graph.IEdge}. + * Implementations of this interface may be queried using the {@link yfiles.support.ILookup#lookup} + * method of {@link yfiles.graph.IPortOwner} implementations like {@link yfiles.graph.INode}. + * @see {@link yfiles.graph.NodeDecorator#portCandidateProviderDecorator} + */ + export interface IPortCandidateProvider extends Object{ + /** + * Returns all port candidates that apply for the provided opposite port candidate. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IPortCandidate} target The opposite port candidate. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given opposite port. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidatesForTarget}. + */ + getSourcePortCandidatesForTarget(context:yfiles.input.IInputModeContext,target:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; + /** + * Returns all port candidates that apply for the provided opposite port candidate. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @param {yfiles.input.IPortCandidate} source The opposite port candidate. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given opposite port. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidatesForSource}. + */ + getTargetPortCandidatesForSource(context:yfiles.input.IInputModeContext,source:yfiles.input.IPortCandidate):yfiles.collections.IEnumerable; + /** + * Returns all port candidates that apply for source port candidates for the provided edge. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @param {yfiles.graph.IEdge} edge The edge for which source port candidates are sought. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given edge. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidatesForEdge}. + */ + getSourcePortCandidatesForEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):yfiles.collections.IEnumerable; + /** + * Returns all port candidates that apply for target port candidates for the provided edge. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @param {yfiles.graph.IEdge} edge The edge for which target port candidates are sought. + * @return {yfiles.collections.IEnumerable.} An enumerable over all port candidates that are associated with the given edge. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidatesForEdge}. + */ + getTargetPortCandidatesForEdge(context:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):yfiles.collections.IEnumerable; + /** + * Returns all source port candidates that belong to the context of this provider. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all source port candidates that are associated with the current context. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getSourcePortCandidates}. + */ + getSourcePortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + /** + * Returns all target port candidates that belong to the context of this provider. + * The enumerable may both contain {@link yfiles.input.PortCandidateValidity valid, invalid, and dynamic} + * port candidates. + * @param {yfiles.input.IInputModeContext} context The context for which the candidates should be provided. + * @return {yfiles.collections.IEnumerable.} An enumerable over all target port candidates that are associated with the current context. + * @see Specified by {@link yfiles.input.IPortCandidateProvider#getTargetPortCandidates}. + */ + getTargetPortCandidates(context:yfiles.input.IInputModeContext):yfiles.collections.IEnumerable; + } + var IPortCandidateProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Helper class that carries information about a reshape operation. + * This class is mainly intended for use by {@link yfiles.input.INodeReshapeSnapResultProvider#collectSnapResults}. + */ + export interface ReshapeRectangleContext extends Object{ + /** + * Gets the initial bounds of the node. + * Value: The initial bounds of the node. + */ + initialBounds:yfiles.geometry.RectD; + /** + * Gets the minimum size of the node. + * Value: The minimum size. + */ + minimumSize:yfiles.geometry.ISize; + /** + * Gets or sets the maximum size of the node. + * Value: The maximum size. + */ + maximumSize:yfiles.geometry.ISize; + /** + * Gets minimum area the node's layout needs to encompass. + * Value: The minimum enclosed area. If the area is {@link yfiles.support.RectangleExtensions#isEmpty empty} the value can be ignored. + */ + minimumEnclosedArea:yfiles.geometry.IRectangle; + /** + * Gets the position of the reshape handle. + * Value: The reshape position. + */ + reshapePosition:yfiles.input.HandlePositions; + /** + * Gets the factor by which the top left corner of the node layout changes when the handle is dragged. + * Value: The top left change factor. + */ + topLeftChangeFactor:yfiles.geometry.PointD; + /** + * Gets the factor by which the bottom right corner of the node layout changes when the handle is dragged. + * Value: The bottom right change factor. + */ + bottomRightChangeFactor:yfiles.geometry.PointD; + /** + * Gets the factor by which the size of the node layout changes when the handle is dragged. + * Value: The size change factor. + */ + sizeChangeFactor:yfiles.geometry.SizeD; + } + var ReshapeRectangleContext:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.ReshapeRectangleContext} class. + * @param {yfiles.geometry.RectD} initialBounds The initial bounds of the node. + * @param {yfiles.geometry.ISize} minimumSize The minimum size of the node. + * @param {yfiles.geometry.ISize} maximumSize The maximum size of the node. + * @param {yfiles.geometry.IRectangle} minimumEnclosedArea The minimum area the node's layout needs to encompass. + * @param {yfiles.input.HandlePositions} reshapePosition The position of the reshape handle. + * @param {yfiles.geometry.PointD} topLeftChangeFactor The factor by which the top left corner of the node layout changes when the handle is dragged. + * @param {yfiles.geometry.PointD} bottomRightChangeFactor The factor by which the bottom right corner of the node layout changes when the handle is dragged. + * @param {yfiles.geometry.SizeD} sizeChangeFactor The factor by which the size of the node layout changes when the handle is dragged. + */ + new (initialBounds:yfiles.geometry.RectD,minimumSize:yfiles.geometry.ISize,maximumSize:yfiles.geometry.ISize,minimumEnclosedArea:yfiles.geometry.IRectangle,reshapePosition:yfiles.input.HandlePositions,topLeftChangeFactor:yfiles.geometry.PointD,bottomRightChangeFactor:yfiles.geometry.PointD,sizeChangeFactor:yfiles.geometry.SizeD):yfiles.input.ReshapeRectangleContext; + }; + /** + * Interface for an implementation which evaluates a list of given {@link yfiles.input.SnapLine}s for a + * node which is resized and adds a set of {@link yfiles.input.SnapResult}s for sizes to which this node + * can potentially snap. + */ + export interface INodeReshapeSnapResultProvider extends Object{ + /** + * Called when a node's handle is {@link yfiles.input.IDragHandler#handleMove dragged} to add + * {@link yfiles.input.SnapResult}s for {@link yfiles.input.OrthogonalSnapLine}s or sizes to which this node can potentially + * snap during resizing. + * @param {yfiles.input.GraphSnapContext} context The snap context which manages the snap lines and the settings. + * @param {yfiles.input.CollectSnapResultsEventArgs} args The event argument to obtain the context from and add the results to. + * @param {yfiles.graph.INode} node The node that is being reshaped. + * @param {yfiles.input.ReshapeRectangleContext} reshapeRectangleContext Carries information about the reshape operation. + * @see Specified by {@link yfiles.input.INodeReshapeSnapResultProvider#collectSnapResults}. + */ + collectSnapResults(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,node:yfiles.graph.INode,reshapeRectangleContext:yfiles.input.ReshapeRectangleContext):void; + } + var INodeReshapeSnapResultProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum PortCandidateValidity{ + /** + * The candidate is valid and can be used to connect an edge to. + */ + VALID, + /** + * The candidate should not be used to connect an edge to. + */ + INVALID, + /** + * The candidate cannot be used to create a port, instead {@link yfiles.input.IPortCandidate#getPortCandidateAt} + * needs to be called to obtain a {@link yfiles.input.IPortCandidate} that is either + * {@link yfiles.input.PortCandidateValidity#VALID} or {@link yfiles.input.PortCandidateValidity#INVALID}. + */ + DYNAMIC + } + /** + * An interface for possible {@link yfiles.graph.IPort} candidates used by + * {@link yfiles.input.IPortCandidateProvider} and the like. + * Note that if an instance's {@link yfiles.input.IPortCandidate#validity} property is + * {@link yfiles.input.PortCandidateValidity#DYNAMIC} this instance {@link yfiles.input.IPortCandidate#getPortCandidateAt} method + * serves as a factory for the actual candidates. + * @see {@link yfiles.input.IEdgePortCandidateProvider} + * @see {@link yfiles.input.IPortCandidateProvider} + * @see {@link yfiles.input.DefaultPortCandidate} + */ + export interface IPortCandidate extends Object{ + /** + * Possibly yields a user defined tag for this candidate. + * The interpretation of this value is implementation dependent + * and may be used for visual feedback or interactive behavior. + * @see Specified by {@link yfiles.input.IPortCandidate#candidateTag}. + */ + candidateTag:Object; + /** + * Determines whether this instance is a valid port candidate. + * Implementations of {@link yfiles.input.IPortCandidateProvider} may return + * sets of port candidates where some of them are marked as invalid e.g. in order + * to provide visual feedback. If the value is {@link yfiles.input.PortCandidateValidity#DYNAMIC}, + * method {@link yfiles.input.IPortCandidate#getPortCandidateAt} needs to be used to determine a concrete candidate instance. + * @see {@link yfiles.input.IPortCandidate#getPortCandidateAt} + * @see Specified by {@link yfiles.input.IPortCandidate#validity}. + */ + validity:yfiles.input.PortCandidateValidity; + /** + * Returns a candidate that is derived from this instance that best fits the provided location. + * This method needs to be called by clients if the {@link yfiles.input.IPortCandidate#validity} of this instance is + * {@link yfiles.input.PortCandidateValidity#DYNAMIC}. In that case calling this method must return an instance whose + * validity is not {@link yfiles.input.PortCandidateValidity#DYNAMIC}. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context for which a concrete candidate is queried. + * @param {yfiles.geometry.PointD} location The location for which a candidate should be returned. + * @return {yfiles.input.IPortCandidate} A {@link yfiles.input.IPortCandidate} implementation whose {@link yfiles.input.IPortCandidate#validity} is guaranteed to + * be non-{@link yfiles.input.PortCandidateValidity#DYNAMIC}. + * @see {@link yfiles.input.IPortCandidate#validity} + * @see Specified by {@link yfiles.input.IPortCandidate#getPortCandidateAt}. + */ + getPortCandidateAt(inputModeContext:yfiles.input.IInputModeContext,location:yfiles.geometry.PointD):yfiles.input.IPortCandidate; + /** + * Returns the model parameter that will be used for the {@link yfiles.graph.IPort#locationModelParameter} + * if this candidate is chosen. + * Note that the value of this property is undefined if this instance's {@link yfiles.input.IPortCandidate#validity} + * is {@link yfiles.input.PortCandidateValidity#DYNAMIC}. In this case, the parameter needs to be obtained via the + * {@link yfiles.input.IPortCandidate#getPortCandidateAt} instance. + * @see Specified by {@link yfiles.input.IPortCandidate#locationModelParameter}. + */ + locationModelParameter:yfiles.graph.IPortLocationModelParameter; + /** + * Returns the possible owner of the port to be created for this candidate. + * @see Specified by {@link yfiles.input.IPortCandidate#owner}. + */ + owner:yfiles.graph.IPortOwner; + /** + * Returns the instance that is already live in the graph if this candidate wraps an + * existing port or null otherwise. + * @return {yfiles.graph.IPort} The instance to use or null otherwise. + * @see {@link yfiles.input.IPortCandidate#createInstance} + * @see Specified by {@link yfiles.input.IPortCandidate#getInstance}. + */ + getInstance():yfiles.graph.IPort; + /** + * If the client decides to use this port candidate, this method will serve as a factory to create + * the instance. + * If this candidate wraps an existing port, it may return that {@link yfiles.input.IPortCandidate#getInstance instance}. + * If this instance's {@link yfiles.input.IPortCandidate#validity} is {@link yfiles.input.PortCandidateValidity#DYNAMIC} this method may + * throw an {@link yfiles.system.NotSupportedException}. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context for which the port will be created. + * Implementations can depend on it providing an {@link yfiles.graph.IGraph} instance in the lookup of the instance. + * @return {yfiles.graph.IPort} The port instance to use if this candidate has been chosen. This method may not return null. + * @see {@link yfiles.graph.GraphExtensions#getGraph} + * @see {@link yfiles.input.IPortCandidate#getInstance} + * @see {@link yfiles.input.IPortCandidate#getPortCandidateAt} + * @throws {yfiles.system.NotSupportedException} If the {@link yfiles.input.IPortCandidate#validity} is {@link yfiles.input.PortCandidateValidity#DYNAMIC}. + * @see Specified by {@link yfiles.input.IPortCandidate#createInstance}. + */ + createInstance(inputModeContext:yfiles.input.IInputModeContext):yfiles.graph.IPort; + } + var IPortCandidate:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A specialized {@link yfiles.input.OrthogonalSnapLine} that stores a {@link yfiles.input.NodeBasedSnapLine#node} as additional information + * that can be used for the visualization. + */ + export interface NodeBasedSnapLine extends yfiles.input.OrthogonalSnapLine{ + /** + * Gets the node that is associated with this snap line. + * Usually this is the instance that induced this snap line. + */ + node:yfiles.graph.INode; + } + var NodeBasedSnapLine:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.NodeBasedSnapLine} class. + * @param {yfiles.graph.INode} node The node to assign to {@link yfiles.input.NodeBasedSnapLine#node}. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the snap line. This is one of {@link yfiles.input.SnapLineOrientation#HORIZONTAL} or {@link yfiles.input.SnapLineOrientation#VERTICAL}. + * @param {yfiles.input.SnapLineSnapType} snapType The type of the line that describes how other items will snap to this line. + * This is one of {@link yfiles.input.SnapLineSnapType#TOP}, {@link yfiles.input.SnapLineSnapType#BOTTOM}, {@link yfiles.input.SnapLineSnapType#LEFT}, {@link yfiles.input.SnapLineSnapType#RIGHT}, + * or {@link yfiles.input.SnapLineSnapType#CENTER}. + * @param {yfiles.system.ResourceKey} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.PointD} coordinates The coordinates of the center point of the snap line. + * @param {Object} tag A tag that is associated with this snap line - see {@link yfiles.input.SnapLine#tag} for a typical use + * of this value. + * @param {number} weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one + * with the greater weight will be used. + */ + new (node:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapType,resourceKey:yfiles.system.ResourceKey,coordinates:yfiles.geometry.PointD,tag:Object,weight:number):yfiles.input.NodeBasedSnapLine; + /** + * Initializes a new instance of the {@link yfiles.input.NodeBasedSnapLine} class. + * @param {yfiles.graph.INode} node The node to assign to {@link yfiles.input.NodeBasedSnapLine#node}. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the snap line. This is one of {@link yfiles.input.SnapLineOrientation#HORIZONTAL} or {@link yfiles.input.SnapLineOrientation#VERTICAL}. + * @param {yfiles.input.SnapLineSnapType} snapType The type of the line that describes how other items will snap to this line. + * This is one of {@link yfiles.input.SnapLineSnapType#TOP}, {@link yfiles.input.SnapLineSnapType#BOTTOM}, {@link yfiles.input.SnapLineSnapType#LEFT}, {@link yfiles.input.SnapLineSnapType#RIGHT}, + * or {@link yfiles.input.SnapLineSnapType#CENTER}. + * @param {yfiles.system.ResourceKey} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.PointD} coordinates The coordinates of the center point of the snap line. + * @param {Object} tag A tag that is associated with this snap line - see {@link yfiles.input.SnapLine#tag} for a typical use + * of this value. + * @param {number} weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one + * with the greater weight will be used. + * @param {number} from The smaller value of the coordinate that delimits this snap line. + * @param {number} to The greater value of the coordinate that delimits this snap line. + */ + WithRange:{ + new (node:yfiles.graph.INode,orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapType,resourceKey:yfiles.system.ResourceKey,coordinates:yfiles.geometry.PointD,from:number,to:number,tag:Object,weight:number):yfiles.input.NodeBasedSnapLine; + }; + }; + /** + * Interface used by {@link yfiles.input.OrthogonalEdgeEditingContext} and the like + * that can be decorated to the {@link yfiles.support.ILookup} of {@link yfiles.graph.IEdge}s. + * This interface is for editing edges in such a way that their path stays orthogonal, i.e. all + * of the segments are oriented either horizontally or vertically. + * @see {@link yfiles.input.OrthogonalEdgeEditingContext#getOrthogonalEdgeHelper} + */ + export interface IOrthogonalEdgeHelper extends Object{ + /** + * Gets the declared orientation of the given segment at the provided edge. + * The orientation cannot always be inferred from the current geometry: If a segment has a zero length it is + * unclear what orientation it should have, also a segment could be accidentally orthogonally oriented, while in + * fact it is considered {@link yfiles.input.SegmentOrientation#NON_ORTHOGONAL}. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context in which the orientation is needed. + * @param {yfiles.graph.IEdge} edge The edge to inspect. + * @param {number} segmentIndex The index of the segment. + * @return {yfiles.input.SegmentOrientation} The declared orientation of the segment. + * @see Specified by {@link yfiles.input.IOrthogonalEdgeHelper#getSegmentOrientation}. + */ + getSegmentOrientation(inputModeContext:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,segmentIndex:number):yfiles.input.SegmentOrientation; + /** + * Determines whether this end of the provided edge can be moved in the input mode context. + * This information is required to determine whether an edge's first or last segment needs to be split or the adjacent edge end + * can be moved along with the other end of the segment. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context in which the segment is edited. + * @param {yfiles.graph.IEdge} edge The edge to inspect. + * @param {boolean} sourceEnd if set to true the source end of the edge is queried, otherwise the target end. + * @return {boolean} + * true if the end of the edge can be moved for the specified input mode context; otherwise, false, in which + * case the corresponding segment needs to be split to keep the segment orientation orthogonal. + * @see Specified by {@link yfiles.input.IOrthogonalEdgeHelper#canBeMoved}. + */ + canBeMoved(inputModeContext:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge,sourceEnd:boolean):boolean; + /** + * Determines whether the provided edge should be edited orthogonally edited at all in the specified input mode context. + * If this method returns false, the other methods will not be queried at all. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context in which the edge is about to be edited. + * @param {yfiles.graph.IEdge} edge The edge to inspect. + * @return {boolean} + * true if the edge should be orthogonally edited in the specified input mode context; otherwise, false. + * @see Specified by {@link yfiles.input.IOrthogonalEdgeHelper#isOrthogonallyEdited}. + */ + isOrthogonallyEdited(inputModeContext:yfiles.input.IInputModeContext,edge:yfiles.graph.IEdge):boolean; + /** + * Callback method that is invoked after the provided edge has been edited orthogonally. + * This callback can be used to remove unused bends and finalize the orthogonal edge editing gesture. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context which edited the edge. + * @param {yfiles.graph.IGraph} graph The graph to use for modifying the edge instance. + * @param {yfiles.graph.IEdge} edge The edge to clean up the path. + * @see Specified by {@link yfiles.input.IOrthogonalEdgeHelper#cleanUpEdge}. + */ + cleanUpEdge(inputModeContext:yfiles.input.IInputModeContext,graph:yfiles.graph.IGraph,edge:yfiles.graph.IEdge):void; + } + var IOrthogonalEdgeHelper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Helper interface used by {@link yfiles.graph.IPortLocationModel} implementations + * to provide possible candidate {@link yfiles.graph.IPortLocationModelParameter}s + * for a given port and model. + * Implementations of this interface can be retrieved from the {@link yfiles.graph.IPortLocationModel}'s + * {@link yfiles.support.ILookup#lookup} method. + * Note that not all models necessarily need to or can provide implementations of this interface. + */ + export interface IPortLocationModelParameterProvider extends Object{ + /** + * Returns an enumerator over a set of possible {@link yfiles.graph.IPortLocationModelParameter} + * instances that can be used for the given port and model. + * @param {yfiles.graph.IPort} port The port instance to use. + * @param {yfiles.graph.IPortLocationModel} model The model to provide parameters for. + * @return {yfiles.collections.IEnumerable.} A possibly empty enumerator over a set of port location model parameters. + * @see Specified by {@link yfiles.input.IPortLocationModelParameterProvider#getParameters}. + */ + getParameters(port:yfiles.graph.IPort,model:yfiles.graph.IPortLocationModel):yfiles.collections.IEnumerable; + } + var IPortLocationModelParameterProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Helper interface used by {@link yfiles.input.GraphEditorInputMode} and the like that + * can be used to customize the label editing experience. + * Implementations of this interface can be put into the {@link yfiles.support.ILookup} of + * {@link yfiles.graph.ILabeledItem}s and {@link yfiles.graph.ILabel}s so that it is possible to + * tweak the behavior on a case by case basis. + * @see {@link yfiles.input.GraphEditorInputMode#createLabel} + * @see {@link yfiles.input.GraphEditorInputMode#editLabel} + * @see {@link yfiles.input.GraphEditorInputMode#addLabel} + */ + export interface IEditLabelHelper extends Object{ + /** + * Helper method that will be called for {@link yfiles.graph.ILabeledItem}s to edit a label. + * This method can determine the {@link yfiles.graph.ILabel#style}, the {@link yfiles.graph.ILabelModelParameter}, + * and the {@link yfiles.graph.ILabel#preferredSize} for a label by returning a non-null + * label instance from which the values will be copied. + * Also returning false will disallow label creation or editing. + * @param {yfiles.input.IInputModeContext} inputModeContext The context in which the label is being created or edited. + * @param {yfiles.graph.ILabel} label A label instance whose style, label model parameter, and preferred size will be used for creating new labels. + * @return {boolean} Whether label editing or creation is allowed. + * @see {@link yfiles.input.IEditLabelHelper#addLabel} + * @see Specified by {@link yfiles.input.IEditLabelHelper#editLabel}. + */ + editLabel(inputModeContext:yfiles.input.IInputModeContext,label:{value:yfiles.graph.ILabel;}):boolean; + /** + * Helper method that will be called for {@link yfiles.graph.ILabeledItem}s to add another label. + * This method can determine the {@link yfiles.graph.ILabel#style}, the {@link yfiles.graph.ILabelModelParameter}, + * and the {@link yfiles.graph.ILabel#preferredSize} for a label by returning a non-null + * label instance from which the values will be copied. + * Also returning false will disallow label creation or editing. + * @param {yfiles.input.IInputModeContext} inputModeContext The context in which the label is being added. + * @param {yfiles.graph.ILabel} label A label instance whose style, label model parameter, and preferred size will be used for creating new labels. + * @return {boolean} Whether adding of labels is allowed. + * @see {@link yfiles.input.IEditLabelHelper#editLabel} + * @see Specified by {@link yfiles.input.IEditLabelHelper#addLabel}. + */ + addLabel(inputModeContext:yfiles.input.IInputModeContext,label:{value:yfiles.graph.ILabel;}):boolean; + /** + * Configures the text editor input mode for the editing of the provided label instance. + * @param {yfiles.input.IInputModeContext} context The context in which the label is being edited or created. + * @param {yfiles.input.TextEditorInputMode} mode The mode that will be used for editing the label's text. + * @param {yfiles.graph.ILabel} label The label that will be edited or created. + * @see Specified by {@link yfiles.input.IEditLabelHelper#configureTextEditorInputMode}. + */ + configureTextEditorInputMode(context:yfiles.input.IInputModeContext,mode:yfiles.input.TextEditorInputMode,label:yfiles.graph.ILabel):void; + } + var IEditLabelHelper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Provides the snap lines and the snap results to the {@link yfiles.input.LabelSnapContext} during dragging of labels. + * @see {@link yfiles.input.LabelSnapContext} + * @see {@link yfiles.graph.LabelDecorator#labelSnapContextHelperDecorator} + */ + export interface ILabelSnapContextHelper extends Object{ + /** + * Called during {@link yfiles.input.IDragHandler#initializeDrag initialization} of a label dragging to + * add + * {@link yfiles.input.SnapLine snap lines} to which the label can potentially snap to the + * context. + * @param {yfiles.input.LabelSnapContext} context + * The snap context which manages the snap lines and the settings. Note that implementations should not change the state + * of the context explicitly. + * @param {yfiles.input.IInputModeContext} inputContext The context of the input mode that handles the dragging. + * @param {yfiles.graph.ILabel} label The label that is dragged. + * @see Specified by {@link yfiles.input.ILabelSnapContextHelper#addSnapLines}. + */ + addSnapLines(context:yfiles.input.LabelSnapContext,inputContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):void; + /** + * Called while the given label is {@link yfiles.input.IDragHandler#handleMove dragged} to add + * {@link yfiles.input.SnapResult snap results} + * for the {@link yfiles.input.SnapLine snap lines} provided by the context. + * @param {yfiles.input.LabelSnapContext} context The snap context which manages the snap lines and the settings. + * @param {yfiles.input.CollectSnapResultsEventArgs} args + * The event argument to obtain the necessary information from and + * {@link yfiles.input.CollectSnapResultsEventArgs#addSnapResult add results to}. + * @param {yfiles.geometry.IOrientedRectangle} suggestedLayout + * The {@link yfiles.graph.ILabel#layout layout} of the label that would be used without snapping. + * @param {yfiles.graph.ILabel} label The label that is dragged. + * @see Specified by {@link yfiles.input.ILabelSnapContextHelper#collectSnapResults}. + */ + collectSnapResults(context:yfiles.input.LabelSnapContext,args:yfiles.input.CollectSnapResultsEventArgs,suggestedLayout:yfiles.geometry.IOrientedRectangle,label:yfiles.graph.ILabel):void; + } + var ILabelSnapContextHelper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An input mode for use in a {@link yfiles.canvas.GraphControl} that fires events when + * the mouse enters or leaves the visualization of a {@link yfiles.model.IModelItem graph item}. + * This mode can be used to determine when the mouse is being moved from one item to the next. + */ + export interface ItemHoverInputMode extends yfiles.input.AbstractConcurrentInputMode{ + /** + * An event that is fired when the item that is being hovered over with the mouse changes. + * Also fires when the mouse pointer leaves an item. + */ + addHoveredItemChangedListener(value:(sender:Object,e:yfiles.input.HoveredItemChangedEventArgs)=> void):void; + /** + * An event that is fired when the item that is being hovered over with the mouse changes. + * Also fires when the mouse pointer leaves an item. + */ + removeHoveredItemChangedListener(value:(sender:Object,e:yfiles.input.HoveredItemChangedEventArgs)=> void):void; + /** + * Gets the current item the mouse is hovering over. + * Value: The current item or null if the mouse is not hovering over a {@link yfiles.input.ItemHoverInputMode#isValidHoverItem valid} item. + */ + currentHoverItem:yfiles.model.IModelItem; + /** + * Gets or sets which graph items are considered by this input mode. + * The default is {@link yfiles.graph.GraphItemTypes#ALL}. + */ + hoverItems:yfiles.graph.GraphItemTypes; + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Gets the items that have been hit at the given location. + * @param {yfiles.geometry.PointD} location The location in world coordinates to query. + * @return {yfiles.collections.IEnumerable.} An enumerable over all items that have been hit at the given location. + */ + getHitItemsAt(location:yfiles.geometry.PointD):yfiles.collections.IEnumerable; + /** + * Forces a reevaluation of the item that the mouse is currently hovering over. + * This method may be called by code that is aware of the fact that the visualization has changed, + * but the mouse may not have been moved. + * By default this implementation will only re-query the items at the mouse location when the mouse has + * moved. This method can be called to force a reevaluation in other cases. + */ + updateHover():void; + /** + * Helper method that can be called by client code to trigger an update of the item for a given specific location. + * This method does not need to be called most of the time and is required for specific customizations, only. + * @param {yfiles.geometry.PointD} queryLocation The query location. + */ + updateHoverWithQueryLocation(queryLocation:yfiles.geometry.PointD):void; + /** + * Gets or sets the cursor to use when the mouse is hovering over a {@link yfiles.input.ItemHoverInputMode#isValidHoverItem} valid hover item. + * Value: The hover cursor or null (the default). + */ + hoverCursor:yfiles.canvas.ICanvasCursor; + /** + * Determines whether items that have been hit at the current location that are not {@link yfiles.input.ItemHoverInputMode#isValidHoverItem valid items} should be ignored or reported as null. + * Value: true if invalid items should be reported as null; otherwise, false, in which case the hit test enumeration + * continues to find the next valid item. The default is true. + * @see {@link yfiles.input.ItemHoverInputMode#isValidHoverItem} + */ + discardInvalidItems:boolean; + /** + * Determines whether the given item is a valid item to be considered for hovering. + * This implementation checks whether the item is covered by the {@link yfiles.input.ItemHoverInputMode#hoverItems} set, only. + * @param {yfiles.model.IModelItem} item The item to check. + * @return {boolean} + * true if it is valid to report a hover over the specified item; otherwise, false. + * @see {@link yfiles.input.ItemHoverInputMode#discardInvalidItems} + */ + isValidHoverItem(item:yfiles.model.IModelItem):boolean; + /** + * Raises the {@link yfiles.input.ItemHoverInputMode#addHoveredItemChangedListener HoveredItemChanged} event. + * @param {yfiles.input.HoveredItemChangedEventArgs} hoveredItemChangedEventArgs The {@link yfiles.input.HoveredItemChangedEventArgs} instance containing the event data. + */ + onHoveredItemChanged(hoveredItemChangedEventArgs:yfiles.input.HoveredItemChangedEventArgs):void; + } + var ItemHoverInputMode:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.ItemHoverInputMode} class. + */ + new ():yfiles.input.ItemHoverInputMode; + }; + /** + * Event argument class containing information about which {@link yfiles.model.IModelItem} the mouse is currently hovering over. + * This event is used by the {@link yfiles.input.ItemHoverInputMode#addHoveredItemChangedListener HoveredItemChanged} event. + * The {@link yfiles.model.ItemEventArgs#item} property yields the item that is currently being hovered over. + * It carries the {@link yfiles.input.HoveredItemChangedEventArgs#oldItem previously hovered item}, too. + */ + export interface HoveredItemChangedEventArgs extends yfiles.model.ItemEventArgs{ + /** + * The item that was previously hovered, possibly null. + * @see {@link yfiles.model.ItemEventArgs#item} + */ + oldItem:yfiles.model.IModelItem; + } + var HoveredItemChangedEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.HoveredItemChangedEventArgs} class. + * @param {yfiles.model.IModelItem} modelItem The model item. + * @param {yfiles.model.IModelItem} oldItem The old item. + */ + new (modelItem:yfiles.model.IModelItem,oldItem:yfiles.model.IModelItem):yfiles.input.HoveredItemChangedEventArgs; + }; + /** + * Interface used for implementations that recognize, approve and disapprove node + * reparenting gestures, as well as actually performs the reparenting. + * Implementations of this interface are queried from the {@link yfiles.input.IInputModeContext} + * by code that wants to reparent a node. Specifically this is used by + * the implementation provided by {@link yfiles.graph.GroupedGraph} that will be used + * to reparent nodes during the {@link yfiles.input.MoveInputMode dragging of nodes}. + */ + export interface IReparentNodeHandler extends Object{ + /** + * Determines whether the current gesture that can be determined through the + * context is a reparent gesture. + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.INode} node The node that will possibly be reparented. + * @return {boolean} Whether this is a reparenting gesture. + * @see Specified by {@link yfiles.input.IReparentNodeHandler#isReparentGesture}. + */ + isReparentGesture(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode):boolean; + /** + * Determines whether the user may detach the given node from its current parent in + * order to reparent it. + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.INode} node The node that is about to be detached from its current parent. + * @return {boolean} Whether the node may be detached and reparented. + * @see Specified by {@link yfiles.input.IReparentNodeHandler#canReparent}. + */ + canReparent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode):boolean; + /** + * Determines whether the provided node may be reparented to a newParent. + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.INode} node The node that will be reparented. + * @param {yfiles.graph.INode} newParent The potential new parent or {@link yfiles.graph.IHierarchy#root}. Can be a group or a + * non-group node. + * @return {boolean} Whether newParent is a valid new parent for node. + * @see Specified by {@link yfiles.input.IReparentNodeHandler#isValidParent}. + */ + isValidParent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,newParent:yfiles.graph.INode):boolean; + /** + * Performs the actual reparenting after the reparent gesture has been finalized. + * Implementations should {@link yfiles.graph.IHierarchy#setParent set the parent} of node + * to newParent. + * @param {yfiles.input.IInputModeContext} context The context that provides information about the user input. + * @param {yfiles.graph.INode} node The node that will be reparented. + * @param {yfiles.graph.INode} newParent The potential new parent or {@link yfiles.graph.IHierarchy#root}. Can be a group or a + * non-group node. + * @see Specified by {@link yfiles.input.IReparentNodeHandler#reparent}. + */ + reparent(context:yfiles.input.IInputModeContext,node:yfiles.graph.INode,newParent:yfiles.graph.INode):void; + } + var IReparentNodeHandler:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Queried by the {@link yfiles.input.GraphSnapContext} to add {@link yfiles.input.OrthogonalSnapLine}s to its collections during the + * {@link yfiles.input.SnapContext#isInitializing initialization phase}. + * Implementations of this interface are queried by {@link yfiles.input.GraphSnapContext} for each item that + * is not modified during the edit using the {@link yfiles.support.ILookup#lookup} of the respective item. + * @see {@link yfiles.graph.NodeDecorator#snapLineProviderDecorator} + */ + export interface ISnapLineProvider extends Object{ + /** + * Called by the {@link yfiles.input.GraphSnapContext} when a {@link yfiles.input.GraphSnapContext#initializeDrag drag} + * is about to start. + * @param {yfiles.input.GraphSnapContext} context The context which holds the settings for the snap lines. Note that implementations should not + * change the state of the context explicitly. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} args The argument to use for adding snap lines. + * @param {yfiles.model.IModelItem} item The item to add snap lines for. + * @see Specified by {@link yfiles.input.ISnapLineProvider#addSnapLines}. + */ + addSnapLines(context:yfiles.input.GraphSnapContext,args:yfiles.input.CollectGraphSnapLinesEventArgs,item:yfiles.model.IModelItem):void; + } + var ISnapLineProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Simple default implementation of the {@link yfiles.input.IEditLabelHelper} + * interface. + * This class provided a number of factory methods that can be overwritten to change the + * default behavior which is modeled after the behavior used by {@link yfiles.input.GraphEditorInputMode}'s + * {@link yfiles.input.GraphEditorInputMode#createLabel} and {@link yfiles.input.GraphEditorInputMode#editLabel}. + */ + export interface EditLabelHelper extends Object,yfiles.input.IEditLabelHelper{ + /** + * Gets or sets to use for the callbacks. + * Value: The owner to use. + */ + owner:yfiles.graph.ILabeledItem; + /** + * Gets or sets the graph instance to retrieve the default values from. + * If this instance is not set, the implementation will try to retrieve the graph + * from the {@link yfiles.input.IInputModeContext}'s {@link yfiles.support.ILookup}. + * Value: The graph instance. + */ + graph:yfiles.graph.IGraph; + /** + * Helper method that will be called for {@link yfiles.graph.ILabeledItem}s. + * This method returns the first of the {@link yfiles.graph.ILabeledItem#labels} that belong + * to the {@link yfiles.input.EditLabelHelper#owner}, if set. Otherwise, it delegates to {@link yfiles.input.EditLabelHelper#createNewLabel}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context in which the label is being created or edited. + * @param {yfiles.graph.ILabel} label A label instance whose style, label model parameter and preferred size will be used for creating new labels. + * @return {boolean} + * Always true. + * @see Specified by {@link yfiles.input.IEditLabelHelper#editLabel}. + */ + editLabel(inputModeContext:yfiles.input.IInputModeContext,label:{value:yfiles.graph.ILabel;}):boolean; + /** + * Helper method that will be called for {@link yfiles.graph.ILabeledItem}s. + * This method delegates to {@link yfiles.input.EditLabelHelper#createNewLabel} and returns true. + * @param {yfiles.input.IInputModeContext} inputModeContext The context in which the label is being created or edited. + * @param {yfiles.graph.ILabel} label A label instance whose style, label model parameter and preferred size will be used for creating new labels. + * @return {boolean} + * Always true. + * @see Specified by {@link yfiles.input.IEditLabelHelper#addLabel}. + */ + addLabel(inputModeContext:yfiles.input.IInputModeContext,label:{value:yfiles.graph.ILabel;}):boolean; + /** + * This implementation does nothing. + * @see Specified by {@link yfiles.input.IEditLabelHelper#configureTextEditorInputMode}. + */ + configureTextEditorInputMode(context:yfiles.input.IInputModeContext,mode:yfiles.input.TextEditorInputMode,label:yfiles.graph.ILabel):void; + /** + * Factory method that creates a new label and associates with it + * a {@link yfiles.input.EditLabelHelper#getLabelParameter label model parameter}, a {@link yfiles.input.EditLabelHelper#getPreferredSize preferred size}, + * and a {@link yfiles.input.EditLabelHelper#getLabelStyle style}. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context. + * @return {yfiles.graph.ILabel} A dummy label that holds the style, parameter, and preferred size. + */ + createNewLabel(inputModeContext:yfiles.input.IInputModeContext):yfiles.graph.ILabel; + /** + * Gets the preferred size for the label. + * This implementation yields null to indicate that + * the preferred size should be calculated after the text has been entered. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context. + * @param {yfiles.graph.ILabel} label The label to get the preferred size from. + * @return {yfiles.geometry.SizeD} The size to use or null. + */ + getPreferredSize(inputModeContext:yfiles.input.IInputModeContext,label:yfiles.graph.ILabel):yfiles.geometry.SizeD; + /** + * Determines the style to use for the label, depending on the {@link yfiles.input.EditLabelHelper#owner}. + * This method will obtain the default style instances from the {@link yfiles.input.EditLabelHelper#graph} + * considering the type of the current {@link yfiles.input.EditLabelHelper#owner}. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context. + * @return {yfiles.drawing.ILabelStyle} The style to use or null. + */ + getLabelStyle(inputModeContext:yfiles.input.IInputModeContext):yfiles.drawing.ILabelStyle; + /** + * Determines the label model parameter to use for the label, depending on the {@link yfiles.input.EditLabelHelper#owner}. + * This method will obtain the default parameter instances from the {@link yfiles.input.EditLabelHelper#graph} + * considering the type of the current {@link yfiles.input.EditLabelHelper#owner}. + * @param {yfiles.input.IInputModeContext} inputModeContext The input mode context. + * @return {yfiles.graph.ILabelModelParameter} The style to use or null. + */ + getLabelParameter(inputModeContext:yfiles.input.IInputModeContext):yfiles.graph.ILabelModelParameter; + } + var EditLabelHelper:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.EditLabelHelper} class. + */ + new ():yfiles.input.EditLabelHelper; + /** + * Initializes a new instance of the {@link yfiles.input.EditLabelHelper} for a given + * label owner instance. + * @param {yfiles.graph.ILabeledItem} owner The owner, probably an {@link yfiles.graph.INode} or an {@link yfiles.graph.IEdge}. + */ + ForLabelOwner:{ + new (owner:yfiles.graph.ILabeledItem):yfiles.input.EditLabelHelper; + }; + }; + /** + * A base class {@link yfiles.input.IInputMode} that can be used to detect mouse drags on + * {@link yfiles.graph.IEdge}s. + * @see {@link yfiles.input.CreateBendInputMode} + */ + export interface EdgeDragInputModeBase extends yfiles.input.StateMachineInputMode{ + /** + * Gets or sets the cursor to use when this mode is in "armed" state. + */ + armedCursor:yfiles.canvas.ICanvasCursor; + /** + * Gets or sets the "pressed" state recognizer. + * This recognizer instance will be used to determine when the user begins + * to move the selection. + * Value: The "pressed" recognizer. + */ + pressedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "dragged" recognizer. + * This recognizer instance determines when the user is moving the selection + * Value: The "dragged" recognizer. + */ + draggedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "cancel" recognizer. + * This recognizer recognizes a cancel action during the move. + * Value: The "cancel" recognizer. + */ + cancelRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "released" recognizer. + * This instance determines when the user has finished the move. + * Value: The "released" recognizer. + */ + releasedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "pressed" state recognizer specifically for touch input. + * This recognizer instance will be used to determine when the user begins + * to move the selection. + * The default value is {@link yfiles.input.Touch2DEvents#TOUCH_LONG_PRESSED_PRIMARY}. + * Value: The "pressed" recognizer. + */ + prepareRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "moved" state recognizer specifically for touch input. + * This recognizer instance will be used to determine when the user begins + * actually moves the selection. + * The default value is {@link yfiles.input.Touch2DEvents#TOUCH_MOVED_PRIMARY}. + * Value: The touch move recognizer. + */ + movedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "released" state recognizer specifically for touch input. + * This recognizer instance will be used to determine when the finalized the gesture. + * The default value is {@link yfiles.input.Touch2DEvents#TOUCH_UP_PRIMARY}. + * Value: The touch released recognizer. + */ + releasedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the {@link yfiles.drawing.IHitTestable} that determines where bends may be created. + */ + beginHitTestable:yfiles.drawing.IHitTestable; + /** + * Gets the location where the bend creation gesture was initialized. + */ + location:yfiles.geometry.PointD; + /** + * Gets the Graph this mode is acting upon. + */ + graph:yfiles.graph.IGraph; + /** + * Called to initialize the state machine. + * @param {yfiles.support.StateMachine} machine The machine to initialize and configure + * @param {yfiles.support.State} startState The start state to use. + * @param {yfiles.support.State} canceledState The canceled state to use. + * @param {yfiles.support.State} stoppedState The stopped state to use. + * @param {yfiles.support.State} finishedState The finished state to use. + * @see Overrides {@link yfiles.input.StateMachineInputMode#initializeStateMachine} + */ + initializeStateMachine(machine:yfiles.support.StateMachine,startState:yfiles.support.State,canceledState:yfiles.support.State,stoppedState:yfiles.support.State,finishedState:yfiles.support.State):void; + /** + * Callback that is triggered when a drag on an edge segment has been recognized. + * This method delegates to {@link yfiles.input.EdgeDragInputModeBase#dragSegment} + * @param {yfiles.support.Transition} t The transition. + */ + dragSegmentWithTransition(t:yfiles.support.Transition):void; + /** + * Callback triggered at the end of each drag. + * This method triggers the {@link yfiles.input.EdgeDragInputModeBase#addDraggedListener Dragged} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragged(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the start of each drag. + * This method triggers the {@link yfiles.input.EdgeDragInputModeBase#addDraggingListener Dragging} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragging(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Event that will be triggered at the start of every drag. + */ + addDraggingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the start of every drag. + */ + removeDraggingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the end of every drag. + */ + addDraggedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the end of every drag. + */ + removeDraggedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Triggers the {@link yfiles.input.EdgeDragInputModeBase#addDragCanceledListener DragCanceled} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragCanceled(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Event that will be triggered when the drag has been canceled. + */ + addDragCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered when the drag has been canceled. + */ + removeDragCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Callback method to be implemented by subclasses that is invoked whenever a drag + * gesture has been recognized by this mode. + * @param {yfiles.graph.IEdge} edge The edge that has been dragged. + * @param {yfiles.geometry.PointD} dragLocation The location of the drag start. + */ + dragSegment(edge:yfiles.graph.IEdge,dragLocation:yfiles.geometry.PointD):void; + /** + * Creates an {@link yfiles.input.IInputModeContext} for use + * with the upcoming {@link yfiles.input.IBendCreator#createBend} call + * in {@link yfiles.input.CreateBendInputMode#createBend}. + * @return {yfiles.input.IInputModeContext} An instance of {@link yfiles.input.IInputModeContext}. + */ + createInputModeContext():yfiles.input.IInputModeContext; + /** + * Finds the edge at the given coordinate. + * @param {yfiles.geometry.PointD} location The coordinates. + * @return {yfiles.graph.IEdge} The edge that has been hit. + */ + getEdge(location:yfiles.geometry.PointD):yfiles.graph.IEdge; + /** + * Determines whether the current location is valid to begin a bend creation gesture. + * @return {boolean} + */ + isValidBegin(source:Object,args:yfiles.system.EventArgs):boolean; + /** + * Called when the state machine has determined that at the current position it is valid to + * start a bend creation gesture. + * This implementation sets the {@link yfiles.input.AbstractConcurrentInputMode#preferredCursor} + * to {@link yfiles.input.EdgeDragInputModeBase#armedCursor}. + */ + armValidBegin(t:yfiles.support.Transition):void; + /** + * Called when the state machine has determined that at the current position it is no + * more valid to start a bend creation gesture. + * This implementation sets the {@link yfiles.input.AbstractConcurrentInputMode#preferredCursor} + * back to null. + */ + disarmValidBegin(t:yfiles.support.Transition):void; + /** + * Called when the {@link yfiles.input.EdgeDragInputModeBase#graph} property changes. + * @param {yfiles.graph.IGraph} oldGraph The old graph instance. + * @param {yfiles.graph.IGraph} newGraph The new graph instance. + */ + onGraphChanged(oldGraph:yfiles.graph.IGraph,newGraph:yfiles.graph.IGraph):void; + /** + * Set a new Graph for this mode. + * Normally the graph is retrieved from this instance's {@link yfiles.input.AbstractInputMode#inputModeContext}. + * If the instance needs to be overridden, this method can be used. + * Triggers {@link yfiles.input.EdgeDragInputModeBase#onGraphChanged}. + * @param {yfiles.graph.IGraph} newGraph The new graph. + */ + setGraphCore(newGraph:yfiles.graph.IGraph):void; + } + var EdgeDragInputModeBase:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that will use the IGraph from the {@link yfiles.input.AbstractInputMode#inputModeContext} + * to create bends in. + * @see {@link yfiles.input.EdgeDragInputModeBase#graph} + */ + new ():yfiles.input.EdgeDragInputModeBase; + /** + * Creates a new instance using the given graph to create the bends in. + * It is recommended to use the parameterless constructor and let the instance retrieve the graph instance + * from the context. + * @param {yfiles.graph.IGraph} graph The graph to create the bends in and query the edges from. + * @see {@link yfiles.input.EdgeDragInputModeBase#graph} + */ + ForGraph:{ + new (graph:yfiles.graph.IGraph):yfiles.input.EdgeDragInputModeBase; + }; + }; + /** + * An {@link yfiles.input.IInputMode} used for recognizing the gesture of creating + * {@link yfiles.graph.IBend}s in an {@link yfiles.graph.IGraph}. + * This mode is used by {@link yfiles.input.GraphEditorInputMode} but can be used stand-alone, too. + * Client code should register with the {@link yfiles.input.CreateBendInputMode#addBendCreatedListener BendCreated} event to + * perform additional actions after the bend has been created. + */ + export interface CreateBendInputMode extends yfiles.input.EdgeDragInputModeBase{ + /** + * The event that will be triggered once a bend creation gesture has been recognized. + */ + addBendCreatedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * The event that will be triggered once a bend creation gesture has been recognized. + */ + removeBendCreatedListener(value:(sender:Object,e:yfiles.model.ItemEventArgs)=> void):void; + /** + * Gets or sets the event recognizer that determines whether during the call to {@link yfiles.input.CreateBendInputMode#dragSegment} + * the bend creation should be treated as a split segment operation. + * Value: The event recognizer that determines whether orthogonal edge segments should be split during the bend creation. + */ + splitOrthogonalSegmentRecognizer:yfiles.input.IEventRecognizer; + /** + * Updates the {@link yfiles.input.CreateBendInputMode#splitOrthogonalSegment} property and then delegates to {@link yfiles.input.CreateBendInputMode#createBend}. + * This method triggers the {@link yfiles.input.CreateBendInputMode#addBendCreatedListener BendCreated} event if a bend is created. + * @param {yfiles.graph.IEdge} edge The edge to create a bend for. + * @param {yfiles.geometry.PointD} dragLocation The location at which the user initiated the gesture. + * @see Overrides {@link yfiles.input.EdgeDragInputModeBase#dragSegment} + */ + dragSegment(edge:yfiles.graph.IEdge,dragLocation:yfiles.geometry.PointD):void; + /** + * Gets or sets a value indicating whether an orthogonal segment should be split by the last bend creation. + * This property can be read by implementations of {@link yfiles.input.IBendCreator} if they retrieve this instance + * from their {@link yfiles.input.IInputModeContext#parentInputMode}. If this property is true, + * implementation are advised to treat the bend creation as a gesture that splits the segment into two. + * @see {@link yfiles.input.CreateBendInputMode#splitOrthogonalSegmentRecognizer} + */ + splitOrthogonalSegment:boolean; + /** + * Creates the bend. + * The bend is created using the hit edge's {@link yfiles.input.IBendCreator} + * implementation, as obtained from the edge's {@link yfiles.support.ILookup#lookup}. + * @param {yfiles.graph.IEdge} hitEdge The hit edge. + * @param {yfiles.geometry.PointD} location The coordinates of the hit. + * @return {yfiles.graph.IBend} The created bend or null. + * @see {@link yfiles.input.EdgeDragInputModeBase#createInputModeContext} + */ + createBend(hitEdge:yfiles.graph.IEdge,location:yfiles.geometry.PointD):yfiles.graph.IBend; + /** + * Triggers the {@link yfiles.input.CreateBendInputMode#addBendCreatedListener BendCreated} event. + */ + onBendCreated(args:yfiles.model.ItemEventArgs):void; + /** + * Gets or sets a property that determines whether this mode should + * return an existing bend in {@link yfiles.input.CreateBendInputMode#createBend} + * if there is one found at the given location. + * The default is true + */ + returnExistingBend:boolean; + } + var CreateBendInputMode:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that will use the IGraph from the {@link yfiles.input.AbstractInputMode#inputModeContext} + * to create bends in. + * @see {@link yfiles.input.EdgeDragInputModeBase#graph} + */ + new ():yfiles.input.CreateBendInputMode; + /** + * Creates a new instance using the given graph to create the bends in. + * It is recommended to use the parameterless constructor and let the instance retrieve the graph instance + * from the context. + * @param {yfiles.graph.IGraph} graph The graph to create the bends in and query the edges from. + * @see {@link yfiles.input.EdgeDragInputModeBase#graph} + */ + ForGraph:{ + new (graph:yfiles.graph.IGraph):yfiles.input.CreateBendInputMode; + }; + }; + /** + * Specialized subclass of {@link yfiles.input.MovementInfo} that describes the movement of an {@link yfiles.graph.INode} + * in the context of {@link yfiles.input.GraphSnapContext}. + * @see {@link yfiles.input.PortMovementInfo} + * @see {@link yfiles.input.BendMovementInfo} + * @see {@link yfiles.input.EdgeEndMovementInfo} + */ + export interface NodeMovementInfo extends yfiles.input.MovementInfo{ + /** + * Gets the node that is being moved. + * Value: The bend. + */ + node:yfiles.graph.INode; + /** + * Gets the current location as a live point. + * Value: The current location. + */ + currentLocation:yfiles.geometry.IPoint; + } + var NodeMovementInfo:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.NodeMovementInfo} class using the current location of the node. + * @param {yfiles.graph.INode} node The bend. + * @param {yfiles.input.MoveTypes} moveType The type of the movement. + */ + new (node:yfiles.graph.INode,moveType:yfiles.input.MoveTypes):yfiles.input.NodeMovementInfo; + /** + * Initializes a new instance of the {@link yfiles.input.NodeMovementInfo} class. + * @param {yfiles.graph.INode} node The bend. + * @param {yfiles.geometry.PointD} originalLocation The location of the node at the initialization time of the gesture. + * @param {yfiles.input.MoveTypes} moveType The type of the movement. + */ + FromOriginalLocation:{ + new (node:yfiles.graph.INode,originalLocation:yfiles.geometry.PointD,moveType:yfiles.input.MoveTypes):yfiles.input.NodeMovementInfo; + }; + }; + /** + * Specialized subclass of {@link yfiles.input.MovementInfo} that describes the movement of an {@link yfiles.graph.IPort} + * in the context of {@link yfiles.input.GraphSnapContext}. + * @see {@link yfiles.input.GraphSnapContext#getMovementInfos} + * @see {@link yfiles.input.GraphSnapContext#addOrthogonalSegment} + * @see {@link yfiles.input.BendMovementInfo} + */ + export interface PortMovementInfo extends yfiles.input.MovementInfo{ + /** + * Gets the port that is being moved. + * Value: The port. + */ + port:yfiles.graph.IPort; + /** + * Gets the current location as a live point. + * Value: The current location. + */ + currentLocation:yfiles.geometry.IPoint; + } + var PortMovementInfo:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.BendMovementInfo} class. + * @param {yfiles.graph.IPort} port The port. + * @param {yfiles.geometry.PointD} originalLocation The location of the port at the initialization time of the gesture. + * @param {yfiles.input.MoveTypes} moveType The type of the movement. + */ + FromOriginalLocation:{ + new (port:yfiles.graph.IPort,originalLocation:yfiles.geometry.PointD,moveType:yfiles.input.MoveTypes):yfiles.input.PortMovementInfo; + }; + /** + * Initializes a new instance of the {@link yfiles.input.BendMovementInfo} class using the current location of the port. + * @param {yfiles.graph.IPort} port The port. + * @param {yfiles.input.MoveTypes} moveType The type of the movement. + */ + new (port:yfiles.graph.IPort,moveType:yfiles.input.MoveTypes):yfiles.input.PortMovementInfo; + }; + export enum MoveTypes{ + /** + * The element does not move at all during the edit. + */ + FIXED, + /** + * The element moves linearly with the mouse in horizontal direction. + */ + LINEAR_MOVE_X, + /** + * The element moves linearly with the mouse in vertical direction. + */ + LINEAR_MOVE_Y, + /** + * The element moves linearly with the mouse in both directions. + */ + LINEAR_MOVE, + /** + * The element moves in horizontal direction but not linearly/predictably with the mouse. + */ + NON_LINEAR_MOVE_X, + /** + * The element moves in vertical direction but not linearly/predictably with the mouse. + */ + NON_LINEAR_MOVE_Y, + /** + * The element moves in both directions but not linearly/predictably with the mouse. + */ + NON_LINEAR_MOVE, + /** + * The bitwise combination of {@link yfiles.input.MoveTypes#LINEAR_MOVE_X} and {@link yfiles.input.MoveTypes#NON_LINEAR_MOVE_X}. + */ + MOVEMENT_X, + /** + * The bitwise combination of {@link yfiles.input.MoveTypes#LINEAR_MOVE_Y} and {@link yfiles.input.MoveTypes#NON_LINEAR_MOVE_Y}. + */ + MOVEMENT_Y + } + /** + * Specialized subclass of {@link yfiles.input.MovementInfo} that describes the movement of an {@link yfiles.graph.IBend} + * in the context of {@link yfiles.input.GraphSnapContext}. + * @see {@link yfiles.input.GraphSnapContext#getMovementInfos} + * @see {@link yfiles.input.GraphSnapContext#addOrthogonalSegment} + * @see {@link yfiles.input.PortMovementInfo} + */ + export interface BendMovementInfo extends yfiles.input.MovementInfo{ + /** + * Gets the bend that is being moved. + * Value: The bend. + */ + bend:yfiles.graph.IBend; + /** + * Gets the current location as a live point. + * Value: The current location. + */ + currentLocation:yfiles.geometry.IPoint; + } + var BendMovementInfo:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.BendMovementInfo} class. + * @param {yfiles.graph.IBend} bend The bend. + * @param {yfiles.geometry.PointD} originalLocation The location of the bend at the initialization time of the gesture. + * @param {yfiles.input.MoveTypes} moveType The type of the movement. + */ + FromOriginalLocation:{ + new (bend:yfiles.graph.IBend,originalLocation:yfiles.geometry.PointD,moveType:yfiles.input.MoveTypes):yfiles.input.BendMovementInfo; + }; + /** + * Initializes a new instance of the {@link yfiles.input.BendMovementInfo} class using the current location of the bend. + * @param {yfiles.graph.IBend} bend The bend. + * @param {yfiles.input.MoveTypes} moveType The type of the movement. + */ + new (bend:yfiles.graph.IBend,moveType:yfiles.input.MoveTypes):yfiles.input.BendMovementInfo; + }; + /** + * A snap line is a line segment in the world coordinate system to which other items (lines + * or points) snap during interactive movements. + * {@link yfiles.input.GraphSnapContext} and {@link yfiles.input.LabelSnapContext} make use of this class to + * interactively snap moving elements to snap lines. + */ + export interface SnapLine extends Object{ + /** + * The type of the line that describes how other items will snap to this line. + * This is one of {@link yfiles.input.SnapLineSnapType#TOP}, {@link yfiles.input.SnapLineSnapType#BOTTOM}, + * {@link yfiles.input.SnapLineSnapType#LEFT}, {@link yfiles.input.SnapLineSnapType#RIGHT}, + * or {@link yfiles.input.SnapLineSnapType#CENTER}. + */ + snapType:yfiles.input.SnapLineSnapType; + /** + * The coordinates of the center point of the snap line. + */ + coordinates:yfiles.geometry.PointD; + /** + * The tag that is associated with this snap line. The tag is most commonly used for the + * {@link yfiles.input.SnapResult#tag snap result tag}. + */ + tag:Object; + /** + * The weight/importance of this snap line. Greater values indicate greater importance. + */ + weight:number; + /** + * The first location that delimits this snap line. + */ + from:yfiles.geometry.PointD; + /** + * The second location that delimits this snap line. + */ + to:yfiles.geometry.PointD; + /** + * The resource key which determines the visual appearance of the snap line. + */ + resourceKey:yfiles.system.ResourceKey; + } + var SnapLine:{ + $class:yfiles.lang.Class; + /** + * Resource key which determines a snap line having a fixed visualization independent + * of the {@link yfiles.input.SnapResult}. + */ + SNAP_LINE_FIXED_LINE_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines a snap line with three special locations, for example the start, end and center + * of an edge segment. + */ + SNAP_LINE_EDGE_SEGMENT_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines a grid snap line having a fixed visualization independent + * of the {@link yfiles.input.SnapResult}. + */ + GRID_LINE_FIXED_LINE_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines a decorated snap line between the {@link yfiles.input.SnapLine#coordinates} + * and the {@link yfiles.input.SnapLineSnapResult#snappedCoordinates}. + */ + SNAP_LINE_VARIABLE_LINE_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines a blank line between the {@link yfiles.input.SnapLine#coordinates} + * and the {@link yfiles.input.SnapLineSnapResult#snappedCoordinates}. + */ + SNAP_LINE_BLANK_VARIABLE_LINE_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines a decorated line between the {@link yfiles.input.SnapLine#coordinates} + * and the {@link yfiles.input.SnapLineSnapResult#snappedCoordinates} that is extended on both sides. + */ + SNAP_LINE_EXTENDED_VARIABLE_LINE_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines a snap line which lets an item snap in a defined distance to another graph item. + */ + SNAP_LINE_FIXED_DISTANCE_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines a snap line which lets an item snap in the center between the bounds of two other items. + */ + SNAP_LINE_CENTER_BETWEEN_BOUNDS_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines a snap line which lets an item snap in the center between the centers of two other items. + */ + SNAP_LINE_CENTER_BETWEEN_CENTERS_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines a snap line which lets an item snap if it has an equal distance to two other items. + */ + SNAP_LINE_EQUAL_DISTANCE_BETWEEN_BOUNDS_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines a snap line which lets an item snap if it's center has an equal distance to the centers' + * of two other items. + */ + SNAP_LINE_EQUAL_DISTANCE_BETWEEN_CENTERS_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines the snapping of a resized item if it's new width is equal to another item. + */ + SNAP_LINE_EQUAL_WIDTH_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines the snapping of a resized item if it's new height is equal to another item. + */ + SNAP_LINE_EQUAL_HEIGHT_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines the snapping of an item to a grid position. + */ + SNAP_TO_GRID_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines the {@link yfiles.system.Pen} used for the snap line visualization. + */ + SNAP_LINE_PEN_KEY:yfiles.system.ResourceKey; + /** + * Resource key which determines the {@link yfiles.system.Color} used for the snap line visualization. + */ + SNAP_LINE_COLOR_KEY:yfiles.system.ResourceKey; + /** + * Creates a new snap line using the provided attributes. + * @param {yfiles.input.SnapLineSnapType} snapType The type of the line that describes how other items will snap to this line. + * This is one of {@link yfiles.input.SnapLineSnapType#TOP}, {@link yfiles.input.SnapLineSnapType#BOTTOM}, + * {@link yfiles.input.SnapLineSnapType#LEFT}, {@link yfiles.input.SnapLineSnapType#RIGHT}, + * or {@link yfiles.input.SnapLineSnapType#CENTER}. + * @param {yfiles.system.ResourceKey} resourceKey A resource key which determines the visual representation of this snap line. + * @param {yfiles.geometry.PointD} coordinates The coordinates of the center point of the snap line. + * @param {yfiles.geometry.PointD} from The first location that delimits this snap line. + * @param {yfiles.geometry.PointD} to The second location that delimits this snap line. + * @param {Object} tag A tag that is associated with this snap line - see {@link yfiles.input.SnapLine#tag} for a typical use + * of this value. + * @param {number} weight The weight (importance) of this snap line. If more than one snap line is snapped to, the one + * with the greater weight will be used. + */ + new (snapType:yfiles.input.SnapLineSnapType,resourceKey:yfiles.system.ResourceKey,coordinates:yfiles.geometry.PointD,from:yfiles.geometry.PointD,to:yfiles.geometry.PointD,tag:Object,weight:number):yfiles.input.SnapLine; + }; + /** + * An orthogonal snap line, in other words, one that is parallel to the x or y axis. + */ + export interface OrthogonalSnapLine extends yfiles.input.SnapLine{ + /** + * The orientation of the snap line. This is one of + * {@link yfiles.input.SnapLineOrientation#HORIZONTAL} or {@link yfiles.input.SnapLineOrientation#VERTICAL}. + */ + orientation:yfiles.input.SnapLineOrientation; + } + var OrthogonalSnapLine:{ + $class:yfiles.lang.Class; + /** + * Creates a new snap line using the provided attributes. + * @param {yfiles.input.SnapLineOrientation} orientation + * The orientation of the snap line. This is one of + * {@link yfiles.input.SnapLineOrientation#HORIZONTAL} or {@link yfiles.input.SnapLineOrientation#VERTICAL}. + * @param {yfiles.input.SnapLineSnapType} snapType + * The type of the line that describes how other items will snap to this line. + * This is one of {@link yfiles.input.SnapLineSnapType#TOP}, {@link yfiles.input.SnapLineSnapType#BOTTOM}, + * {@link yfiles.input.SnapLineSnapType#LEFT}, {@link yfiles.input.SnapLineSnapType#RIGHT}, or + * {@link yfiles.input.SnapLineSnapType#CENTER}. + * @param {yfiles.system.ResourceKey} resourceKey + * A resource key which determines the visual representation of this snap + * line. + * @param {yfiles.geometry.PointD} coordinates The coordinates of the center point of the snap line. + * @param {Object} tag + * A tag that is associated with this snap line - see {@link yfiles.input.SnapLine#tag} + * for a typical use of this value. + * @param {number} weight + * The weight (importance) of this snap line. If more than one snap line is + * snapped to, the one with the greater weight will be used. + */ + new (orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapType,resourceKey:yfiles.system.ResourceKey,coordinates:yfiles.geometry.PointD,tag:Object,weight:number):yfiles.input.OrthogonalSnapLine; + /** + * Creates a new snap line using the provided attributes. + * @param {yfiles.input.SnapLineOrientation} orientation + * The orientation of the snap line. This is one of + * {@link yfiles.input.SnapLineOrientation#HORIZONTAL} or {@link yfiles.input.SnapLineOrientation#VERTICAL}. + * @param {yfiles.input.SnapLineSnapType} snapType + * The type of the line that describes how other items will snap to this line. + * This is one of {@link yfiles.input.SnapLineSnapType#TOP}, {@link yfiles.input.SnapLineSnapType#BOTTOM}, + * {@link yfiles.input.SnapLineSnapType#LEFT}, {@link yfiles.input.SnapLineSnapType#RIGHT}, or + * {@link yfiles.input.SnapLineSnapType#CENTER}. + * @param {yfiles.system.ResourceKey} resourceKey + * A resource key which determines the visual representation of this snap + * line. + * @param {yfiles.geometry.PointD} coordinates The coordinates of the center point of the snap line. + * @param {number} from The smaller value of the coordinate that delimits this snap line. + * @param {number} to The greater value of the coordinate that delimits this snap line. + * @param {Object} tag + * A tag that is associated with this snap line - see {@link yfiles.input.SnapLine#tag} + * for a typical use of this value. + * @param {number} weight + * The weight (importance) of this snap line. If more than one snap line is + * snapped to, the one with the greater weight will be used. + */ + WithFromAndTo:{ + new (orientation:yfiles.input.SnapLineOrientation,snapType:yfiles.input.SnapLineSnapType,resourceKey:yfiles.system.ResourceKey,coordinates:yfiles.geometry.PointD,from:number,to:number,tag:Object,weight:number):yfiles.input.OrthogonalSnapLine; + }; + }; + /** + * Specialized subclass of {@link yfiles.input.MovementInfo} that describes the movement of the endpoint of an {@link yfiles.graph.IEdge} + * in the context of {@link yfiles.input.GraphSnapContext}. + * @see {@link yfiles.input.GraphSnapContext#getMovementInfos} + * @see {@link yfiles.input.GraphSnapContext#addOrthogonalSegment} + * @see {@link yfiles.input.BendMovementInfo} + */ + export interface EdgeEndMovementInfo extends yfiles.input.MovementInfo{ + /** + * Gets the edge that is being described. + * Value: The edge. + * @see {@link yfiles.input.EdgeEndMovementInfo#sourceEnd} + */ + edge:yfiles.graph.IEdge; + /** + * Gets a value indicating whether the source end is being described by this instance. + * Value: true if the source end is described; in case of the target end false. + */ + sourceEnd:boolean; + /** + * Gets the current location as a live point. + * Value: The current location. + */ + currentLocation:yfiles.geometry.IPoint; + } + var EdgeEndMovementInfo:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.BendMovementInfo} class. + * @param {yfiles.graph.IEdge} edge The edge that is moved. + * @param {boolean} sourceEnd Whether the source end of the edge is meant. + * @param {yfiles.geometry.PointD} originalLocation The location of the edge end at the initialization time of the gesture. + * @param {yfiles.input.MoveTypes} moveType The type of the movement. + * @param {yfiles.geometry.IPoint} location The point describing the live location of the edge's end. + */ + ForOriginalAndCurrentLocation:{ + new (edge:yfiles.graph.IEdge,sourceEnd:boolean,originalLocation:yfiles.geometry.PointD,moveType:yfiles.input.MoveTypes,location:yfiles.geometry.IPoint):yfiles.input.EdgeEndMovementInfo; + }; + /** + * Initializes a new instance of the {@link yfiles.input.BendMovementInfo} class using the current location of the end point. + * @param {yfiles.graph.IEdge} edge The edge that is moved. + * @param {boolean} sourceEnd Whether the source end of the edge is meant. + * @param {yfiles.input.MoveTypes} moveType The type of the movement. + * @param {yfiles.geometry.IPoint} location The point describing the live location of the edge's end. + */ + ForCurrentLocation:{ + new (edge:yfiles.graph.IEdge,sourceEnd:boolean,moveType:yfiles.input.MoveTypes,location:yfiles.geometry.IPoint):yfiles.input.EdgeEndMovementInfo; + }; + }; + /** + * An abstract helper class that is used in the context of {@link yfiles.input.GraphSnapContext} to describe the movement + * of entities during the edit process. + * @see {@link yfiles.input.NodeMovementInfo} + * @see {@link yfiles.input.BendMovementInfo} + * @see {@link yfiles.input.PortMovementInfo} + * @see {@link yfiles.input.EdgeEndMovementInfo} + */ + export interface MovementInfo extends Object{ + /** + * Gets or sets the horizontal movement info to which this info is anchored horizontally. + * This info can be declared to be implicitly anchored to another info. Method {@link yfiles.input.MovementInfo#movesHorizontallyInSyncWith} + * will try to match against the anchors to determine if two infos are moving in sync. + * Value: The horizontal anchor or null. + */ + horizontalAnchor:yfiles.input.MovementInfo; + /** + * Gets or sets the vertical movement info to which this info is anchored vertically. + * This info can be declared to be implicitly anchored to another info. Method {@link yfiles.input.MovementInfo#movesVerticallyInSyncWith} + * will try to match against the anchors to determine if two infos are moving in sync. + * Value: The vertical anchor or null. + */ + verticalAnchor:yfiles.input.MovementInfo; + /** + * Gets the original location of the element at the time the editing started. + * Value: The original location. + */ + originalLocation:yfiles.geometry.PointD; + /** + * Gets the current location as a live point. + * Value: The current location. + */ + currentLocation:yfiles.geometry.IPoint; + /** + * Indicates the type of the movement for this instance. + */ + moveType:yfiles.input.MoveTypes; + /** + * Determines whether this instances moves in sync with the provided info. + * @param {yfiles.input.MovementInfo} info The info to check. + * @return {boolean} Whether this info and the given info move vertically in sync. + * @see {@link yfiles.input.MovementInfo#verticalAnchor} + */ + movesVerticallyInSyncWith(info:yfiles.input.MovementInfo):boolean; + /** + * Determines whether this instances moves in sync with the provided info. + * @param {yfiles.input.MovementInfo} info The info to check. + * @return {boolean} Whether this info and the given info move horizontally in sync. + * @see {@link yfiles.input.MovementInfo#horizontalAnchor} + */ + movesHorizontallyInSyncWith(info:yfiles.input.MovementInfo):boolean; + /** + * Gets a value indicating whether the y coordinate of the item is fixed during the move operation. + */ + isVerticallyFixed:boolean; + /** + * Gets a value indicating whether the x coordinate of the item is fixed during the move operation. + */ + isHorizontallyFixed:boolean; + /** + * Gets the new x coordinate of the element if the mouse has been moved by dx during the gesture. + * This takes the {@link yfiles.input.MovementInfo#moveType} and {@link yfiles.input.MovementInfo#originalLocation} into account. + * @param {number} dx The delta x coordinate. + * @return {number} The new x coordinate. + */ + getX(dx:number):number; + /** + * Gets the new y coordinate of the element if the mouse has been moved by dy during the gesture. + * This takes the {@link yfiles.input.MovementInfo#moveType} and {@link yfiles.input.MovementInfo#originalLocation} into account. + * @param {number} dy The delta y coordinate. + * @return {number} The new y coordinate. + */ + getY(dy:number):number; + } + var MovementInfo:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.MovementInfo} class. + * @param {yfiles.geometry.PointD} originalLocation The original location. + * @param {yfiles.input.MoveTypes} moveType The type of the move. + */ + new (originalLocation:yfiles.geometry.PointD,moveType:yfiles.input.MoveTypes):yfiles.input.MovementInfo; + }; + /** + * Concrete {@link yfiles.input.SnapContext} implementation which handles snapping movement for {@link yfiles.graph.IGraph} items. + * This class provides a set of properties that determine the way snapping operations are being performed in the context of {@link yfiles.graph.IGraph}s. + * {@link yfiles.input.IPositionHandler} implementations and the like can use the following idiom to retrieve instances of this class: + *

+    * var snapContext = inputModeContext.lookup(SnapContext.$class);
+    * if (snapContext !== null && snapContext.isInitializing) {
+    *  ...
+    * 
+ * @see {@link yfiles.input.GraphEditorInputMode} + * @see {@link yfiles.input.MainInputMode#snapContext} + */ + export interface GraphSnapContext extends yfiles.input.SnapContext{ + /** + * Disposes of all previously temporarily collected state and clears the {@link yfiles.input.SnapContext#snapResults} collection. + * Subclasses should make sure to call the base implementation as their last operation. + * @see Overrides {@link yfiles.input.SnapContext#cleanUp} + */ + cleanUp():void; + /** + * Called by {@link yfiles.input.IInputMode} implementations when an interactive drag is started. + * Initializes the list of nodes to be moved. Called by the wrapping position handler + * on initialization of a drag action. + * @param {yfiles.input.IInputModeContext} context The context in which the interactive drag is started. + * @param {yfiles.geometry.PointD} originalLocation The original location of the mouse. + * @throws {yfiles.system.InvalidOperationException} If this context is already {@link yfiles.input.SnapContext#isInitialized initialized}. + * @see Overrides {@link yfiles.input.SnapContext#initializeDrag} + */ + initializeDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * Gets the nodes that stay fixed for the current edit. + * Value: The fixed nodes. + */ + fixedNodes:yfiles.collections.ICollection; + /** + * Collects a list of snap lines. + * This method has been overridden to collect the snap lines for all fixed graph elements and {@link yfiles.input.GraphSnapContext#cropSnapLines crop} + * them after collection. + * @see {@link yfiles.input.GraphSnapContext#onCollectSnapLines} + * @see {@link yfiles.input.GraphSnapContext#cropSnapLines} + * @see Overrides {@link yfiles.input.SnapContext#dragInitialized} + */ + dragInitialized():void; + /** + * Raises the {@link yfiles.input.GraphSnapContext#addCollectSnapLinesListener CollectSnapLines} event. + * @param {yfiles.input.CollectGraphSnapLinesEventArgs} args The {@link yfiles.input.CollectGraphSnapLinesEventArgs} instance containing the event data. + */ + onCollectSnapLines(args:yfiles.input.CollectGraphSnapLinesEventArgs):void; + /** + * Occurs every time this instance has been {@link yfiles.input.SnapContext#dragInitialized initialized} to + * collect {@link yfiles.input.OrthogonalSnapLine}s. + * Event handlers should add snap lines to the caller using the methods provided by + * {@link yfiles.input.CollectGraphSnapLinesEventArgs}. + */ + addCollectSnapLinesListener(value:(sender:Object,e:yfiles.input.CollectGraphSnapLinesEventArgs)=> void):void; + /** + * Occurs every time this instance has been {@link yfiles.input.SnapContext#dragInitialized initialized} to + * collect {@link yfiles.input.OrthogonalSnapLine}s. + * Event handlers should add snap lines to the caller using the methods provided by + * {@link yfiles.input.CollectGraphSnapLinesEventArgs}. + */ + removeCollectSnapLinesListener(value:(sender:Object,e:yfiles.input.CollectGraphSnapLinesEventArgs)=> void):void; + /** + * Adds an item which will be moved. + * Items should be added using the type specific methods {@link yfiles.input.GraphSnapContext#addNodeToBeMoved}, + * {@link yfiles.input.GraphSnapContext#addBendToBeMoved}, and {@link yfiles.input.GraphSnapContext#addPortToBeMoved}, rather than using this method. + * @param {yfiles.model.IModelItem} item The item to be added. + */ + addItemToBeMoved(item:yfiles.model.IModelItem):void; + /** + * Adds an item which will be reshaped. + * @param {yfiles.model.IModelItem} item The item to be reshaped. + */ + addItemToBeReshaped(item:yfiles.model.IModelItem):void; + /** + * Determines whether this instance should collect {@link yfiles.input.GraphSnapContext#fixedSegmentSnapLines fixed snap lines} for edge segments. + * The default is true. + * @see {@link yfiles.input.ISnapLineProvider} + * @see {@link yfiles.input.GraphSnapContext#collectFixedSegmentSnapLines} + */ + collectEdgeSnapLines:boolean; + /** + * Determines whether this instance should collect the sizes of fixed nodes. + * The default is true. + * @see {@link yfiles.input.GraphSnapContext#collectSameSizeEntries} + */ + collectNodeSizes:boolean; + /** + * Determines whether this instance should collect {@link yfiles.input.GraphSnapContext#fixedNodeSnapLines fixed snap lines} for nodes. + * The default is true. + * @see {@link yfiles.input.ISnapLineProvider} + * @see {@link yfiles.input.GraphSnapContext#collectFixedNodeSnapLines} + */ + collectNodeSnapLines:boolean; + /** + * Determines whether this instance should collect {@link yfiles.input.GraphSnapContext#fixedPortSnapLines fixed snap lines} for ports. + * The default is true. + * @see {@link yfiles.input.ISnapLineProvider} + * @see {@link yfiles.input.GraphSnapContext#collectFixedPortSnapLines} + */ + collectPortSnapLines:boolean; + /** + * Whether this context will automatically snap the movements of bends so that the two adjacent + * segments become horizontally or vertically oriented. + * The default is true. + */ + snapBendAdjacentSegments:boolean; + /** + * Whether this context will automatically snap the movements of nodes so + * that the first and last segments of edges become orthogonal. + * The default is true. + */ + snapPortAdjacentSegments:boolean; + /** + * Determines whether this context will automatically snap orthogonal edge segments to snap lines. + * The default is true. + */ + snapSegmentsToSnapLines:boolean; + /** + * Whether this context will automatically snap the bends to snap lines. + * The default is false. + */ + snapBendsToSnapLines:boolean; + /** + * Whether {@link yfiles.input.INodeSnapResultProvider} implementations should snap nodes to snap lines. + * The default is true. + */ + snapNodesToSnapLines:boolean; + /** + * The preferred distance between node borders. This will influence the creation of the node snap lines. + * For each fixed node there will be snap lines on the borders of the node itself and around the node at + * the specified distance. + * The default is 0.0d which disables distant snap lines around the nodes. + */ + nodeToNodeDistance:number; + /** + * The preferred distance between node borders and edge segments. This will influence the creation + * of the node snap lines. For each fixed node there will be snap lines on the borders of the node + * itself and around the node at the specified distance to which orthogonal edge segments can snap. + * The default is -1.0d which disables distant snap lines around the nodes for edge segments. + */ + nodeToEdgeDistance:number; + /** + * Gets the preferred distance between edges. This will influence the creation of the segment snap lines. + * For each orthogonally oriented fixed segment there will be snap lines on the segment itself and to both + * sides of the segment at the specified distance. + * The default is 0.0d which disables parallel snap lines. + */ + edgeToEdgeDistance:number; + /** + * Determines whether this context will automatically snap the movement in such a way that the overall + * move gesture is constrained to the horizontal or vertical axis. + * The default is false. + */ + snapOrthogonalMovement:boolean; + /** + * Determines whether this instance will try to align the centers of adjacent nodes so that their centers + * are equally far away from each other. Note that this will only make a difference for differently sized nodes. + * By default this feature is turned off, so that the instance will try to distribute nodes evenly, + * so that there is the same spacing between their borders, not between their centers. + */ + collectNodePairCenterSnapLines:boolean; + /** + * Gets or sets a value indicating whether this instance will collect pairs of adjacent nodes and add snapping logic + * so that moved nodes will snap so that the distances to the adjacent nodes are equal. + * Value: + * true if pairs of nodes should be collected for additional snap lines; otherwise, false. The default is true + */ + collectNodePairSnapLines:boolean; + /** + * Gets or sets a value indicating whether this instance will collect pairs of adjacent nodes and add snapping logic + * so that moved edge segments will snap so that the distances to the adjacent nodes are equal. + * Value: + * true if pairs of nodes should be collected for additional edge snap lines; otherwise, false. The default is true + */ + collectNodePairSegmentSnapLines:boolean; + /** + * Gets or sets the type of the grid snapping that should be performed. + * Determines which grid elements an object should snap to. + * @see {@link yfiles.input.GraphSnapContext#nodeGridConstraintProvider} + * @see {@link yfiles.input.GraphSnapContext#bendGridConstraintProvider} + * @see {@link yfiles.input.GraphSnapContext#portGridConstraintProvider} + */ + gridSnapType:yfiles.canvas.GridSnapType; + /** + * Gets or sets the GridSnapDistance. + * The maximum distance between the current mouse coordinates + * and the coordinates to which the mouse will snap. The distance is interpreted in view coordinates. + */ + gridSnapDistance:number; + /** + * Gets or sets the grid constraint provider for the {@link yfiles.graph.INode}s. + * Value: The node grid constraint provider, or null if none is set. + */ + nodeGridConstraintProvider:yfiles.input.IGridConstraintProvider; + /** + * Gets or sets the grid constraint provider for the {@link yfiles.graph.IBend}s. + * Value: The bend grid constraint provider, or null if none is set. + */ + bendGridConstraintProvider:yfiles.input.IGridConstraintProvider; + /** + * Gets or sets the grid constraint provider for the {@link yfiles.graph.IPort}s. + * Value: The port grid constraint provider, or null if none is set. + */ + portGridConstraintProvider:yfiles.input.IGridConstraintProvider; + /** + * The amount by which snap lines that are induced by existing edge segments and node borders are being extended. + * The default is 40.0d, this value will be used to extend the ends of the snap lines. + */ + snapLineExtension:number; + /** + * Whether to crop the snap lines at obstacles. + * The default is true + */ + cropSnapLines:boolean; + /** + * Adds a node which will be moved. + * @param {yfiles.input.NodeMovementInfo} info The node to be moved. + */ + addNodeToBeMoved(info:yfiles.input.NodeMovementInfo):void; + /** + * Adds a bend which will be moved. + * @param {yfiles.input.BendMovementInfo} info The {@link yfiles.input.BendMovementInfo} which represents the bend to be moved. + */ + addBendToBeMoved(info:yfiles.input.BendMovementInfo):void; + /** + * Adds a port which will be moved. + * @param {yfiles.input.PortMovementInfo} info The {@link yfiles.input.PortMovementInfo} which represents the port to be moved. + */ + addPortToBeMoved(info:yfiles.input.PortMovementInfo):void; + /** + * Adds an edge end that will be moved. + * @param {yfiles.input.EdgeEndMovementInfo} info The {@link yfiles.input.EdgeEndMovementInfo} which represents the edge end to be moved. + */ + addEdgeEndToBeMoved(info:yfiles.input.EdgeEndMovementInfo):void; + /** + * Gets the {@link yfiles.input.MovementInfo movement information} for the provided edge. + * The result describes the shape of the edge and the reshaping behavior of the geometry. + * The first element in the array is the source end of the edge, followed by bend like elements and the target side. + * Note that it cannot in general be assumed that the exact runtime type of the first and last element is either + * {@link yfiles.input.PortMovementInfo} or {@link yfiles.input.EdgeEndMovementInfo}, also items in between may not necessarily be + * bound to {@link yfiles.graph.IBend}s and can therefore be of a different type than {@link yfiles.input.BendMovementInfo}. + * @param {yfiles.graph.IEdge} edge The edge to obtain the movement information of. + * @return {yfiles.input.MovementInfo[]} An array of {@link yfiles.input.MovementInfo}s items that describe the geometry of the edge being modified. + */ + getMovementInfos(edge:yfiles.graph.IEdge):yfiles.input.MovementInfo[]; + /** + * Gets the movement info for the given node. + * This is either the info passed to {@link yfiles.input.GraphSnapContext#addNodeToBeMoved} or another, dynamically created instance, + * if no specific one had been registered. + * @param {yfiles.graph.INode} node The node to obtain the info for. + * @return {yfiles.input.NodeMovementInfo} An instance of {@link yfiles.input.NodeMovementInfo} that describes the movement of the node. + */ + getMovementInfo(node:yfiles.graph.INode):yfiles.input.NodeMovementInfo; + /** + * Gets the movement info for the given port. + * This is either the info passed to {@link yfiles.input.GraphSnapContext#addNodeToBeMoved} or another, dynamically created instance, + * if no specific one had been registered. + * @param {yfiles.graph.IPort} port The port to obtain the info for. + * @return {yfiles.input.PortMovementInfo} An instance of {@link yfiles.input.PortMovementInfo} that describes the movement of the port. + */ + getMovementInfoWithPort(port:yfiles.graph.IPort):yfiles.input.PortMovementInfo; + /** + * Collects snap lines for edge segments. + * Delegates to the {@link yfiles.input.ISnapLineProvider} implementation in the lookup of the {@link yfiles.graph.IEdge}. + * This implementation should then make us of {@link yfiles.input.GraphSnapContext#getMovementInfos} to determine what segments are fixed. + */ + collectFixedSegmentSnapLines(args:yfiles.input.CollectGraphSnapLinesEventArgs):void; + /** + * Collects the {@link yfiles.input.OrthogonalSnapLine}s for the nodes which are not moving. + * Delegates to the {@link yfiles.input.ISnapLineProvider} implementation in the lookup of the {@link yfiles.graph.INode}. + */ + collectFixedNodeSnapLines(args:yfiles.input.CollectGraphSnapLinesEventArgs):void; + /** + * Collects the {@link yfiles.input.OrthogonalSnapLine}s for the ports which are not moving. + * Delegates to the {@link yfiles.input.ISnapLineProvider} implementation in the lookup of the {@link yfiles.graph.IPort}. + */ + collectFixedPortSnapLines(args:yfiles.input.CollectGraphSnapLinesEventArgs):void; + /** + * Finds pairs of nodes that can see each other to create {@link yfiles.input.GraphSnapContext#collectNodePairCenterSnapLines center} + * and {@link yfiles.input.GraphSnapContext#collectNodePairSnapLines same distance} snap lines. + */ + collectVisibleNodePairs():void; + /** + * Collects all node widths and heights in the collections + * {@link yfiles.input.GraphSnapContext#findSameWidthEntries} and {@link yfiles.input.GraphSnapContext#findSameHeightEntries}. + * This method will only be called if {@link yfiles.input.GraphSnapContext#collectNodeSizes} is enabled and delegates to + * {@link yfiles.input.GraphSnapContext#addSameHeightEntry} and {@link yfiles.input.GraphSnapContext#addSameWidthEntry}. + */ + collectSameSizeEntries():void; + /** + * Adds an entry for the same-height-snapping. + * During {@link yfiles.input.SnapContext#isInitializing initialization} this method can be used + * to register entries that can later be retrieved using the {@link yfiles.input.GraphSnapContext#findSameHeightEntries} method. + * The rectangle will be used to obtain the height value and will also be used for the visualization + * of the snap result. + * @param {yfiles.geometry.RectD} rect The rectangle to obtain the height value from. This rectangle will be used for the snap result + * visualization. + * @see {@link yfiles.input.GraphSnapContext#addSameWidthEntry} + */ + addSameHeightEntry(rect:yfiles.geometry.RectD):void; + /** + * Adds an entry for the same-width-snapping. + * During {@link yfiles.input.SnapContext#isInitializing initialization} this method can be used + * to register entries that can later be retrieved using the {@link yfiles.input.GraphSnapContext#findSameWidthEntries} method. + * The rectangle will be used to obtain the width value and will also be used for the visualization + * of the snap result. + * @param {yfiles.geometry.RectD} rect The rectangle to obtain the width value from. This rectangle will be used for the snap result + * visualization. + * @see {@link yfiles.input.GraphSnapContext#addSameHeightEntry} + */ + addSameWidthEntry(rect:yfiles.geometry.RectD):void; + /** + * Finds the entries ({@link yfiles.geometry.RectD}s) that have been registered using the {@link yfiles.input.GraphSnapContext#addSameWidthEntry} previously + * that best match the given constraints. + * @param {number} size The size to find the closest set of identical sizes. + * @param {number} maxSize The maximum allowed size. + * @param {number} minSize The minimum allowed size. + * @param {number} resultingSize The resulting size. + * @param {yfiles.collections.IEnumerable.} rects The rectangles that have been added previously using {@link yfiles.input.GraphSnapContext#addSameWidthEntry}. + * @return {boolean} Whether an entry was found. + */ + findSameWidthEntries(size:number,maxSize:number,minSize:number,resultingSize:{value:number;},rects:{value:yfiles.collections.IEnumerable;}):boolean; + /** + * Finds the entries ({@link yfiles.geometry.RectD}s) that have been registered using the {@link yfiles.input.GraphSnapContext#addSameHeightEntry} previously + * that best match the given constraints. + * @param {number} size The size to find the closest set of identical sizes. + * @param {number} maxSize The maximum allowed size. + * @param {number} minSize The minimum allowed size. + * @param {number} resultingSize The resulting size. + * @param {yfiles.collections.IEnumerable.} rects The rectangles that have been added previously using {@link yfiles.input.GraphSnapContext#addSameHeightEntry}. + * @return {boolean} Whether an entry was found. + */ + findSameHeightEntries(size:number,maxSize:number,minSize:number,resultingSize:{value:number;},rects:{value:yfiles.collections.IEnumerable;}):boolean; + /** + * The collection of {@link yfiles.input.OrthogonalSnapLine}s for fixed nodes. + * This collection is only available if {@link yfiles.input.SnapContext#isInitialized} + * is true. + * @see {@link yfiles.input.GraphSnapContext#getFixedNodeSnapLines} + */ + fixedNodeSnapLines:yfiles.collections.IEnumerable; + /** + * The collection of {@link yfiles.input.OrthogonalSnapLine}s for fixed segments. + * This collection is only available if {@link yfiles.input.SnapContext#isInitialized} + * is true. + * @see {@link yfiles.input.GraphSnapContext#getFixedSegmentSnapLines} + */ + fixedSegmentSnapLines:yfiles.collections.IEnumerable; + /** + * The collection of {@link yfiles.input.OrthogonalSnapLine}s to which ports should be snapping. + * This collection is only available if {@link yfiles.input.SnapContext#isInitialized} + * is true. + * @see {@link yfiles.input.GraphSnapContext#getFixedPortSnapLines} + */ + fixedPortSnapLines:yfiles.collections.IEnumerable; + /** + * The collection of additional {@link yfiles.input.OrthogonalSnapLine}s. + * This collection is only available if {@link yfiles.input.SnapContext#isInitialized} + * is true. + * @see {@link yfiles.input.GraphSnapContext#getAdditionalSnapLines} + */ + additionalSnapLines:yfiles.collections.IEnumerable; + /** + * Gets a subset of {@link yfiles.input.GraphSnapContext#fixedNodeSnapLines} that matches the given orientation, + * snapTypes and intersects with the provided area. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the lines to return. + * @param {yfiles.input.SnapLineSnapType} snapTypes The snap types to be included. + * @param {yfiles.geometry.RectD} area The area to test for intersection. + * @return {yfiles.collections.IEnumerable.} An enumerable of the snap lines that match the provided criteria. + */ + getFixedNodeSnapLines(orientation:yfiles.input.SnapLineOrientation,snapTypes:yfiles.input.SnapLineSnapType,area:yfiles.geometry.RectD):yfiles.collections.IEnumerable; + /** + * Gets a subset of {@link yfiles.input.GraphSnapContext#fixedSegmentSnapLines} that matches the given orientation, + * snapTypes and intersects with the provided area. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the lines to return. + * @param {yfiles.input.SnapLineSnapType} snapTypes The snap types to be included. + * @param {yfiles.geometry.RectD} area The area to test for intersection. + * @return {yfiles.collections.IEnumerable.} An enumerable of the snap lines that match the provided criteria. + */ + getFixedSegmentSnapLines(orientation:yfiles.input.SnapLineOrientation,snapTypes:yfiles.input.SnapLineSnapType,area:yfiles.geometry.RectD):yfiles.collections.IEnumerable; + /** + * Gets a subset of {@link yfiles.input.GraphSnapContext#fixedPortSnapLines} that matches the given orientation, + * snapTypes and intersects with the provided area. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the lines to return. + * @param {yfiles.input.SnapLineSnapType} snapTypes The snap types to be included. + * @param {yfiles.geometry.RectD} area The area to test for intersection. + * @return {yfiles.collections.IEnumerable.} An enumerable of the snap lines that match the provided criteria. + */ + getFixedPortSnapLines(orientation:yfiles.input.SnapLineOrientation,snapTypes:yfiles.input.SnapLineSnapType,area:yfiles.geometry.RectD):yfiles.collections.IEnumerable; + /** + * Gets a subset of {@link yfiles.input.GraphSnapContext#additionalSnapLines} that matches the given orientation, + * snapTypes and intersects with the provided area. + * @param {yfiles.input.SnapLineOrientation} orientation The orientation of the lines to return. + * @param {yfiles.input.SnapLineSnapType} snapTypes The snap types to be included. + * @param {yfiles.geometry.RectD} area The area to test for intersection. + * @return {yfiles.collections.IEnumerable.} An enumerable of the snap lines that match the provided criteria. + */ + getAdditionalSnapLines(orientation:yfiles.input.SnapLineOrientation,snapTypes:yfiles.input.SnapLineSnapType,area:yfiles.geometry.RectD):yfiles.collections.IEnumerable; + /** + * Adds an orthogonally moved segment to this context for which this instance will + * automatically collect {@link yfiles.input.SnapResult}s and provide a default visualization. + * This method can be called during initialization to collect orthogonal segments that should + * be tested against {@link yfiles.input.GraphSnapContext#fixedSegmentSnapLines} and {@link yfiles.input.GraphSnapContext#additionalSnapLines}. + * @param {yfiles.input.MovementInfo} segStart The starting point of the manipulated segment. + * @param {yfiles.input.MovementInfo} segEnd The end point of the manipulated segment. + */ + addOrthogonalSegment(segStart:yfiles.input.MovementInfo,segEnd:yfiles.input.MovementInfo):void; + /** + * Helper method that wraps the given context so that a {@link yfiles.support.ILookup#lookup} + * query on the wrapped context for the {@link yfiles.input.SnapContext} type yields this instance. + * @param {yfiles.input.IInputModeContext} context The context to wrap and delegate all calls to. + * @return {yfiles.input.IInputModeContext} A modified instance that yields this instance if it is queried for the {@link yfiles.input.SnapContext} type. + */ + wrapContext(context:yfiles.input.IInputModeContext):yfiles.input.IInputModeContext; + } + var GraphSnapContext:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with default settings. + */ + new ():yfiles.input.GraphSnapContext; + }; + /** + * An {@link yfiles.input.IInputMode} that can {@link yfiles.input.NavigationInputMode#moveTo navigate} + * an {@link yfiles.graph.IGraph} displayed in a {@link yfiles.input.NavigationInputMode#graphControl}. + */ + export interface NavigationInputMode extends yfiles.input.AbstractConcurrentInputMode{ + /** + * Gets or sets the item types that can be navigated to by this mode. + * Value: The navigable items. + * @see {@link yfiles.input.NavigationInputMode#shouldBeNavigatedTo} + */ + navigableItems:yfiles.graph.GraphItemTypes; + /** + * Gets the types of the items that should be selectable by this instance. + * The selectable items. The default value is {@link yfiles.graph.GraphItemTypes#NODE}. + */ + selectableItems:yfiles.graph.GraphItemTypes; + /** + * Gets or sets the the location that should be kept fixed if toggling a group node state. + * Default value is {@link yfiles.input.NodeAlignmentPolicy#NONE} + * @see {@link yfiles.input.NavigationInputMode#expandGroup} + * @see {@link yfiles.input.NavigationInputMode#collapseGroup} + */ + autoGroupNodeAlignmentPolicy:yfiles.input.NodeAlignmentPolicy; + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Gets or sets the graph control this mode acts on. + * Value: The graph control. + */ + graphControl:yfiles.canvas.GraphControl; + /** + * Gets the list of commands that are available in this instance. + * By default, all supported commands are available + *

+ * Removing commands from this collection also removes the command bindings + * registered by this instance. + *

+ *

+ * Add supported commands to make them available in this instance. + *

+ *

+ * Supported commands are + *

    + *
  • {@link yfiles.system.ComponentCommands#MOVE_LEFT}
  • + *
  • {@link yfiles.system.ComponentCommands#MOVE_RIGHT}
  • + *
  • {@link yfiles.system.ComponentCommands#MOVE_UP}
  • + *
  • {@link yfiles.system.ComponentCommands#MOVE_DOWN}
  • + *
  • {@link yfiles.system.ComponentCommands#MOVE_TO_PAGE_UP}
  • + *
  • {@link yfiles.system.ComponentCommands#MOVE_TO_PAGE_DOWN}
  • + *
  • {@link yfiles.system.ComponentCommands#MOVE_FOCUS_BACK}
  • + *
  • {@link yfiles.system.ComponentCommands#MOVE_FOCUS_FORWARD}
  • + *
  • {@link yfiles.system.ComponentCommands#MOVE_FOCUS_UP}
  • + *
  • {@link yfiles.system.ComponentCommands#MOVE_FOCUS_DOWN}
  • + *
  • {@link yfiles.system.ComponentCommands#MOVE_FOCUS_PAGE_UP}
  • + *
  • {@link yfiles.system.ComponentCommands#MOVE_FOCUS_PAGE_DOWN}
  • + *
  • {@link yfiles.system.ComponentCommands#EXTEND_SELECTION_LEFT}
  • + *
  • {@link yfiles.system.ComponentCommands#EXTEND_SELECTION_RIGHT}
  • + *
  • {@link yfiles.system.ComponentCommands#EXTEND_SELECTION_UP}
  • + *
  • {@link yfiles.system.ComponentCommands#EXTEND_SELECTION_DOWN}
  • + *
  • {@link yfiles.system.ComponentCommands#SELECT_TO_PAGE_UP}
  • + *
  • {@link yfiles.system.ComponentCommands#SELECT_TO_PAGE_DOWN}
  • + *
+ *

+ */ + availableCommands:yfiles.collections.ICollection; + /** + * Called when the {@link yfiles.input.AbstractConcurrentInputMode#enabled} property changes to true. + * This implementation does nothing. + */ + onEnabled():void; + /** + * Called when the {@link yfiles.input.AbstractConcurrentInputMode#enabled} property changes to false. + * This implementation sets the {@link yfiles.input.AbstractConcurrentInputMode#preferredCursor} property to null + * and {@link yfiles.input.AbstractConcurrentInputMode#releaseMutex releases} the mutex if the mutex is currently owned + * by this instance. + */ + onDisabled():void; + /** + * Gets or sets a value indicating whether to use the {@link yfiles.canvas.GraphControl#currentItem} + * as a fallback for the commands if no item is provided in the parameter and the current selection + * is empty. + * This applies to the following commands: + *
    + *
  • {@link yfiles.input.GraphCommands#ENTER_GROUP_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#EXPAND_GROUP_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#COLLAPSE_GROUP_COMMAND}
  • + *
  • {@link yfiles.input.GraphCommands#TOGGLE_GROUP_STATE_COMMAND}
  • + *
+ * Value: + * true if the current item should be used as a fallback; otherwise, false, which is the default. + */ + useCurrentItemForCommands:boolean; + /** + * Gets or sets the {@link yfiles.graph.IGraphSelection} this mode operates on. + * Value: The graph selection. + */ + graphSelection:yfiles.graph.IGraphSelection; + /** + * Gets or sets the graph this mode operates on. + * Value: The graph. + */ + graph:yfiles.graph.IGraph; + /** + * This method allows for entering a group node so that the currently + * displayed {@link yfiles.graph.IFoldedGraph}'s {@link yfiles.graph.IFoldedGraph#localRoot} + * will be reset to the provided node. + * It is possible to both use a local group node that is part of the currently displayed {@link yfiles.input.NavigationInputMode#graph} + * as the node argument, as well as an item that belongs to the + * {@link yfiles.graph.FoldingManager#masterHierarchy} to allow for switching to group nodes which are currently + * not being displayed in this view. + * @see {@link yfiles.input.NavigationInputMode#shouldEnterGroup} + * @see {@link yfiles.input.NavigationInputMode#enteringGroupsAllowed} + * @see {@link yfiles.graph.FoldingManager} + * @param {yfiles.graph.INode} node The node that needs to be either part of the current graph, or part of the {@link yfiles.graph.FoldingManager#masterHierarchy}. + */ + enterGroup(node:yfiles.graph.INode):void; + /** + * Callback that adjusts the {@link yfiles.canvas.CanvasControl#contentRect} to encompass + * all elements. + * This implementation will try to delegate to {@link yfiles.input.GraphEditorInputMode#adjustContentRect} + * if it can find the {@link yfiles.input.GraphEditorInputMode} in the {@link yfiles.input.AbstractInputMode#inputModeContext}, + * otherwise the {@link yfiles.canvas.GraphControl#FIT_GRAPH_BOUNDS_COMMAND} is executed. + */ + adjustContentRect():void; + /** + * Exits the current {@link yfiles.graph.IFoldedGraph#localRoot} of the currently displayed + * {@link yfiles.graph.IFoldedGraph} view and shows the contents of the parent container. + * This method will also {@link yfiles.input.MainInputMode#clearSelection clear the selection} + * and {@link yfiles.input.MainInputMode#setSelected select} the exited group node. + * @see {@link yfiles.graph.FoldingManager} + * @see {@link yfiles.input.NavigationInputMode#exitingGroupAllowed} + * @see {@link yfiles.input.NavigationInputMode#shouldExitGroup} + */ + exitGroup():void; + /** + * Predicate method that decides whether it is allowed to {@link yfiles.input.NavigationInputMode#enterGroup enter} the specific + * group node. + * This implementation yields the value of {@link yfiles.input.NavigationInputMode#enteringGroupsAllowed}. + * @param {yfiles.graph.INode} node The group node to enter. + * @return {boolean} Whether to enter the group or not. + */ + shouldEnterGroup(node:yfiles.graph.INode):boolean; + /** + * Gets or sets a value that determines whether it is allowed to {@link yfiles.input.NavigationInputMode#enterGroup enter group nodes} + * via the {@link yfiles.input.GraphCommands#ENTER_GROUP_COMMAND}. + * The default value is true. + * @see {@link yfiles.input.NavigationInputMode#shouldEnterGroup} + * @see {@link yfiles.graph.FoldingManager} + */ + enteringGroupsAllowed:boolean; + /** + * Gets or sets a value that determines whether it is allowed to {@link yfiles.input.NavigationInputMode#collapseGroup collapse group nodes} + * via the {@link yfiles.input.GraphCommands#COLLAPSE_GROUP_COMMAND}. + * The default value is true. + * @see {@link yfiles.input.NavigationInputMode#shouldCollapseGroup} + * @see {@link yfiles.graph.FoldingManager} + */ + collapsingGroupsAllowed:boolean; + /** + * Gets or sets a value that determines whether it is allowed to {@link yfiles.input.NavigationInputMode#expandGroup expand group nodes} + * via the {@link yfiles.input.GraphCommands#EXPAND_GROUP_COMMAND}. + * The default value is true. + * @see {@link yfiles.input.NavigationInputMode#shouldExpandGroup} + * @see {@link yfiles.graph.FoldingManager} + */ + expandingGroupsAllowed:boolean; + /** + * Gets or sets a value that determines whether it is allowed to {@link yfiles.input.NavigationInputMode#exitGroup exit the current group node} + * via the {@link yfiles.input.GraphCommands#EXIT_GROUP_COMMAND}. + * The default value is true. + * @see {@link yfiles.input.NavigationInputMode#shouldExitGroup} + * @see {@link yfiles.graph.FoldingManager} + */ + exitingGroupAllowed:boolean; + /** + * Gets or sets a value that determines whether {@link yfiles.canvas.CanvasControl#fitContent} or the {@link yfiles.canvas.CanvasControl#FIT_CONTENT_COMMAND} should + * be triggered after a group navigation action. + * The default value is true. + */ + fitContentAfterGroupActions:boolean; + /** + * Predicate method that decides whether it is allowed to {@link yfiles.input.NavigationInputMode#exitGroup exit} the current + * group node. + * This implementation yields the value of {@link yfiles.input.NavigationInputMode#exitingGroupAllowed}. + * @return {boolean} Whether to exit the current group or not. + */ + shouldExitGroup():boolean; + /** + * {@link yfiles.graph.IFoldedGraph#expand Expands} the given group node + * to show the contents of the collapsed group node in this {@link yfiles.graph.IFoldedGraph}. + * @param {yfiles.graph.INode} groupNode The group node to expand + * @see {@link yfiles.graph.FoldingManager} + * @see {@link yfiles.input.NavigationInputMode#expandingGroupsAllowed} + */ + expandGroup(groupNode:yfiles.graph.INode):void; + /** + * Event that will be triggered before a group will be {@link yfiles.input.NavigationInputMode#collapseGroup Collapsed}. + */ + addGroupCollapsingListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered before a group will be {@link yfiles.input.NavigationInputMode#collapseGroup Collapsed}. + */ + removeGroupCollapsingListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered whenever a group has been {@link yfiles.input.NavigationInputMode#collapseGroup Collapsed}. + */ + addGroupCollapsedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered whenever a group has been {@link yfiles.input.NavigationInputMode#collapseGroup Collapsed}. + */ + removeGroupCollapsedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered before a group will be {@link yfiles.input.NavigationInputMode#expandGroup Expanded}. + */ + addGroupExpandingListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered before a group will be {@link yfiles.input.NavigationInputMode#expandGroup Expanded}. + */ + removeGroupExpandingListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered whenever a group has been {@link yfiles.input.NavigationInputMode#expandGroup Expanded}. + */ + addGroupExpandedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered whenever a group has been {@link yfiles.input.NavigationInputMode#expandGroup Expanded}. + */ + removeGroupExpandedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered before a group will be {@link yfiles.input.NavigationInputMode#enterGroup Entered}. + */ + addGroupEnteringListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered before a group will be {@link yfiles.input.NavigationInputMode#enterGroup Entered}. + */ + removeGroupEnteringListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered whenever a group has been {@link yfiles.input.NavigationInputMode#enterGroup Entered}. + */ + addGroupEnteredListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered whenever a group has been {@link yfiles.input.NavigationInputMode#enterGroup Entered}. + */ + removeGroupEnteredListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered before a group will be {@link yfiles.input.NavigationInputMode#exitGroup Exited}. + */ + addGroupExitingListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered before a group will be {@link yfiles.input.NavigationInputMode#exitGroup Exited}. + */ + removeGroupExitingListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered whenever a group has been {@link yfiles.input.NavigationInputMode#exitGroup Exited}. + */ + addGroupExitedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered whenever a group has been {@link yfiles.input.NavigationInputMode#exitGroup Exited}. + */ + removeGroupExitedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupCollapsedListener GroupCollapsed} event. + * @param {yfiles.model.ItemEventArgs.} argument The {@link yfiles.model.ItemEventArgs} instance containing the event data. + */ + onGroupCollapsed(argument:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupExpandedListener GroupExpanded} event. + * @param {yfiles.model.ItemEventArgs.} argument The {@link yfiles.model.ItemEventArgs} instance containing the event data. + */ + onGroupExpanded(argument:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupEnteredListener GroupEntered} event. + * @param {yfiles.model.ItemEventArgs.} argument The {@link yfiles.model.ItemEventArgs} instance containing the event data. + */ + onGroupEntered(argument:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupExitedListener GroupExited} event. + * @param {yfiles.model.ItemEventArgs.} argument The {@link yfiles.model.ItemEventArgs} instance containing the event data. + */ + onGroupExited(argument:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupCollapsingListener GroupCollapsing} event. + * @param {yfiles.model.ItemEventArgs.} argument The {@link yfiles.model.ItemEventArgs} instance containing the event data. + */ + onGroupCollapsing(argument:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupExpandingListener GroupExpanding} event. + * @param {yfiles.model.ItemEventArgs.} argument The {@link yfiles.model.ItemEventArgs} instance containing the event data. + */ + onGroupExpanding(argument:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupEnteringListener GroupEntering} event. + * @param {yfiles.model.ItemEventArgs.} argument The {@link yfiles.model.ItemEventArgs} instance containing the event data. + */ + onGroupEntering(argument:yfiles.model.ItemEventArgs):void; + /** + * Raises the {@link yfiles.input.NavigationInputMode#addGroupExitingListener GroupExiting} event. + * @param {yfiles.model.ItemEventArgs.} argument The {@link yfiles.model.ItemEventArgs} instance containing the event data. + */ + onGroupExiting(argument:yfiles.model.ItemEventArgs):void; + /** + * Predicate method that decides whether it is allowed to {@link yfiles.input.NavigationInputMode#expandGroup expand} the given + * group node. + * This implementation yields the value of {@link yfiles.input.NavigationInputMode#expandingGroupsAllowed}. + * @return {boolean} Whether to expand the given group or not. + */ + shouldExpandGroup(node:yfiles.graph.INode):boolean; + /** + * Predicate method that decides whether it is allowed to {@link yfiles.input.NavigationInputMode#toggleGroupNodeState toggle} the collapsed + * state of the given group node. + * This implementation uses {@link yfiles.input.NavigationInputMode#shouldExpandGroup} and {@link yfiles.input.NavigationInputMode#shouldCollapseGroup} respectively. + * @return {boolean} Whether to expand the given group or not. + */ + shouldToggleGroupState(node:yfiles.graph.INode):boolean; + /** + * Performs {@link yfiles.input.NavigationInputMode#collapseGroup} for all {@link yfiles.graph.IGraphSelection#selectedNodes}. + */ + collapseSelection():void; + /** + * Performs {@link yfiles.input.NavigationInputMode#expandGroup} for all {@link yfiles.graph.IGraphSelection#selectedNodes}. + */ + expandSelection():void; + /** + * Performs {@link yfiles.input.NavigationInputMode#enterGroup} for the first valid {@link yfiles.graph.IGraphSelection#selectedNodes}. + */ + enterSelectedGroup():void; + /** + * {@link yfiles.graph.IFoldedGraph#collapse Collapses} the given group node + * to hide the contents of the group node from this {@link yfiles.graph.IFoldedGraph}. + * @param {yfiles.graph.INode} groupNode The group node to collapse. + * @see {@link yfiles.graph.FoldingManager} + * @see {@link yfiles.input.NavigationInputMode#collapsingGroupsAllowed} + */ + collapseGroup(groupNode:yfiles.graph.INode):void; + /** + * Determines whether the input mode should try to request the mutex when a command + * is executed. This resets the state of any other input mode, unless it currently + * possesses the mutex. + * The value of this method is queried for {@link yfiles.input.GraphCommands#COLLAPSE_GROUP_COMMAND}, + * {@link yfiles.input.GraphCommands#EXPAND_GROUP_COMMAND}, {@link yfiles.input.GraphCommands#TOGGLE_GROUP_STATE_COMMAND}, + * {@link yfiles.input.GraphCommands#ENTER_GROUP_COMMAND} and {@link yfiles.input.GraphCommands#EXIT_GROUP_COMMAND}. + * @return {boolean} whether the input mode should request the mutex. + */ + shouldRequestMutex():boolean; + /** + * Adjust the group node location according to the value of {@link yfiles.input.NavigationInputMode#autoGroupNodeAlignmentPolicy}. + * @param {boolean} collapse true iff the node has just been collapsed. + * @param {yfiles.graph.INode} groupNode The node that has changed its state. + */ + adjustGroupNodeLocation(collapse:boolean,groupNode:yfiles.graph.INode):void; + /** + * Toggles the {@link yfiles.graph.IFoldedGraph#isExpanded expanded/collapsed} state + * for the given group node in the {@link yfiles.graph.IFoldedGraph}. + * @param {yfiles.graph.INode} groupNode The group node to toggle the state for. + * @see {@link yfiles.graph.FoldingManager} + */ + toggleGroupNodeState(groupNode:yfiles.graph.INode):void; + /** + * Predicate method that decides whether it is allowed to {@link yfiles.input.NavigationInputMode#collapseGroup collapse} the given + * group node. + * This implementation returns the value of {@link yfiles.input.NavigationInputMode#collapsingGroupsAllowed}. + * @return {boolean} Whether to collapse the given group or not. + */ + shouldCollapseGroup(node:yfiles.graph.INode):boolean; + /** + * Sets the graph control to use for the various actions. + * This will register or unregister the {@link yfiles.system.CommandBinding}s for + * the control. + * This method is called in response to {@link yfiles.input.NavigationInputMode#install} and {@link yfiles.input.NavigationInputMode#uninstall}. + * @param {yfiles.canvas.GraphControl} newControl The control to use or null. + */ + setGraphControlCore(newControl:yfiles.canvas.GraphControl):void; + /** + * Moves the focus into the given direction, setting the selection + * to the new element. + * @param {yfiles.input.MoveFocusDirection} direction The direction to move the focus and selection. + */ + moveTo(direction:yfiles.input.MoveFocusDirection):void; + /** + * Moves the focus into the given direction, extending the selection + * to the new element. + * @param {yfiles.input.MoveFocusDirection} direction The direction to move the focus and extend the selection. + */ + extendSelectionTo(direction:yfiles.input.MoveFocusDirection):void; + /** + * Moves the focus into the given direction, not changing the current selection. + * @param {yfiles.input.MoveFocusDirection} direction The direction to move the focus. + */ + moveFocusTo(direction:yfiles.input.MoveFocusDirection):void; + /** + * Callback that actually sets the current item property. + * @param {yfiles.canvas.GraphControl} graphControl The graph control to set the current item of. + * @param {yfiles.model.IModelItem} item The item to set. + * @return {boolean} Whether the operation was actually performed. + */ + setCurrentItemForGraphControl(graphControl:yfiles.canvas.GraphControl,item:yfiles.model.IModelItem):boolean; + /** + * Sets the "current" item to the given one. + * @param {yfiles.model.IModelItem} item The item to set as the current item. + * @see {@link yfiles.input.NavigationInputMode#setCurrentItemForGraphControl} + */ + setCurrentItem(item:yfiles.model.IModelItem):void; + /** + * Callback that selects the given item. + * @param {yfiles.canvas.GraphControl} graphControl The graph control. + * @param {yfiles.model.IModelItem} item The item to select. + * @param {boolean} extendSelection if set to true the current selection is extended otherwise it is cleared beforehand. + * @see {@link yfiles.input.NavigationInputMode#clearSelection} + */ + selectItem(graphControl:yfiles.canvas.GraphControl,item:yfiles.model.IModelItem,extendSelection:boolean):void; + /** + * Selects the {@link yfiles.canvas.GraphControl#currentItem} current item. + * This method delegates to {@link yfiles.input.NavigationInputMode#selectItem}. + */ + selectCurrentItem():void; + /** + * Clears the selection in the graph control. + */ + clearSelection():void; + /** + * Callback predicate method that determines whether a given model item should be navigated to. + * This implementation uses the {@link yfiles.input.NavigationInputMode#navigableItems} property + * to determine whether the modelItem can be navigated to. + * @param {yfiles.model.IModelItem} modelItem The model item. + * @return {boolean} Whether the item should be considered for navigational commands. + */ + shouldBeNavigatedTo(modelItem:yfiles.model.IModelItem):boolean; + /** + * Callback predicate method that determines whether a given model item should be selected. + * This implementation uses the {@link yfiles.input.NavigationInputMode#selectableItems} property + * to determine whether the modelItem should be selected. + * @param {yfiles.model.IModelItem} modelItem The model item. + * @return {boolean} Whether the item should be selected by the navigational commands. + */ + shouldBeSelected(modelItem:yfiles.model.IModelItem):boolean; + } + var NavigationInputMode:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.NavigationInputMode} class. + */ + new ():yfiles.input.NavigationInputMode; + }; + /** + * Manages interactive snapping of {@link yfiles.graph.ILabel}s to their owner during drag operations like movements. + * This class provides a set of properties to customize the snapping behavior. + * {@link yfiles.input.IPositionHandler} implementations and similar classes can use the following idiom to get an instance of + * this class: + *

+    * var snapContext = inputModeContext.Get<SnapContext>() as LabelSnapContext;
+    * if (snapContext != null && snapContext.IsInitializing) {
+    * 
+ * @see {@link yfiles.input.MainInputMode#snapContext} + */ + export interface LabelSnapContext extends yfiles.input.SnapContext{ + /** + * Determines whether this instance should collect snap lines for the initial position of a label. + * Value: + * true if this instance should collect snap lines for the initial position of a label; otherwise, false. + * The default is true. + */ + collectInitialLocationSnapLines:boolean; + /** + * Determines whether this instance should collect six snap lines, two through the center and four through the + * border sides of the label owner. + * Value: + * true if this instance should collect snap lines through the border and center of the label owner; otherwise, + * false. + * The default is true. + */ + collectNodeShapeSnapLines:boolean; + /** + * Determines whether this instance should collect four snap lines in parallel to the owner's borders at the + * initial label distance. + * Note that the label snaps to these snap lines with the side that is closer to the node's border. That way, + * snapping to such a snap line preserves the perceived distance from the node border for both labels inside and + * outside the node bounds. + * Value: + * true if this instance should collect snap lines through the border and center of the label owner; otherwise, + * false. + * The default is true. + */ + collectOwnNodeDistanceSnapLines:boolean; + /** + * Determines whether this instance should collect snap lines in parallel to the border of the label owner at the + * distance of other node labels of that owner. + * Note that the label snaps to these snap lines with the side that is closer to the node's border. That way, + * snapping to such a snap line preserves the perceived distance from the node border for both labels inside and + * outside the node bounds. + * Value: + * true if this instance should collect this kind of snap lines; otherwise, false. + * The default is true. + */ + collectSameOwnerNodeDistanceSnapLines:boolean; + /** + * Determines whether this instance should collect snap lines in parallel to the border of the label owner at the + * distance of other node labels in the graph. + * Note that the label snaps to these snap lines with the side that is closer to the node's border. That way, + * snapping to such a snap line preserves the perceived distance from the node border for both labels inside and + * outside the node bounds. + * Value: + * true if this instance should collect this kind of snap lines; otherwise, false. + * The default is false. + */ + collectAllNodeDistanceSnapLines:boolean; + /** + * Determines whether this instance should collect snap lines on the edge path. + * Value: + * true if this instance should collect this kind of snap lines; otherwise, false. + * The default is true. + */ + collectEdgePathSnapLines:boolean; + /** + * Determines whether this instance should collect two snap lines in parallel to the edge path of the + * label owner at the initial distance of the edge label. + * Value: + * true if this instance should collect this kind of snap lines; otherwise, false. + * The default is true. + */ + collectOwnEdgeDistanceSnapLines:boolean; + /** + * Determines whether this instance should collect snap lines in parallel to the edge path of the label owner at the + * distances of all edge labels of that owner. + * Value: + * true if this instance should collect this kind of snap lines; otherwise, false. + * The default is true. + */ + collectSameOwnerEdgeDistanceSnapLines:boolean; + /** + * Determines whether this instance should collect snap lines in parallel to the edge path of the label owner at the + * distance of other edge labels in the graph. + * Value: + * true if this instance should collect this kind of snap lines; otherwise, false. + * The default is false. + */ + collectAllEdgeDistanceSnapLines:boolean; + /** + * Specifies whether this context will automatically snap the node labels to snap lines. + * Value: + * true if node labels will snap to snap lines; otherwise, false. + * The default is true. + */ + snapNodeLabels:boolean; + /** + * Specifies whether this context will automatically snap the edge labels to snap lines. + * Value: + * true if edge labels will snap to snap lines; otherwise, false. + * The default is true. + */ + snapEdgeLabels:boolean; + /** + * Gets or sets the amount by which snap lines that are induced by existing edge segments are being extended. + * Value: + * The amount by which snap lines that are induced by existing edge segments are being extended. + * The default is 40.0d, this value will be used to prolongate the ends of the snap lines. + */ + snapLineExtension:number; + /** + * The collection of the {@link yfiles.input.SnapLine snap lines} that have been {@link yfiles.input.LabelSnapContext#addSnapLine added} + * to this context. + * This collection is only available if {@link yfiles.input.SnapContext#isInitialized} + * is true. + * @see {@link yfiles.input.LabelSnapContext#addSnapLine} + */ + snapLines:yfiles.collections.IEnumerable; + /** + * Adds the given snapLine to the {@link yfiles.input.LabelSnapContext#snapLines snap line} collection of this + * context. + * @param {yfiles.input.SnapLine} snapLine The snap line to add. + * @see {@link yfiles.input.GraphSnapContext#additionalSnapLines} + */ + addSnapLine(snapLine:yfiles.input.SnapLine):void; + /** + * Occurs every time this instance has been {@link yfiles.input.SnapContext#dragInitialized initialized} to collect + * {@link yfiles.input.SnapLine}s. + * Event handlers should add snap lines to the caller using the methods provided by + * {@link yfiles.input.CollectLabelSnapLineEventArgs}. + */ + addCollectSnapLinesListener(value:(sender:Object,e:yfiles.input.CollectLabelSnapLineEventArgs)=> void):void; + /** + * Occurs every time this instance has been {@link yfiles.input.SnapContext#dragInitialized initialized} to collect + * {@link yfiles.input.SnapLine}s. + * Event handlers should add snap lines to the caller using the methods provided by + * {@link yfiles.input.CollectLabelSnapLineEventArgs}. + */ + removeCollectSnapLinesListener(value:(sender:Object,e:yfiles.input.CollectLabelSnapLineEventArgs)=> void):void; + /** + * Raises the {@link yfiles.input.LabelSnapContext#addCollectSnapLinesListener CollectSnapLines} event. + * @param {yfiles.input.CollectLabelSnapLineEventArgs} args + * The {@link yfiles.input.CollectLabelSnapLineEventArgs} instance containing the event data. + */ + onCollectSnapLines(args:yfiles.input.CollectLabelSnapLineEventArgs):void; + /** + * Collects a list of snap lines. + * Snap lines represent possible horizontal or vertical lines to which a moved item can "snap". + *

+ * This method is called in the {@link yfiles.input.MoveInputMode}'s or {@link yfiles.input.HandleInputMode}'s + * {@link yfiles.input.MoveInputMode#beginDrag} method after all items to be moved or reshaped + * have been added. + *

+ */ + dragInitialized():void; + /** + * Called by {@link yfiles.input.IInputMode} implementations when an interactive drag is started. + * Updates {@link yfiles.input.SnapContext#isInitializing}, {@link yfiles.input.SnapContext#originalLocation}, and {@link yfiles.input.SnapContext#currentInputModeContext} + * and then triggers the {@link yfiles.input.SnapContext#addInitializingListener Initializing} event. + * @param {yfiles.input.IInputModeContext} context The context in which the interactive drag is started. + * @param {yfiles.geometry.PointD} originalLocation The original location of the mouse. + * @throws {yfiles.system.InvalidOperationException} If this context is already {@link yfiles.input.SnapContext#isInitialized initialized}. + */ + initializeDrag(context:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * This method can be called by the {@link yfiles.input.IInputMode} while this instance {@link yfiles.input.SnapContext#isInitialized} + * alternatively to {@link yfiles.input.SnapContext#handleMove}. + * Calling this method will temporarily disable any snapping operations and clears all {@link yfiles.input.SnapContext#snapResults}. + * @see {@link yfiles.input.SnapContext#initializeDrag} + * @see {@link yfiles.input.SnapContext#handleMove} + * @see {@link yfiles.input.SnapContext#dragged} + * @see {@link yfiles.input.SnapContext#cancelDrag} + * @see {@link yfiles.input.SnapContext#dragFinished} + */ + disableSnapping():void; + /** + * Performs clean up procedures. + * This is called in response to {@link yfiles.input.SnapContext#cancelDrag} and {@link yfiles.input.SnapContext#dragFinished} as well as initially during {@link yfiles.input.SnapContext#initializeDrag}. + */ + cleanUp():void; + /** + * Helper method that wraps the given context so that a {@link yfiles.support.ILookup#lookup} + * query on the wrapped context for the {@link yfiles.input.SnapContext} type yields this instance. + * @param {yfiles.input.IInputModeContext} context The context to wrap and delegate all calls to. + * @return {yfiles.input.IInputModeContext} A modified instance that yields this instance if it is queried for the {@link yfiles.input.SnapContext} type. + */ + wrapContext(context:yfiles.input.IInputModeContext):yfiles.input.IInputModeContext; + } + var LabelSnapContext:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.LabelSnapContext} class. + */ + new ():yfiles.input.LabelSnapContext; + }; + /** + * The event arguments used by {@link yfiles.input.LabelSnapContext} to collect custom snap lines for each drag. + * @see {@link yfiles.input.LabelSnapContext#addCollectSnapLinesListener CollectSnapLines} + */ + export interface CollectLabelSnapLineEventArgs extends yfiles.input.InputModeEventArgs{ + /** + * Adds the given snap line to the snap line collection of this class. + * @param {yfiles.input.OrthogonalSnapLine} snapLine the snap line to add. + */ + addSnapLine(snapLine:yfiles.input.OrthogonalSnapLine):void; + } + var CollectLabelSnapLineEventArgs:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this class. + * @param {yfiles.input.IInputModeContext} context The context this event is being used in. + * @param {yfiles.collections.ICollection.} snapLines The snap lines collection to add to. + */ + new (context:yfiles.input.IInputModeContext,snapLines:yfiles.collections.ICollection):yfiles.input.CollectLabelSnapLineEventArgs; + }; + export enum ReparentGesture{ + /** + * Add the moved stripe as a new child of the target stripe. + */ + ADD_CHILD, + /** + * Insert the moved stripe before the target stripe. + */ + INSERT_BEFORE, + /** + * Insert the moved stripe after the target stripe. + */ + INSERT_AFTER, + /** + * The current gesture would result in an invalid operation (such as trying to make a stripe to its own child). + */ + INVALID + } + export enum SegmentOrientation{ + /** + * The segment has a horizontal orientation, i.e. the end points should be moved vertically in synch + * so that the orientation is not destroyed. + */ + HORIZONTAL, + /** + * The segment has a vertical orientation, i.e. the end points should be moved horizontally in synch + * so that the orientation is not destroyed. + */ + VERTICAL, + /** + * The segment does not need to be treated especially, both endpoints can be moved independently from each other. + */ + NON_ORTHOGONAL + } + export enum MoveFocusDirection{ + /** + * No direction. + */ + NONE, + /** + * In the direction of the negative x Axis. + */ + LEFT, + /** + * In the direction of the positive x Axis. + */ + RIGHT, + /** + * In the direction of the negative y Axis. + */ + UP, + /** + * In the direction of the positive y Axis. + */ + DOWN, + /** + * In the direction of the {@link yfiles.graph.IHierarchy#getParent parent} in the {@link yfiles.graph.IGroupedGraph}. + */ + PARENT, + /** + * In the direction of the {@link yfiles.graph.IHierarchy#getChildren children} in the {@link yfiles.graph.IGroupedGraph}. + */ + CHILD + } + export enum NodeAlignmentPolicy{ + /** + * Don't fix any specific point. + */ + NONE, + /** + * Fix the center point. + */ + CENTER, + /** + * Fix the upper left corner. + */ + TOP_LEFT, + /** + * Fix the lower left corner. + */ + BOTTOM_LEFT, + /** + * Fix the upper right corner. + */ + TOP_RIGHT, + /** + * Fix the lower right corner. + */ + BOTTOM_RIGHT, + /** + * Fix the uppermost center. + */ + TOP_CENTER, + /** + * Fix the lowermost center. + */ + BOTTOM_CENTER, + /** + * Fix the left center. + */ + CENTER_LEFT, + /** + * Fix the right center. + */ + CENTER_RIGHT + } + /** + * An interface for objects that can install a visual representation of + * a highlight decoration of an item in the model displayed in a canvas. + * This interface is a tagging sub interface of the {@link yfiles.model.IModelItemInstaller} + * which fixes the type of the items to {@link Object}. + * This interface is used for {@link yfiles.support.ILookup#lookup} operations. + * @see {@link yfiles.model.HighlightPaintManager} + * @see {@link yfiles.model.ISelectionInstaller} + */ + export interface IHighlightInstaller extends Object,yfiles.model.IModelItemInstaller{ + } + var IHighlightInstaller:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface for objects that can install a visual + * focus indicator decoration of an item in the model displayed in a canvas. + * This interface is a tagging sub interface of the {@link yfiles.model.IModelItemInstaller} + * which fixes the type of the items to {@link Object}. + * This interface is used for {@link yfiles.support.ILookup#lookup} operations. + * @see {@link yfiles.model.FocusPaintManager} + * @see {@link yfiles.model.ISelectionInstaller} + * @see {@link yfiles.input.IHighlightInstaller} + */ + export interface IFocusIndicatorInstaller extends Object,yfiles.model.IModelItemInstaller{ + } + var IFocusIndicatorInstaller:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum ClickHandlingMode{ + /** + * Using this mode, in case of a double click, only the double click is reported, but neither of the two single clicks. + * Single clicks will be reported with a short delay to ensure that they do not become double clicks. + */ + DOUBLE_CLICK_ONLY, + /** + * In this mode, in case of a double click, only one single click is reported and one double click. The second + * click for the double click is not reported as a single click. + */ + INITIAL_SINGLE_AND_DOUBLE_CLICK, + /** + * In this mode, every click (i.e. both single click and either of the clicks of a multi-click) is reported as a single click + * and every double click is reported as a double click. + */ + BOTH_SINGLE_CLICKS_AND_DOUBLE_CLICK + } + /** + * An input mode that recognizes simple mouse clicks. + * Clients register to {@link yfiles.input.ClickInputMode#addClickedListener Clicked} to get notified of mouse clicks. + * The {@link yfiles.input.ClickInputMode#leftClick} property can be used to switch between the detection of + * right and left mouse clicks. + * This mode can be instructed to {@link yfiles.input.ClickInputMode#swallowFocusClick swallow clicks} + * if they lead happen shortly after the control gained focus. This is useful to prevent + * accidental clicks from being processed if the user wanted to put the focus into the control, only. + * @see {@link yfiles.input.ClickInputMode#clickHandlingMode} + * @see {@link yfiles.input.ClickInputMode#swallowFocusClick} + * @see {@link yfiles.input.ClickInputMode#leftClick} + */ + export interface ClickInputMode extends yfiles.input.StateMachineInputMode{ + /** + * The event handler that will be triggered once a click has been + * detected. + * @see {@link yfiles.input.ClickEventArgs} + * @see {@link yfiles.input.ClickInputMode#clickHandlingMode} + */ + addClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * The event handler that will be triggered once a click has been + * detected. + * @see {@link yfiles.input.ClickEventArgs} + * @see {@link yfiles.input.ClickInputMode#clickHandlingMode} + */ + removeClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * The event handler that will be triggered once a left click has been + * detected. + * @see {@link yfiles.input.ClickEventArgs} + * @see {@link yfiles.input.ClickInputMode#clickHandlingMode} + */ + addLeftClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * The event handler that will be triggered once a left click has been + * detected. + * @see {@link yfiles.input.ClickEventArgs} + * @see {@link yfiles.input.ClickInputMode#clickHandlingMode} + */ + removeLeftClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * The event handler that will be triggered once a right click has been + * detected. + * @see {@link yfiles.input.ClickEventArgs} + * @see {@link yfiles.input.ClickInputMode#clickHandlingMode} + */ + addRightClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * The event handler that will be triggered once a right click has been + * detected. + * @see {@link yfiles.input.ClickEventArgs} + * @see {@link yfiles.input.ClickInputMode#clickHandlingMode} + */ + removeRightClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * The event handler that will be triggered once a double-click has been + * detected. + * @see {@link yfiles.input.ClickEventArgs} + * @see {@link yfiles.input.ClickInputMode#clickHandlingMode} + */ + addDoubleClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * The event handler that will be triggered once a double-click has been + * detected. + * @see {@link yfiles.input.ClickEventArgs} + * @see {@link yfiles.input.ClickInputMode#clickHandlingMode} + */ + removeDoubleClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * The event handler that will be triggered once a left double-click has been + * detected. + * @see {@link yfiles.input.ClickEventArgs} + * @see {@link yfiles.input.ClickInputMode#clickHandlingMode} + */ + addLeftDoubleClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * The event handler that will be triggered once a left double-click has been + * detected. + * @see {@link yfiles.input.ClickEventArgs} + * @see {@link yfiles.input.ClickInputMode#clickHandlingMode} + */ + removeLeftDoubleClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * The event handler that will be triggered once a right double-click has been + * detected. + * @see {@link yfiles.input.ClickEventArgs} + * @see {@link yfiles.input.ClickInputMode#clickHandlingMode} + */ + addRightDoubleClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * The event handler that will be triggered once a right double-click has been + * detected. + * @see {@link yfiles.input.ClickEventArgs} + * @see {@link yfiles.input.ClickInputMode#clickHandlingMode} + */ + removeRightDoubleClickedListener(value:(sender:Object,e:yfiles.input.ClickEventArgs)=> void):void; + /** + * Gets or sets the click handling mode that determines the + * triggering behavior of {@link yfiles.input.ClickInputMode#addClickedListener Clicked} and + * {@link yfiles.input.ClickInputMode#addDoubleClickedListener DoubleClicked}. + * Value: + * The click handling mode to use for this instance. The default is {@link yfiles.input.ClickHandlingMode#BOTH_SINGLE_CLICKS_AND_DOUBLE_CLICK} + * @see {@link yfiles.input.ClickInputMode#clickHandlingMode} + */ + clickHandlingMode:yfiles.input.ClickHandlingMode; + /** + * Gets or sets a hit test that determines where this mode should recognize + * clicks. + * This implementation is tested during the {@link yfiles.input.ClickInputMode#isValidPress} + * to determine whether it is valid to click here. + * The default implementation is {@link yfiles.drawing.HitTestable#ALWAYS}. + */ + validClickHitTestable:yfiles.drawing.IHitTestable; + /** + * Obsolete property whether to detect left clicks. + * If set to true this will detect only left mouse clicks, otherwise, only right clicks are detected. + * @see {@link yfiles.input.ClickInputMode#createClickRecognizer} + */ + leftClick:boolean; + /** + * Obsolete property that determines whether to detect double clicks, only. + * If set to true this will detect double clicks, only. + * This property is preceded by {@link yfiles.input.ClickInputMode#clickHandlingMode} which allows for a better + * way of detecting both single clicks and {@link yfiles.input.ClickInputMode#addDoubleClickedListener double clicks}. + * @see {@link yfiles.input.ClickInputMode#createClickRecognizer} + */ + doubleClick:boolean; + /** + * Whether to {@link yfiles.input.AbstractConcurrentInputMode#requestMutex request the mutex} on a click. + * If set to true this will discard other concurrent input modes on a click. + * The default is true. + */ + requestMutextOnClick:boolean; + /** + * Determines for which button(s) mouse clicks should be processed. + * Default value is {@link yfiles.system.MouseButtons#LEFT} + * @see {@link yfiles.input.ClickInputMode#createClickRecognizer} + */ + activeButtons:yfiles.system.MouseButtons; + /** + * Called to initialize the state machine. + * This implementation does nothing. + * @param {yfiles.support.StateMachine} machine The machine to initialize and configure + * @param {yfiles.support.State} startState The start state to use. + * @param {yfiles.support.State} canceledState The canceled state to use. + * @param {yfiles.support.State} stoppedState The stopped state to use. + * @param {yfiles.support.State} finishedState The finished state to use. + */ + initializeStateMachine(machine:yfiles.support.StateMachine,startState:yfiles.support.State,canceledState:yfiles.support.State,stoppedState:yfiles.support.State,finishedState:yfiles.support.State):void; + /** + * Called when the {@link yfiles.input.AbstractConcurrentInputMode#enabled} property changes to true. + * This implementation does nothing. + */ + onEnabled():void; + /** + * Installs all necessary listeners to trigger the {@link yfiles.input.StateMachineInputMode#run} method. + * This implementation registers for all mouse events, keyboard events, and + * the {@link yfiles.canvas.CanvasControl#addEditableChangedListener EditableChanged} event. + */ + installListeners():void; + /** + * Removes all listeners from the canvas that have been registered in {@link yfiles.input.StateMachineInputMode#installListeners}. + */ + uninstallListeners():void; + /** + * Gets or sets a property that determines whether clicks should + * be swallowed if they happen within a short amount of time + * after the {@link yfiles.canvas.CanvasControl} got focus. + * The default is false. If set to true clicks are discarded within + * 100 ms after the focus entered. + */ + swallowFocusClick:boolean; + /** + * Creates the event recognizer that is used to recognize the clicks for this instance. + */ + createClickRecognizer():yfiles.input.IEventRecognizer; + /** + * Determines whether the given event is a valid click event. + * @see {@link yfiles.input.ClickInputMode#validClickHitTestable} + */ + isValidClick(src:Object,arg:yfiles.system.EventArgs):boolean; + /** + * Creates the event recognizer that is used to recognize the release event for this instance. + */ + createReleaseRecognizer():yfiles.input.IEventRecognizer; + /** + * Determines whether the given event is a valid release event. + * @see {@link yfiles.input.ClickInputMode#validClickHitTestable} + */ + isValidRelease(src:Object,arg:yfiles.system.EventArgs):boolean; + /** + * Creates the event recognizer that is used to recognize the press event for this instance. + */ + createPressRecognizer():yfiles.input.IEventRecognizer; + /** + * Determines whether the given event is a valid press event. + */ + isValidPress(eventSource:Object,eventArg:yfiles.system.EventArgs):boolean; + /** + * Determines whether the given event is a press event that occurred at an invalid location. + * @see {@link yfiles.input.ClickInputMode#validClickHitTestable} + */ + isInvalidPress(eventSource:Object,eventArg:yfiles.system.EventArgs):boolean; + /** + * Called once the gesture has begun. + */ + begin(t:yfiles.support.Transition):void; + /** + * Returns the location of the last click. + * @return {yfiles.geometry.PointD} + */ + getClickPoint():yfiles.geometry.PointD; + /** + * Called once the gesture has ended. + * This will trigger the {@link yfiles.input.ClickInputMode#addClickedListener Clicked} event. + */ + end(t:yfiles.support.Transition):void; + /** + * Returns the state of the modifier keys at the time of {@link yfiles.input.ClickInputMode#end}. + */ + modifierState:yfiles.input.ModifierKeys; + /** + * Called once this mode has recognized a click gesture. + * This method will trigger the {@link yfiles.input.ClickInputMode#addClickedListener Clicked} event. + * @param {yfiles.input.ClickEventArgs} eventArgs The arguments. + */ + onClicked(eventArgs:yfiles.input.ClickEventArgs):void; + /** + * Called once this mode has recognized a left click gesture. + * This method will trigger the {@link yfiles.input.ClickInputMode#addLeftClickedListener LeftClicked} event. + * @param {yfiles.input.ClickEventArgs} eventArgs The arguments. + */ + onLeftClicked(eventArgs:yfiles.input.ClickEventArgs):void; + /** + * Called once this mode has recognized a right click gesture. + * This method will trigger the {@link yfiles.input.ClickInputMode#addRightClickedListener RightClicked} event. + * @param {yfiles.input.ClickEventArgs} eventArgs The arguments. + */ + onRightClicked(eventArgs:yfiles.input.ClickEventArgs):void; + /** + * Called once this mode has recognized a double-click gesture. + * This method will trigger the {@link yfiles.input.ClickInputMode#addDoubleClickedListener DoubleClicked} event. + * @param {yfiles.input.ClickEventArgs} eventArgs The arguments. + */ + onDoubleClicked(eventArgs:yfiles.input.ClickEventArgs):void; + /** + * Called once this mode has recognized a left double-click gesture. + * This method will trigger the {@link yfiles.input.ClickInputMode#addLeftDoubleClickedListener LeftDoubleClicked} event. + * @param {yfiles.input.ClickEventArgs} eventArgs The arguments. + */ + onLeftDoubleClicked(eventArgs:yfiles.input.ClickEventArgs):void; + /** + * Called once this mode has recognized a double-click gesture. + * This method will trigger the {@link yfiles.input.ClickInputMode#addRightDoubleClickedListener RightDoubleClicked} event. + * @param {yfiles.input.ClickEventArgs} eventArgs The arguments. + */ + onRightDoubleClicked(eventArgs:yfiles.input.ClickEventArgs):void; + /** + * Prevents a double-click event from being issued if the next click would do so and sends only a single click instead. + *

+ * The intention is for "breaking" a double click if an input mode using {@link yfiles.input.ClickInputMode} performs actions + * that would lead to surprising behavior if the next click would lead to a double-click. Examples of this are + * {@link yWorks.yFiles.UI.Input.GraphEditorInputMode}'s selection cycling where several clicks in short + * succession may occur, as well as creating a node by clicking on the canvas and selecting it immediately afterwards + * with another click. + *

+ *

+ * This method's effect is very short-lived. It really only prevents a double-click event for the very next click that + * this input mode handles. The internal flag set by this method is re-set on every click received. This also means that + * if you call this method and the next click is just a regular single-click the flag is cleared nonetheless. + *

+ */ + preventNextDoubleClick():void; + /** + * Returns and resets the flag set by {@link yfiles.input.ClickInputMode#preventNextDoubleClick}. + * To ensure that the flag really acts just once, this method resets the flag and returns its value prior to the reset. + */ + queryAndResetPreventNextDoubleClick():boolean; + } + var ClickInputMode:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this mode that detects left mouse clicks. + */ + new ():yfiles.input.ClickInputMode; + }; + /** + * Interface implemented by input modes that can be registered with a + * {@link yfiles.canvas.CanvasControl} instance. + * Input modes capture user gestures (or any other kind of "input") and manipulate + * the contents of the scene graph or the model behind the scene graph. + * @see {@link yfiles.input.AbstractInputMode} + * @see {@link yfiles.input.IConcurrentInputMode} + */ + export interface IInputMode extends Object{ + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Called by the client in order to stop a current editing progress. + * This should stop the current edit, if one is in progress and possibly commit + * all of the changes. If stopping is not possible, this method can return false + * @return {boolean} true if and only if the editing has been stopped or there was + * no edit in progress + * @see {@link yfiles.input.IInputMode#cancel} + * @see Specified by {@link yfiles.input.IInputMode#stop}. + */ + stop():boolean; + /** + * Called by the client to unconditionally cancel all editing. + * This will be called prior to the uninstalling of this instance. + * In order to stop an active input mode manually, client code should use + * the following idiom: + *

+      * if (!mode.stop()){
+      *   mode.cancel();
+      * }
+      * 
+ * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + } + var IInputMode:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A simple integer based implementation of {@link yfiles.input.IGridConstraintProvider}. + */ + export interface SimpleGridConstraintProvider extends Object,yfiles.input.IGridConstraintProvider{ + /** + * Gets or sets the grid info that describes the geometry of the grid. + * Value: The grid info. + */ + gridInfo:yfiles.canvas.GridInfo; + /** + * Gets the grid height. + * This implementation delegates to the {@link yfiles.input.SimpleGridConstraintProvider#gridInfo} + * @see Specified by {@link yfiles.input.IGridConstraintProvider#horizontalGridWidth}. + */ + horizontalGridWidth:number; + /** + * Gets the grid width. + * This implementation delegates to the {@link yfiles.input.SimpleGridConstraintProvider#gridInfo} + * @see Specified by {@link yfiles.input.IGridConstraintProvider#verticalGridWidth}. + */ + verticalGridWidth:number; + /** + * Gets the grid origin. + * This implementation delegates to the {@link yfiles.input.SimpleGridConstraintProvider#gridInfo} + * @see Specified by {@link yfiles.input.IGridConstraintProvider#gridOrigin}. + */ + gridOrigin:yfiles.geometry.PointD; + /** + * Performs the actual snapping to grid coordinates. + * @param {yfiles.input.IInputModeContext} context The context in which the snapping should occur. + * @param {T} item The item of which the coordinates should be snapped. + * @param {yfiles.geometry.IMutablePoint} point The coordinates to snap. + * @param {yfiles.input.SnapPolicy} xSnapPolicy The policy for the x coordinate. + * @param {yfiles.input.SnapPolicy} ySnapPolicy The policy for the y coordinate. + * @return {boolean} Whether the point has been snapped. + * @see Specified by {@link yfiles.input.IGridConstraintProvider#snapToGrid}. + */ + snapToGrid(context:yfiles.input.IInputModeContext,item:T,point:yfiles.geometry.IMutablePoint,xSnapPolicy:yfiles.input.SnapPolicy,ySnapPolicy:yfiles.input.SnapPolicy):boolean; + } + var SimpleGridConstraintProvider:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the given grid distances. + */ + FromGridSpacing:{ + new (gridWidth:number):yfiles.input.SimpleGridConstraintProvider; + }; + /** + * Creates a new instance using the given grid specification. + * @param {number} gridWidth Width of the grid. + * @param {number} gridHeight Height of the grid. + */ + FromGridWidthAndGridHeight:{ + new (gridWidth:number,gridHeight:number):yfiles.input.SimpleGridConstraintProvider; + }; + /** + * Creates a new instance using the given grid info. + * @param {yfiles.canvas.GridInfo} gridInfo The grid info object. + */ + FromGridInfo:{ + new (gridInfo:yfiles.canvas.GridInfo):yfiles.input.SimpleGridConstraintProvider; + }; + }; + /** + * Interface for classes that can snap coordinates of items of a specific type to a grid. + * @see {@link yfiles.input.SimpleGridConstraintProvider} + */ + export interface IGridConstraintProvider extends Object{ + /** + * Gets the canonic grid width in horizontal direction. + * @see Specified by {@link yfiles.input.IGridConstraintProvider#horizontalGridWidth}. + */ + horizontalGridWidth:number; + /** + * Gets the canonic grid width in vertical direction. + * @see Specified by {@link yfiles.input.IGridConstraintProvider#verticalGridWidth}. + */ + verticalGridWidth:number; + /** + * Gets the canonic origin of the grid. + * @see Specified by {@link yfiles.input.IGridConstraintProvider#gridOrigin}. + */ + gridOrigin:yfiles.geometry.PointD; + /** + * Performs the actual snapping to grid coordinates. + * @param {yfiles.input.IInputModeContext} context The context in which the snapping should occur. + * @param {T} item The item of which the coordinates should be snapped. + * @param {yfiles.geometry.IMutablePoint} point The coordinates to snap. + * @param {yfiles.input.SnapPolicy} xSnapPolicy The policy for the x coordinate. + * @param {yfiles.input.SnapPolicy} ySnapPolicy The policy for the y coordinate. + * @return {boolean} Whether the point has been snapped. + * @see Specified by {@link yfiles.input.IGridConstraintProvider#snapToGrid}. + */ + snapToGrid(context:yfiles.input.IInputModeContext,item:T,point:yfiles.geometry.IMutablePoint,xSnapPolicy:yfiles.input.SnapPolicy,ySnapPolicy:yfiles.input.SnapPolicy):boolean; + } + var IGridConstraintProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface for the context object that is passed to {@link yfiles.input.IInputMode} + * instances during {@link yfiles.input.IInputMode#install} and {@link yfiles.input.IInputMode#uninstall} + * and {@link yfiles.input.IDragHandler} + * implementations like {@link yfiles.input.IPositionHandler} + * and {@link yfiles.input.IHandle} to provide additional context for the implementations. + * Implementations of this interface can carry additional information through + * their {@link yfiles.support.ILookup#lookup} method. + * @see {@link yfiles.support.ILookup} + * @see {@link yfiles.input.IInputMode} + */ + export interface IInputModeContext extends Object,yfiles.support.ILookup{ + /** + * Yields the {@link yfiles.input.IInputModeContext#canvasControl} on which the mode currently acts. + * This can be null if this mode is used outside the context of a CanvasControl. + * @see Specified by {@link yfiles.input.IInputModeContext#canvasControl}. + */ + canvasControl:yfiles.canvas.CanvasControl; + /** + * Yields the {@link yfiles.input.IInputMode} which issued the context object. + * This can be null if this context is used outside the context of an IInputMode. + * @see Specified by {@link yfiles.input.IInputModeContext#parentInputMode}. + */ + parentInputMode:yfiles.input.IInputMode; + /** + * Tries to retrieve an {@link yfiles.graph.IFoldedGraph} instance from the {@link yfiles.input.IInputModeContext}. + * This is a bridge method that delegates to {@link yfiles.graph.FoldedGraphExtensions#getFoldedGraph}. + * @return {yfiles.graph.IFoldedGraph} The instance or null. + */ + getFoldedGraph():yfiles.graph.IFoldedGraph; + /** + * Tries to retrieve an {@link yfiles.graph.IGroupedGraph} instance from the {@link yfiles.input.IInputModeContext}. + * This is a bridge method that delegates to {@link yfiles.graph.GroupedGraphExtensions#getGroupedGraph}. + * @return {yfiles.graph.IGroupedGraph} The instance or null. + */ + getGroupedGraph():yfiles.graph.IGroupedGraph; + /** + * Tries to retrieve an {@link yfiles.graph.IGraph} instance from the {@link yfiles.input.IInputModeContext}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#getGraph}. + * @return {yfiles.graph.IGraph} Return the graph or null. + */ + getGraph():yfiles.graph.IGraph; + /** + * Tries to call {@link yfiles.graph.IGraph#invalidateDisplays} on the {@link yfiles.graph.GraphExtensions#getGraph graph} from the {@link yfiles.input.IInputModeContext}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#invalidateDisplays}. + */ + invalidateDisplays():void; + /** + * Tries to retrieve an {@link yfiles.graph.IGraphSelection} instance from the {@link yfiles.input.IInputModeContext}. + * This is a bridge method that delegates to {@link yfiles.graph.GraphExtensions#getGraphSelection}. + * @return {yfiles.graph.IGraphSelection} Return the selection or null. + */ + getGraphSelection():yfiles.graph.IGraphSelection; + } + var IInputModeContext:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface that allows input modes to collect {@link yfiles.model.IModelItem}s for various purposes. + * This is mainly used for {@link yfiles.input.HandleInputMode} and {@link yfiles.input.MoveInputMode} to allow access to the + * items that were affected during the respective operation. + * @see {@link yfiles.input.HandleInputMode#affectedItems} + * @see {@link yfiles.input.MoveInputMode#affectedItems} + */ + export interface IModelItemCollector extends Object{ + /** + * Adds a model item to this collector instance. + * @param {yfiles.model.IModelItem} item The model item to add. + * @see Specified by {@link yfiles.input.IModelItemCollector#add}. + */ + add(item:yfiles.model.IModelItem):void; + } + var IModelItemCollector:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum HandleType{ + /** + * A handle which serves a general purpose but should not be displayed. + * This is the basic type of a handle and can be queried using + * the {@link yfiles.input.HandleType#TYPE_MASK}. + */ + INVISIBLE, + /** + * A default handle which serves a general purpose. + * This is the basic type of a handle and can be queried using + * the {@link yfiles.input.HandleType#TYPE_MASK}. + */ + DEFAULT, + /** + * A handle which can be used to resize something. + * This is the basic type of a handle and can be queried using + * the {@link yfiles.input.HandleType#TYPE_MASK}. + */ + RESIZE, + /** + * A handle which can be used to rotate something. + * This is the basic type of a handle and can be queried using + * the {@link yfiles.input.HandleType#TYPE_MASK}. + */ + ROTATE, + /** + * A handle which can be used to move something. + * This is the basic type of a handle and can be queried using + * the {@link yfiles.input.HandleType#TYPE_MASK}. + */ + MOVE, + /** + * A handle which can be used to shear an object. + * This is the basic type of a handle and can be queried using + * the {@link yfiles.input.HandleType#TYPE_MASK}. + */ + SHEAR, + /** + * A handle which can be used to warp an object. + * This is the basic type of a handle and can be queried using + * the {@link yfiles.input.HandleType#TYPE_MASK}. + */ + WARP, + /** + * A bitmask that can be used to query the basic type of a handle type. + * @see {@link yfiles.input.HandleType#DEFAULT} + * @see {@link yfiles.input.HandleType#MOVE} + * @see {@link yfiles.input.HandleType#RESIZE} + * @see {@link yfiles.input.HandleType#ROTATE} + * @see {@link yfiles.input.HandleType#SHEAR} + * @see {@link yfiles.input.HandleType#WARP} + */ + TYPE_MASK, + /** + * A default variant modifier that decorates a basic type. + * @see {@link yfiles.input.HandleType#VARIANT_MASK} + */ + VARIANT1, + /** + * The second variant modifier that decorates a basic type. + * @see {@link yfiles.input.HandleType#VARIANT_MASK} + */ + VARIANT2, + /** + * The third variant modifier that decorates a basic type. + * @see {@link yfiles.input.HandleType#VARIANT_MASK} + */ + VARIANT3, + /** + * The forth variant modifier that decorates a basic type. + * @see {@link yfiles.input.HandleType#VARIANT_MASK} + */ + VARIANT4, + /** + * A bitmask that can be used to query the variant of a basic handle type. + * @see {@link yfiles.input.HandleType#VARIANT1} + * @see {@link yfiles.input.HandleType#VARIANT2} + * @see {@link yfiles.input.HandleType#VARIANT3} + * @see {@link yfiles.input.HandleType#VARIANT4} + */ + VARIANT_MASK, + /** + * A modifier that can be used to tell the rendering engine to + * render the visual representation of this handle with an offset to + * the north. + * @see {@link yfiles.input.HandleType#OFFSET_MASK} + */ + OFFSET_NORTH, + /** + * A modifier that can be used to tell the rendering engine to + * render the visual representation of this handle with an offset to + * the east. + * @see {@link yfiles.input.HandleType#OFFSET_MASK} + */ + OFFSET_EAST, + /** + * A modifier that can be used to tell the rendering engine to + * render the visual representation of this handle with an offset to + * the south. + * @see {@link yfiles.input.HandleType#OFFSET_MASK} + */ + OFFSET_SOUTH, + /** + * A modifier that can be used to tell the rendering engine to + * render the visual representation of this handle with an offset to + * the west. + * @see {@link yfiles.input.HandleType#OFFSET_MASK} + */ + OFFSET_WEST, + /** + * A bitmask that can be used to query the offsets of a basic handle type. + * @see {@link yfiles.input.HandleType#OFFSET_NORTH} + * @see {@link yfiles.input.HandleType#OFFSET_EAST} + * @see {@link yfiles.input.HandleType#OFFSET_SOUTH} + * @see {@link yfiles.input.HandleType#OFFSET_WEST} + */ + OFFSET_MASK + } + /** + * Interface for a handle that can be displayed in a {@link yfiles.canvas.CanvasControl} + * as a UI element for the user to modify the contents of the control. + * Handles can be dragged with the mouse and will thereby modify their context. + * Typically client code will use the {@link yfiles.input.IDragHandler#location} to render a visual handle + * that can be dragged using the mouse. A drag will trigger the invocation of + * {@link yfiles.input.IDragHandler#initializeDrag}, zero or more {@link yfiles.input.IDragHandler#handleMove} calls, and + * will be finalized + * by either {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. + * @see {@link yfiles.input.HandleInputMode} + * @see {@link yfiles.input.PointHandle} + * @see {@link yfiles.input.RectangleHandle} + * @see {@link yfiles.input.IDragHandler} + */ + export interface IHandle extends Object,yfiles.input.IDragHandler{ + /** + * Returns the type of the handle that can be used by the rendering engine + * to render types differently. + * @see Specified by {@link yfiles.input.IHandle#type}. + */ + type:yfiles.input.HandleType; + /** + * Provides the cursor to display when the mouse hovers over or drags this + * handle. + * @see Specified by {@link yfiles.input.IHandle#cursor}. + */ + cursor:yfiles.canvas.ICanvasCursor; + } + var IHandle:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for an object that can be interactively reshaped in a {@link yfiles.canvas.CanvasControl}. + * Items can be reshaped interactively and an instance of this class can be used to handle + * that process. + * A reshape operation will be initialized by a call to + * {@link yfiles.input.IReshapeHandler#initializeReshape}, then zero or more {@link yfiles.input.IReshapeHandler#handleReshape} calls follow, and + * the operation will be finalized + * by a call to either {@link yfiles.input.IReshapeHandler#reshapeFinished} or {@link yfiles.input.IReshapeHandler#cancelReshape}. + * Note that implementations of this class will only be used during interactive reshape operations. + * @see {@link yfiles.input.IDragHandler} + * @see {@link yfiles.input.IPositionHandler} + * @see {@link yfiles.input.IHandle} + * @see {@link yfiles.input.IInputModeContext} + */ + export interface IReshapeHandler extends Object{ + /** + * Returns a view of the bounds of the item. + * The rectangle describes the current world coordinate of the element that can + * be modified by this handler. + * @see Specified by {@link yfiles.input.IReshapeHandler#bounds}. + */ + bounds:yfiles.geometry.IRectangle; + /** + * Called by clients to indicate that the element is going to be reshaped. + * This call will be followed by one or more calls to {@link yfiles.input.IReshapeHandler#handleReshape}, + * and a final {@link yfiles.input.IReshapeHandler#reshapeFinished} or {@link yfiles.input.IReshapeHandler#cancelReshape}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @see Specified by {@link yfiles.input.IReshapeHandler#initializeReshape}. + */ + initializeReshape(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Called by clients to indicate that the element has been dragged and its position + * should be updated. + * This method may be called more than once after an initial {@link yfiles.input.IReshapeHandler#initializeReshape} + * and will the final call will be followed by either one + * {@link yfiles.input.IReshapeHandler#reshapeFinished} or one {@link yfiles.input.IReshapeHandler#cancelReshape} call. + * @param {yfiles.geometry.RectD} originalBounds The value of the {@link yfiles.input.IReshapeHandler#bounds} property at the time of {@link yfiles.input.IReshapeHandler#initializeReshape}. + * @param {yfiles.geometry.RectD} newBounds The coordinates of the bounds in the world coordinate system that the client wants the shape to be at. + * Depending on the implementation the {@link yfiles.input.IReshapeHandler#bounds} may or may not be modified to reflect the new value. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the reshaping from. + * @return {boolean} Whether the reshaping had any visual effect. This is a hint to the engine to optimize invalidation. + * @see Specified by {@link yfiles.input.IReshapeHandler#handleReshape}. + */ + handleReshape(inputModeContext:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.RectD,newBounds:yfiles.geometry.RectD):boolean; + /** + * Called by clients to indicate that the reshaping has been canceled by the user. + * This method may be called after the initial {@link yfiles.input.IReshapeHandler#initializeReshape} and zero or + * more invocations of {@link yfiles.input.IReshapeHandler#handleReshape}. + * Implementations should reset the bounds of the items they modify to their initial state. + * Alternatively to this method the {@link yfiles.input.IReshapeHandler#reshapeFinished} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the reshaping from. + * @param {yfiles.geometry.RectD} originalBounds The value of the coordinate of the {@link yfiles.input.IReshapeHandler#bounds} property at the time of {@link yfiles.input.IReshapeHandler#initializeReshape}. + * @see Specified by {@link yfiles.input.IReshapeHandler#cancelReshape}. + */ + cancelReshape(inputModeContext:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.RectD):void; + /** + * Called by clients to indicate that the reshaping has just been finished. + * This method may be called after the initial {@link yfiles.input.IReshapeHandler#initializeReshape} and zero or + * more invocations of {@link yfiles.input.IReshapeHandler#handleReshape}. + * Alternatively to this method the {@link yfiles.input.IReshapeHandler#cancelReshape} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.RectD} newBounds The coordinates of the bounds in the world coordinate system that the client wants the shape to be at. + * Depending on the implementation the {@link yfiles.input.IReshapeHandler#bounds} may or may not be modified to reflect the new value. + * This is the same value as delivered in the last invocation of {@link yfiles.input.IReshapeHandler#handleReshape} + * @param {yfiles.geometry.RectD} originalBounds The value of the coordinate of the {@link yfiles.input.IReshapeHandler#bounds} property at the time of {@link yfiles.input.IReshapeHandler#initializeReshape}. + * @see Specified by {@link yfiles.input.IReshapeHandler#reshapeFinished}. + */ + reshapeFinished(inputModeContext:yfiles.input.IInputModeContext,originalBounds:yfiles.geometry.RectD,newBounds:yfiles.geometry.RectD):void; + } + var IReshapeHandler:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface used by implementations that provide various size constraints + * for items of a specific type. + * @see {@link yfiles.input.SizeConstraintProvider} + */ + export interface ISizeConstraintProvider extends Object{ + /** + * Returns the minimum size allowed for the given item. + * @param {T} item The item to return the minimum size for. + * @return {yfiles.geometry.SizeD} The minimum size or {@link yfiles.geometry.SizeD#EMPTY} if there is no constraint on the size. + * @see Specified by {@link yfiles.input.ISizeConstraintProvider#getMinimumSize}. + */ + getMinimumSize(item:T):yfiles.geometry.SizeD; + /** + * Returns the maximum size allowed for the given item. + * @param {T} item The item to return the maximum size for. + * @return {yfiles.geometry.SizeD} The maximum size or {@link yfiles.geometry.SizeD#INFINITE} if there is no constraint on the size. + * @see Specified by {@link yfiles.input.ISizeConstraintProvider#getMaximumSize}. + */ + getMaximumSize(item:T):yfiles.geometry.SizeD; + /** + * Returns the minimum area that needs to be enclosed by the given item. + * @param {T} item The item to return the area for. + * @return {yfiles.geometry.RectD} The area to enclose or {@link yfiles.geometry.RectD#EMPTY} if there is no constraint on the size due to an enclosed area. + * @see Specified by {@link yfiles.input.ISizeConstraintProvider#getMinimumEnclosedArea}. + */ + getMinimumEnclosedArea(item:T):yfiles.geometry.RectD; + } + var ISizeConstraintProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for an object that provides a number of + * {@link yfiles.input.IHandle} implementations. + */ + export interface IHandleProvider extends Object{ + /** + * Returns a collection of zero or more {@link yfiles.input.IHandle} implementations + * that are associated with this instance. + * @return {yfiles.collections.ICollection.} A collection of handles. + * @see Specified by {@link yfiles.input.IHandleProvider#getHandles}. + */ + getHandles(inputModeContext:yfiles.input.IInputModeContext):yfiles.collections.ICollection; + } + var IHandleProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Event Arguments used by {@link yfiles.input.ClickInputMode#addClickedListener Clicked}. + */ + export interface ClickEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the location of the click. + * Value: The location. + */ + location:yfiles.geometry.PointD; + /** + * Gets the context in which the click occurred. + */ + context:yfiles.input.IInputModeContext; + /** + * Gets the state of the modifiers at the time of the click. + * Value: The state of the modifiers. + */ + modifierState:yfiles.input.ModifierKeys; + /** + * Gets or sets a value indicating whether this {@link yfiles.input.ClickEventArgs} have been handled. + * Client code that is triggered by the event and does not want the event to become handled + * by other handles should set this property to true to stop propagation + * of the event. + * Value: true if handled; otherwise, false. + */ + handled:boolean; + /** + * Gets the {@link yfiles.system.MouseButtons} that have changed for this event. + */ + mouseButtons:yfiles.system.MouseButtons; + /** + * Gets the number of clicks associated with this event. + * This can be used to distinguish between single and multiple clicks. + * Note that for compatibility reasons, a negative value means that no click count has been provided at event creation time. + */ + clickCount:number; + } + var ClickEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.ClickEventArgs} class. + * @param {yfiles.geometry.PointD} location The location. + * @param {yfiles.input.ModifierKeys} modifierState State of the modifiers. + */ + FromLocationAndModifierState:{ + new (location:yfiles.geometry.PointD,modifierState:yfiles.input.ModifierKeys):yfiles.input.ClickEventArgs; + }; + /** + * Initializes a new instance of the {@link yfiles.input.ClickEventArgs} class. + * @param {yfiles.input.IInputModeContext} context The context in which the click occurred. + * @param {yfiles.geometry.PointD} location The location. + * @param {yfiles.input.ModifierKeys} modifierState State of the modifiers. + */ + FromContextLocationAndModifierState:{ + new (context:yfiles.input.IInputModeContext,location:yfiles.geometry.PointD,modifierState:yfiles.input.ModifierKeys):yfiles.input.ClickEventArgs; + }; + /** + * Initializes a new instance of the {@link yfiles.input.ClickEventArgs} class. + * @param {yfiles.input.IInputModeContext} context The context in which the click occurred. + * @param {yfiles.geometry.PointD} location The location. + * @param {yfiles.input.ModifierKeys} modifierState State of the modifiers. + * @param {yfiles.system.MouseButtons} mouseButton The mouse button(s) that have changed + * @param {number} clickCount + */ + FromContextLocationModifierStateButtonsAndClickCount:{ + new (context:yfiles.input.IInputModeContext,location:yfiles.geometry.PointD,modifierState:yfiles.input.ModifierKeys,mouseButton:yfiles.system.MouseButtons,clickCount:number):yfiles.input.ClickEventArgs; + }; + }; + /** + * A specialized version of the {@link yfiles.input.IHandleProvider} interface + * that can be used to query {@link yfiles.input.IHandle} implementation for + * resizing an object. + */ + export interface IReshapeHandleProvider extends Object{ + /** + * Returns a bitwise combination of all of the {@link yfiles.input.HandlePositions} + * this interface can provide an implementation for. + * Client code will use this method to query the available positions and may then + * call for each of the positions the {@link yfiles.input.IReshapeHandleProvider#getHandle} method to retrieve + * an implementation. + * @param {yfiles.input.IInputModeContext} inputModeContext The context for which the handles are queried. + * @return {yfiles.input.HandlePositions} A bitwise combination of all positions the {@link yfiles.input.IReshapeHandleProvider#getHandle} method + * can be queried for. + * @see Specified by {@link yfiles.input.IReshapeHandleProvider#getAvailableHandles}. + */ + getAvailableHandles(inputModeContext:yfiles.input.IInputModeContext):yfiles.input.HandlePositions; + /** + * Returns an implementation of an {@link yfiles.input.IHandle} for the given position, that can be used to reshape an object. + * This method may be called for each possible single position contained in the + * set as returned by {@link yfiles.input.IReshapeHandleProvider#getAvailableHandles}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context for which the handles are queried. + * @param {yfiles.input.HandlePositions} position The single position a handle implementation should be returned for. + * @return {yfiles.input.IHandle} An implementation of {@link yfiles.input.IHandle} for the given position. + * @see Specified by {@link yfiles.input.IReshapeHandleProvider#getHandle}. + */ + getHandle(inputModeContext:yfiles.input.IInputModeContext,position:yfiles.input.HandlePositions):yfiles.input.IHandle; + } + var IReshapeHandleProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Abstract base class for an {@link yfiles.input.IInputMode} that can be used + * concurrently with other {@link yfiles.input.IConcurrentInputMode} implementations. + * This class extends from Component so that implementations can be + * used in visual designers. + */ + export interface AbstractConcurrentInputMode extends yfiles.input.AbstractInputMode,yfiles.input.IConcurrentInputMode{ + /** + * An event that will be triggered if the {@link yfiles.input.AbstractConcurrentInputMode#preferredCursor} property + * changes. + */ + addPreferredCursorChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * An event that will be triggered if the {@link yfiles.input.AbstractConcurrentInputMode#preferredCursor} property + * changes. + */ + removePreferredCursorChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Gets or sets the enabled state of this input mode. + * The {@link yfiles.input.AbstractConcurrentInputMode#controller} will disable this mode if another + * mode acquires the input mutex. + * Also clients can use this property to disable or reenable this instance. + * A disabled instance should never try to acquire the input mutex. + * This will call the {@link yfiles.input.AbstractConcurrentInputMode#onEnabled} or {@link yfiles.input.AbstractConcurrentInputMode#onDisabled} + * methods respectively. A disabled mode cannot be enabled if another + * mode currently owns the input mutex. + * @see Specified by {@link yfiles.input.IConcurrentInputMode#enabled}. + */ + enabled:boolean; + /** + * Gets the cursor this mode would like to have displayed in the + * {@link yfiles.canvas.CanvasControl}. + * This property should not be used by client code. The setter is for subclass implementations, while + * the getter is an implementation of {@link yfiles.input.IConcurrentInputMode}. + * To indicate that this mode does not have any preferences subclasses should + * set null to the property. + * Modifying the value will trigger the {@link yfiles.input.AbstractConcurrentInputMode#onPreferredCursorChanged} method. + * @see Specified by {@link yfiles.input.IConcurrentInputMode#preferredCursor}. + */ + preferredCursor:yfiles.canvas.ICanvasCursor; + /** + * Called when the {@link yfiles.input.AbstractConcurrentInputMode#preferredCursor} property changes. + * This implementation will set the {@link yfiles.canvas.Control#cursor} property + * if no {@link yfiles.input.AbstractConcurrentInputMode#controller} is associated with this instance. + * @param {yfiles.system.EventArgs} args The event arguments. + */ + onPreferredCursorChanged(args:yfiles.system.EventArgs):void; + /** + * Called when the {@link yfiles.input.AbstractConcurrentInputMode#enabled} property changes to false. + * This implementation sets the {@link yfiles.input.AbstractConcurrentInputMode#preferredCursor} property to null + * and {@link yfiles.input.AbstractConcurrentInputMode#releaseMutex releases} the mutex if the mutex is currently owned + * by this instance. + */ + onDisabled():void; + /** + * Overridden to {@link yfiles.input.AbstractConcurrentInputMode#releaseMutex release} the mutex if it is currently owned + * by this instance. + * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Overridden to only return true if this instance does not currently + * {@link yfiles.input.AbstractConcurrentInputMode#hasMutex have the input mutex}. + * @return {boolean} true iff this instance does not {@link yfiles.input.AbstractConcurrentInputMode#hasMutex own the mutex}. + * @see Specified by {@link yfiles.input.IInputMode#stop}. + */ + stop():boolean; + /** + * Called when the {@link yfiles.input.AbstractConcurrentInputMode#enabled} property changes to true. + * This implementation does nothing. + */ + onEnabled():void; + /** + * Gets or injects the {@link yfiles.input.ConcurrencyController} for this instance. + * @see {@link yfiles.input.AbstractConcurrentInputMode#requestMutex} + * @see {@link yfiles.input.AbstractConcurrentInputMode#releaseMutex} + * @see {@link yfiles.input.AbstractConcurrentInputMode#hasMutex} + * @see {@link yfiles.input.AbstractConcurrentInputMode#canRequestMutex} + * @see Specified by {@link yfiles.input.IConcurrentInputMode#controller}. + */ + controller:yfiles.input.ConcurrencyController; + /** + * Requests the {@link yfiles.input.InputMutex} from the current {@link yfiles.input.AbstractConcurrentInputMode#controller}. + * This implementation will call the {@link yfiles.input.AbstractConcurrentInputMode#onMutexObtained} method if the mutex has + * been successfully obtained or if there is no {@link yfiles.input.AbstractConcurrentInputMode#controller} associated + * with this mode currently. + * If the mutex cannot be obtained this method will trigger an exception. + * @throws {yfiles.lang.Exception} If the mutex could not be obtained. + */ + requestMutex():void; + /** + * Determines whether this instance owns the input mutex. + * If no {@link yfiles.input.AbstractConcurrentInputMode#controller} had been associated with this instance upon the call + * to {@link yfiles.input.AbstractConcurrentInputMode#requestMutex} this method will return true, too. + * @return {boolean} Whether this instance has the input mutex. + */ + hasMutex():boolean; + /** + * Called when this instance obtains the {@link yfiles.input.InputMutex}. + * If no {@link yfiles.input.AbstractConcurrentInputMode#controller} had been associated with this instance upon the call + * to {@link yfiles.input.AbstractConcurrentInputMode#requestMutex} this method will be called, too. + */ + onMutexObtained():void; + /** + * Releases the mutex that is currently owned by this instance. + * This will trigger the {@link yfiles.input.AbstractConcurrentInputMode#onMutexReleased} method if this + * instance previously owned the mutex. + */ + releaseMutex():void; + /** + * Called when this instance released the {@link yfiles.input.InputMutex}. + * If no {@link yfiles.input.AbstractConcurrentInputMode#controller} had been associated with this instance upon the call + * to {@link yfiles.input.AbstractConcurrentInputMode#requestMutex} this method will be called, too. + */ + onMutexReleased():void; + /** + * Determines whether this instance can request the {@link yfiles.input.InputMutex}. + * This will return true, iff the no {@link yfiles.input.AbstractConcurrentInputMode#controller} has been injected or + * the controller allows requesting the mutex. + * @return {boolean} Whether a call to {@link yfiles.input.AbstractConcurrentInputMode#requestMutex} would currently succeed. + */ + canRequestMutex():boolean; + } + var AbstractConcurrentInputMode:{ + $class:yfiles.lang.Class; + new ():yfiles.input.AbstractConcurrentInputMode; + }; + /** + * Abstract base class implementation of an {@link yfiles.input.IInputMode}. + * This class adds convenience methods for derived classes. + */ + export interface AbstractInputMode extends Object,yfiles.input.IInputMode{ + /** + * Event that will be triggered before the call to {@link yfiles.input.AbstractInputMode#initialize}. + * Clients can use this event to perform configuration of the instance shortly before the + * initialization begins. + * @see {@link yfiles.input.AbstractInputMode#install} + */ + addInitializingListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered before the call to {@link yfiles.input.AbstractInputMode#initialize}. + * Clients can use this event to perform configuration of the instance shortly before the + * initialization begins. + * @see {@link yfiles.input.AbstractInputMode#install} + */ + removeInitializingListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered after the call to {@link yfiles.input.AbstractInputMode#initialize}. + * Clients can use this event to perform post configuration steps of the instance shortly after + * the initialization has been performed. + * @see {@link yfiles.input.AbstractInputMode#install} + */ + addInitializedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered after the call to {@link yfiles.input.AbstractInputMode#initialize}. + * Clients can use this event to perform post configuration steps of the instance shortly after + * the initialization has been performed. + * @see {@link yfiles.input.AbstractInputMode#install} + */ + removeInitializedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Helper method that yields a suitably configured {@link yfiles.input.InputModeEventArgs} + * for this input mode. + * @return {yfiles.input.InputModeEventArgs} An input mode event argument that is configured for this instance. + */ + createInputModeEventArgs():yfiles.input.InputModeEventArgs; + /** + * Event dispatch method that will dispatch the {@link yfiles.input.AbstractInputMode#addCanceledListener Canceled} event. + * This method is called by subclasses when the editing process has been {@link yfiles.input.AbstractInputMode#cancel}ed. + * @param {yfiles.input.InputModeEventArgs} eventArgs The event arguments. + * @see {@link yfiles.input.AbstractInputMode#initialize} + */ + onCanceled(eventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Event that will be triggered after the call to {@link yfiles.input.AbstractInputMode#cancel}. + * Clients can use this event to perform post cleanup steps of the instance shortly after + * the mode has been canceled. + * @see {@link yfiles.input.AbstractInputMode#onCanceled} + * @see {@link yfiles.input.AbstractInputMode#cancel} + * @see {@link yfiles.input.AbstractInputMode#stop} + * @see {@link yfiles.input.AbstractInputMode#addStoppedListener Stopped} + */ + addCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered after the call to {@link yfiles.input.AbstractInputMode#cancel}. + * Clients can use this event to perform post cleanup steps of the instance shortly after + * the mode has been canceled. + * @see {@link yfiles.input.AbstractInputMode#onCanceled} + * @see {@link yfiles.input.AbstractInputMode#cancel} + * @see {@link yfiles.input.AbstractInputMode#stop} + * @see {@link yfiles.input.AbstractInputMode#addStoppedListener Stopped} + */ + removeCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event dispatch method that will dispatch the {@link yfiles.input.AbstractInputMode#addStoppedListener Stopped} event. + * This method will be called by {@link yfiles.input.AbstractInputMode#stop} or can be called by subclasses during + * a {@link yfiles.input.AbstractInputMode#stop} operation. + * @param {yfiles.input.InputModeEventArgs} eventArgs The event arguments. + * @see {@link yfiles.input.AbstractInputMode#stop} + * @see {@link yfiles.input.AbstractInputMode#addStoppedListener Stopped} + */ + onStopped(eventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Event that will be triggered after the call to {@link yfiles.input.AbstractInputMode#stop}. + * Clients can use this event to perform post cleanup steps of the instance shortly after + * the mode has been stopped. + * @see {@link yfiles.input.AbstractInputMode#onStopped} + * @see {@link yfiles.input.AbstractInputMode#cancel} + * @see {@link yfiles.input.AbstractInputMode#stop} + * @see {@link yfiles.input.AbstractInputMode#addCanceledListener Canceled} + */ + addStoppedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered after the call to {@link yfiles.input.AbstractInputMode#stop}. + * Clients can use this event to perform post cleanup steps of the instance shortly after + * the mode has been stopped. + * @see {@link yfiles.input.AbstractInputMode#onStopped} + * @see {@link yfiles.input.AbstractInputMode#cancel} + * @see {@link yfiles.input.AbstractInputMode#stop} + * @see {@link yfiles.input.AbstractInputMode#addCanceledListener Canceled} + */ + removeStoppedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Returns whether this mode is currently installed so a call to {@link yfiles.input.AbstractInputMode#canvas} will yield a non-null result. + * @see {@link yfiles.input.AbstractInputMode#install} + */ + installed:boolean; + /** + * Returns the canvas instance this mode is currently installed in or + * null. + */ + canvas:yfiles.canvas.CanvasControl; + /** + * Returns the context instance this mode is currently installed in or + * null if this instance is not installed. + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Installs this mode into a {@link yfiles.canvas.CanvasControl} using the provided {@link yfiles.input.IInputModeContext}. + * Subclasses should override this method and callbase.Install(context), first. + * One-time initialization should be performed in the {@link yfiles.input.AbstractInputMode#initialize} method. + * This implementation will call the {@link yfiles.input.AbstractInputMode#initialize} method the first + * time this mode gets installed. + * The initialization will be surrounded by calls to {@link yfiles.input.AbstractInputMode#onInitializing} + * and {@link yfiles.input.AbstractInputMode#onInitialized} to trigger the corresponding events. + * @param {yfiles.input.IInputModeContext} context the context to install this mode into + * @see {@link yfiles.input.AbstractInputMode#canvas} + * @see {@link yfiles.input.AbstractInputMode#inputModeContext} + * @see {@link yfiles.canvas.CanvasControl#inputMode} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Event dispatch method that will dispatch the {@link yfiles.input.AbstractInputMode#addInitializingListener Initializing} event. + * This method will be called by {@link yfiles.input.AbstractInputMode#install} for the first installation + * directly before {@link yfiles.input.AbstractInputMode#initialize} is invoked. + * @param {yfiles.system.EventArgs} eventArgs The event arguments. + * @see {@link yfiles.input.AbstractInputMode#initialize} + */ + onInitializing(eventArgs:yfiles.system.EventArgs):void; + /** + * Event dispatch method that will dispatch the {@link yfiles.input.AbstractInputMode#addInitializedListener Initialized} event. + * This method will be called by {@link yfiles.input.AbstractInputMode#install} for the first installation + * directly after {@link yfiles.input.AbstractInputMode#initialize} has returned. + * @param {yfiles.system.EventArgs} eventArgs The event arguments. + * @see {@link yfiles.input.AbstractInputMode#initialize} + */ + onInitialized(eventArgs:yfiles.system.EventArgs):void; + /** + * Performs one-time initialization of this instance. This method should not + * be invoked by subclasses. This will be done automatically upon first + * {@link yfiles.input.AbstractInputMode#install installation} of this mode. + * This code will be executed only once per instance. The {@link yfiles.input.AbstractInputMode#canvas} property + * and {@link yfiles.input.AbstractInputMode#inputModeContext} property + * will be null when this code is executed. This method should not + * be used to install this mode into a specific canvas. + * Subclasses should always call base.Initialize() first. + * @see {@link yfiles.input.AbstractInputMode#install} + */ + initialize():void; + /** + * Cancels the editing of this mode. + * This implementation fires the {@link yfiles.input.AbstractInputMode#onCanceled} event, only. + * Classes that need to perform clean-up should override this method + * and invoke base.Cancel as the last statement. + * @see {@link yfiles.input.AbstractInputMode#onCanceled} + * @see {@link yfiles.input.AbstractInputMode#addCanceledListener Canceled} + * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Tries to stop the editing. This implementation always returns true. + * This implementation calls {@link yfiles.input.AbstractInputMode#onStopped}. + * Subclasses that want to prevent a stop or need to do special clean up + * should do this here if base.Stop() returns true. + * A typical implementation should follow this idiom if it wants to stop: + *

+      * if (base.stop()){
+      *   //do cleanup
+      *   return true;
+      * } else {
+      *   return false;
+      * }
+      * 
+ * and if it don't wants to stop simply return false immediately. + *

+ * Calling this method raises the {@link yfiles.input.AbstractInputMode#addStoppedListener Stopped} event. + *

+ * @return {boolean} true + * @see {@link yfiles.input.AbstractInputMode#onStopped} + * @see Specified by {@link yfiles.input.IInputMode#stop}. + */ + stop():boolean; + /** + * Uninstalls this mode from the canvas. + * Subclasses should always call base.Uninstall(context) as the last + * statement. + * @param {yfiles.input.IInputModeContext} context The context to remove this mode from. This is the same instance that has been + * passed to {@link yfiles.input.AbstractInputMode#install}. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Convenience method for subclass implementations that invalidates + * the canvas this mode is currently installed in. + */ + invalidate():void; + /** + * Requests capturing of all keyboard input that happens in the {@link yfiles.canvas.CanvasControl}. + * This sets the {@link yfiles.canvas.Control#captureAllKeyboardInput} + * property to true, which will prevent visuals inside the + * canvas from stealing key strokes. + * @see {@link yfiles.input.AbstractInputMode#releaseKeyboard} + * @see {@link yfiles.input.StateMachineInputMode#releaseKeyboardTransition} + */ + requestKeyboard():void; + /** + * Helper method that creates an implementation of {@link yfiles.canvas.ICanvasContext} + * mainly for use in {@link yfiles.drawing.IHitTestable#isHit} calls that is specific to this mode. + * The result can be given to {@link yfiles.drawing.IHitTestable#isHit} or {@link yfiles.canvas.CanvasControl#enumerateFilteredHitsAtRootWithContext} + * to let implementation of {@link yfiles.drawing.IHitTestable} get access to the current {@link yfiles.input.IInputModeContext}. + * This can be done by looking up {@link yfiles.input.IInputModeContext} from the {@link yfiles.canvas.ICanvasContext}'s {@link yfiles.support.ILookup#lookup} method. + * @return {yfiles.canvas.ICanvasContext} An implementation of {@link yfiles.canvas.ICanvasContext} that carries a readily configured {@link yfiles.input.IInputModeContext} in it's {@link yfiles.support.ILookup#lookup}. + * @see {@link yfiles.canvas.CanvasControl#enumerateFilteredHitsAtRootWithContext} + * @see {@link yfiles.drawing.IHitTestable#isHit} + * @see {@link yfiles.input.AbstractInputMode#inputModeContext} + */ + getCanvasContext():yfiles.canvas.ICanvasContext; + /** + * Requests capturing of all mouse and touch input that happens in the {@link yfiles.canvas.CanvasControl}. + * This sets the {@link yfiles.canvas.Control#captureAllPointerInput} + * property to true, which will prevent visuals inside the + * canvas from stealing mouse input. + * @see {@link yfiles.input.AbstractInputMode#releasePointer} + * @see {@link yfiles.input.StateMachineInputMode#releasePointerTransition} + */ + requestPointer():void; + /** + * Releases previously captured keyboard input. + */ + releaseKeyboard():void; + /** + * Releases previously captured mouse and touch input. + */ + releasePointer():void; + } + var AbstractInputMode:{ + $class:yfiles.lang.Class; + }; + /** + * Specializes the {@link yfiles.input.IInputMode} interface to support + * concurrency via {@link yfiles.input.ConcurrencyController} instances. + * Implementations may request an input mutex from a {@link yfiles.input.ConcurrencyController} + * that will be given to them via the {@link yfiles.input.IConcurrentInputMode#controller} property. + * This allows them to exclusively modify the contents of the view. + * If another {@link yfiles.input.IInputMode} successfully acquires the mutex, this mode will be disabled via the + * {@link yfiles.input.IConcurrentInputMode#enabled} property. + */ + export interface IConcurrentInputMode extends Object,yfiles.input.IInputMode{ + /** + * Gets or sets the enabled state of this input mode. + * The {@link yfiles.input.IConcurrentInputMode#controller} will disable this mode if another + * mode acquires the input mutex. + * Also clients can use this property to disable or reenable this instance. + * A disabled instance should never try to acquire the input mutex. + * @see Specified by {@link yfiles.input.IConcurrentInputMode#enabled}. + */ + enabled:boolean; + /** + * Returns the cursor this mode would like to have displayed in the + * {@link yfiles.canvas.CanvasControl}. + * To indicate that this mode does not have any preferences implementations should + * return null. + * @see Specified by {@link yfiles.input.IConcurrentInputMode#preferredCursor}. + */ + preferredCursor:yfiles.canvas.ICanvasCursor; + /** + * Used by clients to provide this instance with a {@link yfiles.input.ConcurrencyController}. + * Note that implementations may not depend on this property being set. + * The controller can be used to acquire and release an input mutex. + * @see Specified by {@link yfiles.input.IConcurrentInputMode#controller}. + */ + controller:yfiles.input.ConcurrencyController; + } + var IConcurrentInputMode:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Simple default implementation of {@link yfiles.input.IInputModeContext}. + */ + export interface SimpleInputModeContext extends Object,yfiles.input.IInputModeContext{ + /** + * Yields the {@link yfiles.input.IInputModeContext#canvasControl} on which the mode currently acts. + * This can be null if this mode is used outside the context of a CanvasControl. + * @see Specified by {@link yfiles.input.IInputModeContext#canvasControl}. + */ + canvasControl:yfiles.canvas.CanvasControl; + /** + * Yields the {@link yfiles.input.IInputMode} which issued the context object. + * This can be null if this context is used outside the context of an IInputMode. + * @see Specified by {@link yfiles.input.IInputModeContext#parentInputMode}. + */ + parentInputMode:yfiles.input.IInputMode; + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + } + var SimpleInputModeContext:{ + $class:yfiles.lang.Class; + /** + * An empty context where both the inputmode and the canvas is null. + * The lookup always yields null, also. + */ + EMPTY:yfiles.input.IInputModeContext; + /** + * Factory method that creates a context that uses the provided parent mode + * to retrieve the various values from. + */ + create(parent:yfiles.input.AbstractInputMode):yfiles.input.IInputModeContext; + /** + * Factory method that creates a context that uses the provided parent mode + * and lookup decoration. + */ + createWithLookup(parent:yfiles.input.AbstractInputMode,lookup:yfiles.support.ILookup):yfiles.input.IInputModeContext; + /** + * Factory method that creates a context that uses the provided parent mode + * and lookup decoration. + */ + createWithCallback(parent:yfiles.input.AbstractInputMode,lookup:(subject:Object,type:yfiles.lang.Class)=>Object):yfiles.input.IInputModeContext; + /** + * Factory method that creates a context that uses the provided parent mode, parent context, + * and lookup decoration. + */ + createWithContextAndLookup(parent:yfiles.input.IInputMode,parentContext:yfiles.input.IInputModeContext,lookup:yfiles.support.ILookup):yfiles.input.IInputModeContext; + /** + * Factory method that creates a context that uses the provided parent mode, parent context, + * and lookup decoration. + */ + createWithContextAndCallback(parent:yfiles.input.IInputMode,parentContext:yfiles.input.IInputModeContext,lookup:(subject:Object,type:yfiles.lang.Class)=>Object):yfiles.input.IInputModeContext; + /** + * Main constructor that initializes the state of this instance. + * @param {yfiles.canvas.CanvasControl} canvasControl The control to use, may not be null. + */ + WithCanvasControl:{ + new (canvasControl:yfiles.canvas.CanvasControl):yfiles.input.SimpleInputModeContext; + }; + /** + * Main constructor that initializes the state of this instance. + * @param {yfiles.canvas.CanvasControl} canvasControl The control to use, may not be null. + * @param {yfiles.input.IInputMode} mode The mode to set as the parent. This may be null for the canvas' context. + */ + WithCanvasControlAndMode:{ + new (canvasControl:yfiles.canvas.CanvasControl,mode:yfiles.input.IInputMode):yfiles.input.SimpleInputModeContext; + }; + /** + * Main constructor that initializes the state of this instance. + * @param {yfiles.canvas.CanvasControl} canvasControl The control to use, may not be null. + * @param {yfiles.input.IInputMode} mode The mode to set as the parent. This may be null for the canvas' context. + * @param {yfiles.support.ILookup} lookup The lookup to use. + */ + WithCanvasControlModeAndLookup:{ + new (canvasControl:yfiles.canvas.CanvasControl,mode:yfiles.input.IInputMode,lookup:yfiles.support.ILookup):yfiles.input.SimpleInputModeContext; + }; + }; + /** + * A class used as a parameter of {@link yfiles.canvas.CanvasControl#INPUT_FEEDBACK_COMMAND} + * to describe the feedback details. + */ + export interface InputFeedbackParameter extends Object{ + /** + * The Context of the {@link yfiles.input.IInputMode InputMode} + * that triggered the command. + */ + context:yfiles.input.IInputModeContext; + /** + * The location in world coordinates where the trigger action + * occurred on the canvas or null. + */ + location:yfiles.geometry.PointD; + /** + * The trigger action type. + */ + type:yfiles.input.InputFeedbackParameter.ActionType_Interface; + /** + * Contains additional information. + */ + tag:Object; + } + export module InputFeedbackParameter{ + export interface ActionType_Interface{} + } + var InputFeedbackParameter:{ + $class:yfiles.lang.Class; + ActionType:{ + NONE:yfiles.input.InputFeedbackParameter.ActionType_Interface; + ACTION_STARTED:yfiles.input.InputFeedbackParameter.ActionType_Interface; + INTERMEDIATE_ACTION:yfiles.input.InputFeedbackParameter.ActionType_Interface; + ACTION_ENDED:yfiles.input.InputFeedbackParameter.ActionType_Interface; + }; + /** + * Creates a new parameter instance. + * @param {yfiles.input.IInputModeContext} context The {@link yfiles.input.IInputModeContext context} of the input mode that triggered the command. + * @param {yfiles.input.InputFeedbackParameter.ActionType} type The type of the action that triggers the feedback. + * @param {yfiles.geometry.PointD} location The location in world coordinates where the trigger action occurred on the canvas. + * @param {Object} tag Use to put in constants that define the action details. + */ + FromContextTypeLocationAndTag:{ + new (context:yfiles.input.IInputModeContext,type:yfiles.input.InputFeedbackParameter.ActionType_Interface,location:yfiles.geometry.PointD,tag:Object):yfiles.input.InputFeedbackParameter; + }; + /** + * Creates a new parameter instance. + * @param {yfiles.input.IInputModeContext} context The {@link yfiles.input.IInputModeContext context} of the input mode that triggered the command. + * @param {yfiles.input.InputFeedbackParameter.ActionType} type The type of the action that triggers the feedback. + * @param {Object} tag Use to put in constants that define the action details. + */ + FromContextTypeAndTag:{ + new (context:yfiles.input.IInputModeContext,type:yfiles.input.InputFeedbackParameter.ActionType_Interface,tag:Object):yfiles.input.InputFeedbackParameter; + }; + }; + /** + * A simple default implementation of {@link yfiles.input.ISizeConstraintProvider}. + */ + export interface SizeConstraintProvider extends Object,yfiles.input.ISizeConstraintProvider{ + /** + * Gets or sets the instance to return by {@link yfiles.input.SizeConstraintProvider#getMaximumSize}. + */ + maximumSize:yfiles.geometry.ISize; + /** + * Gets or sets the instance to return by {@link yfiles.input.SizeConstraintProvider#getMinimumEnclosedArea}. + */ + minimumEnclosedArea:yfiles.geometry.IRectangle; + /** + * Gets or sets the instance to return by {@link yfiles.input.SizeConstraintProvider#getMinimumSize}. + */ + minimumSize:yfiles.geometry.ISize; + /** + * Returns the minimum size allowed for the given item. + * @param {T} item The item to return the minimum size for. + * @return {yfiles.geometry.SizeD} The minimum size or {@link yfiles.geometry.SizeD#EMPTY} if there is no constraint on the size. + * @see Specified by {@link yfiles.input.ISizeConstraintProvider#getMinimumSize}. + */ + getMinimumSize(item:T):yfiles.geometry.SizeD; + /** + * Returns the maximum size allowed for the given item. + * @param {T} item The item to return the maximum size for. + * @return {yfiles.geometry.SizeD} The maximum size or {@link yfiles.geometry.SizeD#INFINITE} if there is no constraint on the size. + * @see Specified by {@link yfiles.input.ISizeConstraintProvider#getMaximumSize}. + */ + getMaximumSize(item:T):yfiles.geometry.SizeD; + /** + * Returns the minimum area that needs to be enclosed by the given item. + * @param {T} item The item to return the area for. + * @return {yfiles.geometry.RectD} The area to enclose or {@link yfiles.geometry.RectD#EMPTY} if there is no constraint on the size due to an enclosed area. + * @see Specified by {@link yfiles.input.ISizeConstraintProvider#getMinimumEnclosedArea}. + */ + getMinimumEnclosedArea(item:T):yfiles.geometry.RectD; + } + var SizeConstraintProvider:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the provided size instances as the initial values. + * @param {yfiles.geometry.ISize} minimumSize The {@link yfiles.input.SizeConstraintProvider#minimumSize}. + * @param {yfiles.geometry.ISize} maximumSize The {@link yfiles.input.SizeConstraintProvider#maximumSize}. + * @param {yfiles.geometry.IRectangle} minimumEnclosedArea The {@link yfiles.input.SizeConstraintProvider#minimumEnclosedArea}. + */ + FromSizesAndArea:{ + new (minimumSize:yfiles.geometry.ISize,maximumSize:yfiles.geometry.ISize,minimumEnclosedArea:yfiles.geometry.IRectangle):yfiles.input.SizeConstraintProvider; + }; + /** + * Creates a new instance using the provided size instances as the initial values. + * This will set {@link yfiles.input.SizeConstraintProvider#minimumEnclosedArea} to {@link yfiles.geometry.ImmutableRectangle#EMPTY}. + * @param {yfiles.geometry.ISize} minimumSize The {@link yfiles.input.SizeConstraintProvider#minimumSize}. + * @param {yfiles.geometry.ISize} maximumSize The {@link yfiles.input.SizeConstraintProvider#maximumSize}. + */ + FromSizes:{ + new (minimumSize:yfiles.geometry.ISize,maximumSize:yfiles.geometry.ISize):yfiles.input.SizeConstraintProvider; + }; + }; + /** + * An {@link yfiles.input.IInputMode} implementation that can handle a collection + * of {@link yfiles.input.IHandle}s. + * This mode will render a visual representation of {@link yfiles.input.IHandle}s in + * the {@link yfiles.canvas.CanvasControl} and deal with mouse gestures that drag the visual + * representations accordingly. + * @see {@link yfiles.input.IHandle} + */ + export interface HandleInputMode extends yfiles.input.StateMachineInputMode{ + /** + * Gets or sets event recognizer that recognizes when the user temporarily disables snapping. + * Value: The instance to use for disabling snapping. The default is {@link yfiles.input.KeyEvents#CTRL_DOWN} + * @see {@link yfiles.input.HandleInputMode#enableSnappingRecognizer} + */ + disableSnappingRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets event recognizer that recognizes when the user reenables temporarily disabled snapping. + * Value: The instance to use for reenabling snapping. The default is {@link yfiles.input.KeyEvents#CTRL_UP} + */ + enableSnappingRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets a value indicating whether this {@link yfiles.input.HandleInputMode} is active. + * Deactivating this mode will hide the handles and prevent the user from interacting + * with them. By default this mode is active. + * Value: true if active; otherwise, false. + */ + active:boolean; + /** + * Convenience method for subclass implementations that invalidates + * the canvas this mode is currently installed in. + */ + invalidate():void; + /** + * Gets or sets the "pressed" state recognizer. + * This recognizer instance will be used to determine when the user begins + * to move a handle. + * Value: The "pressed" recognizer. + */ + pressedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "dragged" recognizer. + * This recognizer instance determines when the user is moving a handle. + * Value: The "dragged" recognizer. + */ + draggedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "cancel" recognizer. + * This recognizer recognizes the cancel action during the move. + * Value: The "cancel" recognizer. + */ + cancelRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "released" recognizer. + * This instance determines when the user has finished moving the handle. + * Value: The "released" recognizer. + */ + releasedRecognizer:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "pressed" state recognizer for touch input. + * This recognizer instance will be used to determine when the user begins + * to move a handle. + * Value: The "pressed" recognizer for touch events. + */ + pressedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "dragged" recognizer for touch input. + * This recognizer instance determines when the user is moving a handle. + * Value: The "dragged" recognizer for touch events. + */ + draggedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the "released" recognizer for touch input. + * This instance determines when the user has finished moving the handle. + * Value: The "released" recognizer for touch events. + */ + releasedRecognizerTouch:yfiles.input.IEventRecognizer; + /** + * Gets or sets the collection of {@link yfiles.input.IHandle}s this mode + * manages. + */ + handles:yfiles.model.ICollectionModel; + /** + * Initializes the state machine this input mode uses internally to manage its state. + * @see Overrides {@link yfiles.input.StateMachineInputMode#initializeStateMachine} + */ + initializeStateMachine(machine:yfiles.support.StateMachine,startState:yfiles.support.State,canceledState:yfiles.support.State,stoppedState:yfiles.support.State,finishedState:yfiles.support.State):void; + /** + * Called when the users cancels the dragging of the handle. + */ + cancelDrag(t:yfiles.support.Transition):void; + /** + * Installs the visual representation of the handles into the canvas at the group provided by{@link yfiles.input.HandleInputMode#canvasGroupProvider}. + * @see Overrides {@link yfiles.input.StateMachineInputMode#install} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(c:yfiles.input.IInputModeContext):void; + /** + * Gets or sets the canvas object group provider this mode should render the + * visual representations of the handles in. + * The default is an instance of {@link yfiles.model.CanvasGroupProviders#createTopGroupProvider}. + */ + canvasGroupProvider:yfiles.model.ICanvasGroupProvider; + /** + * Removes the {@link yfiles.canvas.ICanvasObject} that displays the handles from the canvas. + * @see Overrides {@link yfiles.input.StateMachineInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(c:yfiles.input.IInputModeContext):void; + /** + * Method that can be used to initialize the dragging of a given handle by hand. + * This will simulate the user having initialized a drag of the given handle. + * @param {yfiles.input.IHandle} handle The handle to be dragged. + */ + beginDragging(handle:yfiles.input.IHandle):void; + /** + * Event recognizer callback used to determine whether the mouse is currently hovering + * over a handle. + * @return {boolean} Whether the mouse is hovering over handle. + * @see {@link yfiles.input.HandleInputMode#getClosestHitHandle} + * @see {@link yfiles.input.StateMachineInputMode#lastEventLocation} + */ + isHovering(sender:Object,args:yfiles.system.EventArgs):boolean; + /** + * Transition callback that is invoked when the mouse gets "armed". + * This method will be invoked if the mouse hovers over a handle. + */ + arm(newState:yfiles.support.State,oldState:yfiles.support.State):void; + /** + * Transition callback that is invoked when the mouse gets "disarmed". + * This method will be invoked if the mouse stops hovering over a handle. + */ + disarm(newState:yfiles.support.State,oldState:yfiles.support.State):void; + /** + * The {@link yfiles.input.HandleInputMode#snapContext} which manages snapping model items to certain coordinates (e.g. other items). + * If set to null (the default) this input mode tries to obtain the {@link yfiles.input.HandleInputMode#snapContext} + * from the {@link yfiles.input.IInputModeContext}. To explicitly disable snapping, a {@link yfiles.input.HandleInputMode#snapContext} implementation that does nothing + * has to be set to this instance. + */ + snapContext:yfiles.input.SnapContext; + /** + * Gets the handle that is currently being moved or null otherwise. + * Value: The current handle or null. + */ + currentHandle:yfiles.input.IHandle; + /** + * Called by the state machine if a beginning drag gesture has been recognized. + */ + beginDrag(t:yfiles.support.Transition):void; + /** + * Creates an {@link yfiles.input.IInputModeContext} for use + * with the {@link yfiles.input.IHandle} interface for the upcoming + * drag operation. + * @return {yfiles.input.IInputModeContext} An instance of {@link yfiles.input.IInputModeContext}. + */ + createHandleInputModeContext():yfiles.input.IInputModeContext; + /** + * Called by the state machine during the drag. + */ + onDrag(t:yfiles.support.Transition):void; + /** + * Called by the state machine once that drag has been finalized. + */ + endDrag(t:yfiles.support.Transition):void; + /** + * Gets an immutable snapshot of the {@link yfiles.model.IModelItem}s affected by the currently + * modified {@link yfiles.input.HandleInputMode#currentHandle handle} gesture. + *

+ * When the gesture is {@link yfiles.input.HandleInputMode#addDragStartingListener starting} and the {@link yfiles.input.HandleInputMode#currentHandle} + * is {@link yfiles.input.IDragHandler#initializeDrag initialized}, the implementation can + * {@link yfiles.input.IModelItemCollector#add register} the affected item(s) through the {@link yfiles.input.IModelItemCollector} + * instance that is bound to the {@link yfiles.input.HandleInputMode#createHandleInputModeContext context} available via + * its {@link yfiles.support.ILookup#lookup}. + *

+ *

+ * Client code can register with the {@link yfiles.input.HandleInputMode#addDragStartedListener DragStarted} event, as well as the {@link yfiles.input.HandleInputMode#addDragFinishedListener DragFinished} event + * to get notified of the elements that may be or have been affected respectively by this input mode. + *

+ * Value: + * A snapshot of the current collection of the items that are affected by the handle drag operation. + */ + affectedItems:yfiles.collections.IEnumerable; + /** + * Determines whether a given handle has been visually hit by the mouse at the + * given world coordinates. + * @param {yfiles.input.IHandle} handle The handle to check + * @param {yfiles.geometry.PointD} location The world coordinates to check. + * @param {number} distance A distance metric that returns the distance from the mouse + * to the handle. + * @return {boolean} Whether the handle has been hit. + */ + handleIsHit(handle:yfiles.input.IHandle,location:yfiles.geometry.PointD,distance:{value:number;}):boolean; + /** + * Determines whether a given handle has been visually hit by the touch device + * at the given world coordinates. + * @param {yfiles.input.IHandle} handle The handle to check + * @param {yfiles.geometry.PointD} location The world coordinates to check. + * @param {number} distance A distance metric that returns the distance from the touch location + * to the handle. + * @return {boolean} Whether the handle has been hit. + */ + handleIsHitTouch(handle:yfiles.input.IHandle,location:yfiles.geometry.PointD,distance:{value:number;}):boolean; + /** + * Finds the closest hit handle for the given world coordinate pair. + * @param {yfiles.geometry.PointD} location The coordinates in the world coordinate system. + * @return {yfiles.input.IHandle} The closest handle that has been hit or null + */ + getClosestHitHandle(location:yfiles.geometry.PointD):yfiles.input.IHandle; + /** + * Finds the closest hit handle for the given world coordinate pair. + * @param {yfiles.geometry.PointD} location The coordinates in the world coordinate system. + * @return {yfiles.input.IHandle} The closest handle that has been hit or null + */ + getClosestHitHandleTouch(location:yfiles.geometry.PointD):yfiles.input.IHandle; + /** + * Factory method that creates and {@link yfiles.input.HandleInputMode#addHandle adds} + * a handle to this mode by wrapping a given {@link yfiles.geometry.IMutablePoint} + * instance. + * @param {yfiles.geometry.IMutablePoint} p The point to use as a handle. + * @return {yfiles.input.IHandle} The handle created. + */ + addHandleForPoint(p:yfiles.geometry.IMutablePoint):yfiles.input.IHandle; + /** + * Factory method that creates and {@link yfiles.input.HandleInputMode#addHandle adds} + * a handle to this mode by wrapping a given {@link yfiles.geometry.IMutablePoint} + * instance. + * The cursor and handleType are used to initialize the {@link yfiles.input.IHandle} instance. + * @param {yfiles.geometry.IMutablePoint} p The point to use as a handle. + * @param {yfiles.canvas.ICanvasCursor} cursor The cursor to use. + * @param {yfiles.input.HandleType} handleType The type of the handle to create. + * @return {yfiles.input.IHandle} The handle created. + */ + addHandleForPointWithType(p:yfiles.geometry.IMutablePoint,cursor:yfiles.canvas.ICanvasCursor,handleType:yfiles.input.HandleType):yfiles.input.IHandle; + /** + * Adds a handle to the collection of handles managed by this instance. + * @param {yfiles.input.IHandle} handle The handle to add. + */ + addHandle(handle:yfiles.input.IHandle):void; + /** + * Removes a handle from the collection of handles managed by this instance. + * @param {yfiles.input.IHandle} handle The handle to remove. + */ + removeHandle(handle:yfiles.input.IHandle):void; + /** + * Event that will be triggered before the drag will be finished. + */ + addDragFinishingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be finished. + */ + removeDragFinishingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag has been finished. + */ + addDragFinishedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag has been finished. + */ + removeDragFinishedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is starting. + */ + addDragStartingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is starting. + */ + removeDragStartingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is initialized and has started. + */ + addDragStartedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered once the drag is initialized and has started. + */ + removeDragStartedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the start of every drag. + */ + addDraggingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the start of every drag. + */ + removeDraggingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the end of every drag. + */ + addDraggedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered at the end of every drag. + */ + removeDraggedListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered when the drag has been canceled. + */ + addDragCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered when the drag has been canceled. + */ + removeDragCanceledListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be canceled. + */ + addDragCancelingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Event that will be triggered before the drag will be canceled. + */ + removeDragCancelingListener(value:(sender:Object,e:yfiles.input.InputModeEventArgs)=> void):void; + /** + * Triggers the {@link yfiles.input.HandleInputMode#addDragStartingListener DragStarting} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragStarting(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.HandleInputMode#addDragStartedListener DragStarted} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragStarted(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the start of each drag. + * This method triggers the {@link yfiles.input.HandleInputMode#addDraggingListener Dragging} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragging(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered at the end of each drag. + * This method triggers the {@link yfiles.input.HandleInputMode#addDraggedListener Dragged} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragged(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered once the drag has been finalized. + * This method triggers the {@link yfiles.input.HandleInputMode#addDragFinishedListener DragFinished} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragFinished(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback triggered before the drag will be finalized. + * This method triggers the {@link yfiles.input.HandleInputMode#addDragFinishingListener DragFinishing} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragFinishing(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.HandleInputMode#addDragCanceledListener DragCanceled} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragCanceled(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Triggers the {@link yfiles.input.HandleInputMode#addDragCancelingListener DragCanceling} event. + * @param {yfiles.input.InputModeEventArgs} inputModeEventArgs The event argument that contains context information. + */ + onDragCanceling(inputModeEventArgs:yfiles.input.InputModeEventArgs):void; + /** + * Callback that creates the {@link yfiles.drawing.Visual} for the given handle. + * @param {yfiles.input.IHandle} handle The handle to create a visual representation for. + * @return {yfiles.drawing.ArrangeVisual} The {@link yfiles.drawing.Visual}. + */ + createVisual(handle:yfiles.input.IHandle):yfiles.drawing.ArrangeVisual; + } + var HandleInputMode:{ + $class:yfiles.lang.Class; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.DEFAULT. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_DEFAULT_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.MOVE. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_MOVE_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.RESIZE. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_RESIZE_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.ROTATE. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_ROTATE_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.SHEAR. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_SHEAR_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.INVISIBLE. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_INVISIBLE_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.INVISIBLE| HandleType.VARIANT2. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_INVISIBLE_VARIANT2_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.INVISIBLE| HandleType.VARIANT3. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_INVISIBLE_VARIANT3_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.INVISIBLE| HandleType.VARIANT4. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_INVISIBLE_VARIANT4_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.DEFAULT| HandleType.VARIANT2. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_DEFAULT_VARIANT2_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.MOVE| HandleType.VARIANT2. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_MOVE_VARIANT2_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.RESIZE| HandleType.VARIANT2. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_RESIZE_VARIANT2_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.ROTATE| HandleType.VARIANT2. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_ROTATE_VARIANT2_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.SHEAR| HandleType.VARIANT2. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_SHEAR_VARIANT2_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.DEFAULT| HandleType.VARIANT3. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_DEFAULT_VARIANT3_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.MOVE| HandleType.VARIANT3. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_MOVE_VARIANT3_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.RESIZE| HandleType.VARIANT3. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_RESIZE_VARIANT3_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.ROTATE| HandleType.VARIANT3. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_ROTATE_VARIANT3_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.SHEAR| HandleType.VARIANT3. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_SHEAR_VARIANT3_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.DEFAULT| HandleType.VARIANT4. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_DEFAULT_VARIANT4_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.MOVE| HandleType.VARIANT4. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_MOVE_VARIANT4_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.RESIZE| HandleType.VARIANT4. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_RESIZE_VARIANT4_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.ROTATE| HandleType.VARIANT4. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_ROTATE_VARIANT4_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.SHEAR| HandleType.VARIANT4. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_SHEAR_VARIANT4_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.WARP. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_WARP_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.WARP| HandleType.VARIANT2. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_WARP_VARIANT2_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.WARP| HandleType.VARIANT3. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_WARP_VARIANT3_KEY:yfiles.system.ResourceKey; + /** + * A {@link yfiles.system.ResourceKey} that can be used by instances of the + * {@link yfiles.input.HandleInputMode} to look up a {@link yfiles.drawing.DataTemplate} + * that will be used for the rendering of {@link yfiles.input.IHandle}s of {@link yfiles.input.HandleType type} HandleType.WARP| HandleType.VARIANT4. + * The drawing returned should be centered around (0,0). + */ + HANDLE_DRAWING_WARP_VARIANT4_KEY:yfiles.system.ResourceKey; + /** + * Creates a new mode with no handles initially. + * @see {@link yfiles.input.HandleInputMode#handles} + */ + new ():yfiles.input.HandleInputMode; + }; + /** + * The event arguments for the {@link yfiles.input.ContextMenuInputMode#addPopulateContextMenuListener PopulateContextMenu} event. + */ + export interface PopulateContextMenuEventArgs extends yfiles.input.InputModeEventArgs{ + /** + * Gets the queried location in world coordinates. + * Value: The queried location in world coordinates. + */ + queryLocation:yfiles.geometry.PointD; + /** + * Gets or sets a value indicating whether this {@link yfiles.input.PopulateContextMenuEventArgs} + * has been handled. + * If this event is marked as handled, the input mode will use the + * property {@link yfiles.input.PopulateContextMenuEventArgs#showMenu} to decide whether to show the context menu. + *

+ * This property is automatically set to true if a value is + * assigned to the property {@link yfiles.input.PopulateContextMenuEventArgs#showMenu}. + *

+ * Value: true if handled; otherwise, false. + */ + handled:boolean; + /** + * Gets or sets a value indicating whether to actually display the context menu. + * This will set the {@link yfiles.input.PopulateContextMenuEventArgs#handled} property to true. + *

+ * The default value of this property is true. + *

+ * Value: true if the menu should be shown; otherwise, false. + */ + showMenu:boolean; + } + var PopulateContextMenuEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.PopulateContextMenuEventArgs} class. + * @param {yfiles.input.IInputModeContext} context The context. + * @param {yfiles.geometry.PointD} queryLocation The query location. + */ + new (context:yfiles.input.IInputModeContext,queryLocation:yfiles.geometry.PointD):yfiles.input.PopulateContextMenuEventArgs; + }; + /** + * A controller class that manages a number of {@link yfiles.input.IConcurrentInputMode} + * implementations. + * Modes can {@link yfiles.input.ConcurrencyController#requestMutex request} an {@link yfiles.input.InputMutex} + * to {@link yfiles.input.IConcurrentInputMode#enabled disable} other modes + * registered with this controller. + * {@link yfiles.input.ConcurrencyController#release Releasing the mutex} will reenable the other modes. + * @see {@link yfiles.input.IConcurrentInputMode} + * @see {@link yfiles.input.InputMutex} + * @see {@link yfiles.input.MultiplexingInputMode} + */ + export interface ConcurrencyController extends Object{ + /** + * Determines if a mutex can be successfully requested currently. + * @return {boolean} Whether {@link yfiles.input.ConcurrencyController#requestMutex} would currently succeed. + */ + canRequestMutex():boolean; + /** + * Can be called to request an {@link yfiles.input.InputMutex} for the given mode. + * Modes should call this method to request exclusive editing for a + * canvas control. + * @param {yfiles.input.IConcurrentInputMode} mode The mode that should be given the mutex + * @return {yfiles.input.InputMutex} The acquired mutex. + * @throws {yfiles.system.InvalidOperationException} If the mutex could not be obtained. + * @see {@link yfiles.input.ConcurrencyController#canRequestMutex} + * @throws {yfiles.system.ArgumentNullException} mode is null. + */ + requestMutex(mode:yfiles.input.IConcurrentInputMode):yfiles.input.InputMutex; + /** + * Releases the given mutex. + * Modes should call this method when they have finished editing the contents + * exclusively. This will reenable those modes that had been {@link yfiles.input.IConcurrentInputMode#enabled disabled} + * at the time this mutex has been requested. + * @param {yfiles.input.InputMutex} mutex The mutex to release. + * @throws {yfiles.system.ArgumentException} If the mutex is not the current mutex of this controller. + */ + release(mutex:yfiles.input.InputMutex):void; + /** + * Event that will be triggered if the mutex has been successfully requested. + */ + addMutexRequestedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered if the mutex has been successfully requested. + */ + removeMutexRequestedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered if the mutex has been released. + */ + addMutexReleasedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Event that will be triggered if the mutex has been released. + */ + removeMutexReleasedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Registers the given mode with this controller. + * This mode can now request the input mutex and will be disabled + * once another mode acquires the mutex. + * If another mode currently owns the mutex, this mode will be immediately + * disabled. + * This will automatically inject this instance into the mode using the + * {@link yfiles.input.IConcurrentInputMode#controller} property. + * @param {yfiles.input.IConcurrentInputMode} mode The mode to register with this controller. + * @see {@link yfiles.input.ConcurrencyController#unregister} + * @throws {yfiles.system.ArgumentException} If the mode is null or + * has already been registered with this instance. + */ + register(mode:yfiles.input.IConcurrentInputMode):void; + /** + * Unregisters this mode from this controller. + * This will reset the {@link yfiles.input.IConcurrentInputMode#controller} property + * of the given mode to null. + * @param {yfiles.input.IConcurrentInputMode} mode The mode to remove from this controller. + */ + unregister(mode:yfiles.input.IConcurrentInputMode):void; + /** + * Gets the current owner of the input mutex or null if no mode + * currently owns the mutex. + */ + currentOwner:yfiles.input.IConcurrentInputMode; + /** + * Enables or disables this controller. + * The default state is enabled. + * If disabled, this controller will not allow for {@link yfiles.input.ConcurrencyController#requestMutex requesting} + * new mutex instances and will indicate so in the {@link yfiles.input.ConcurrencyController#canRequestMutex} call. + * If the controller is disabled while a mutex is currently given to a {@link yfiles.input.ConcurrencyController#currentOwner}, + * the owner will be requested to {@link yfiles.input.IInputMode#stop} or {@link yfiles.input.IInputMode#cancel}. + * This method will ultimately call {@link yfiles.input.ConcurrencyController#onEnabled} or {@link yfiles.input.ConcurrencyController#onDisabled}. + * If it fails to reobtain the mutex from the current owner, even though the owner has been canceled, + * this method will throw an exception. + */ + enabled:boolean; + /** + * Callback that is called if {@link yfiles.input.ConcurrencyController#enabled} has been successfully changed accordingly. + */ + onDisabled():void; + /** + * Callback that is called if {@link yfiles.input.ConcurrencyController#enabled} has been successfully changed accordingly. + */ + onEnabled():void; + /** + * Callback method that will be triggered if a mode requests the input mutex. + * This method will {@link yfiles.input.IInputMode#cancel} and + * {@link yfiles.input.IConcurrentInputMode#enabled disable} all other + * modes that have been registered with this instance. + * Finally, it triggers the {@link yfiles.input.ConcurrencyController#addMutexRequestedListener MutexRequested} event. + * @param {yfiles.input.IConcurrentInputMode} newOwner The new owner of the mutex. + */ + onMutexRequested(newOwner:yfiles.input.IConcurrentInputMode):void; + /** + * Callback method that will be triggered if a mode released the input mutex. + * This will trigger the {@link yfiles.input.ConcurrencyController#addMutexReleasedListener MutexReleased} event. + * @param {yfiles.input.IConcurrentInputMode} oldOwner The old owner of the mutex. + */ + onMutexReleased(oldOwner:yfiles.input.IConcurrentInputMode):void; + } + var ConcurrencyController:{ + $class:yfiles.lang.Class; + new ():yfiles.input.ConcurrencyController; + }; + /** + * An implementation of the {@link yfiles.input.IInputMode} interface that handles + * the display of a custom context menu when the user right clicks on the + * {@link yfiles.canvas.CanvasControl}. + * This mode can be used with any context menu implementation since it does + * not impose any specific requirements. Typically, it is used in the following + * way. + *

+ * First, this mode must be informed that the user wants to show the context menu + * with the methods {@link yfiles.input.ContextMenuInputMode#menuOpening} or {@link yfiles.input.ContextMenuInputMode#menuOpeningForQueryLocation}, + * for example because a contextmenu event was fired. + *

+ *

+ * Then, in response, this mode checks whether its current state allows + * opening a context menu, and fires the events {@link yfiles.input.ContextMenuInputMode#addPopulateContextMenuListener PopulateContextMenu} and + * GraphEditorInputMode.populateItemContextMenu. + *

+ *

+ * If the context menu was closed because of user interaction with it, for + * example the user selected an menu entry, this mode must be informed by + * calling the method {@link yfiles.input.ContextMenuInputMode#menuClosed}. + *

+ *

+ * This mode detects automatically if the menu must be closed because of + * other user interaction, for example the user clicked somewhere else, and + * fires the event {@link yfiles.input.ContextMenuInputMode#addCloseMenuListener CloseMenu} to request closing of the + * context menu. + *

+ */ + export interface ContextMenuInputMode extends yfiles.input.AbstractConcurrentInputMode{ + /** + * An event that will be triggered when the context menu is about to + * be shown. + * Handlers of the event can populate their context menu, + * set the property {@link yfiles.input.PopulateContextMenuEventArgs#showMenu} and + * set or respect the property {@link yfiles.input.PopulateContextMenuEventArgs#handled}. + * Note that all handlers will be called, even if one of them sets the property {@link yfiles.input.PopulateContextMenuEventArgs#handled} + * to true. Every handler should query this property and decide carefully what to do. + */ + addPopulateContextMenuListener(value:(sender:Object,e:yfiles.input.PopulateContextMenuEventArgs)=> void):void; + /** + * An event that will be triggered when the context menu is about to + * be shown. + * Handlers of the event can populate their context menu, + * set the property {@link yfiles.input.PopulateContextMenuEventArgs#showMenu} and + * set or respect the property {@link yfiles.input.PopulateContextMenuEventArgs#handled}. + * Note that all handlers will be called, even if one of them sets the property {@link yfiles.input.PopulateContextMenuEventArgs#handled} + * to true. Every handler should query this property and decide carefully what to do. + */ + removePopulateContextMenuListener(value:(sender:Object,e:yfiles.input.PopulateContextMenuEventArgs)=> void):void; + /** + * Gets or sets an {@link yfiles.drawing.IHitTestable} that determines whether + * it is valid to open a context menu at the queried position. + * If the instance yields false, {@link yfiles.input.ContextMenuInputMode#onPopulateContextMenuWithPosition} + * will not be queried and the context menu will not be shown. + * By default there is a hit testable instance that always yields true. + */ + validContextMenuLocationHitTestable:yfiles.drawing.IHitTestable; + /** + * This method must be called by custom code to inform this input mode that a context menu is about to be opened + * by a user gesture. + * Since this input mode does not know when the user wants to open a context menu, this method must be called to + * possibly cancel the request and, otherwise, update the internal state of this mode. + *

+ * Client code must pass a {@link yfiles.system.CancelEventArgs} object and check the {@link yfiles.system.CancelEventArgs#cancel} + * property whether the context menu must not be opened at all. + *

+ *

+ * This method will use the last known mouse location as the query location. + * If another query location should be used, use the the method {@link yfiles.input.ContextMenuInputMode#menuOpeningForQueryLocation} instead. + *

+ * @param {yfiles.system.CancelEventArgs} cancelEventArgs The {@link yfiles.system.CancelEventArgs} instance containing the event data. + * @see {@link yfiles.input.ContextMenuInputMode#menuClosed} + * @see {@link yfiles.input.ContextMenuInputMode#addCloseMenuListener CloseMenu} + */ + menuOpening(cancelEventArgs:yfiles.system.CancelEventArgs):void; + /** + * This method must be called by custom code to inform this input mode that a context menu is about to be opened + * by a user gesture. + * Since this input mode does not know when the user wants to open a context menu, this method must be called to + * possibly cancel the request and, otherwise, update the internal state of this mode. + *

+ * Client code must pass a {@link yfiles.system.CancelEventArgs} object and check the {@link yfiles.system.CancelEventArgs#cancel} + * property whether the context menu must not be opened at all. + *

+ * @param {yfiles.system.CancelEventArgs} cancelEventArgs The {@link yfiles.system.CancelEventArgs} instance containing the event data. + * @param {yfiles.geometry.PointD} queryLocation The location at for which the context menu content should be queried. This value will be passed to + * {@link yfiles.input.ContextMenuInputMode#onPopulateContextMenuWithPosition} and will ultimately be available + * in {@link yfiles.input.PopulateContextMenuEventArgs#queryLocation}. + * @see {@link yfiles.input.ContextMenuInputMode#menuClosed} + * @see {@link yfiles.input.ContextMenuInputMode#addCloseMenuListener CloseMenu} + */ + menuOpeningForQueryLocation(cancelEventArgs:yfiles.system.CancelEventArgs,queryLocation:yfiles.geometry.PointD):void; + /** + * This method must be called by custom code to indicate that the menu has been closed. + * Since this input mode cannot know when the user has closed a context menu, this callback should be used to allow + * the instance to adjust the internal state. + * @see {@link yfiles.input.ContextMenuInputMode#addCloseMenuListener CloseMenu} + */ + menuClosed():void; + /** + * This will populate the context menu for the given world coordinate. + * This implementation will trigger the {@link yfiles.input.ContextMenuInputMode#addPopulateContextMenuListener PopulateContextMenu} event + * and will use the {@link yfiles.input.PopulateContextMenuEventArgs#showMenu} value as the return value. + * If the event will not be handled, this method will return true. + * @param {yfiles.geometry.PointD} position The position in the world coordinate system for which the context menu has been invoked. + * @return {boolean} Whether to show the context menu. + */ + onPopulateContextMenuWithPosition(position:yfiles.geometry.PointD):boolean; + /** + * Raises the {@link yfiles.input.ContextMenuInputMode#addPopulateContextMenuListener PopulateContextMenu} event. + * @param {yfiles.input.PopulateContextMenuEventArgs} args The {@link yfiles.input.PopulateContextMenuEventArgs} instance containing the event data. + */ + onPopulateContextMenu(args:yfiles.input.PopulateContextMenuEventArgs):void; + /** + * Creates an {@link yfiles.input.IInputModeContext} for use + * with the {@link yfiles.input.ContextMenuInputMode#addPopulateContextMenuListener PopulateContextMenu} call in the upcoming + * query. + * @return {yfiles.input.IInputModeContext} An instance of {@link yfiles.input.IInputModeContext}. + */ + createContextMenuHandlerInputModeContext():yfiles.input.IInputModeContext; + /** + * Installs this mode in the canvas. + * @param {yfiles.input.IInputModeContext} canvas The canvas to install this mode into. + * @see Overrides {@link yfiles.input.AbstractInputMode#install} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(canvas:yfiles.input.IInputModeContext):void; + /** + * Cancels the display of the context menu and requests that the context menu is closed. + * @see {@link yfiles.input.ContextMenuInputMode#addCloseMenuListener CloseMenu} + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#cancel} + * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Gets or sets a value that determines whether clicks are swallowed if they happen within a + * short amount of time after a context menu was closed. + * This is especially useful to cancel the menu by clicking somewhere outside the menu without + * creating a node. The default is true. + */ + swallowCloseClick:boolean; + /** + * Stops the display of the context menu and requests that the context menu is closed. + * @return {boolean} super.Stop() + * @see {@link yfiles.input.ContextMenuInputMode#addCloseMenuListener CloseMenu} + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#stop} + * @see Specified by {@link yfiles.input.IInputMode#stop}. + */ + stop():boolean; + /** + * Called when the menu is closed and triggers the {@link yfiles.input.ContextMenuInputMode#addCloseMenuListener CloseMenu} event. + */ + onCloseMenu():void; + /** + * Occurs when this instance requests closing an open context menu. + * Custom context menus must be closed in response to this event. + * @see {@link yfiles.input.ContextMenuInputMode#menuClosed} + * @see {@link yfiles.input.ContextMenuInputMode#menuOpening} + */ + addCloseMenuListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when this instance requests closing an open context menu. + * Custom context menus must be closed in response to this event. + * @see {@link yfiles.input.ContextMenuInputMode#menuClosed} + * @see {@link yfiles.input.ContextMenuInputMode#menuOpening} + */ + removeCloseMenuListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Uninstalls this mode from the canvas. + * @param {yfiles.input.IInputModeContext} context The context to uninstall this mode from. + * @see Overrides {@link yfiles.input.AbstractInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + } + var ContextMenuInputMode:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.input.ContextMenuInputMode} class. + */ + new ():yfiles.input.ContextMenuInputMode; + }; + /** + * An {@link yfiles.input.IConcurrentInputMode} that can be added to a {@link yfiles.input.MultiplexingInputMode} + * to suppress other modes from doing unwanted things if the control has just become focused. + * This mode requests the input mutex once the canvas loses focus. And returns the mutex + * after the mode has regained focus and the mouse has been clicked or 100 milliseconds have passed. + * This mode should be registered with the {@link yfiles.input.MultiplexingInputMode} + * using the {@link yfiles.input.MultiplexingInputMode#addConcurrentWithPriority} + * method and a large priority number (e.g. 1000). So that other modes don't receive + * the input mutex once this one has released the mutex. + */ + export interface FocusGuardInputMode extends yfiles.input.AbstractConcurrentInputMode{ + /** + * Gets or sets the Cursor that will be shown during active guards. + * The default is {@link yfiles.canvas.CanvasCursor#ARROW} + */ + guardCursor:yfiles.canvas.ICanvasCursor; + /** + * Installs this mode into the given context that is provided by the canvas. + * In general a mode can only be installed into a single canvas at all times. + * This method is called to initialize this instance. Subclasses should override + * this method to register the corresponding event handler delegates for + * the various input events they need to register with. + * When this instance gets {@link yfiles.input.IInputMode#uninstall uninstalled} from the context + * the same context instance will be passed to it. + * Implementations may hold a reference to the context instance + * and use it while they are being installed. + * @param {yfiles.input.IInputModeContext} context The context that this instance shall be installed into. + * The same instance will be passed to this instance during {@link yfiles.input.IInputMode#uninstall}. + * A reference to the context may be kept and queried during the time the mode is installed. + * @see {@link yfiles.input.IInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Called by the client to unconditionally cancel all editing. + * This will be called prior to the uninstalling of this instance. + * In order to stop an active input mode manually, client code should use + * the following idiom: + *

+      * if (!mode.stop()){
+      *   mode.cancel();
+      * }
+      * 
+ * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Called by the client in order to stop a current editing progress. + * This should stop the current edit, if one is in progress and possibly commit + * all of the changes. If stopping is not possible, this method can return false + * @return {boolean} true if and only if the editing has been stopped or there was + * no edit in progress + * @see {@link yfiles.input.IInputMode#cancel} + * @see Specified by {@link yfiles.input.IInputMode#stop}. + */ + stop():boolean; + /** + * Uninstalls this mode from the given context. + * This code should clean up all changes made to the canvas in the {@link yfiles.input.IInputMode#install} + * method. After a mode has been uninstalled it can be installed again into the same or + * another canvas. + * @param {yfiles.input.IInputModeContext} context The context to deregister from. This is the same instance that had been + * passed to {@link yfiles.input.IInputMode#install} during installation. + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + } + var FocusGuardInputMode:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this mode. + */ + new ():yfiles.input.FocusGuardInputMode; + }; + /** + * This is an input mode handling drag and drop related events + * on a {@link yfiles.canvas.CanvasControl}. + * An instance of DropInputMode is initialized for an + * expected data format in the constructor. + * There are four events raised by an instance of this class. + *
    + *
  • {@link yfiles.input.DropInputMode#addDragEnteredListener DragEntered} is raised, if a drag operation enters + * the {@link yfiles.canvas.CanvasControl}.
  • + *
  • {@link yfiles.input.DropInputMode#addDragOverListener DragOver} is raised, if a drag operation moves over + * the {@link yfiles.canvas.CanvasControl} after having entered it.
  • + *
  • {@link yfiles.input.DropInputMode#addDragDroppedListener DragDropped} is raised, if a drag is dropped onto + * the {@link yfiles.canvas.CanvasControl}.
  • + *
  • {@link yfiles.input.DropInputMode#addDragLeftListener DragLeft} is raised, if a drag is operation leaves + * the {@link yfiles.canvas.CanvasControl}.
  • + *
+ *

+ * Clients can query the current {@link yfiles.input.DropInputMode#mousePosition} which is + * updated while a drag is in progress. Clients get the data from the + * drag operation by calling {@link yfiles.input.DropInputMode#dropData} from an event handler + * registered for any of these events. + *

+ *

+ * This input mode supports concurrency. It can be added to a + * {@link yfiles.input.MultiplexingInputMode} using + * {@link yfiles.input.MultiplexingInputMode#addConcurrent} or + * {@link yfiles.input.MultiplexingInputMode#addConcurrentWithPriority}. + *

+ */ + export interface DropInputMode extends yfiles.input.AbstractConcurrentInputMode{ + /** + * This event is raised, if a drag operation enters the + * {@link yfiles.canvas.CanvasControl} into which this instance is installed. + * No event is raised + *
    + *
  • if this instance is not {@link yfiles.input.AbstractConcurrentInputMode#enabled},
  • + *
  • if another concurrent input mode is active or
  • + *
  • the data from the drag operation does not conform to the expected + * format.
  • + *
+ * To get additional data for the event, clients should use the sender + * which is set to the sending {@link yfiles.input.DropInputMode}. The + * {@link yfiles.system.EventArgs} provide no useful data. + */ + addDragEnteredListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * This event is raised, if a drag operation enters the + * {@link yfiles.canvas.CanvasControl} into which this instance is installed. + * No event is raised + *
    + *
  • if this instance is not {@link yfiles.input.AbstractConcurrentInputMode#enabled},
  • + *
  • if another concurrent input mode is active or
  • + *
  • the data from the drag operation does not conform to the expected + * format.
  • + *
+ * To get additional data for the event, clients should use the sender + * which is set to the sending {@link yfiles.input.DropInputMode}. The + * {@link yfiles.system.EventArgs} provide no useful data. + */ + removeDragEnteredListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * This event is raised, if a drag operation drags over the + * {@link yfiles.canvas.CanvasControl} into which this instance is installed. + * No event is raised + *
    + *
  • if this instance is not {@link yfiles.input.AbstractConcurrentInputMode#enabled},
  • + *
  • if another concurrent input mode is active or
  • + *
  • the data from the drag operation does not conform to the expected + * format.
  • + *
+ * To get additional data for the event, clients should use the sender + * which is set to the sending {@link yfiles.input.DropInputMode}. The + * {@link yfiles.system.EventArgs} provide no useful data. + */ + addDragOverListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * This event is raised, if a drag operation drags over the + * {@link yfiles.canvas.CanvasControl} into which this instance is installed. + * No event is raised + *
    + *
  • if this instance is not {@link yfiles.input.AbstractConcurrentInputMode#enabled},
  • + *
  • if another concurrent input mode is active or
  • + *
  • the data from the drag operation does not conform to the expected + * format.
  • + *
+ * To get additional data for the event, clients should use the sender + * which is set to the sending {@link yfiles.input.DropInputMode}. The + * {@link yfiles.system.EventArgs} provide no useful data. + */ + removeDragOverListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * This event is raised, if a drag operation leaves the + * {@link yfiles.canvas.CanvasControl} into which this instance is installed. + * No event is raised + *
    + *
  • if this instance is not {@link yfiles.input.AbstractConcurrentInputMode#enabled},
  • + *
  • if another concurrent input mode is active or
  • + *
  • the data from the drag operation does not conform to the expected + * format.
  • + *
+ * To get additional data for the event, clients should use the sender + * which is set to the sending {@link yfiles.input.DropInputMode}. The + * {@link yfiles.system.EventArgs} provide no useful data. + */ + addDragLeftListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * This event is raised, if a drag operation leaves the + * {@link yfiles.canvas.CanvasControl} into which this instance is installed. + * No event is raised + *
    + *
  • if this instance is not {@link yfiles.input.AbstractConcurrentInputMode#enabled},
  • + *
  • if another concurrent input mode is active or
  • + *
  • the data from the drag operation does not conform to the expected + * format.
  • + *
+ * To get additional data for the event, clients should use the sender + * which is set to the sending {@link yfiles.input.DropInputMode}. The + * {@link yfiles.system.EventArgs} provide no useful data. + */ + removeDragLeftListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * This event is raised, if a drag operation is dropped onto the + * {@link yfiles.canvas.CanvasControl} into which this instance is installed. + * No event is raised + *
    + *
  • if this instance is not {@link yfiles.input.AbstractConcurrentInputMode#enabled},
  • + *
  • if another concurrent input mode is active or
  • + *
  • the data from the drag operation does not conform to the expected + * format.
  • + *
+ * To get additional data for the event, clients should use the sender + * which is set to the sending {@link yfiles.input.DropInputMode}. The + * {@link yfiles.system.EventArgs} provide no useful data. + */ + addDragDroppedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * This event is raised, if a drag operation is dropped onto the + * {@link yfiles.canvas.CanvasControl} into which this instance is installed. + * No event is raised + *
    + *
  • if this instance is not {@link yfiles.input.AbstractConcurrentInputMode#enabled},
  • + *
  • if another concurrent input mode is active or
  • + *
  • the data from the drag operation does not conform to the expected + * format.
  • + *
+ * To get additional data for the event, clients should use the sender + * which is set to the sending {@link yfiles.input.DropInputMode}. The + * {@link yfiles.system.EventArgs} provide no useful data. + */ + removeDragDroppedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Gets or sets the {@link yfiles.system.DragDropEffects} that will + * be used for drags on the canvas. + */ + dragDropEffect:yfiles.system.DragDropEffects; + /** + * Gets or sets the {@link yfiles.drawing.IHitTestable} that determines + * whether the given location is a valid drop location. + * Value: The hit testable that yields true for valid drop locations. + */ + validDropHitTestable:yfiles.drawing.IHitTestable; + /** + * Gets the last processed drag event argument. + */ + lastDragEventArgs:yfiles.system.DragEventArgs; + /** + * Gets the current mouse position during drag operations. + * The position is returned in world coordinates according to the + * {@link yfiles.canvas.CanvasControl} into which this input mode is installed. + */ + mousePosition:yfiles.geometry.IPoint; + /** + * Gets the mouse position after dropping an item. + * The position is returned in world coordinates according to the + * {@link yfiles.canvas.CanvasControl} into which this input mode is installed. + */ + dropLocation:yfiles.geometry.PointD; + /** + * Gets the data carried by a drag operation. + * This is only valid, if a drag entered the {@link yfiles.canvas.CanvasControl} first. + */ + dropData:Object; + /** + * Gets or sets a value indicating whether to capture mouse input during drag operations. + * The default is true and thus prevents mouse events from being processed + * by visuals in the canvas. + * Value: + * true if mouse input should be captured during the drag; otherwise, false. + */ + captureMouseInputDuringDrag:boolean; + /** + * Cleanly cancels this mode. + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#cancel} + * @see Specified by {@link yfiles.input.IInputMode#cancel}. + */ + cancel():void; + /** + * Installs this mode into the given canvas. + * Clients should not call this method as this is handled by the framework. + * @param {yfiles.input.IInputModeContext} context the context to install this mode into + * @see {@link yfiles.canvas.CanvasControl} + * @see Overrides {@link yfiles.input.AbstractInputMode#install} + * @see Specified by {@link yfiles.input.IInputMode#install}. + */ + install(context:yfiles.input.IInputModeContext):void; + /** + * Uninstalls this mode from the canvas. + * Clients should not call this method as this is handled by the framework. + * @param {yfiles.input.IInputModeContext} context the context + * @see Overrides {@link yfiles.input.AbstractInputMode#uninstall} + * @see Specified by {@link yfiles.input.IInputMode#uninstall}. + */ + uninstall(context:yfiles.input.IInputModeContext):void; + /** + * Called when the {@link yfiles.input.AbstractConcurrentInputMode#enabled} property changes to false. + * This implementation removes the drag and drop listeners from the canvas. + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#onDisabled} + */ + onDisabled():void; + /** + * Called when the {@link yfiles.input.AbstractConcurrentInputMode#enabled} property changes to true. + * This implementation registers the drag and drop listeners on the canvas. + * @see Overrides {@link yfiles.input.AbstractConcurrentInputMode#onEnabled} + */ + onEnabled():void; + /** + * Called once a drag has entered the canvas. + */ + onDragEntered(e:yfiles.system.DragEventArgs):void; + /** + * Called whenever a drag is over the canvas. + */ + onDraggedOver(e:yfiles.system.DragEventArgs):void; + /** + * Called once a drag has been dropped on the canvas. + */ + onDragDropped(e:yfiles.system.DragEventArgs):void; + /** + * Called once a drag has left the canvas. + * @param {yfiles.system.DragEventArgs} e the drag event arguments. + */ + onDragLeft(e:yfiles.system.DragEventArgs):void; + /** + * Callback that adjusts the effect accordingly. + */ + adjustEffect(e:yfiles.system.DragEventArgs):boolean; + /** + * This method updates the {@link yfiles.input.DropInputMode#mousePosition} according to the coordinates passed in. + * It is called prior to the {@link yfiles.input.DropInputMode#onDragEntered}, {@link yfiles.input.DropInputMode#onDraggedOver}, {@link yfiles.input.DropInputMode#onDragDropped} + * and {@link yfiles.input.DropInputMode#onDragLeft} methods. + * @param {yfiles.geometry.PointD} coordinates The current location of the mouse in world coordinates. + */ + setDragLocation(coordinates:yfiles.geometry.PointD):void; + } + var DropInputMode:{ + $class:yfiles.lang.Class; + /** + * Constructs a new instance of class {@link yfiles.input.DropInputMode} for the + * expected data format. + * The input mode fires events (see {@link yfiles.input.DropInputMode#addDragEnteredListener DragEntered} and + * {@link yfiles.input.DropInputMode#addDragDroppedListener DragDropped}) only if a drag operation carries data + * conforming to the given type. + * @param {yfiles.lang.Class} expectedType This is a type which can be given to + * {@link yfiles.system.IDataObject#getData}. + */ + new (expectedType:yfiles.lang.Class):yfiles.input.DropInputMode; + }; + /** + * A controller class that makes multiple {@link yfiles.input.IHandle} + * implementations appear to be synchronized. + * This class wraps given {@link yfiles.input.IHandle} implementations + * and synchronizes method calls to them automatically so that + * if clients drag one of the wrapped handles, all handles will be dragged + * synchronously. + */ + export interface CompositeHandle extends Object{ + /** + * Returns a live collection of {@link yfiles.input.IHandle}s that wrap the handles + * added to this instance by {@link yfiles.input.CompositeHandle#addHandles}. + */ + handles:yfiles.model.ICollectionModel; + /** + * Adds the array of handles so that they appear to be synchronized + * with all other handles previously being added to this instance. + * @param {T} tag The tag to use for {@link yfiles.input.CompositeHandle#removeHandles removing} the handles later on. + * @param {yfiles.input.IHandle[]} handleArray The handles to add to this instance. + * @see {@link yfiles.input.CompositeHandle#wrap} + */ + addHandles(tag:T,handleArray:yfiles.input.IHandle[]):void; + /** + * Removes the handles from the {@link yfiles.input.CompositeHandle#handles} collection that + * have been added to this instance previously using {@link yfiles.input.CompositeHandle#addHandles} tagged + * with the same tag. + * @param {T} tag The tag used during the call to {@link yfiles.input.CompositeHandle#addHandles}. + * @see {@link yfiles.input.CompositeHandle#wrap} + */ + removeHandles(tag:T):void; + /** + * Wraps a given {@link yfiles.input.IHandle} implementation so that it appears to be + * synchronized with all handles that are used for the same position identifier. + * The returned wrapped instances should be {@link yfiles.input.CompositeHandle#addHandles added} to this instance. + * If the returned instance will be dragged by the user all other handles + * that have been wrapped by this instance using the same position identifier will + * be dragged synchronously. + * @param {yfiles.input.HandlePositions} position The position the given handle should be synchronized with. + * @param {yfiles.input.IHandle} handle The handle to wrap. + * @return {yfiles.input.IHandle} The wrapped implementation. + */ + wrap(position:yfiles.input.HandlePositions,handle:yfiles.input.IHandle):yfiles.input.IHandle; + /** + * Wraps an {@link yfiles.input.IHandle} implementation that will be obtained from + * the handleFactory initially and each time + * {@link yfiles.input.IDragHandler#initializeDrag the drag is initialized} + * The wrapped handle will appear to be + * synchronized with all handles that are used for the same position identifier. + * The returned wrapped instances should be {@link yfiles.input.CompositeHandle#addHandles added} to this instance. + * If the returned instance will be dragged by the user all other handles + * that have been wrapped by this instance using the same position identifier will + * be dragged synchronously. + * @param {yfiles.input.HandlePositions} position The position the given handle should be synchronized with. + * @return {yfiles.input.IHandle} The wrapped implementation. + * @param {function(T):yfiles.input.IHandle} handleFactory The factory method that will be called initially and each time a drag is initialized. + * @param {T} handleFactoryContext The context to pass to the handleFactory during invocation. + */ + wrapWithFactoryContext(position:yfiles.input.HandlePositions,handleFactory:(context:T)=>yfiles.input.IHandle,handleFactoryContext:T):yfiles.input.IHandle; + /** + * Wraps an {@link yfiles.input.IHandle} implementation that will be obtained from + * the handleFactory each time + * {@link yfiles.input.IDragHandler#initializeDrag the drag is initialized} + * The wrapped handle will appear to be + * synchronized with all handles that are used for the same position identifier. + * The returned wrapped instances should be {@link yfiles.input.CompositeHandle#addHandles added} to this instance. + * If the returned instance will be dragged by the user all other handles + * that have been wrapped by this instance using the same position identifier will + * be dragged synchronously. + * @param {yfiles.input.HandlePositions} position The position the given handle should be synchronized with. + * @return {yfiles.input.IHandle} The wrapped implementation. + * @param {yfiles.input.IHandle} initialHandle The handle to use initially. + * @param {function(T):yfiles.input.IHandle} handleFactory The factory method that will be called initially and each time a drag is initialized. + * @param {T} handleFactoryContext The context to pass to the handleFactory during invocation. + */ + wrapWithInitialHandle(position:yfiles.input.HandlePositions,initialHandle:yfiles.input.IHandle,handleFactory:(context:T)=>yfiles.input.IHandle,handleFactoryContext:T):yfiles.input.IHandle; + } + var CompositeHandle:{ + $class:yfiles.lang.Class; + /** + * Constructs a new instance of this class. + * Using {@link yfiles.input.CompositeHandle#addHandles} and {@link yfiles.input.CompositeHandle#removeHandles} + * clients can modify the collection of handles wrapped by this instance. + * The collection can be obtained using the {@link yfiles.input.CompositeHandle#handles} property. + */ + new ():yfiles.input.CompositeHandle; + }; + /** + * Event Argument used by {@link yfiles.input.SnapContext} to collect {@link yfiles.input.SnapResult}s. + */ + export interface CollectSnapResultsEventArgs extends yfiles.input.InputModeEventArgs{ + /** + * Gets the original location of the mouse at the beginning of the gesture. + * Value: The original location. + */ + originalLocation:yfiles.geometry.PointD; + /** + * Gets the new (current) location of the mouse that is going to be manipulated by the snapping process. + * Value: The new (current) location. + */ + newLocation:yfiles.geometry.PointD; + /** + * Gets the delta by which the mouse has been actually moved since the initialization. + * Value: The delta. + */ + delta:yfiles.geometry.PointD; + /** + * Adds a {@link yfiles.input.SnapResult} to the collection of snap results. + * null values will be discarded. + * @param {yfiles.input.SnapResult} result The result to add. + */ + addSnapResult(result:yfiles.input.SnapResult):void; + /** + * The zoom invariant snap distance. + */ + snapDistance:number; + } + var CollectSnapResultsEventArgs:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of the event arguments using the provided values for initialization. + * @param {yfiles.input.IInputModeContext} inputContext The context for which the event is queried. + * @param {yfiles.geometry.PointD} originalLocation The original location of the mouse at the beginning of the gesture. + * @param {yfiles.geometry.PointD} newLocation The new (current) location of the mouse. + * @param {number} snapDistance The zoom invariant snap distance. + * @param {yfiles.collections.ICollection.} snapResults The collection to store the snap results in. + */ + new (inputContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD,snapDistance:number,snapResults:yfiles.collections.ICollection):yfiles.input.CollectSnapResultsEventArgs; + }; + /** + * An input mutex that can be obtained from {@link yfiles.input.ConcurrencyController}s. + * If an input mode owns the mutex, all other input modes registered with + * the controller will be disabled. + * @see {@link yfiles.input.IConcurrentInputMode} + * @see {@link yfiles.input.ConcurrencyController} + */ + export interface InputMutex extends Object{ + /** + * Gets the controller this mutex has been obtained from. + */ + controller:yfiles.input.ConcurrencyController; + /** + * Returns the {@link yfiles.input.IConcurrentInputMode} that owns this mutex. + */ + mutexOwner:yfiles.input.IConcurrentInputMode; + /** + * Releases this mutex. + * @see {@link yfiles.input.ConcurrencyController#release} + */ + release():void; + } + var InputMutex:{ + $class:yfiles.lang.Class; + }; + /** + * Interface for an object that can be used to drag something + * displayed in a {@link yfiles.canvas.CanvasControl}. + * Items can be dragged with the mouse and an instance of this class will modify their position + * accordingly. + * A drag will trigger the invocation of + * {@link yfiles.input.IDragHandler#initializeDrag}, zero or more {@link yfiles.input.IDragHandler#handleMove} calls, and + * will be finalized + * by either {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. + * @see {@link yfiles.input.IPositionHandler} + * @see {@link yfiles.input.IHandle} + * @see {@link yfiles.input.IInputModeContext} + */ + export interface IDragHandler extends Object{ + /** + * Returns a view of the location of the item. + * The point describes the current world coordinate of the element that can + * be modified by this handler. + * @see Specified by {@link yfiles.input.IDragHandler#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Called by clients to indicate that the element is going to be dragged. + * This call will be followed by one or more calls to {@link yfiles.input.IDragHandler#handleMove}, + * and a final {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. + */ + initializeDrag(inputModeContext:yfiles.input.IInputModeContext):void; + /** + * Called by clients to indicate that the element has been dragged and its position + * should be updated. + * This method may be called more than once after an initial {@link yfiles.input.IDragHandler#initializeDrag} + * and will the final call will be followed by either one + * {@link yfiles.input.IDragHandler#dragFinished} or one {@link yfiles.input.IDragHandler#cancelDrag} call. + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @return {boolean} Whether the move had any visual effect. This is a hint to the engine to optimize invalidation. + * @see Specified by {@link yfiles.input.IDragHandler#handleMove}. + */ + handleMove(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):boolean; + /** + * Called by clients to indicate that the dragging has been canceled by the user. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Implementations should reset the position of the items they modify to their initial state. + * Alternatively to this method the {@link yfiles.input.IDragHandler#dragFinished} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} originalLocation The value of the coordinate of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#cancelDrag}. + */ + cancelDrag(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * Called by clients to indicate that the repositioning has just been finished. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Alternatively to this method the {@link yfiles.input.IDragHandler#cancelDrag} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * This is the same value as delivered in the last invocation of {@link yfiles.input.IDragHandler#handleMove} + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#dragFinished}. + */ + dragFinished(inputModeContext:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + } + var IDragHandler:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A composite implementation of the {@link yfiles.input.IPositionHandler} interface. + * Instances of this class to transparently treat multiple instances + * of {@link yfiles.input.IPositionHandler} like a single instance. + */ + export interface CompositePositionHandler extends Object,yfiles.input.IPositionHandler,yfiles.geometry.IPoint{ + /** + * Returns the items that would be currently moved by the composite handler. + * This is a live view on all items that have been added as keys through one of the Add* methods. + */ + movedItems:yfiles.collections.IEnumerable; + /** + * Tries to add a new handler to this composite by inspecting the provided lookup + * for suitable implementations that can be wrapped by this instance. + * This implementation tries to find the following implementation in the lookup: + *
    + *
  • + * {@link yfiles.input.IPositionHandler} + *
  • + *
  • + * {@link yfiles.input.IHandle} + *
  • + *
  • + * {@link yfiles.geometry.IMutablePoint} + *
  • + *
  • + * {@link yfiles.geometry.IMovable} and {@link yfiles.geometry.IPoint} + *
  • + *
+ * @param {T} tag The tag to use. + * @param {yfiles.support.ILookup} lookup The lookup to query implementations from. + * @return {boolean} Whether an implementation has been found and a handler has been added to this composite. + */ + addPositionHandlerWithTAndLookup(tag:T,lookup:yfiles.support.ILookup):boolean; + /** + * Adds another {@link yfiles.input.IPositionHandler} instance to this instance + * using the given tag for later {@link yfiles.input.CompositePositionHandler#removePositionHandler removal}. + * @param {T} tag An instance to tag the handler which must be used for {@link yfiles.input.CompositePositionHandler#removePositionHandler removing} + * the instance from this composite later. + * @param {yfiles.input.IPositionHandler} handler The instance to add to this composite. + */ + addPositionHandler(tag:T,handler:yfiles.input.IPositionHandler):void; + /** + * Returns the {@link yfiles.input.IPositionHandler} that has been added for the specified tag. + * @param {T} tag The tag to identify the handler to return. + * @return {yfiles.input.IPositionHandler} A position handler that has been added for the specified tag or null. + */ + getPositionHandler(tag:T):yfiles.input.IPositionHandler; + /** + * Adds another position handler to this instance + * using the given tag for later {@link yfiles.input.CompositePositionHandler#removePositionHandler removal}. + * This new position handler is created using the location and {@link yfiles.geometry.IMovable} implementation + * provided. + * @param {T} tag An instance to tag the handler which must be used for {@link yfiles.input.CompositePositionHandler#removePositionHandler removing} + * the instance from this composite later. + * @param {yfiles.geometry.IPoint} location A live view of the location of the element to reposition. + * @param {yfiles.geometry.IMovable} handler The movable implementation that will be used for repositioning the element. + */ + addLocatedMovable(tag:T,location:yfiles.geometry.IPoint,handler:yfiles.geometry.IMovable):void; + /** + * Adds an {@link yfiles.input.IHandle} to this instance + * using the given tag for later {@link yfiles.input.CompositePositionHandler#removePositionHandler removal}. + * This new position handler is created by delegating the calls to the handle implementation correspondingly. + * @param {T} tag An instance to tag the handler which must be used for {@link yfiles.input.CompositePositionHandler#removePositionHandler removing} + * the instance from this composite later. + * @param {yfiles.input.IHandle} handle A handle to delegate the repositioning to. + */ + addHandle(tag:T,handle:yfiles.input.IHandle):void; + /** + * Returns the {@link yfiles.input.IHandle} that has been added for the specified tag. + * @param {T} tag The tag to identify the handle to return. + * @return {yfiles.input.IHandle} A handle that has been added for the specified tag or null. + */ + getHandle(tag:T):yfiles.input.IHandle; + /** + * Adds a {@link yfiles.geometry.IMutablePoint} to this instance + * using the given tag for later {@link yfiles.input.CompositePositionHandler#removePositionHandler removal}. + * This new position handler is created by delegating the calls to the point implementation correspondingly. + * @param {T} tag An instance to tag the handler which must be used for {@link yfiles.input.CompositePositionHandler#removePositionHandler removing} + * the instance from this composite later. + * @param {yfiles.geometry.IMutablePoint} point A point implementation to delegate the repositioning to. + */ + addMutablePoint(tag:T,point:yfiles.geometry.IMutablePoint):void; + /** + * Adds another position handler to this instance + * using the given tag for later {@link yfiles.input.CompositePositionHandler#removePositionHandler removal}. + * This new position handler is created using the {@link yfiles.geometry.IMovable} implementation + * provided. + * @param {T} tag An instance to tag the handler which must be used for {@link yfiles.input.CompositePositionHandler#removePositionHandler removing} + * the instance from this composite later. + * @param {yfiles.geometry.IMovable} movable The movable implementation that will be used for repositioning the element. + * @see {@link yfiles.input.CompositePositionHandler#addLocatedMovable} + */ + addMovable(tag:T,movable:yfiles.geometry.IMovable):void; + /** + * Removes an implementation from this composite that has previously been added to + * this instance using the given tag. + * @param {T} tag The tag to identify the handler to remove from this composite. + */ + removePositionHandler(tag:T):void; + /** + * Sets the virtual position of this composite. + * This will reposition all elements included in this composite accordingly. + * @see Specified by {@link yfiles.input.IPositionHandler#setPosition}. + */ + setPosition(location:yfiles.geometry.PointD):void; + /** + * Returns a view of the location of the item. + * The point describes the current world coordinate of the element that can + * be modified by this handler. + * @see Specified by {@link yfiles.input.IDragHandler#location}. + */ + location:yfiles.geometry.IPoint; + /** + * Called by clients to indicate that the element is going to be dragged. + * This call will be followed by one or more calls to {@link yfiles.input.IDragHandler#handleMove}, + * and a final {@link yfiles.input.IDragHandler#dragFinished} or {@link yfiles.input.IDragHandler#cancelDrag}. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @see Specified by {@link yfiles.input.IDragHandler#initializeDrag}. + */ + initializeDrag(ctx:yfiles.input.IInputModeContext):void; + /** + * Called by clients to indicate that the element has been dragged and its position + * should be updated. + * This method may be called more than once after an initial {@link yfiles.input.IDragHandler#initializeDrag} + * and will the final call will be followed by either one + * {@link yfiles.input.IDragHandler#dragFinished} or one {@link yfiles.input.IDragHandler#cancelDrag} call. + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @return {boolean} Whether the move had any visual effect. This is a hint to the engine to optimize invalidation. + * @see Specified by {@link yfiles.input.IDragHandler#handleMove}. + */ + handleMove(ctx:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):boolean; + /** + * Called by clients to indicate that the dragging has been canceled by the user. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Implementations should reset the position of the items they modify to their initial state. + * Alternatively to this method the {@link yfiles.input.IDragHandler#dragFinished} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} originalLocation The value of the coordinate of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#cancelDrag}. + */ + cancelDrag(ctx:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD):void; + /** + * Called by clients to indicate that the repositioning has just been finished. + * This method may be called after the initial {@link yfiles.input.IDragHandler#initializeDrag} and zero or + * more invocations of {@link yfiles.input.IDragHandler#handleMove}. + * Alternatively to this method the {@link yfiles.input.IDragHandler#cancelDrag} method might be called. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to retrieve information about the drag from. + * @param {yfiles.geometry.PointD} newLocation The coordinates in the world coordinate system that the client wants the handle to be at. + * Depending on the implementation the {@link yfiles.input.IDragHandler#location} may or may not be modified to reflect the new value. + * This is the same value as delivered in the last invocation of {@link yfiles.input.IDragHandler#handleMove} + * @param {yfiles.geometry.PointD} originalLocation The value of the {@link yfiles.input.IDragHandler#location} property at the time of {@link yfiles.input.IDragHandler#initializeDrag}. + * @see Specified by {@link yfiles.input.IDragHandler#dragFinished}. + */ + dragFinished(ctx:yfiles.input.IInputModeContext,originalLocation:yfiles.geometry.PointD,newLocation:yfiles.geometry.PointD):void; + /** + * Removes all previously registered handlers. + * @see {@link yfiles.input.CompositePositionHandler#removePositionHandler} + */ + clear():void; + } + var CompositePositionHandler:{ + $class:yfiles.lang.Class; + /** + * Constructs a new compound {@link yfiles.input.IPositionHandler}instance. + * Use the various {@link yfiles.input.CompositePositionHandler#addPositionHandlerWithTAndLookup add} methods to + * add more instances to this composite. + */ + new ():yfiles.input.CompositePositionHandler; + }; + export enum SnapPolicy{ + /** + * Don't perform snapping. + */ + NO_SNAPPING, + /** + * Snap to the nearest grid coordinate. + */ + TO_NEAREST, + /** + * Snap to the nearest grid coordinate whose value is not less than the current coordinate. + */ + TO_GREATER, + /** + * Snap to the nearest grid coordinate whose value is not greater than the current coordinate. + */ + TO_SMALLER + } + } + export module internal{ + } + export module labeling{ + /** + * This class places the labels of a graph using a greedy strategy. + * This is the fastest label placing algorithm provided. + */ + export interface GreedyMISLabeling extends yfiles.labeling.MISLabelingAlgorithm{ + } + var GreedyMISLabeling:{ + $class:yfiles.lang.Class; + new ():yfiles.labeling.GreedyMISLabeling; + }; + export enum OptimizationStrategy{ + /** + * Use a balanced optimization strategy. + */ + BALANCED, + /** + * Use an optimization strategy that especially reduces overlaps between labels and nodes as well as labels and node + * halos. + */ + NODE_OVERLAP, + /** + * Use an optimization strategy that especially reduces overlaps between labels. + */ + LABEL_OVERLAP, + /** + * Use an optimization strategy that especially reduces overlaps between labels and edges. + */ + EDGE_OVERLAP, + /** + * Use no optimization strategy. + */ + NONE + } + /** + * This class is based on the enhanced profit model and places the labels of a graph using a simulated annealing + * strategy taking into account the amount of overlaps of labels. + * The algorithm is inspired by the article of + * Christensen, Marks and Shieber. + */ + export interface SALabeling extends yfiles.labeling.MISLabelingAlgorithm{ + /** + * Specifies whether or not this labeling algorithm should work deterministically. + * In deterministic mode this labeling algorithm produces + * the same layout results for the same input graph and layout/labeling + * parameters. + *

+ * By default deterministic mode is disabled. + *

+ */ + deterministicMode:boolean; + /** + * The time limit for the algorithm (in milliseconds). + * Note, that this limit is not strictly observed. + */ + maximalDuration:number; + } + var SALabeling:{ + $class:yfiles.lang.Class; + new ():yfiles.labeling.SALabeling; + }; + /** + * Solving labeling problem by reducing it to the maximum independent set problem. + */ + export interface MISLabelingAlgorithm extends yfiles.labeling.AbstractLabelingAlgorithm{ + graph:yfiles.layout.LayoutGraph; + /** + * the conflict graph. + */ + conflictGraph:yfiles.algorithms.Graph; + /** + * holds for each node in the conflictGraph the corresponding LabelCandidate. + */ + nodesToBoxes:yfiles.algorithms.INodeMap; + boxesToNodes:yfiles.algorithms.IMap; + /** + * holds for each node in the conflictGraph the corresponding integer index of the Label[]. + */ + nodesToID:yfiles.algorithms.INodeMap; + /** + * The custom profit model ratio. + * @see {@link yfiles.labeling.AbstractLabelingAlgorithm#profitModel} + * @see {@link yfiles.labeling.MISLabelingAlgorithm#optimizationStrategy} + */ + customProfitModelRatio:number; + /** + * The optimization strategy of the labeling algorithm. + * Possible values are: + * {@link yfiles.labeling.OptimizationStrategy#NONE}, {@link yfiles.labeling.OptimizationStrategy#BALANCED}, + * {@link yfiles.labeling.OptimizationStrategy#NODE_OVERLAP}, {@link yfiles.labeling.OptimizationStrategy#EDGE_OVERLAP} + * and {@link yfiles.labeling.OptimizationStrategy#LABEL_OVERLAP}. + */ + optimizationStrategy:yfiles.labeling.OptimizationStrategy; + /** + * Creates one edge between two nodes if the corresponding label candidates are intersecting. + */ + createEdges():void; + /** + * Creates a node map which assigns to each node the profit. + */ + assignProfit():yfiles.algorithms.INodeMap; + /** + * Calculates the overlapping factor between two label candidates. + * Default value is 1.0. + */ + foundLabelOverlap(lc1:yfiles.layout.LabelCandidate,lc2:yfiles.layout.LabelCandidate,e:yfiles.algorithms.Edge):void; + /** + * Calculates the overlapping factor between a label candidate and a node. + */ + foundNodeOverlap(lc:yfiles.layout.LabelCandidate,n:yfiles.algorithms.Node,nBox:yfiles.algorithms.YRectangle):void; + /** + * Calculates the overlapping factor between a label candidate and an edge segment. + */ + foundEdgeOverlap(lc:yfiles.layout.LabelCandidate,e:yfiles.algorithms.Edge,eSegment:yfiles.algorithms.LineSegment):void; + /** + * Calculates the overlapping factor between a label candidate and a node halo. + */ + foundHaloOverlap(lc:yfiles.layout.LabelCandidate,n:yfiles.algorithms.Node,haloRect:yfiles.algorithms.YRectangle):void; + } + var MISLabelingAlgorithm:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the MISLabelingAlgorithm class. + */ + new ():yfiles.labeling.MISLabelingAlgorithm; + }; + /** + * This class is an abstract base class for labeling algorithms. + * A labeling algorithm places a set of labels. + */ + export interface AbstractLabelingAlgorithm extends yfiles.layout.AbstractLayoutStage{ + /** + * The profit model that is used to rank the available positions for each label. + * The higher the rank of a + * position, the more likely it will be chosen by the algorithm. By default an instance of type {@link yfiles.layout.LabelRanking} is set. + */ + profitModel:yfiles.layout.IProfitModel; + /** + * True if the labeling algorithm is allowed to move internal node labels. + * A node label is deemed internal if the label's bounds are completely within the node bounds. + */ + moveInternalNodeLabels:boolean; + /** + * True if the postprocessing step is applied. + * The postprocessing step tries to further reduce the number of + * overlaps. + * Note: the postprocessing step is only applied to edge labels whose edge label model is + * FreeEdgeLabelModel and node labels whose node label model is FreeNodeLabelModel. + */ + applyPostprocessing:boolean; + /** + * true if the preference on which side of an edge a corresponding label should be placed is + * interpreted by human perception instead of always following the edge from source to target. + *

+ * Note: the alternative side handling is only applied to edge labels whose edge label model is + * FreeEdgeLabelModel. + *

+ */ + useAlternativeSideHandling:boolean; + /** + * How label candidates which overlap with nodes are handled. + * If true these candidates are not + * considered, if false these candidates are considered, but a penalty is assigned to them. + */ + removeNodeOverlaps:boolean; + /** + * How label candidates which overlap with edges are handled. + * If true these candidates are not + * considered, if false these candidates are considered, but a penalty is assigned to them. + */ + removeEdgeOverlaps:boolean; + /** + * Specifies whether labels assigned to nodes in a graph should be placed or ignored. + * This method has higher priority + * than a specified selection, that means that all selected node labels are ignored by this algorithm if this property + * is set to false. + * @see {@link yfiles.labeling.AbstractLabelingAlgorithm#selectedLabelsDpKey} + */ + placeNodeLabels:boolean; + /** + * Specifies whether labels assigned to edges in a graph should be placed or ignored. + * This method has higher priority + * than a specified selection, that means that all selected edge labels are ignored by this algorithm if this property + * is set to false. + * @see {@link yfiles.labeling.AbstractLabelingAlgorithm#selectedLabelsDpKey} + */ + placeEdgeLabels:boolean; + /** + * The labeling selection DataProvider key. + * The data provider registered with this key has to return true + * for labels that should be placed and false for all other + * labels. + */ + selectedLabelsDpKey:Object; + /** + * Determines whether or not edge labels associated with a "free" label model + * should be automatically flipped + * if they would be upside-down. + *

+ * By default, this property is set to false. + *

+ */ + autoFlipping:boolean; + /** + * Returns true. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#canLayout} + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Place the labels in the graph. + * This method is equivalent to the label() method. + * @param {yfiles.layout.LayoutGraph} graph The graph to label. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * This method throws an {@link yfiles.system.ArgumentException} if the width/height of the given node object is zero. + * It is called by the label-methods for each node object in the input graph. + * @see {@link yfiles.labeling.AbstractLabelingAlgorithm#checkGroupNodeSize} + * @param {yfiles.layout.IGraphLayout} layout a graph layout object. + * @param {Object} node the node object to test. + * @throws {yfiles.system.ArgumentException} thrown if the width/height of the node object is zero. + */ + checkNodeSize(layout:yfiles.layout.IGraphLayout,node:Object):void; + /** + * This method throws an {@link yfiles.system.ArgumentException} if the width/height of the given group node object is zero. + * It is called by the label-methods for each group node object in the input graph. + * @see {@link yfiles.labeling.AbstractLabelingAlgorithm#checkNodeSize} + * @param {yfiles.layout.IGraphLayout} layout a graph layout object. + * @param {Object} node the group node object to test. + * @throws {yfiles.system.ArgumentException} thrown if the width/height of the group node object is zero. + */ + checkGroupNodeSize(layout:yfiles.layout.IGraphLayout,node:Object):void; + /** + * Place the labels in the graph. + * @param {yfiles.layout.LayoutGraph} gl The graph to label. + */ + label(gl:yfiles.layout.LayoutGraph):void; + /** + * Place a subset of the labels. + * @param {Object} key + * The key for a DataProvider in gl. Labels which should be placed return + * true. + */ + labelSubset(gl:yfiles.layout.LayoutGraph,key:Object):void; + /** + * Place some labels in the graph. + * The selection is ignored, if set. + */ + labelSubsetLists(gl:yfiles.layout.LayoutGraph,nodeLabels:yfiles.algorithms.YList,edgeLabels:yfiles.algorithms.YList):void; + /** + * Returns the profit model that is used to rank the available positions for each label. + * The higher the rank of a + * position, the more likely it will be chosen by the algorithm. By default an instance of type {@link yfiles.layout.LabelRanking} is set. + */ + getProfit(l:yfiles.layout.LabelCandidate):number; + /** + * The set of all generated candidate rectangles. + *

+ * Debug only. + *

+ */ + rects:yfiles.algorithms.YList; + /** + * Specifies whether the candidate rectangles should be stored to be retrieved. + *

+ * Debug only. + *

+ */ + storeRects:boolean; + /** + * Specifies whether edge labels may overlap with edges belonging to the same edge group. + * If edge labels overlap with other edges of the same group, this flag decides + * whether these positions are allowed. + */ + edgeGroupOverlapAllowed:boolean; + } + var AbstractLabelingAlgorithm:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key to specify for each {@link yfiles.layout.IEdgeLabelLayout}s and each + * {@link yfiles.layout.INodeLabelLayout} a replacement {@link yfiles.layout.IEdgeLabelModel} or {@link yfiles.layout.INodeLabelModel}, + * respectively, that is used by the labeling algorithm instead of the original label model. + * If this key is not + * defined or if a label has no mapping, the original model is used as normal. Otherwise, a model parameter that + * fits the calculated position of the replacement model best is set for the original model. + * This feature is especially useful to restrict a free model. For example, to place a label upon its associated edge, + * a centered {@link yfiles.layout.RotatedSliderEdgeLabelLayoutModel} can be used a replacement model. + */ + LABEL_MODEL_DP_KEY:Object; + /** + * Creates a new instance of this class. + */ + new ():yfiles.labeling.AbstractLabelingAlgorithm; + }; + } + export module lang{ + /** + * Base type for types that provide value type semantics, which means that they + * are cloned when their containing type is cloned. + *

+ * They provide a static {@link yfiles.lang.Struct#createDefault} method that can be used to create an instance + * of an struct where all of its values are set to their default without using any of its constructors. + *

+ *

+ * Besides those properties, they can be treated like any other class, i.e. they can implement {@link yfiles.lang.Trait Traits} and can + * be tested with a instanceof A and A.$class.isInstance(a). + *

+ * @see {@link yfiles.lang.Struct#createDefault} + */ + export interface Struct extends Object{ + /** + * Tests whether another object is equal to this struct. + * As opposed to the implementation of {@link yfiles.lang.Object_Interface}, this implementation + * tests the members of both objects to determine equality. + * @param {Object} other The other struct. + * @return {boolean} true, if both objects are equal; false otherwise. + */ + equals(other:Object):boolean; + /** + * Calculates the hash code of this struct based on its members. + * @return {number} The hash code. + */ + hashCode():number; + } + var Struct:{ + $class:yfiles.lang.Class; + /** + * This methods creates an instance of the struct in which all of its values are set to their default values without + * using any of its constructors. + */ + createDefault():Object; + }; + /** + * The base type of an enumeration. It is not type safe. All enums extend {@link yfiles.lang.Enum} + * and should be used instead of "magic values". + *

+ * The members of the enum type definition will be static and an enum can not be constructed. + *

+ *

+    *  var RequestState = yfiles.lang.Enum('RequestState', {
+    *      SEND: 1,
+    *      PROCESSED: 2,
+    *      SHIPPED: 3,
+    *      FAILED: 4,
+    *     });
+    *     if(state === RequestState.FAILED) { ... }
+    * 
+ */ + export interface Enum extends Object{ + } + var Enum:{ + $class:yfiles.lang.Class; + /** + * Returns the value of the field with the given ID. + * @param {yfiles.lang.Class} type The type of the enum. + * @param {string} id The name of the field. + * @param {boolean} ignoreCase If true, then the case of the field + * will be ignored and the search is case-insensitive. + * @return {yfiles.lang.Enum} The value of the field with the given ID. + */ + parse(type:yfiles.lang.Class,id:string,ignoreCase:boolean):yfiles.lang.Enum; + /** + * Returns the name of an enum value. + * @param {yfiles.lang.Class} type The type of the enum. + * @param {yfiles.lang.Enum} value The value of the field. + * @return {string} The name of the field. + */ + getName(type:yfiles.lang.Class,value:yfiles.lang.Enum):string; + /** + * Returns a list of all numeric values. + * @param {yfiles.lang.Class} type The type of the enum. + * @return {yfiles.collections.IEnumerable.} A list of all numeric values. + */ + getValues(type:yfiles.lang.Class):yfiles.collections.IEnumerable; + /** + * Returns a list of all field names that represent an enum value. + * @param {yfiles.lang.Class} type The type of the enum. + * @return {yfiles.collections.IEnumerable.} A list of all field names that represent an enum value. + */ + getValueNames(type:yfiles.lang.Class):yfiles.collections.IEnumerable; + }; + /** + * Wrapper around JavaScript function objects. + * Compared with plain JavaScript functions, + *
    + *
  • delegates can be bound to a different target, which acts as this in the delegate function body,
  • + *
  • multiple delegates can be combined into a single delegate instance, which provides multicast functionality.
  • + *
+ */ + export interface delegate extends Object{ + } + var delegate:{ + $class:yfiles.lang.Class; + /** + * Apply function in the current execution context. + * @param {yfiles.lang.delegate} function The function to execute. + * @param {Object[]} args Optional function arguments. + * @return {Object} The result from invoking function. + */ + dynamicInvoke(a:yfiles.lang.delegate,args:Object[]):Object; + /** + * Creates a new delegate from the given functions and the execution target. + * When the delegate is executed, the functions will be applied on target, independent from the current closure. + * If multiple functions are specified, they will all be applied in order. + * @param {yfiles.lang.delegate[]} functions The functions from which the delegate should be created. + * @param {Object} target The target object on which the functions should be applied. + * @return {yfiles.lang.delegate} A new delegate. + */ + createDelegate(functions:yfiles.lang.delegate[],target:Object):yfiles.lang.delegate; + /** + * Return a list of all delegates that are combined into del. + * @param {yfiles.lang.delegate} del The delegate to test. + * @return {yfiles.lang.delegate[]} A list of all delegates that are combined into del. + */ + getInvocationList(del:yfiles.lang.delegate):yfiles.lang.delegate[]; + /** + * Combines two delegates into a single one. + * @param {yfiles.lang.delegate} d1 One of the delegates to combine. + * @param {yfiles.lang.delegate} d2 One of the delegates to combine. + * @return {yfiles.lang.delegate} A delegate that combines both original delegates. + */ + combine(d1:yfiles.lang.delegate,d2:yfiles.lang.delegate):yfiles.lang.delegate; + /** + * Removes the first occurrence of d2 from the {@link yfiles.lang.delegate#getInvocationList invocation list} of d1. + * @param {yfiles.lang.delegate} d1 The delegate that should be modified. + * @param {yfiles.lang.delegate} d2 The delegate that should be removed. + * @return {yfiles.lang.delegate} The modified delegate d1. + */ + remove(d1:yfiles.lang.delegate,d2:yfiles.lang.delegate):yfiles.lang.delegate; + /** + * Removes all occurrences of d2 from the {@link yfiles.lang.delegate#getInvocationList invocation list} of d1. + * @param {yfiles.lang.delegate} d1 The delegate that should be modified. + * @param {yfiles.lang.delegate} d2 The delegate that should be removed. + * @return {yfiles.lang.delegate} The modified delegate d1. + */ + removeAll(d1:yfiles.lang.delegate,d2:yfiles.lang.delegate):yfiles.lang.delegate; + }; + /** + * Wrapper class for the JavaScript number primitive type. + */ + export interface Number extends Object,yfiles.lang.IComparable,yfiles.lang.IObjectComparable{ + /** + * Compares this number with another one. + * @param {yfiles.lang.Number} obj The other number to compare with. + * @return {number} 0 if both numbers are equal, -1 if this number is smaller than the other one, 1 otherwise. + * @see Specified by {@link yfiles.lang.IComparable#compareTo}. + */ + compareTo(obj:yfiles.lang.Number):number; + /** + * Compares this number with another object. + * @param {Object} obj The other object to compare with. + * @return {number} 0 if both numbers are equal, -1 if this number is smaller than the other one, 1 otherwise. + * @see Specified by {@link yfiles.lang.IObjectComparable#compareToObject}. + */ + compareToObject(obj:Object):number; + } + var Number:{ + $class:yfiles.lang.Class; + }; + /** + * Wrapper class for the JavaScript string primitive type. + */ + export interface String extends Object,yfiles.lang.IComparable,yfiles.lang.IObjectComparable{ + /** + * Compares this string with another one. + * @param {yfiles.lang.String} obj The other string to compare with. + * @return {number} 0 if both strings are equal, -1 if this string comes before the other one in lexicographic sort order, 1 otherwise. + * @see Specified by {@link yfiles.lang.IComparable#compareTo}. + */ + compareTo(obj:yfiles.lang.String):number; + /** + * Compares this string with another one. + * @param {Object} obj The other string to compare with. + * @return {number} 0 if both strings are equal, -1 if this string comes before the other one in lexicographic sort order, 1 otherwise. + * @see Specified by {@link yfiles.lang.IObjectComparable#compareToObject}. + */ + compareToObject(obj:Object):number; + } + var String:{ + $class:yfiles.lang.Class; + }; + /** + * Wrapper class for the JavaScript boolean primitive type. + */ + export interface Boolean extends Object,yfiles.lang.IComparable,yfiles.lang.IObjectComparable{ + /** + * Compares this boolean with another one. + * @param {yfiles.lang.Boolean} obj The other boolean to compare with. + * @return {number} 0 if both booleans are equal, -1 if this boolean is false and the other is true, 1 otherwise. + * @see Specified by {@link yfiles.lang.IComparable#compareTo}. + */ + compareTo(obj:yfiles.lang.Boolean):number; + /** + * Compares this boolean with another object. + * @param {Object} obj The other object to compare with. + * @return {number} 0 if both booleans are equal, -1 if this boolean is false and the other is true, 1 otherwise. + * @see Specified by {@link yfiles.lang.IObjectComparable#compareToObject}. + */ + compareToObject(obj:Object):number; + } + var Boolean:{ + $class:yfiles.lang.Class; + }; + /** + * Provides a method by which implementors can be compared to each other. + */ + export interface IComparable extends Object{ + /** + * Compares this object to the given object of the same type. + * @param {T} 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.IComparable#compareTo}. + */ + compareTo(obj:T):number; + } + var IComparable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Provides a method by which implementors can be compared to each other. + */ + export interface IObjectComparable extends Object{ + /** + * 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(obj:Object):number; + } + var IObjectComparable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Wrapper for the native JavaScript Error type. This class can be used to write custom errors and include a stack trace. + */ + export interface Exception extends Object{ + /** + * Gets or sets the exception message. + */ + message:string; + } + var Exception:{ + $class:yfiles.lang.Class; + /** + * Creates a new exception with the given message. + * @param {string} message The exception message. + * @see {@link yfiles.lang.Exception#message} + */ + new (message:string):yfiles.lang.Exception; + }; + /** + * An Assembly is a top-level namespace that may contain {@link yfiles.lang.Attribute}s. + */ + export interface Assembly extends Object{ + /** + * The fully qualified name of the assembly. + */ + fullName:string; + /** + * Returns all {@link yfiles.lang.Attribute}s registered for this assembly. + * @param {boolean} inherit + * @return {yfiles.lang.Attribute[]} All attributes registered for this assembly. + */ + getCustomAttributes(inherit:boolean):yfiles.lang.Attribute[]; + /** + * Returns all {@link yfiles.lang.Attribute}s registered for this assembly that are instances of the given type. + * @param {yfiles.lang.Class} type The type of the attribute. + * @param {boolean} inherit + * @return {yfiles.lang.Attribute[]} All attributes registered for this assembly that are instances of the given type. + */ + getCustomAttributesOfType(type:yfiles.lang.Class,inherit:boolean):yfiles.lang.Attribute[]; + /** + * Returns the {@link yfiles.lang.Class} object for name, if such a type is defined in the assembly's namespace. + * @param {string} name The fully qualified name of the type. + * @param {boolean} throwError + * @return {yfiles.lang.Class} Returns the specified type, or null if no such type is defined. + */ + getType(name:string,throwError:boolean):yfiles.lang.Class; + /** + * Tests if an {@link yfiles.lang.Attribute} of the given type is defined for this Assembly. + * @param {yfiles.lang.Class} type The attribute type. + * @return {boolean} true, if an attribute of the type is defined for this assembly; false otherwise. + */ + isDefined(type:yfiles.lang.Class):boolean; + } + var Assembly:{ + $class:yfiles.lang.Class; + /** + * Returns the primary assembly. + * @return {yfiles.lang.Assembly} The primary assembly. + */ + getExecutingAssembly():yfiles.lang.Assembly; + }; + /** + * A trait is an interface that may or may not have default implementations of its + * methods, properties and fields. + *

+ * Traits have very specific rules in case two traits with the same member are implemented by a subtype: + *

    + *
  • If both method definitions are abstract, then the method is abstract.
  • + *
  • If one method definition is abstract and the other concrete, then the concrete method is used.
  • + *
  • If both method definitions are concrete: + *
      + *
    • If the traits are implemented at the same level, then the method is abstract.
    • + *
    • If one of the traits is a sub-type of the other, then its method definition will be used.
    • + *
    + *
  • + *
+ *

+ *

+ * In all of those cases, the rule is that a subtype overrides the parent types' definitions. + * Example: Given the traits A, B, C and D where A defines a method "a" to be abstract and B and C extending + * trait A with concrete implementations of "a", when D is a trait that implements both B and C, its version of + * "a" will be abstract, unless it defines its own implementation of "a", in which case that definition is used. + *

+ *

+ * All trait types have a $class property, which contains their {@link yfiles.lang.Class type}, and + * a static {@link yfiles.lang.Trait#isTrait} method that can be used to test whether an object implements the trait. + *

+ */ + export interface Trait extends Object{ + } + var Trait:{ + $class:yfiles.lang.Class; + /** + * Tests whether the given object is a trait. + * This method is equivalent to using obj.$class.isTrait but safe in case the object does not have a + * $class property. + * @param {Object} o The trait candidate. + * @return {boolean} true, if the object is a trait; false otherwise. + */ + isTrait(o:Object):boolean; + }; + /** + * Specialized type that can be used to describe meta information about other types, methods, fields, properties and constructors. + *

All attributes extend {@link yfiles.lang.Attribute} or a subtype of an attribute. + * They can also implement {@link yfiles.lang.Trait Traits}.

+ *

The actual creation of an attribute is delayed to the point in time when it is needed by the reflection API. + * Therefore, the attribute constructors are wrapped and replaced by a function that creates an instance of the attribute. + *


+    * var MyAttribute = yfiles.lang.Attribute('MyAttribute', {
+    *  constructor: function(message) {
+    *      this.message = message;
+    *  }
+    * });
+    * var MyClass = yfiles.lang.Class('MyClass', {
+    *  $meta: [MyAttribute('hello').init(recipient: 'world')]
+    * });
+    * var attr = yfiles.lang.Attribute.getCustomAttribute(MyClass.$class, MyAttribute.$class);
+    * console.log(attr.message + ' ' + attr.recipient); // 'hello world'
+    * 
+ * Even though MyAttribute is invoked at the definition of MyClass, no attribute is created until + * the reflection API is used (in the above example: using {@link yfiles.lang.Attribute#getCustomAttribute}).

+ *

+ * The result of the constructor function of an attribute is a function, that, when invoked, returns + * an instance of the attribute. It also provides an init method that adds the properties of the given object + * to the attribute. + *

+ *

+ * Note: Attribute constructors are always called without the new keyword. + *

+ */ + export interface Attribute extends Object{ + } + var Attribute:{ + $class:yfiles.lang.Class; + /** + * Constructor for a new attribute definition. + *

The constructor is wrapped and replaced by function that create an instance of the attribute to delay + * the actual creation to the point in time when it is needed by the reflection API. + *


+      * var MyAttribute = yfiles.lang.Attribute('MyAttribute', {
+      *  constructor: function(message) {
+      *      this.message = message;
+      *  }
+      * });
+      * var MyClass = yfiles.lang.Class('MyClass', {
+      *  $meta: [MyAttribute('hello').init(recipient: 'world')]
+      * });
+      * var attr = yfiles.lang.Attribute.getCustomAttribute(MyClass.$class, MyAttribute.$class);
+      * console.log(attr.message + ' ' + attr.recipient); // 'hello world'
+      * 
+ * Even though MyAttribute is invoked at the definition of MyClass, no attribute is created until + * the reflection API is used (in the above example: using {@link yfiles.lang.Attribute#getCustomAttribute}).

+ *

+ * The result of the constructor function of an attribute is a function, that, when invoked, returns + * an instance of the attribute. It also provides an init method that adds the properties of the given object + * to the attribute. + *

+ *

+ * Note: Attribute constructors are always called without the new keyword. + *

+ * @param {string} name The attribute name. + * @param {Object} definition The attribute definition code. + */ + new (name:string,definition:Object):yfiles.lang.Attribute; + /** + * Returns the first attribute of the given attributeType that is registered for a given member info or type. + * If none can be found, then null is returned. + * @param {Object} element The reflection object (type, method, property...) for which to retrieve the attribute. + * @param {yfiles.lang.Class} attributeType The type of the attribute. + * @return {yfiles.lang.Attribute} An attribute of the specified attributeType, or null if no such attribute can be found. + */ + getCustomAttribute(element:Object,attributeType:yfiles.lang.Class):yfiles.lang.Attribute; + }; + /** + * The root of the class hierarchy of the yFiles for HTML class framework. + * Two of these methods are actually defined on the native JavaScript object prototype: + *
    + *
  • {@link yfiles.lang.Object_Interface#hashCode}
  • + *
  • {@link yfiles.lang.Object_Interface#equals}
  • + *
+ * The other methods are part of the {@link yfiles.lang.Object_Interface} type, only. + */ + export interface Object_Interface extends Object{ + /** + * Returns the hash code of this object. + * If two objects are {@link yfiles.lang.Object_Interface#equals equal}, then they must have the same hash code. + * @return {number} The hash code of this object. + */ + hashCode():number; + /** + * Tests whether this object and the other object are equal. + * @param {Object} other The tested object. + * @return {boolean} true, if the objects are equal; false otherwise. + */ + equals(other:Object):boolean; + /** + * Returns the type of this object. + * @return {yfiles.lang.Class} The type of this object. + */ + getClass():yfiles.lang.Class; + /** + * Shallow clones an object. It will also clone any value types. + * @return {Object} A cloned instance of the same type. + */ + memberwiseClone():Object; + /** + * Displays the textual representation of the object. + * @return {string} The textual representation of this object. + */ + toString():string; + /** + * Returns an object with a get and/or a set method that is optionally bound to this instance. + * The requested name must be a property (with getter and/or setter). + * @param {string} name The name of the property. + * @param {boolean} bound If true, then the get/set methods of the returned object will be bound to this instance. + * @return {Object} An object with a get and/or set method that reads/writes to the specified field. + */ + getOwnProperty(name:string,bound:boolean):Object; + } + var Object_Interface:{ + $class:yfiles.lang.Class; + /** + * Tests if two objects are equal. + * @param {Object} a One of the objects. Can be null or of any type. + * @param {Object} b One of the objects. Can be null or of any type. + * @return {boolean} true, if the objects are equal; false otherwise. + */ + equals(a:Object,b:Object):boolean; + /** + * Tests if two objects are identical. + * @param {Object} a One of the objects. + * @param {Object} b One of the objects. + * @return {boolean} true, if the objects are the identical; false otherwise. + */ + referenceEquals(a:Object,b:Object):boolean; + /** + * Returns the most recently defined property descriptor in the prototype chain of the given object. + * @param {Object} o The object that the property belongs to + * @param {string} name The name of the property. + * @return {Object} The most recently defined property descriptor in the prototype chain of the given object. + */ + getPropertyDescriptor(o:Object,name:string):Object; + }; + /** + * A function that transforms a class definition object into a class type. + *

+ * The class definition object may contain any of the following special identifiers: + *

    + *
  • $extends: An object reference that points to the parent object.
  • + *
  • $with: An array of traits this class implements.
  • + *
  • $abstract: A boolean value that indicates whether or not this class is abstract.
  • + *
  • $static: An object that contains methods, fields and properties that should + * be statically available and will be registered on the constructor function instead of + * its prototype.
  • + *
  • $meta: An array of {@link yfiles.lang.Attribute}s or a function that returns an array of + * {@link yfiles.lang.Attribute}s that describe the class.
  • + *
+ *

+ *

+ * Additionally, it may contain methods, properties and fields that should be added to the constructor functions prototype. + * If the value of an field is an object with a $meta property, then it will be used as a + * property descriptor for the field (meaning that writable, enumerable and configurable, value and get, set + * can be used as in a property descriptor for Object.defineProperty + * and the value of the $meta property is stored for usage in the reflection API. + * If the object has a get and/or set property, then it will also be used as a property descriptor. + *


+    *     var MyList = yfiles.lang.Class('MyList', {
+    *         $extends: my.AbstractList,
+    *         $with: [my.Iterable, my.Collection],
+    *         constructor: function() { // the constructor function
+    *         },
+    *         add: function(obj) { ... },
+    *         size: { // transformed into a property
+    *          'get': function() { return ...; }
+    *         },
+    *         $static: {
+    *          create: function() { ... }
+    *         }
+    *     });
+    *     // usage
+    *     var list = new MyList();
+    *     list.add("hello");
+    *     list.size === 1; // true
+    * 
+ *

+ *

+ * The constructor property can be either a function (in case of a single constructor) or an object + * that is transformed into named constructors. + *


+    *     var Rect = yfiles.lang.Class('Rect', {
+    *      constructor: {
+    *          'default': function(x, y, width, height) { ... },
+    *          'FromPoints': function(topLeft, bottomRight) { ... },
+    *          'FromPoint': function(topLeft, width, height) { ... }
+    *      }
+    *     });
+    *     // usage:
+    *     var myrect = new Rect(10, 10, 50, 50);
+    *     myrect instanceof Rect; // true
+    *     myrect = new Rect.FromPoints({x: 10, y: 10}, {x: 60, y: 60});
+    *     myrect instanceof Rect; // true
+    *     myrect = new Rect.FromPoint({x: 10, y: 10}, 50, 50);
+    *     myrect instanceof Rect; // true
+    * 
+ * Named constructors can call other constructors and can be written like any other constructor, + * i.e. this will be a new instance of the class that is being constructed. + *

+ *

+ * To access super methods, you can use the static $super property that is added to all classes. + * Example (inside a method or property of the previously defined Rect class): + *

Rect.$super.toString.call(this);
+ * If you do not specify the parent class of a new class, then {@link yfiles.lang.Object_Interface} will be used as its + * base type. + * The parent class of {@link yfiles.lang.Object_Interface} is the standard JavaScript Object.prototype. + * Every class has a couple of static methods and properties: + *
    + *
  • {@link yfiles.lang.Class#isInstance}: tests whether an object is an instance of this class.
  • + *
  • $class: a reference to the {@link yfiles.lang.Class} instance that provides reflective information + * about this type.
  • + *
  • $super: the parent class.
  • + *
+ *

+ */ + export interface Class extends Object{ + /** + * Returns a type that describes an array with the specified dimensions and this type as element type. + * @param {number} rank The dimension of the array type + * @return {yfiles.lang.Class} A type that describes an array with the specified dimensions and this type as element type. + */ + makeArrayType(rank:number):yfiles.lang.Class; + /** + * Returns the dimension of this type if it is an array type or 0, otherwise. + * @return {number} The dimension of this type if it is an array type or 0, otherwise. + */ + getArrayRank():number; + /** + * Returns the type of the members of this type is an array, otherwise the type itself. + * @return {yfiles.lang.Class} The type of the members of this type is an array, otherwise the type itself. + */ + getElementType():yfiles.lang.Class; + /** + * A reference to the type itself. + * @return {yfiles.lang.Class} + */ + clone():yfiles.lang.Class; + /** + * Tests whether an object is an instance of this type. + * This is the only way to test if an object implements a {@link yfiles.lang.Trait}. + * @param {Object} o The object that may be an instance of this type. + * @return {boolean} true, if the object is an instance of this type; false otherwise. + */ + isInstance(o:Object):boolean; + /** + * Tests whether or not this type is a sub type of the given type. + * @param {yfiles.lang.Class} c The parent type candidate. + * @return {boolean} true, if this type is a sub type of the given type; false otherwise. + */ + isSubclassOf(c:yfiles.lang.Class):boolean; + /** + * Tests whether this type is a parent type of the given type. + * @param {yfiles.lang.Class} c The sub type candidate. + * @return {boolean} true, if this type is a sub type of the given type; false otherwise. + */ + isAssignableFrom(c:yfiles.lang.Class):boolean; + /** + * The direct parent type of this type (not including {@link yfiles.lang.Trait}s or null, + * if no parent type exists. + */ + baseType:yfiles.lang.Class; + /** + * The {@link yfiles.lang.Assembly} that this type belongs to. + */ + assembly:yfiles.lang.Assembly; + /** + * true, if this type represents a true class; false otherwise. + */ + isClass:boolean; + /** + * true, if this type represents an enum; false otherwise. + */ + isEnum:boolean; + /** + * true, if this type represents a {@link yfiles.lang.Trait}; false otherwise. + */ + isInterface:boolean; + /** + * true, if this type represents a primitive type; false otherwise. + * The primitive types are: number, string and boolean. + */ + isPrimitive:boolean; + /** + * true, if this type has public visibility; false otherwise. + */ + isPublic:boolean; + /** + * true, if this type represents a value type; false otherwise. + * A value type is either a primitive or an instance of a {@link yfiles.lang.Struct}. + */ + isValueType:boolean; + /** + * Creates a new instance of this type using its default constructor. + * @return {Object} A new instance of this type using its default constructor. + */ + newInstance():Object; + /** + * Returns a filtered list of all interfaces implemented by this type. + * @param {function(yfiles.lang.Class):boolean} filter A function that takes a {@link yfiles.lang.Class} and the filterCriteria parameter + * and returns true, if the interface type should be returned and false otherwise. + * @param {Object} filterCriteria An optional criteria object that should be passed to the filter function. + * @return {yfiles.lang.Trait[]} An array of all implemented interfaces that pass the specified filter. + */ + findInterfaces(filter:(obj:yfiles.lang.Class)=>boolean,filterCriteria:Object):yfiles.lang.Trait[]; + /** + * Returns a list of all interfaces implemented by this type. + * @return {yfiles.lang.Trait[]} A list of all interfaces implemented by this type. + */ + getInterfaces():yfiles.lang.Trait[]; + /** + * Finds all members of the specified type that match the criteria. + * @param {yfiles.lang.Class} type The type that is being reflected. + * @param {yfiles.system.MemberTypes} memberType The types of interesting members. + * @param {yfiles.system.BindingFlags} bindingAttr A flag that specifies attributes that members must match. + * @param {function(yfiles.system.MemberInfo):boolean} filter An optional function that takes a {@link yfiles.system.MemberInfo} and + * the filterCriteria object and returns true if the member should be accepted. + * @param {Object} filterCriteria An optional criteria object that should be passed to the filter function. + * @return {yfiles.system.MemberInfo[]} An array of members that match the specified criteria. + */ + findMembers(type:yfiles.lang.Class,memberType:yfiles.system.MemberTypes,bindingAttr:yfiles.system.BindingFlags,filter:(obj:yfiles.system.MemberInfo)=>boolean,filterCriteria:Object):yfiles.system.MemberInfo[]; + /** + * If flags is undefined or null, returns all members that are public and belong to the type itself and not its parent type, + * otherwise, the members that match the specified {@link yfiles.system.BindingFlags}. + * @param {yfiles.system.BindingFlags} flags The optional binding flags. + * @return {yfiles.system.MemberInfo[]} The members that match the criteria. + */ + getMembers(flags:yfiles.system.BindingFlags):yfiles.system.MemberInfo[]; + /** + * Returns a member with the given memberName. + * If flags is undefined or null, the member must be public and belong to the type itself and not its parent type, + * otherwise, the member must match the specified {@link yfiles.system.BindingFlags}. + * @param {string} memberName The name of the member. + * @param {yfiles.system.BindingFlags} flags The optional binding flags. + * @return {yfiles.system.MemberInfo} The member with the given name that matches the criteria. + */ + getMember(memberName:string,flags:yfiles.system.BindingFlags):yfiles.system.MemberInfo; + /** + * Returns a list of all constructors of the type. If flags is undefined or null, returns all constructors that are public, + * otherwise, the constructors that match the specified {@link yfiles.system.BindingFlags}. + * @param {yfiles.system.BindingFlags} flags The optional binding flags. + * @return {yfiles.system.ConstructorInfo[]} An array of constructors. + */ + getConstructors(flags:yfiles.system.BindingFlags):yfiles.system.ConstructorInfo[]; + /** + * Returns a list of all fields of the type. If flags is undefined or null, returns all fields that are public. + * Otherwise, the fields that match the specified {@link yfiles.system.BindingFlags}. + * @param {yfiles.system.BindingFlags} flags The optional binding flags. + * @return {yfiles.system.FieldInfo[]} An array of fields. + */ + getFields(flags:yfiles.system.BindingFlags):yfiles.system.FieldInfo[]; + /** + * Returns a field with the given memberName. + * If flags is undefined or null, the field must be public and belong to the type itself and not its parent type. + * Otherwise, the field must match the specified {@link yfiles.system.BindingFlags}. + * @param {string} memberName The name of the field. + * @param {yfiles.system.BindingFlags} flags The optional binding flags. + * @return {yfiles.system.FieldInfo} The field with the given name that matches the criteria. + */ + getField(memberName:string,flags:yfiles.system.BindingFlags):yfiles.system.FieldInfo; + /** + * Returns a list of all methods of the type. If flags is undefined or null, returns all methods that are public. + * Otherwise, the methods that match the specified {@link yfiles.system.BindingFlags}. + * @param {yfiles.system.BindingFlags} flags The optional binding flags. + * @return {yfiles.system.MethodInfo[]} An array of methods. + */ + getMethods(flags:yfiles.system.BindingFlags):yfiles.system.MethodInfo[]; + /** + * Returns a method with the given memberName and argTypes. + * If flags is undefined or null, the method must be public and belong to the type itself and not its parent type. + * Otherwise, the method must match the specified {@link yfiles.system.BindingFlags}. + * @param {string} memberName The name of the method. + * @param {yfiles.lang.Class[]} argTypes The argument types of the method. + * @param {yfiles.system.BindingFlags} flags The optional binding flags. + * @return {yfiles.system.MemberInfo} The method with the given name that matches the criteria. + */ + getMethod(memberName:string,argTypes:yfiles.lang.Class[],flags:yfiles.system.BindingFlags):yfiles.system.MemberInfo; + /** + * Returns a list of all nested types of the type. If flags is undefined or null, returns all nested types that are public. + * Otherwise, the nested types that match the specified {@link yfiles.system.BindingFlags}. + * @param {yfiles.system.BindingFlags} flags The optional binding flags. + * @return {yfiles.lang.Class[]} An array of nested types. + */ + getNestedTypes(flags:yfiles.system.BindingFlags):yfiles.lang.Class[]; + /** + * Returns a nested type with the given memberName. + * If flags is undefined or null, the nested type must be public and belong to the type itself and not its parent type. + * Otherwise, the nested type must match the specified {@link yfiles.system.BindingFlags}. + * @param {string} memberName The name of the nested type. + * @param {yfiles.system.BindingFlags} flags The optional binding flags. + * @return {yfiles.lang.Class} The nested type with the given name that matches the criteria. + */ + getNestedType(memberName:string,flags:yfiles.system.BindingFlags):yfiles.lang.Class; + /** + * Returns a list of all properties of the type. If flags is undefined or null, returns all properties that are public. + * Otherwise, the properties that match the specified {@link yfiles.system.BindingFlags}. + * @param {yfiles.system.BindingFlags} flags The optional binding flags. + * @return {yfiles.system.PropertyInfo[]} An array of properties. + */ + getProperties(flags:yfiles.system.BindingFlags):yfiles.system.PropertyInfo[]; + /** + * Returns a property with the given memberName and type. + * If flags is undefined or null, the property must be public and belong to the type itself and not its parent type. + * Otherwise, the property must match the specified {@link yfiles.system.BindingFlags}. + * @param {string} memberName The name of the property. + * @param {yfiles.lang.Class} type The name of the property. + * @param {yfiles.lang.Class[]} indexerTypes Unused. + * @param {yfiles.system.BindingFlags} flags The optional binding flags. + * @return {yfiles.system.PropertyInfo} The property with the given name that matches the criteria. + */ + getProperty(memberName:string,type:yfiles.lang.Class,indexerTypes:yfiles.lang.Class[],flags:yfiles.system.BindingFlags):yfiles.system.PropertyInfo; + /** + * The default constructor function of this type that contains all of its static members and the prototype chain link. + */ + object:Object; + /** + * Returns all attributes that belong to this type. + * @param {boolean} inherit If true, then the attributes of the parent types are also + * added to the list. Default value is false. + * @return {yfiles.lang.Attribute[]} A list of attributes that belong to this type. + */ + getCustomAttributes(inherit:boolean):yfiles.lang.Attribute[]; + /** + * Tests whether this type has an {@link yfiles.lang.Attribute} of the specified attributeType. + * @param {yfiles.lang.Class} attributeType The type of the attribute that is tested. + * @param {boolean} inherit If true, then the attributes of the parent types are also considered. Default value is false. + * @return {boolean} Whether this type has an {@link yfiles.lang.Attribute} of the specified attributeType. + */ + isDefined(attributeType:yfiles.lang.Class,inherit:boolean):boolean; + /** + * The type of the reflected type. + */ + memberType:yfiles.system.MemberTypes; + /** + * The short name of this class. + */ + name:string; + /** + * The fully qualified of this class. + */ + fullName:string; + /** + * The namespace of this class. + */ + namespace:string; + /** + * Identifier for the type: "Class", "Enum" or "Trait". + */ + type:string; + /** + * The type that is being accessed via reflection. + * This is always the type instance itself + */ + reflectedType:yfiles.lang.Class; + /** + * Returns all attributes that belong to this type and are instances of the specified attributeType. + * @param {yfiles.lang.Class} attributeType The type that all matched attributes should implement. + * @param {boolean} inherit If true, then the attributes of the parent types are also added to the list. Default value is false. + * @return {yfiles.lang.Attribute[]} A list of attributes that belong to this type and are instances of the specified attribute. + */ + getCustomAttributesOfType(attributeType:yfiles.lang.Class,inherit:boolean):yfiles.lang.Attribute[]; + /** + * Returns the {@link yfiles.lang.Attribute}s of the member with the given name. + * The {@link yfiles.lang.Attribute}s are not evaluated unless this method is invoked. + * @param {string} name The name of the member whose properties are to be provided. + * @return {yfiles.lang.Attribute[]} A list of attributes for the specified member. + */ + getAttributesFor(name:string):yfiles.lang.Attribute[]; + } + var Class:{ + $class:yfiles.lang.Class; + /** + * Returns the class object for the given name, or null if no such class exists. + * @param {string} name The name of the requested class. + * @return {yfiles.lang.Class} The class object or null, if no such class exists. + */ + forName(name:string):yfiles.lang.Class; + /** + * Returns a list of all assemblies, where an assembly is defined as a top-level namespace. + * @return {yfiles.lang.Assembly[]} An array of assembly objects. + */ + getAssemblies():yfiles.lang.Assembly[]; + /** + * Modify an existing object obj that is not created + * with the help of the yfiles class framework to be usable with our library functions. + * This method modifies a given object obj in the following ways: + *
    + *
  • Methods and properties that implement member declarations of the traits are callable + * from yfiles library code.
  • + *
  • For each interface trait in traits, trait.isInstance(obj) is true.
  • + *
+ * Note that this method does not enable extended usages, e.g. obj does not implement the full reflection API necessary for GraphML + * serialization, and it is not possible to inject actual classes as opposed to interfaces. + * To modify an object on an instance level: + *

+      * //Create a plain JavaScript object
+      * var myHitTestable = {};
+      * myHitTestable.isHit = function(p, ctx) { return false; };
+      * myHitTestable.lookup = function(clazz) { return null; };
+      * //Modify
+      * yfiles.lang.Class.injectInterfaces(myHitTestable, [yfiles.drawing.IHitTestable, yfiles.support.ILookup]);
+      * //These are equally valid:
+      * //yfiles.lang.Class.injectInterfaces(myHitTestable, ["yfiles.drawing.IHitTestable", "yfiles.support.ILookup"]);
+      * //yfiles.lang.Class.injectInterfaces(myHitTestable, [yfiles.drawing.IHitTestable.$class, yfiles.support.ILookup.$class]);
+      * //As well as using a variable number of arguments, such as:
+      * //yfiles.lang.Class.injectInterfaces(myHitTestable, yfiles.drawing.IHitTestable, yfiles.support.ILookup);
+      * //This is true now:
+      * yfiles.drawing.IHitTestable.isInstance(myHitTestable);
+      * //And the object can be used where an interface instance is expected:
+      * graphEditorInputMode.clickInputMode.validClickHitTestable = myHitTestable;
+      * 
+ * It is also possible to modify an object prototype, e.g. in TypeScript: + * Class definition: + *
 
+      * export class MyHitTestable implements yfiles.drawing.IHitTestable {
+      *    isHit(p: yfiles.geometry.PointD, ctx: yfiles.canvas.ICanvasContext): boolean {
+      *        return false;
+      *    }
+      * }
+      * 
+ * Usage: + *

+      * //This is false:
+      * //yfiles.drawing.IHitTestable.isInstance(new MyHitTestable());
+      * //Modify
+      * yfiles.lang.Class.injectInterfaces(MyHitTestable.prototype, [yfiles.drawing.IHitTestable]);
+      * //Now it is true
+      * var myHitTestable = new MyHitTestable();
+      * yfiles.drawing.IHitTestable.isInstance(myHitTestable);
+      * //And the object can be used where an interface instance is expected:
+      * graphEditorInputMode.clickInputMode.validClickHitTestable = myHitTestable;
+      * 
+ * @param {Object} obj The object to modify. + * @param {Object[]} traits Array or variable number of {@link yfiles.lang.Trait}s, {@link yfiles.lang.Class} objects of traits or fully qualified string + * names of traits. + */ + injectInterfaces(obj:Object,traits:Object[]):void; + }; + /** + * This type represents an abstract value, that is a function that is not implemented. + */ + export interface Abstract extends Object{ + } + var Abstract:{ + $class:yfiles.lang.Class; + /** + * Tests whether the given object or property descriptor is a representation of an abstract value. + * @param {Object} o The object to test. + * @return {boolean} true, if the object is abstract; false otherwise. + */ + isAbstract(o:Object):boolean; + }; + } + export module layout{ + /** + * Class that represents directions. + * Note: for each direction there exists exactly one object. + */ + export interface Direction extends Object{ + /** + * The direction that follows this direction in clockwise order. + */ + turnCW:yfiles.layout.Direction; + /** + * The direction that follows this direction in counterclockwise order. + */ + turnCCW:yfiles.layout.Direction; + /** + * The mirror direction (turns the direction two times). + */ + mirror:yfiles.layout.Direction; + /** + * True if this direction is horizontal (right or left). + */ + horizontal:boolean; + /** + * True if this direction is vertical (up or down). + */ + vertical:boolean; + /** + * Returns the direction as int value. + * @return {number} 0 for UP, 1 for RIGHT, 2 for DOWN, and 3 for LEFT. + */ + getDirection():number; + /** + * Returns the current direction as string. + * @return {string} ^ for UP, > for RIGHT, v for DOWN, and < for LEFT. + */ + toString():string; + } + var Direction:{ + $class:yfiles.lang.Class; + /** + * Decodes the up direction. + */ + UP:yfiles.layout.Direction; + /** + * Decodes the right direction. + */ + RIGHT:yfiles.layout.Direction; + /** + * Decodes the down direction. + */ + DOWN:yfiles.layout.Direction; + /** + * Decodes the left direction. + */ + LEFT:yfiles.layout.Direction; + }; + /** + * An edge label model that allows placement of labels + * at some positions along an edge. + *

+ * It's possible to specify a distance value that controls the + * distance between label and edge. + * Furthermore, there's the possibility to mask out + * arbitrary edge label candidates. This can either be done by + * specifying predefined candidate masks or by OR-ing allowed label + * candidates to a user defined mask. + *

+ */ + export interface DiscreteEdgeLabelLayoutModel extends Object,yfiles.layout.IEdgeLabelModel{ + /** + * The bit mask specifying the valid positions for edge labels. + *

+ * Defaults to {@link yfiles.layout.DiscreteEdgeLabelPosition#SIX_POS}. + *

+ */ + candidateMask:yfiles.layout.DiscreteEdgeLabelPosition; + /** + * The distance between the label's bounding box and the edge's path. + */ + distance:number; + /** + * A model parameter that encodes the default position of this model's + * allowed edge label positions. + * Default positions are (in descending order): + *
    + *
  • {@link yfiles.layout.DiscreteEdgeLabelPosition#CENTER}
  • + *
  • {@link yfiles.layout.DiscreteEdgeLabelPosition#SCENTER}
  • + *
  • {@link yfiles.layout.DiscreteEdgeLabelPosition#TAIL}
  • + *
  • {@link yfiles.layout.DiscreteEdgeLabelPosition#STAIL}
  • + *
+ * Descending order means that whenever two or more of the above default positions + * are part of the allowed positions, then the model parameter encodes the one + * that is listed first. + * Note that the model parameter encodes {@link yfiles.layout.DiscreteEdgeLabelPosition#CENTER} when none of the above + * default positions is part of the allowed positions. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#defaultParameter}. + */ + defaultParameter:Object; + /** + * Creates a model parameter that represents the given edge label context best + * within this model. + * The created model parameter represents the closest parameter representation + * of the given label location that can be achieved within this model. + * @param {yfiles.algorithms.YOrientedRectangle} labelBounds The bounds of the label for which a parameter representation is sought. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceLayout The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetLayout The layout of the target node of the label owning edge. + * @return {Object} + * A model parameter that can be passed to the + * {@link yfiles.layout.IEdgeLabelModel#getLabelPlacement} + * method. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#createModelParameter}. + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):Object; + /** + * Checks if the given model parameter encodes an edge label position that is + * valid in this model. + * @return {boolean} + * Whether the label position encoded by the given model parameter is among the + * allowed positions. + */ + isParameterValid(parameter:Object):boolean; + /** + * Returns the bounds of the label for the position encoded + * by the given model parameter. + * @param {yfiles.algorithms.YDimension} labelSize The size of the label that should be placed. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceLayout The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetLayout The layout of the target node of the label owning edge. + * @param {Object} param + * The model parameter that describes the abstract position of the label within + * this model. + * The parameter must have been generated by this model. + * @return {yfiles.algorithms.YOrientedRectangle} The bounds of the label. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#getLabelPlacement}. + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,para:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Returns a list of {@link yfiles.layout.EdgeLabelCandidate} objects each of which describes + * a valid label position within this model. + * @param {yfiles.layout.IEdgeLabelLayout} labelLayout The label for which candidates should be generated. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceLayout The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetLayout The layout of the target node of the label owning edge. + * @return {yfiles.algorithms.YList} + * A list of {@link yfiles.layout.EdgeLabelCandidate} objects. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#getLabelCandidates}. + */ + getLabelCandidates(label:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * Returns the coordinates of the upper-left corner of the given label position. + * @param {yfiles.algorithms.YDimension} labelSize The size of the label that should be placed. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceNode The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetNode The layout of the target node of the label owning edge. + * @param {yfiles.layout.DiscreteEdgeLabelPosition} pos + * A label position (given by a symbolic position specifier) that is valid in + * this model. + * @return {yfiles.algorithms.YOrientedRectangle} The coordinates of the upper-left corner of a label position. + */ + getLabelPlacementForPosition(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,pos:yfiles.layout.DiscreteEdgeLabelPosition):yfiles.algorithms.YOrientedRectangle; + } + var DiscreteEdgeLabelLayoutModel:{ + $class:yfiles.lang.Class; + /** + * Returns a new instance of DiscreteEdgeLabelModel. + * Position mask {@link yfiles.layout.DiscreteEdgeLabelPosition#SIX_POS} is used to define the allowed positions for + * an edge label. + */ + new ():yfiles.layout.DiscreteEdgeLabelLayoutModel; + /** + * Returns a new instance of DiscreteEdgeLabelModel. + * @param {yfiles.layout.DiscreteEdgeLabelPosition} candidateMask Position mask that defines the allowed positions for an edge label. + */ + FromPosition:{ + new (candidateMask:yfiles.layout.DiscreteEdgeLabelPosition):yfiles.layout.DiscreteEdgeLabelLayoutModel; + }; + /** + * Returns a model parameter that encodes the specified position. + * @param {number} position + * one of + *
    + *
  • {@link yfiles.layout.DiscreteEdgeLabelPosition#SHEAD},
  • + *
  • {@link yfiles.layout.DiscreteEdgeLabelPosition#HEAD},
  • + *
  • {@link yfiles.layout.DiscreteEdgeLabelPosition#THEAD},
  • + *
  • {@link yfiles.layout.DiscreteEdgeLabelPosition#STAIL},
  • + *
  • {@link yfiles.layout.DiscreteEdgeLabelPosition#TAIL},
  • + *
  • {@link yfiles.layout.DiscreteEdgeLabelPosition#TTAIL},
  • + *
  • {@link yfiles.layout.DiscreteEdgeLabelPosition#SCENTER},
  • + *
  • {@link yfiles.layout.DiscreteEdgeLabelPosition#CENTER},
  • + *
  • {@link yfiles.layout.DiscreteEdgeLabelPosition#TCENTER}
  • + *
+ * @return {Object} a model parameter that encodes the specified position. + * @throws {yfiles.system.ArgumentException} + * if the specified position is not one + * of the symbolic position constants defined in this class. + */ + createPositionParameter(position:number):Object; + }; + /** + * A node label model that allows placement of labels at eight positions around + * a node and at nine positions inside the node. + * It's possible to specify an insets value that controls the distance between label + * and node. + * Furthermore, there's the possibility to mask out arbitrary node label candidates. + * This can either be done by specifying predefined candidate masks or by OR-ing + * allowed node label candidates to a user defined mask. + */ + export interface DiscreteNodeLabelLayoutModel extends Object,yfiles.layout.INodeLabelModel{ + /** + * Allowed candidate positions, default is all positions. + */ + candidateMask:yfiles.layout.DiscreteNodeLabelPosition; + /** + * The distance between the bounding boxes of label and node. + * It is applied to all label positions, except the {@link yfiles.layout.DiscreteNodeLabelPosition#CENTER} position. + */ + distance:number; + /** + * A model parameter that encodes the default position of this model's + * allowed node label positions. + * Default positions are (in descending order): + *
    + *
  • {@link yfiles.layout.DiscreteNodeLabelPosition#CENTER}
  • + *
  • {@link yfiles.layout.DiscreteNodeLabelPosition#NORTH_EAST}
  • + *
  • {@link yfiles.layout.DiscreteNodeLabelPosition#NORTH}
  • + *
  • {@link yfiles.layout.DiscreteNodeLabelPosition#EAST}
  • + *
+ * Descending order means that whenever two or more of the above default positions + * are part of the allowed positions, then the model parameter encodes the one + * that is listed first. + * Note that the model parameter encodes {@link yfiles.layout.DiscreteNodeLabelPosition#CENTER} when none of the above + * default positions is part of the allowed positions. + * @see Specified by {@link yfiles.layout.INodeLabelModel#defaultParameter}. + */ + defaultParameter:Object; + /** + * Checks if the given model parameter encodes a node label position that is valid + * in this model. + * @return {boolean} + * Whether the label position encoded by the given model parameter is among the + * allowed positions. + */ + isParameterValid(parameter:Object):boolean; + /** + * Returns the the oriented label position and bounds encoded by the given + * model parameter. + * @param {yfiles.algorithms.YDimension} labelSize The size of the label. + * @param {yfiles.layout.INodeLayout} nodeLayout The geometric description of the label's node. + * @param {Object} param + * A model parameter that encodes a label position that is valid + * in this model. + * @see Specified by {@link yfiles.layout.INodeLabelModel#getLabelPlacement}. + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Returns a list of candidate positions for the given node label. + * @see Specified by {@link yfiles.layout.INodeLabelModel#getLabelCandidates}. + */ + getLabelCandidates(nl:yfiles.layout.INodeLabelLayout,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * Returns the oriented label position and bounds for a node label of the + * specified size. + * @param {yfiles.algorithms.YDimension} labelSize The size of the label. + * @param {yfiles.layout.INodeLayout} nodeLayout The geometric description of the label's node. + * @param {yfiles.layout.DiscreteNodeLabelPosition} pos A label position that is valid in this model. + * @return {yfiles.algorithms.YOrientedRectangle} the oriented label position and bounds. + */ + getLabelPlacementForPosition(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,pos:yfiles.layout.DiscreteNodeLabelPosition):yfiles.algorithms.YOrientedRectangle; + /** + * Creates a model parameter that represents the given node label context best + * within this model. + * The created model parameter represents the closest parameter representation + * of the given oriented label bounds that can be achieved within this model. + * @param {yfiles.algorithms.YOrientedRectangle} labelBounds The bounds of the label for which a parameter representation is sought. + * @param {yfiles.layout.INodeLayout} nodeLayout The layout of the node to which the label belongs. + * @return {Object} + * A model parameter that can be passed to the + * {@link yfiles.layout.INodeLabelModel#getLabelPlacement} method. + * @see Specified by {@link yfiles.layout.INodeLabelModel#createModelParameter}. + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,nodeLayout:yfiles.layout.INodeLayout):Object; + } + var DiscreteNodeLabelLayoutModel:{ + $class:yfiles.lang.Class; + /** + * Returns a new instance of DiscreteNodeLabelModel. + * {@link yfiles.layout.DiscreteNodeLabelPosition#INTERNAL_MASK} is used to define the allowed positions for the node + * label. + * The distance between label and node is set to 4.0 [pixel]. + * @see {@link yfiles.layout.DiscreteNodeLabelLayoutModel#distance} + */ + new ():yfiles.layout.DiscreteNodeLabelLayoutModel; + /** + * Returns a new instance of DiscreteNodeLabelModel. + * The given position mask is used to define the allowed positions for the node + * label. + * The distance between label and node is set to 4.0 [pixel]. + * @param {yfiles.layout.DiscreteNodeLabelPosition} candidateMask Defines the allowed positions for the node label. + * @see {@link yfiles.layout.DiscreteNodeLabelLayoutModel#distance} + */ + FromPosition:{ + new (candidateMask:yfiles.layout.DiscreteNodeLabelPosition):yfiles.layout.DiscreteNodeLabelLayoutModel; + }; + /** + * Returns a new instance of DiscreteNodeLabelModel. + * @param {yfiles.layout.DiscreteNodeLabelPosition} candidateMask Defines the allowed positions for the node label. + * @param {number} inset The distance between label and node. + * @see {@link yfiles.layout.DiscreteNodeLabelLayoutModel#distance} + */ + FromPositionWithInset:{ + new (candidateMask:yfiles.layout.DiscreteNodeLabelPosition,inset:number):yfiles.layout.DiscreteNodeLabelLayoutModel; + }; + }; + /** + * This class is a default implementation of the EdgeLayout interface. + */ + export interface DefaultEdgeLayout extends Object,yfiles.layout.IEdgeLayout{ + /** + * Returns the number of control points of the edge. + * The source and target points are not included in the point count. + * @return {number} the number of control points + * @see Specified by {@link yfiles.layout.IEdgeLayout#pointCount}. + */ + pointCount():number; + /** + * Returns the control point at position index of + * the sequence. + * @see {@link yfiles.layout.IEdgeLayout#setPoint} + * @param {number} index position of the control point in the control point sequence. + * @return {yfiles.algorithms.YPoint} the absolute coordinates of the control point at the given index. + * @see Specified by {@link yfiles.layout.IEdgeLayout#getPoint}. + */ + getPoint(index:number):yfiles.algorithms.YPoint; + /** + * Sets the coordinates of the control point at position index of + * the sequence. + * The first control point in the sequence has index 0 + * and the last control point has index pointCount() - 1. + * @param {number} index position of the control point in the control point sequence. + * @param {number} x absolute x-coordinate of the control point at the given index. + * @param {number} y absolute y-coordinate of the control point at the given index. + * @see Specified by {@link yfiles.layout.IEdgeLayout#setPoint}. + */ + setPoint(index:number,x:number,y:number):void; + /** + * Adds a control point to the end of the control point sequence. + * @param {number} x the absolute x-coordinate of the control point. + * @param {number} y the absolute y-coordinate of the control point. + * @see Specified by {@link yfiles.layout.IEdgeLayout#addPoint}. + */ + addPoint(x:number,y:number):void; + /** + * Remove all control points from this edge layout. + * @see Specified by {@link yfiles.layout.IEdgeLayout#clearPoints}. + */ + clearPoints():void; + /** + * The relative coordinates of the first end point of this layout + * that is associated with the source node of the edge. + * Getter:The returned coordinates are relative to the center location of the source + * node of the edge. To obtain the absolute coordinates of the end point it + * is therefore necessary to add the center coordinates of the source node layout + * to the returned value. + * Setter:The given coordinates must be relative to the center location of the source + * node of the edge. + * @see {@link yfiles.layout.LayoutGraph#getCenterX} + * @see {@link yfiles.layout.LayoutGraph#getCenterY} + * @see {@link yfiles.layout.INodeLayout#x} + * @see {@link yfiles.layout.INodeLayout#width} + * @see {@link yfiles.layout.IEdgeLayout#targetPoint} + * @see Specified by {@link yfiles.layout.IEdgeLayout#sourcePoint}. + */ + sourcePoint:yfiles.algorithms.YPoint; + /** + * The relative coordinates of the second end point of this layout + * that is associated with the target node of the edge. + * Getter:The returned coordinates are relative to the center location of the target + * node of the edge. To obtain the absolute coordinates of the end point it + * is therefore necessary to add the center coordinates of the target node layout + * to the returned value. + * Setter:The given coordinates must be relative to the center location of the target + * node of the edge. + * @see {@link yfiles.layout.LayoutGraph#getCenterX} + * @see {@link yfiles.layout.LayoutGraph#getCenterY} + * @see {@link yfiles.layout.INodeLayout#x} + * @see {@link yfiles.layout.INodeLayout#width} + * @see Specified by {@link yfiles.layout.IEdgeLayout#targetPoint}. + */ + targetPoint:yfiles.algorithms.YPoint; + } + var DefaultEdgeLayout:{ + $class:yfiles.lang.Class; + /** + * Creates a new DefaultEdgeLayout. + */ + new ():yfiles.layout.DefaultEdgeLayout; + /** + * Creates a new DefaultEdgeLayout which is the copy of another EdgeLayout. + * @param {yfiles.layout.IEdgeLayout} layout another edge layout + */ + FromEdgeLayout:{ + new (layout:yfiles.layout.IEdgeLayout):yfiles.layout.DefaultEdgeLayout; + }; + }; + /** + * This is a LayoutGraph implementation that serves as a copy of + * another LayoutGraph or as copy of a combined GraphInterface and + * and GraphLayout interface implementation. + */ + export interface CopiedLayoutGraph extends yfiles.layout.LayoutGraph{ + /** + * Creates an copied edge. + * The mappings are updated so that it is possible to look up the newly created + * node by using {@link yfiles.layout.CopiedLayoutGraph#getCopiedEdge}. + * This method can be used to keep the CopiedLayoutGraph in sync with the original graph. + * @param {Object} origEdge the original edge the copied edge is based on + * @return {yfiles.algorithms.Edge} the newly created edge (belongs to the copied graph) + */ + createEdge(origEdge:Object):yfiles.algorithms.Edge; + /** + * Creates a factory that delegates to the {@link yfiles.layout.CopiedLayoutGraph#createNodeWithOriginalNode} + * and {@link yfiles.layout.CopiedLayoutGraph#createEdge} methods of this instance. + * @see Overrides {@link yfiles.layout.LayoutGraph#createGraphCopyFactory} + */ + createGraphCopyFactory():yfiles.algorithms.GraphCopier.ICopyFactory; + /** + * Creates a copy of the given original node. + * The mappings are updated so that the lookup methods + * ({@link yfiles.layout.CopiedLayoutGraph#getOriginalNode} and {@link yfiles.layout.CopiedLayoutGraph#getCopiedNode} can be used. + * This method is especially useful to keep the CopiedLayoutGraph in sync with the original graph. + * @param {Object} origNode the node of the original graph the copy will be created for + * @return {yfiles.algorithms.Node} the newly created node that represents a copy of the given node. + */ + createNodeWithOriginalNode(origNode:Object):yfiles.algorithms.Node; + /** + * Synchronizes the structure of the CopiedLayoutGraph with the actual structure of the underlying LayoutGraph. + */ + syncStructure():void; + /** + * Returns the layout information for a node in the drawing. + * @param {yfiles.algorithms.Node} v a node in the drawing. + * @return {yfiles.layout.INodeLayout} the layout information for node. + * @see Overrides {@link yfiles.layout.LayoutGraph#getLayoutForNode} + */ + getLayoutForNode(v:yfiles.algorithms.Node):yfiles.layout.INodeLayout; + /** + * Returns the layout information for an edge in the drawing. + * @param {yfiles.algorithms.Edge} e an edge in the drawing. + * @return {yfiles.layout.IEdgeLayout} the layout information for the given edge. + * @see Overrides {@link yfiles.layout.LayoutGraph#getLayoutForEdge} + */ + getLayoutForEdge(e:yfiles.algorithms.Edge):yfiles.layout.IEdgeLayout; + /** + * Returns NodeLabelLayout objects which describe the layouts + * of the labels that belong to the given node. + * @param {yfiles.algorithms.Node} v a node in the drawing. + * @return {yfiles.layout.INodeLabelLayout[]} the node label layout information for node. + * @see Overrides {@link yfiles.layout.LayoutGraph#getLabelLayoutForNode} + */ + getLabelLayoutForNode(v:yfiles.algorithms.Node):yfiles.layout.INodeLabelLayout[]; + /** + * Returns EdgeLabelLayout objects which describe the layouts + * of the labels that belong to the given edge. + * @param {yfiles.algorithms.Edge} e an edge in the drawing. + * @return {yfiles.layout.IEdgeLabelLayout[]} the edge label layout information for the given edge. + * @see Overrides {@link yfiles.layout.LayoutGraph#getLabelLayoutForEdge} + */ + getLabelLayoutForEdge(e:yfiles.algorithms.Edge):yfiles.layout.IEdgeLabelLayout[]; + /** + * Returns the node which is described by a given label layout. + * @see Overrides {@link yfiles.layout.LayoutGraph#getFeatureNode} + */ + getFeatureNode(labelLayout:yfiles.layout.INodeLabelLayout):yfiles.algorithms.Node; + /** + * Returns the edge which is described by a given label layout. + * @see Overrides {@link yfiles.layout.LayoutGraph#getFeatureEdge} + */ + getFeatureEdge(labelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.algorithms.Edge; + /** + * The GraphLayout that is valid for the original graph. + * The information contained + * in the GraphLayout is identical to the graph layout associated with this graph, but it + * uses the original graph elements as lookup domain, i.e. + * getLayout(copiedNode) corresponds to + * getLayoutForOriginalGraph().getLayout(getOriginalNode(copiedNode)). + */ + layoutForOriginalGraph:yfiles.layout.IGraphLayout; + /** + * Writes the current layout information to the original graph. + * Works only when the graph was constructed as copy of another graph. + */ + commitLayoutToOriginalGraph():void; + /** + * Returns the original node that corresponds to the given + * node. + * @param {yfiles.algorithms.Node} v a node in this graph that is a copy of the returned node + * @return {Object} a node in the original graph whose copy is the given node + */ + getOriginalNode(v:yfiles.algorithms.Node):Object; + /** + * Returns the original edge that corresponds to the given + * edge. + * @param {yfiles.algorithms.Edge} e an edge in this graph that is a copy of the returned edge + * @return {Object} an edge in the original graph whose copy is the given edge + */ + getOriginalEdge(e:yfiles.algorithms.Edge):Object; + /** + * Returns the copied node that corresponds to the given + * original node. + * @param {Object} v a node in the original graph whose copy is in this graph + * @return {yfiles.algorithms.Node} a node in this graph that is the copy of the given original node + */ + getCopiedNode(v:Object):yfiles.algorithms.Node; + /** + * Returns the copied edge that corresponds to the given + * original edge. + * @param {Object} e an edge in the original graph whose copy is in this graph + * @return {yfiles.algorithms.Edge} an edge in this graph that is the copy of the given original edge + */ + getCopiedEdge(e:Object):yfiles.algorithms.Edge; + /** + * The original graph. + */ + originalGraph:yfiles.algorithms.IGraphInterface; + /** + * The original layout. + */ + originalLayout:yfiles.layout.IGraphLayout; + /** + * Creates a new label layout factory for this graph. + * @return {yfiles.layout.ILabelLayoutFactory} the new label layout factory. + * @see Overrides {@link yfiles.layout.LayoutGraph#createLabelFactory} + */ + createLabelFactory():yfiles.layout.ILabelLayoutFactory; + } + var CopiedLayoutGraph:{ + $class:yfiles.lang.Class; + /** + * Initializes this graph as a copy of the given graph. + */ + new (graph:yfiles.layout.LayoutGraph):yfiles.layout.CopiedLayoutGraph; + /** + * Initializes this graph as a copy of the given graph interface + * and graph layout. + */ + FromGraphAndLayout:{ + new (graph:yfiles.algorithms.IGraphInterface,layout:yfiles.layout.IGraphLayout):yfiles.layout.CopiedLayoutGraph; + }; + }; + /** + * A layouter that allows to express a layout stage + * as a chain of more basic layout stages. + */ + export interface CompositeLayouter extends Object,yfiles.layout.ILayouter{ + /** + * Prepends a stage to this composite layout stage. + * Stage added with this method + * will be invoked before any other stages will be invoked. + */ + prependStage(stage:yfiles.layout.ILayoutStage):void; + /** + * The chain of layout stages that make up this composite layout stage. + */ + layoutStages:yfiles.algorithms.IList; + /** + * Appends a stage to the layout pipeline. + * Stages added with this method will be + * invoked just before the core layouter of the composite layout stage will be invoked. + */ + appendStage(stage:yfiles.layout.ILayoutStage):void; + /** + * Returns true if all layout stages and the core layout stage + * can layout the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Assigns a new graph layout to the given layout graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var CompositeLayouter:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of CompositeLayouter with the + * specified LayoutStage prepended to the specified + * Layouter. + * @param {yfiles.layout.ILayoutStage} stage + * a LayoutStage that is prepended to the specified + * core layouter. + * @param {yfiles.layout.ILayouter} coreLayouter + * a Layouter that is used as core (i.e. + * innermost) layouter for this CompositeLayouter. + */ + new (stage:yfiles.layout.ILayoutStage,coreLayouter:yfiles.layout.ILayouter):yfiles.layout.CompositeLayouter; + }; + /** + * This class is a default implementation of the NodeLayout interface. + */ + export interface DefaultNodeLayout extends Object,yfiles.layout.INodeLayout{ + /** + * Sets the coordinates of the upper left corner of the node. + * @param {number} x the x-coordinates of the upper left corner. + * @param {number} y the y-coordinates of the upper left corner. + * @see Specified by {@link yfiles.layout.INodeLayout#setLocation}. + */ + setLocation(x:number,y:number):void; + /** + * Sets the center coordinates of the node. + * @param {number} x the x-coordinates of the center. + * @param {number} y the y-coordinates of the center + */ + setCenter(x:number,y:number):void; + /** + * Sets the size of the node. + * @param {number} width the width of the node. + * @param {number} height the height of the node. + * @see Specified by {@link yfiles.layout.INodeLayout#setSize}. + */ + setSize(width:number,height:number):void; + /** + * The height of the node. + * @see Specified by {@link yfiles.layout.INodeLayout#height}. + */ + height:number; + /** + * The width of the node. + * @see Specified by {@link yfiles.layout.INodeLayout#width}. + */ + width:number; + /** + * X-Coordinate of the upper left corner of the node. + * @see Specified by {@link yfiles.layout.INodeLayout#x}. + */ + x:number; + /** + * Y-Coordinate of the upper left corner of the node. + * @see Specified by {@link yfiles.layout.INodeLayout#y}. + */ + y:number; + } + var DefaultNodeLayout:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of DefaultNodeLayout. + */ + new ():yfiles.layout.DefaultNodeLayout; + /** + * Creates a new instance of DefaultNodeLayout as copy of another instance + * of NodeLayout. + * @param {yfiles.layout.INodeLayout} layout another instance of NodeLayout. + */ + FromNodeLayout:{ + new (layout:yfiles.layout.INodeLayout):yfiles.layout.DefaultNodeLayout; + }; + /** + * Creates a new instance of DefaultNodeLayout. + * @param {number} x the x-coordinate of the upper left corner of the node. + * @param {number} y the y-coordinate of the upper left corner of the node. + * @param {number} width the width of the node. + * @param {number} height the height of the node. + */ + FromXYWidthAndHeight:{ + new (x:number,y:number,width:number,height:number):yfiles.layout.DefaultNodeLayout; + }; + /** + * Creates a new instance of DefaultNodeLayout. + * @param {yfiles.algorithms.YPoint} location the upper-left corner coordinate of the node layout. + * @param {yfiles.algorithms.YDimension} size the size of the node layout. + */ + FromLocationAndSize:{ + new (location:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension):yfiles.layout.DefaultNodeLayout; + }; + }; + /** + * This class is a default implementation of the abstract class LayoutGraph. + */ + export interface DefaultLayoutGraph extends yfiles.layout.LayoutGraph{ + /** + * NodeMap used to associate node label layouts with the nodes of this graph. + * @see {@link yfiles.layout.DefaultLayoutGraph#setNodeLabelLayoutMultiple} + */ + nodeLabelMap:yfiles.algorithms.INodeMap; + /** + * EdgeMap used to associate edge label layouts with the edges of this graph. + * @see {@link yfiles.layout.DefaultLayoutGraph#setEdgeLabelLayout} + */ + edgeLabelMap:yfiles.algorithms.IEdgeMap; + /** + * Map used to associate the owner of a node label with the node label itself. + */ + nodeLabelFeatureMap:yfiles.algorithms.IMap; + /** + * Map used to associate the owner of an edge label with the edge label itself. + */ + edgeLabelFeatureMap:yfiles.algorithms.IMap; + /** + * Creates a new {@link yfiles.layout.LayoutGraphCopyFactory.HierarchicGraphCopyFactory}. + * @see Overrides {@link yfiles.layout.LayoutGraph#createGraphCopyFactory} + */ + createGraphCopyFactory():yfiles.algorithms.GraphCopier.ICopyFactory; + /** + * Returns the layout information for a node in the drawing. + * @param {yfiles.algorithms.Node} v a node in the drawing. + * @return {yfiles.layout.INodeLayout} the layout information for node. + * @see Overrides {@link yfiles.layout.LayoutGraph#getLayoutForNode} + */ + getLayoutForNode(v:yfiles.algorithms.Node):yfiles.layout.INodeLayout; + /** + * Sets the layout information for a node in the drawing. + */ + setNodeLayout(v:yfiles.algorithms.Node,layout:yfiles.layout.INodeLayout):void; + /** + * Sets the layout information for an edge in the drawing. + */ + setEdgeLayout(e:yfiles.algorithms.Edge,layout:yfiles.layout.IEdgeLayout):void; + /** + * Returns the layout information for an edge in the drawing. + * @param {yfiles.algorithms.Edge} e a edge in the drawing. + * @return {yfiles.layout.IEdgeLayout} the layout information for the given edge. + * @see Overrides {@link yfiles.layout.LayoutGraph#getLayoutForEdge} + */ + getLayoutForEdge(e:yfiles.algorithms.Edge):yfiles.layout.IEdgeLayout; + /** + * Returns NodeLabelLayout objects that describe the layouts + * of the labels belonging to the given node. + * @param {yfiles.algorithms.Node} node a node in the drawing. + * @return {yfiles.layout.INodeLabelLayout[]} the node label layout information for the given node. + * @see Overrides {@link yfiles.layout.LayoutGraph#getLabelLayoutForNode} + */ + getLabelLayoutForNode(node:yfiles.algorithms.Node):yfiles.layout.INodeLabelLayout[]; + /** + * Sets the NodeLabelLayout object which describes the layout + * of the label that belongs to the given node. + * @param {yfiles.algorithms.Node} node a node in the drawing. + * @param {yfiles.layout.INodeLabelLayout} layout a layout object for the node label + */ + setNodeLabelLayout(node:yfiles.algorithms.Node,layout:yfiles.layout.INodeLabelLayout):void; + /** + * Sets the NodeLabelLayout objects which describe the layouts + * of the labels that belong to the given node. + * @param {yfiles.algorithms.Node} node a node in the drawing. + * @param {yfiles.layout.INodeLabelLayout[]} llayout an array of node label layout objects + */ + setNodeLabelLayoutMultiple(node:yfiles.algorithms.Node,llayout:yfiles.layout.INodeLabelLayout[]):void; + /** + * Sets the EdgeLabelLayout objects which describe the layouts + * of the labels that belong to the given edge. + * @param {yfiles.algorithms.Edge} edge an edge in the drawing. + * @param {yfiles.layout.IEdgeLabelLayout[]} layout an array of edge label layout objects + */ + setEdgeLabelLayout(edge:yfiles.algorithms.Edge,layout:yfiles.layout.IEdgeLabelLayout[]):void; + /** + * Returns EdgeLabelLayout objects which describe the layouts + * of the labels that belong to the given edge. + * @param {yfiles.algorithms.Edge} edge an edge in the drawing. + * @return {yfiles.layout.IEdgeLabelLayout[]} the edge label layout information for the given edge. + * @see Overrides {@link yfiles.layout.LayoutGraph#getLabelLayoutForEdge} + */ + getLabelLayoutForEdge(edge:yfiles.algorithms.Edge):yfiles.layout.IEdgeLabelLayout[]; + /** + * Returns the node which is described by a given label layout. + * @see Overrides {@link yfiles.layout.LayoutGraph#getFeatureNode} + */ + getFeatureNode(labelLayout:yfiles.layout.INodeLabelLayout):yfiles.algorithms.Node; + /** + * Returns the edge which is described by a given label layout. + * @see Overrides {@link yfiles.layout.LayoutGraph#getFeatureEdge} + */ + getFeatureEdge(labelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.algorithms.Edge; + /** + * Override this to create your own EdgeLayouts. + */ + createEdgeLayout():yfiles.layout.IEdgeLayout; + /** + * Override this to create your own NodeLayouts. + */ + createNodeLayout():yfiles.layout.INodeLayout; + /** + * Creates a new label layout factory for this graph. + * @return {yfiles.layout.ILabelLayoutFactory} the new label layout factory. + * @see Overrides {@link yfiles.layout.LayoutGraph#createLabelFactory} + */ + createLabelFactory():yfiles.layout.ILabelLayoutFactory; + } + var DefaultLayoutGraph:{ + $class:yfiles.lang.Class; + /** + * Creates a new Layout Graph. + */ + new ():yfiles.layout.DefaultLayoutGraph; + /** + * Creates a copy of the given subgraph. + */ + FromGraph:{ + new (argGraph:yfiles.layout.LayoutGraph):yfiles.layout.DefaultLayoutGraph; + }; + /** + * Creates a copy of the given subgraph. + */ + FromGraphForSubset:{ + new (graph:yfiles.layout.LayoutGraph,nodeSubset:yfiles.algorithms.ICursor):yfiles.layout.DefaultLayoutGraph; + }; + /** + * Creates a copy of the given subgraph. + */ + FromDefaultLayoutGraphForSubset:{ + new (graph:yfiles.layout.DefaultLayoutGraph,nodeSubset:yfiles.algorithms.ICursor):yfiles.layout.DefaultLayoutGraph; + }; + }; + /** + * This class is a default implementation of the simple GraphLayout + * interface. + */ + export interface DefaultGraphLayout extends Object,yfiles.layout.IGraphLayout{ + /** + * Sets the layout information associated with the given node object. + */ + setNodeLayout(node:Object,layout:yfiles.layout.INodeLayout):void; + /** + * Sets the layout information associated with the given edge object. + */ + setEdgeLayout(edge:Object,layout:yfiles.layout.IEdgeLayout):void; + /** + * Returns the layout information associated with the given edge object. + * @see Specified by {@link yfiles.layout.IGraphLayout#getEdgeLayout}. + */ + getEdgeLayout(edge:Object):yfiles.layout.IEdgeLayout; + /** + * Returns the layout information associated with the given node object. + * @see Specified by {@link yfiles.layout.IGraphLayout#getNodeLayout}. + */ + getNodeLayout(node:Object):yfiles.layout.INodeLayout; + /** + * Sets the node label layouts associated with the given node. + */ + setNodeLabelLayout(node:Object,layout:yfiles.layout.INodeLabelLayout[]):void; + /** + * Returns the node label layouts associated with the given node. + * @see Specified by {@link yfiles.layout.IGraphLayout#getNodeLabelLayout}. + */ + getNodeLabelLayout(node:Object):yfiles.layout.INodeLabelLayout[]; + /** + * Sets the edge label layouts associated with the given edge. + */ + setEdgeLabelLayout(edge:Object,layout:yfiles.layout.IEdgeLabelLayout[]):void; + /** + * Returns the edge label layouts associated with the given edge. + * @see Specified by {@link yfiles.layout.IGraphLayout#getEdgeLabelLayout}. + */ + getEdgeLabelLayout(edge:Object):yfiles.layout.IEdgeLabelLayout[]; + /** + * Returns the bounding box of this graph layout + * This is the smallest rectangle containing the entire layout. + * If the layout does not contain any node layout information + * (and therefore no edge layout information either), + * the bounding box will have negative width and/or height. + * @see Specified by {@link yfiles.layout.IGraphLayout#getBoundingBox}. + */ + getBoundingBox():yfiles.algorithms.Rectangle; + } + var DefaultGraphLayout:{ + $class:yfiles.lang.Class; + new ():yfiles.layout.DefaultGraphLayout; + }; + export enum DiscreteEdgeLabelPosition{ + /** + * Symbolic position specifier. + * Places the label near the source node. + * The label's position is to the left of or above the edge's path. + */ + SHEAD, + /** + * Symbolic position specifier. + * Places the label near the middle of the edge's path. + * The label's position is to the left of or above the edge's path. + */ + HEAD, + /** + * Symbolic position specifier. + * Places the label near the target node. + * The label's position is to the left of or above the edge's path. + * Places the label near the target node on the "head" side of the edge. + */ + THEAD, + /** + * Symbolic position specifier. + * Places the label near the source node. + * The label's position is to the right of or below the edge's path. + */ + STAIL, + /** + * Symbolic position specifier. + * Places the label near the middle of the edge's path. + * The label's position is to the right of or below the edge's path. + */ + TAIL, + /** + * Symbolic position specifier. + * Places the label near the target node. + * The label's position is to the right of or below the edge's path. + */ + TTAIL, + /** + * Symbolic position specifier. + * Places the label near the source node directly on the edge path. + */ + SCENTER, + /** + * Symbolic position specifier. + * Places the label near the middle of an edge directly on its path. + */ + CENTER, + /** + * Symbolic position specifier. + * Places the label near the target node directly on the edge path. + */ + TCENTER, + /** + * Position mask that constrains allowed positions to the two near the edge's + * end points. + * Namely, these are {@link yfiles.layout.DiscreteEdgeLabelPosition#HEAD} and {@link yfiles.layout.DiscreteEdgeLabelPosition#TAIL}. + */ + TWO_POS, + /** + * Position mask that constrains allowed positions to {@link yfiles.layout.DiscreteEdgeLabelPosition#CENTER}. + */ + CENTERED, + /** + * Position mask that constrains allowed positions to a set of six positions on + * the "head" and "tail" sides of an edge. + * Namely, these are {@link yfiles.layout.DiscreteEdgeLabelPosition#SHEAD}, {@link yfiles.layout.DiscreteEdgeLabelPosition#HEAD}, {@link yfiles.layout.DiscreteEdgeLabelPosition#THEAD}, {@link yfiles.layout.DiscreteEdgeLabelPosition#STAIL}, + * {@link yfiles.layout.DiscreteEdgeLabelPosition#TAIL}, and {@link yfiles.layout.DiscreteEdgeLabelPosition#TTAIL}. + */ + SIX_POS, + /** + * Position mask that constrains allowed positions to a set of three positions + * directly on the edge's path. + * Namely, these are {@link yfiles.layout.DiscreteEdgeLabelPosition#SCENTER}, {@link yfiles.layout.DiscreteEdgeLabelPosition#CENTER}, and {@link yfiles.layout.DiscreteEdgeLabelPosition#TCENTER}. + */ + THREE_CENTER + } + export enum ComponentArrangementStyles{ + /** + * Style specification constant describing no special component arrangement at all. + * Components will be centered at the same position they resided at before the layout + * started. If combined with the style modifier {@link yfiles.layout.ComponentArrangementStyles#MODIFIER_NO_OVERLAP} + * components might get moved so that they don't overlap after the layout. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + NONE, + /** + * Style specification constant describing a component arrangement strategy that + * tries to place components in multiple rows so that the overall aspect ratio of all + * components gets as close to the aspect ratio of the preferred layout size as possible. + * @see {@link yfiles.layout.ComponentLayouter#style} + * @see {@link yfiles.layout.ComponentLayouter#setPreferredLayoutSize} + */ + ROWS, + /** + * Style specification constant describing a component arrangement strategy that + * places components next to each other in a single row. If combined with the + * style modifier {@link yfiles.layout.ComponentArrangementStyles#MODIFIER_AS_IS} + * components will be placed in the same order as they were placed before the layout. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + SINGLE_ROW, + /** + * Style specification constant describing a component arrangement strategy that + * places components above each other in a single column. If combined with the + * style modifier {@link yfiles.layout.ComponentArrangementStyles#MODIFIER_AS_IS} + * components will be placed in the same order as they were placed before the layout. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + SINGLE_COLUMN, + /** + * Style specification constant describing a component arrangement strategy that + * tries to place components like in a rectangular cloud around the biggest component. Entities + * of different components will not overlap, however the bounding boxes of the components + * may overlap. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + PACKED_RECTANGLE, + /** + * Style specification constant describing a component arrangement strategy that + * tries to place components like in a rectangular cloud around the biggest component. Entities + * of different components will not overlap, however the bounding boxes of the components + * may overlap. In contrast to {@link yfiles.layout.ComponentArrangementStyles#PACKED_RECTANGLE} components might even be placed in empty spaces inside other components. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + PACKED_COMPACT_RECTANGLE, + /** + * Style specification constant describing a component arrangement strategy that + * tries to place components like in a cloud around the biggest component. Entities + * of different components will not overlap, however the bounding boxes of the components + * may overlap. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + PACKED_CIRCLE, + /** + * Style specification constant describing a component arrangement strategy that + * tries to place components like in a cloud around the biggest component. Entities + * of different components will not overlap, however the bounding boxes of the components + * may overlap. In contrast to {@link yfiles.layout.ComponentArrangementStyles#PACKED_CIRCLE} components might even be placed in empty spaces inside other components. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + PACKED_COMPACT_CIRCLE, + /** + * Style specification constant describing a component arrangement strategy that places components in multiple + * rows. In contrast to {@link yfiles.layout.ComponentArrangementStyles#ROWS}, each row may also be divided into further sub-rows, thus especially + * being advantageous, if there are few very large components and many significantly smaller ones. + * The strategy tries to arrange the components such that the aspect ratio of the final component placement + * gets as close as possible to the aspect ratio of the preferred layout size, configurable + * using {@link yfiles.layout.ComponentLayouter#setPreferredLayoutSize}. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + MULTI_ROWS, + /** + * Style specification constant describing a component arrangement strategy that places components in multiple + * rows. In contrast to {@link yfiles.layout.ComponentArrangementStyles#ROWS}, each row may also be divided into further sub-rows, thus especially + * being advantageous, if there are few very large components and many significantly smaller ones. + * The strategy tries to arrange the components such that the aspect ratio of the final component placement + * gets close to the aspect ratio of the preferred layout size, configurable using + * {@link yfiles.layout.ComponentLayouter#setPreferredLayoutSize}. But in contrast to {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS}, this strategy + * tries not always to come as close to the preferred view ratio, if not necessary, i.e. if a ratio close to the preferred + * ratio only induces a lot of unused view space. This unused space will be minimized. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + MULTI_ROWS_COMPACT, + /** + * Style specification constant describing a component arrangement strategy. + * It uses the same core strategy as {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS}, but under the restriction that the resulting + * height does not exceed the preferred height ({@link yfiles.layout.ComponentLayouter#preferredLayoutSize}). + * Note, that the preferred width and thus the aspect ratio will be ignored. + * In contrast to {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_HEIGHT_CONSTRAINT_COMPACT}, the result will be an arrangement which uses as + * much height as possible, even if that means that all components will be arranged in one single column. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + MULTI_ROWS_HEIGHT_CONSTRAINT, + /** + * Style specification constant describing a component arrangement strategy. + * It uses the same core strategy as {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS}, but under the restriction that the resulting + * height does not exceed the preferred height ({@link yfiles.layout.ComponentLayouter#preferredLayoutSize}). + * Note, that the preferred width and thus the aspect ratio will be ignored. In comparison with + * {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_HEIGHT_CONSTRAINT}, the result will be compacted, which means that an arrangement + * with the minimum width such that the height constraint is still fulfilled will be realized. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + MULTI_ROWS_HEIGHT_CONSTRAINT_COMPACT, + /** + * Style specification constant describing a component arrangement strategy. + * It uses the same core strategy as {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS}, but under the restriction that the resulting + * width does not exceed the preferred width ({@link yfiles.layout.ComponentLayouter#preferredLayoutSize}). + * Note, that the preferred height and thus the aspect ratio will be ignored. + * In contrast to {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_WIDTH_CONSTRAINT_COMPACT} the result will be an arrangement which uses as + * much space in width as possible, even if that means that all components will be arranged in a single row. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + MULTI_ROWS_WIDTH_CONSTRAINT, + /** + * Style specification constant describing a component arrangement strategy. + * It uses the same core strategy as {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS}, but under the restriction that the resulting + * width does not exceed the preferred width ({@link yfiles.layout.ComponentLayouter#preferredLayoutSize}). + * Note, that the preferred height and thus the aspect ratio will be ignored. In comparison with + * {@link yfiles.layout.ComponentArrangementStyles#MULTI_ROWS_HEIGHT_CONSTRAINT} the result will be compacted, in order to minimize + * unused view space induced by components that are large in height. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + MULTI_ROWS_WIDTH_CONSTRAINT_COMPACT, + /** + * Use this constant for masking actual styles constants from style modifiers. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + MASK, + /** + * Modifier constant that can be added to normal style constants to indicate that + * the arrangement strategy should take the initial positions of the components + * into account. + * Combining this modifier is supported with the following styles: + * {@link yfiles.layout.ComponentArrangementStyles#SINGLE_ROW}, {@link yfiles.layout.ComponentArrangementStyles#SINGLE_COLUMN}, {@link yfiles.layout.ComponentArrangementStyles#PACKED_RECTANGLE}, + * {@link yfiles.layout.ComponentArrangementStyles#PACKED_COMPACT_RECTANGLE}, {@link yfiles.layout.ComponentArrangementStyles#PACKED_CIRCLE}, and + * {@link yfiles.layout.ComponentArrangementStyles#PACKED_COMPACT_CIRCLE}. + * @see {@link yfiles.layout.ComponentLayouter#style} + */ + MODIFIER_AS_IS, + /** + * Modifier constant that can be added to normal style constants to indicate that + * the arrangement strategy should produce a non-overlapping component layout. + * Combining this modifier is supported with {@link yfiles.layout.ComponentArrangementStyles#NONE}. + *

+ * Note that non-overlapping component layout (in the sense that no elements from + * adjacent components overlap) is inherently supported by the following styles: + * {@link yfiles.layout.ComponentArrangementStyles#PACKED_RECTANGLE}, {@link yfiles.layout.ComponentArrangementStyles#PACKED_COMPACT_RECTANGLE}, {@link yfiles.layout.ComponentArrangementStyles#PACKED_CIRCLE}, + * and {@link yfiles.layout.ComponentArrangementStyles#PACKED_COMPACT_CIRCLE}. + *

+ * @see {@link yfiles.layout.ComponentLayouter#style} + */ + MODIFIER_NO_OVERLAP + } + /** + * A node label model that allows placement of labels at a fixed offset relative + * to the node's upper-left corner. + */ + export interface FreeNodeLabelLayoutModel extends Object,yfiles.layout.INodeLabelModel{ + /** + * A model parameter that encodes the default position of this model's + * allowed node label positions. + *

+ * The offset is set to a default value of -20 pixel for both directions, i.e., + * the node label's upper-left corner is placed 20 pixel to the left and 20 + * pixel above the node. + *

+ * @see Specified by {@link yfiles.layout.INodeLabelModel#defaultParameter}. + */ + defaultParameter:Object; + /** + * Returns the oriented label position and bounds encoded by the given model + * parameter. + * @param {yfiles.algorithms.YDimension} labelSize The size of the label that should be placed. + * @param {yfiles.layout.INodeLayout} nodeLayout The layout of the node to which the label belongs. + * @param {Object} param + * The model parameter that describes the abstract position of + * the label within this model. The parameter must have been generated by + * this model. + * @return {yfiles.algorithms.YOrientedRectangle} the oriented label position and bounds. + * @see Specified by {@link yfiles.layout.INodeLabelModel#getLabelPlacement}. + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Returns a list of candidate positions for the given node label. + * The list consists of exactly one position. + * @see Specified by {@link yfiles.layout.INodeLabelModel#getLabelCandidates}. + */ + getLabelCandidates(nl:yfiles.layout.INodeLabelLayout,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * Creates a model parameter that represents the given node label context best + * within this model. + * The created model parameter represents the closest parameter representation + * of the given oriented label bounds that can be achieved within this model. + * @param {yfiles.algorithms.YOrientedRectangle} labelBounds The bounds of the label for which a parameter representation is sought. + * @param {yfiles.layout.INodeLayout} nodeLayout The layout of the node to which the label belongs. + * @return {Object} + * A model parameter that can be passed to the + * {@link yfiles.layout.INodeLabelModel#getLabelPlacement} method. + * @see Specified by {@link yfiles.layout.INodeLabelModel#createModelParameter}. + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,nodeLayout:yfiles.layout.INodeLayout):Object; + } + export module FreeNodeLabelLayoutModel{ + /** + * The model parameter that encodes a node label position within FreeNodeLabelModel. + * Holds the offset of a node label's upper-left corner relative to its node's + * upper-left corner. + */ + export interface ModelParameter extends Object{ + /** + * The offset of this ModelParameter. + */ + point:yfiles.algorithms.YPoint; + /** + * Sets the node label's offset. + */ + setPoint(dx:number,dy:number):void; + } + } + var FreeNodeLabelLayoutModel:{ + $class:yfiles.lang.Class; + /** + * Returns a new instance of FreeNodeLabelModel. + */ + new ():yfiles.layout.FreeNodeLabelLayoutModel; + ModelParameter:{ + $class:yfiles.lang.Class; + /** + * Returns a new instance of ModelParameter. + * It has no offset, i.e., the upper-left corners of both node label and node + * are at the same location. + */ + new ():yfiles.layout.FreeNodeLabelLayoutModel; + /** + * Returns a new instance of ModelParameter with the given offset. + */ + WithOffset:{ + new (dx:number,dy:number):yfiles.layout.FreeNodeLabelLayoutModel; + }; + }; + }; + export enum LabelPlacements{ + /** + * Preferred placement specifier for edge labels. + * Expresses that the label should be placed near the source + * node of an edge. + */ + AT_SOURCE, + /** + * Preferred placement specifier for edge labels. + * Expresses that the label should be placed near the target + * node of an edge. + */ + AT_TARGET, + /** + * Preferred placement specifier for edge labels. + * Expresses that the label should be placed near the center + * of the edge path. + */ + AT_CENTER, + /** + * Placement specifier mask. Masks all placement specifiers that are not one of + * {@link yfiles.layout.LabelPlacements#AT_TARGET}, {@link yfiles.layout.LabelPlacements#AT_SOURCE}, or {@link yfiles.layout.LabelPlacements#AT_CENTER}. + */ + ALONG_EDGE_MASK, + /** + * Preferred placement specifier for edge labels. + * Expresses that the label should be placed on the path of the edge. + */ + ON_EDGE, + /** + * Preferred placement specifier for edge labels. + * Expresses that the label should be placed on the left hand side of the edge + * path if looking from the source node into the direction of the target node. + */ + LEFT_OF_EDGE, + /** + * Preferred placement specifier for edge labels. + * Expresses that the label should be placed on the right hand side of the edge + * path if looking from the source node into the direction of the target node. + */ + RIGHT_OF_EDGE, + /** + * Placement specifier mask. Masks all placement specifiers that are not one of + * {@link yfiles.layout.LabelPlacements#ON_EDGE}, {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE}, or {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE}. + */ + ON_SIDE_OF_EDGE_MASK, + /** + * Preferred placement specifier for edge labels. + * Expresses that the label can be placed anywhere along the edge or on any side of the edge. + */ + ANYWHERE + } + export enum FixPointPolicy{ + /** + * Fix point calculation policy that results in the center of a given + * rectangle to be considered the fix point. + */ + CENTER, + /** + * Fix point calculation policy that results in the upper left corner of a + * given rectangle to be considered the fix point. + */ + UPPER_LEFT, + /** + * Fix point calculation policy that results in the upper right corner of a + * given rectangle to be considered the fix point. + */ + UPPER_RIGHT, + /** + * Fix point calculation policy that results in the lower right corner of a + * given rectangle to be considered the fix point. + */ + LOWER_RIGHT, + /** + * Fix point calculation policy that results in the lower left corner of a + * given rectangle to be considered the fix point. + */ + LOWER_LEFT + } + export enum DiscreteNodeLabelPosition{ + /** + * Symbolic position specifier. Places the label north of the node. + */ + NORTH, + /** + * Symbolic position specifier. Places the label north-west of the node. + */ + NORTH_WEST, + /** + * Symbolic position specifier. Places the label north-east of the node. + */ + NORTH_EAST, + /** + * Symbolic position specifier. Places the label east of the node. + */ + EAST, + /** + * Symbolic position specifier. Places the label west of the node. + */ + WEST, + /** + * Symbolic position specifier. Places the label south of the node. + */ + SOUTH, + /** + * Symbolic position specifier. Places the label south-west of the node. + */ + SOUTH_WEST, + /** + * Symbolic position specifier. Places the label south-east of the node. + */ + SOUTH_EAST, + /** + * Symbolic position specifier. Places the label in the center of the node. + */ + CENTER, + /** + * Symbolic position specifier. Places the label at the bottom inside of the node. + */ + BOTTOM, + /** + * Symbolic position specifier. Places the label at the top inside of the node. + */ + TOP, + /** + * Symbolic position specifier. Places the label at the left inside of the node. + */ + LEFT, + /** + * Symbolic position specifier. Places the label at the right inside of the node. + */ + RIGHT, + /** + * Symbolic position specifier. Places the label at the top-left inside of the node. + */ + TOP_LEFT, + /** + * Symbolic position specifier. Places the label at the top-right inside of the node. + */ + TOP_RIGHT, + /** + * Symbolic position specifier. Places the label at the bottom-left inside of the node. + */ + BOTTOM_LEFT, + /** + * Symbolic position specifier. Places the label at the bottom-right inside of the node. + */ + BOTTOM_RIGHT, + /** + * Position mask that constrains the positions to + * {@link yfiles.layout.DiscreteNodeLabelPosition#NORTH} and {@link yfiles.layout.DiscreteNodeLabelPosition#SOUTH}. + */ + SANDWICH_MASK, + /** + * Position mask that allows only the nine node-internal positions. + */ + INTERNAL_MASK, + /** + * Position mask that constrains the positions to + * {@link yfiles.layout.DiscreteNodeLabelPosition#EAST}, {@link yfiles.layout.DiscreteNodeLabelPosition#WEST}, {@link yfiles.layout.DiscreteNodeLabelPosition#NORTH}, and {@link yfiles.layout.DiscreteNodeLabelPosition#SOUTH}. + */ + SIDES_MASK, + /** + * Position mask that constrains the positions to + * {@link yfiles.layout.DiscreteNodeLabelPosition#NORTH_EAST}, {@link yfiles.layout.DiscreteNodeLabelPosition#NORTH_WEST}, {@link yfiles.layout.DiscreteNodeLabelPosition#SOUTH_EAST}, and {@link yfiles.layout.DiscreteNodeLabelPosition#SOUTH_WEST}. + */ + CORNER_MASK, + /** + * Position mask that allows only the eight node-external positions. + */ + EIGHT_POS_MASK + } + /** + * Helper for layouter with integrated edge labeling to support orientation and mirroring. + *

+ * To calculate the position and orientation of edge labels, whose placements are defined with the + * {@link yfiles.layout.PreferredPlacementDescriptor}, the {@link yfiles.layout.OrientationLayouter} would need the direction of the associated + * edge. Since this direction is not available for the OrientationLayouter, because it is a wrapper, the + * calculation must be done in the core layouter itself with the help of the EdgeLabelOrientationSupport. + *

+ *

+ * Important: Since all layouters with integrated edge labeling could not deal with ambiguous preferred placement + * descriptors (combinations of the same setting e.g. source or target for the + * {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge}), + * {@link yfiles.layout.EdgeLabelOrientationSupport#preProcessLabel} removes combinations and replaces the original + * descriptor with a "non-ambiguous" one during the layout calculation. + *

+ */ + export interface EdgeLabelOrientationSupport extends Object{ + /** + * Replaces the {@link yfiles.layout.PreferredPlacementDescriptor}s of all edge labels in the given graph with non-ambiguous + * descriptors. + *

+ * It should be called by a layouter at the beginning of layout calculation to assure that the label's placement + * is handled consistently. + *

+ */ + replaceAmbiguousLabelDescriptors(graph:yfiles.algorithms.Graph):void; + /** + * Restores the {@link yfiles.layout.PreferredPlacementDescriptor}s of all edge labels in the given graph with their original + * descriptors. + *

+ * It should be called by a layouter at the end of layout calculation to assure that the original state of the + * graph is not corrupted. + *

+ */ + resetAmbiguousLabelDescriptors(graph:yfiles.algorithms.Graph):void; + /** + * Called by the core layouter with the integrated edge labeling for each edge label before the layouter uses the + * labels geometry. + * The method should be called as soon as the direction of the segment the label belongs to is + * determined. + *

+ * First it replaces the {@link yfiles.layout.LabelLayoutData#preferredPlacementDescriptor} of the edge label by a + * PreferredPlacementDescriptor that has only relative references. This descriptor is orientation + * independent and could be used in the core layouter. Second it rotates the + * {@link yfiles.layout.LabelLayoutData#bounds label} in respect of it PreferredPlacementDescriptor and + * the direction of the segment it belongs to. After that call the core layouter could use the geometry + * ({@link yfiles.layout.LabelLayoutData#width} and {@link yfiles.layout.LabelLayoutData#width}) of the label to + * calculate its location. + *

+ * @param {yfiles.algorithms.Graph} graph graph to get the orientation information from + * @param {yfiles.layout.LabelLayoutData} label edge label whose segment direction is determined + * @param {yfiles.layout.Direction} segmentDirection direction of the segment the edge label belongs to + */ + preProcessLabel(graph:yfiles.algorithms.Graph,label:yfiles.layout.LabelLayoutData,segmentDirection:yfiles.layout.Direction):void; + /** + * Called by the core layouter with the integrated edge labeling for each edge label after the location of the label + * is determined. + *

+ * It restores the original {@link yfiles.layout.LabelLayoutData#preferredPlacementDescriptor} that has been replaced + * in {@link yfiles.layout.EdgeLabelOrientationSupport#preProcessLabel}. Then it move and rotates the + * {@link yfiles.layout.LabelLayoutData#bounds label} in respect of the orientation. + *

+ * @param {yfiles.algorithms.Graph} graph graph to get the orientation information from + * @param {yfiles.layout.LabelLayoutData} label edge label whose location is determined + */ + postProcessLabel(graph:yfiles.algorithms.Graph,label:yfiles.layout.LabelLayoutData):void; + } + var EdgeLabelOrientationSupport:{ + $class:yfiles.lang.Class; + /** + * Creates an instance. + * Since this class handles the orientation of the edge labels, the core layouter should switch + * the calculation in its {@link yfiles.layout.OrientationLayouter} off. + */ + new ():yfiles.layout.EdgeLabelOrientationSupport; + /** + * Transforms a direction of the layout to the oriented layout. + * @param {yfiles.layout.Direction} direction direction in the layout + * @param {number} orientation + * @param {number} mirrorMask @return the direction in the oriented layout + */ + getOrientedDirection(direction:yfiles.layout.Direction,orientation:number,mirrorMask:number):yfiles.layout.Direction; + /** + * Returns whether or not the orientation is mirrored. + * @return {boolean} true if the orientation is mirrored; false otherwise + * @param {number} orientation + * @param {number} mirrorMask + */ + isOrientationMirrored(orientation:number,mirrorMask:number):boolean; + /** + * Calculates and sets the up vector of an edge label considering the preferred placement of the label as well as the + * direction of the edge segment the label is attached to. + * @param {yfiles.layout.LabelLayoutData} label The data that describes the label orientation and is used to set the new up vector. + * @param {yfiles.layout.Direction} segmentDirection The direction the edge segment is pointing to. + * @see {@link yfiles.layout.EdgeLabelOrientationSupport#getEdgeLabelUpVector} + */ + updateLabelOrientation(label:yfiles.layout.LabelLayoutData,segmentDirection:yfiles.layout.Direction):void; + /** + * Calculates the up vector of an edge label considering the preferred placement of the label as well as the direction + * of the edge segment the label is attached to. + * @param {yfiles.layout.PreferredPlacementDescriptor} descriptor The data describing the preferred label orientation. + * @param {yfiles.layout.Direction} segmentDirection The direction the edge segment is pointing to. + * @return {yfiles.algorithms.YVector} + * An up vector for the edge label that considers the preferred placement of the label as well as the + * direction of the edge segment the label is attached to. + */ + getEdgeLabelUpVector(descriptor:yfiles.layout.PreferredPlacementDescriptor,segmentDirection:yfiles.layout.Direction):yfiles.algorithms.YVector; + /** + * Calculates the up vector for a label whose right vector is rotated clockwise by the given rightVectorAngle. + * @param {number} rightVectorAngle The angle in radians the right vector is rotated by. + * @return {yfiles.algorithms.YVector} The up vector for a label whose right vector is rotated clockwise by the given angle. + */ + getLabelUpVector(rightVectorAngle:number):yfiles.algorithms.YVector; + }; + /** + * This class is an default implementation of the EdgeLabelLayout + * interface. + */ + export interface EdgeLabelLayoutImpl extends yfiles.layout.LabelLayoutImpl,yfiles.layout.IEdgeLabelLayout{ + /** + * The edge label model associated with this label layout. + * @see Specified by {@link yfiles.layout.IEdgeLabelLayout#labelModel}. + */ + labelModel:yfiles.layout.IEdgeLabelModel; + /** + * The edge label model associated with this label layout. + */ + edgeLabelModel:yfiles.layout.IEdgeLabelModel; + /** + * The preferred placement of this label. + */ + preferredPlacement:yfiles.layout.LabelPlacements; + /** + * The preferred placement of this label. + * @throws {yfiles.system.ArgumentException} + * if the specified descriptor is + * null. + * @see Specified by {@link yfiles.layout.IEdgeLabelLayout#preferredPlacementDescriptor}. + */ + preferredPlacementDescriptor:yfiles.layout.PreferredPlacementDescriptor; + } + var EdgeLabelLayoutImpl:{ + $class:yfiles.lang.Class; + /** + * Initializes a new EdgeLabelLayoutImpl instance. + */ + new ():yfiles.layout.EdgeLabelLayoutImpl; + }; + /** + * A candidate position for edge labels. + */ + export interface EdgeLabelCandidate extends yfiles.layout.LabelCandidate{ + } + var EdgeLabelCandidate:{ + $class:yfiles.lang.Class; + /** + * Returns a new instance of LabelCandidate. + * @param {yfiles.algorithms.YPoint} pos + * the location of the upper + * left corner of the candidate. + * @param {yfiles.algorithms.YDimension} size the size of the candidate. + * @param {Object} param + * the parameters of the labeling model + * associated with this candidate. + * @param {yfiles.layout.IEdgeLabelLayout} owner the label associated to the candidate. + */ + FromPointAndSize:{ + new (pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.IEdgeLabelLayout):yfiles.layout.EdgeLabelCandidate; + }; + /** + * Returns a new instance of EdgeLabelCandidate. + * @param {yfiles.algorithms.YPoint} pos + * the location of the upper + * left corner of the candidate. + * @param {yfiles.algorithms.YDimension} size the size of the candidate. + * @param {Object} param + * the parameters of the labeling model + * associated with this candidate. + * @param {yfiles.layout.IEdgeLabelLayout} owner the label associated to the candidate. + * @param {boolean} internal + * flag whether the candidate is + * allowed to overlap the layout of the associated edge. + */ + FromPointAndSizeCanOverlap:{ + new (pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.IEdgeLabelLayout,internal:boolean):yfiles.layout.EdgeLabelCandidate; + }; + /** + * Returns a new instance of EdgeLabelCandidate. + * @param {yfiles.algorithms.YOrientedRectangle} orientedBox the box that specifies the candidate's size and position. + * @param {Object} param + * the parameters of the labeling model + * associated with this candidate. + * @param {yfiles.layout.IEdgeLabelLayout} owner the label associated to the candidate. + * @param {boolean} internal + * flag whether the candidate is + * allowed to overlap the layout of the associated edge. + */ + new (orientedBox:yfiles.algorithms.YOrientedRectangle,param:Object,owner:yfiles.layout.IEdgeLabelLayout,internal:boolean):yfiles.layout.EdgeLabelCandidate; + /** + * Returns a new instance of EdgeLabelCandidate. + * @param {yfiles.algorithms.YOrientedRectangle} orientedBox the box that specifies the candidate's size and position. + * @param {Object} param + * the parameters of the labeling model + * associated with this candidate. + * @param {yfiles.layout.IEdgeLabelLayout} owner the label associated to the candidate. + */ + FromRectangle:{ + new (orientedBox:yfiles.algorithms.YOrientedRectangle,param:Object,owner:yfiles.layout.IEdgeLabelLayout):yfiles.layout.EdgeLabelCandidate; + }; + }; + /** + * An edge label model that allows placement of labels + * at a fixed offset from the source intersection point of the node. + */ + export interface FreeEdgeLabelLayoutModel extends Object,yfiles.layout.IEdgeLabelModel{ + /** + * The default parameter. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#defaultParameter}. + */ + defaultParameter:Object; + /** + * Returns a model parameter that represents the given edge label + * context. + * The created model parameter reproduces the location + * of the given label bounds. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#createModelParameter}. + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):Object; + /** + * Returns the positions of the upper left corner of the label + * with given parameter. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#getLabelPlacement}. + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Returns exactly one label candidate that corresponds to + * the actual label layout of the given label. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#getLabelCandidates}. + */ + getLabelCandidates(label:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + } + export module FreeEdgeLabelLayoutModel{ + /** + * The model parameters for the FreeEdgeLabelModel. + */ + export interface ModelParameter extends Object{ + /** + * The rotation angle of the label defined by this label position. + */ + angle:number; + /** + * A point whose x-coordinate corresponds to the radius associated with this + * class and whose y-coordinate corresponds to the angle associated with this class. + */ + point:yfiles.algorithms.YPoint; + /** + * Sets angle and radius for this class. + * The x-coordinate of the given point + * holds the radius, the y-coordinate the angle. + */ + setPoint(radius:number,theta:number):void; + toString():string; + } + } + var FreeEdgeLabelLayoutModel:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of {@link yfiles.layout.FreeEdgeLabelLayoutModel}. + */ + new ():yfiles.layout.FreeEdgeLabelLayoutModel; + ModelParameter:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of {@link yfiles.layout.FreeEdgeLabelLayoutModel.ModelParameter} with radius 50 + * and angle 0. + */ + new ():yfiles.layout.FreeEdgeLabelLayoutModel; + /** + * Creates a new instance of {@link yfiles.layout.FreeEdgeLabelLayoutModel.ModelParameter} with given radius and angle. + * @param {number} radius the distance of the label from the source node of the underlying edge + * @param {number} theta + * the angle between the first segment of the underlying edge and the imaginary line to the center of + * the label. the angle is measured in radian. + */ + WithRadiusAndAngle:{ + new (radius:number,theta:number):yfiles.layout.FreeEdgeLabelLayoutModel; + }; + /** + * Creates a new instance of {@link yfiles.layout.FreeEdgeLabelLayoutModel.ModelParameter} with given radius and angle. + * @param {number} radius the distance of the label from the source node of the underlying edge + * @param {number} theta + * the angle between the first segment of the underlying edge and the + * imaginary line to the center of the label. the angle is measured in radian. + * @param {number} angle the rotation angle of the label. + */ + WithRadiusAndAngleAndRotation:{ + new (radius:number,theta:number,angle:number):yfiles.layout.FreeEdgeLabelLayoutModel; + }; + }; + }; + /** + * Layout stage that can be used to fix the position of either a single + * node or the alignment of the bounding box of several nodes (but not the + * positions of the individual nodes). + */ + export interface FixNodeLayoutStage extends yfiles.layout.AbstractLayoutStage{ + /** + * The fix point calculation policy used in + * {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint} to determine which + * point in the corresponding rectangle should be considered fixed. + *

+ * By default, {@link yfiles.layout.FixPointPolicy#CENTER} is used. + *

+ * @see {@link yfiles.layout.FixPointPolicy#CENTER} + * @see {@link yfiles.layout.FixPointPolicy#UPPER_LEFT} + * @see {@link yfiles.layout.FixPointPolicy#UPPER_RIGHT} + * @see {@link yfiles.layout.FixPointPolicy#LOWER_RIGHT} + * @see {@link yfiles.layout.FixPointPolicy#LOWER_LEFT} + */ + fixPointPolicy:yfiles.layout.FixPointPolicy; + /** + * Determines whether or not subgraph edges should be taken into account + * when calculating the bounding box of the fixed nodes. + *

+ * By default, this property is set to false, i.e. subgraph + * edges are not taken into account. + *

+ * @see {@link yfiles.layout.FixNodeLayoutStage#calculateBounds} + * @see {@link yfiles.layout.FixNodeLayoutStage#calculateBounds} + */ + includingEdges:boolean; + /** + * Determines whether or not label geometries should be taken into account + * when calculating the bounding box of the fixed nodes. + *

+ * By default, this property is set to false, i.e. label + * geometries are not taken into account. + *

+ * @see {@link yfiles.layout.FixNodeLayoutStage#calculateBounds} + * @see {@link yfiles.layout.FixNodeLayoutStage#calculateBounds} + */ + includingLabels:boolean; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Calculates the fix point for the specified nodes in the specified graph. + * The default implementation calls + * {@link yfiles.layout.FixNodeLayoutStage#calculateBounds} and + * {@link yfiles.layout.FixNodeLayoutStage#calculateFixPoint}. + * @param {yfiles.layout.LayoutGraph} graph the graph associated to the specified nodes. + * @param {yfiles.algorithms.NodeList} fixed the list of nodes for which a fix point has to be determined. + * @return {yfiles.algorithms.YPoint} the fix point for the specified nodes in the specified graph. + */ + calculateFixPointForNodes(graph:yfiles.layout.LayoutGraph,fixed:yfiles.algorithms.NodeList):yfiles.algorithms.YPoint; + /** + * Calculates the fix point of the specified rectangle according to the policy + * returned by {@link yfiles.layout.FixNodeLayoutStage#fixPointPolicy}. + * If the specified rectangle is null or the rectangle has + * negative width or negative height, + * null will be returned. + * @param {yfiles.algorithms.Rectangle2D} bounds the rectangle for which to determine the fix point. + * @return {yfiles.algorithms.YPoint} + * the fix point of the specified rectangle or null if + * nothing should be fixed. + * @see {@link yfiles.layout.FixNodeLayoutStage#fixPointPolicy} + */ + calculateFixPoint(bounds:yfiles.algorithms.Rectangle2D):yfiles.algorithms.YPoint; + /** + * Calculates the bounding box of the specified nodes. + * The return values of methods {@link yfiles.layout.FixNodeLayoutStage#includingEdges} and + * {@link yfiles.layout.FixNodeLayoutStage#includingLabels} determine whether or not edges and labels + * are taken into account when calculating the box. + * @param {yfiles.layout.LayoutGraph} graph the graph associated to the specified nodes. + * @param {yfiles.algorithms.NodeList} fixed the list of nodes that determine the bounding box. + * @return {yfiles.algorithms.Rectangle2D} the bounding box of the specified nodes. + * @see {@link yfiles.layout.FixNodeLayoutStage#includingEdges} + * @see {@link yfiles.layout.FixNodeLayoutStage#includingLabels} + */ + calculateBounds(graph:yfiles.layout.LayoutGraph,fixed:yfiles.algorithms.NodeList):yfiles.algorithms.Rectangle2D; + } + var FixNodeLayoutStage:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key to specify a DataProvider + * whose {@link yfiles.algorithms.IDataProvider#getBool} method is used to + * determine which nodes should be considered fixed. + */ + FIXED_NODE_DP_KEY:Object; + /** + * Initializes a new FixNodeLayoutStage. + */ + new ():yfiles.layout.FixNodeLayoutStage; + /** + * Initializes a new FixNodeLayoutStage. + * @param {yfiles.layout.ILayouter} core the core layout algorithm for this stage. + */ + WithCoreLayouter:{ + new (core:yfiles.layout.ILayouter):yfiles.layout.FixNodeLayoutStage; + }; + }; + /** + * A layout stage that can be used to (selectively) reverse edges in a + * graph while keeping the layout and label positions of the reversed edges + * as close to the pre-reversal layout and positions as possible. + */ + export interface EdgeReversalStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Reverses selected edges in the specified graph. + * An edge is considered selected in this context according to the + * criteria described for {@link yfiles.layout.EdgeReversalStage#REVERSE_EDGES_DP_KEY}. + *

+ * Implementation detail: This method calls + * {@link yfiles.layout.EdgeReversalStage#reverseEdge} in order to reverse a + * selected edge. + *

+ * @param {yfiles.layout.LayoutGraph} graph the graph in which to reverse edges. + * @see {@link yfiles.layout.EdgeReversalStage#REVERSE_EDGES_DP_KEY} + */ + reverseEdges(graph:yfiles.layout.LayoutGraph):void; + /** + * Reverse the specified edge in the specified graph. + * The layout of the specified edge is reversed as specified in + * {@link yfiles.layout.LayoutTool#reverseEdgeLayout}. + * Moreover, the positions of all labels associated to the specified edge + * are adjusted to match the pre-reversal position as closely as possible. + * (Depending on a label's model it might not always be possible to achieve + * an exact match.) + * @param {yfiles.layout.LayoutGraph} graph the graph to which the specified edge belongs. + * @param {yfiles.algorithms.Edge} edge the edge to be reversed. + */ + reverseEdge(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; + } + var EdgeReversalStage:{ + $class:yfiles.lang.Class; + /** + * This key can be used to select specific edges for reversal. + * An edge is considered selected in this context, if the + * corresponding DataProvider returns true for + * said edge. + *

+ * Note: + * If there is no DataProvider for this key, all edges are + * considered selected. + *

+ */ + REVERSE_EDGES_DP_KEY:Object; + new ():yfiles.layout.EdgeReversalStage; + WithCoreLayouter:{ + new (core:yfiles.layout.ILayouter):yfiles.layout.EdgeReversalStage; + }; + /** + * Marks edges in a tree-structured graph component that need to be reversed + * to make the specified node the root of the tree component. + * Only edges in the graph component to which the specified node belongs will + * be marked. + * Edges are marked with a boolean true flag. + * @param {yfiles.layout.LayoutGraph} graph the graph to which the specified node belongs. + * @param {yfiles.algorithms.Node} root the node to be considered the root of its tree component. + * @param {yfiles.algorithms.IDataAcceptor} reversedEdges + * a data acceptor that is used to mark edges for + * reversal. + * @see {@link yfiles.layout.EdgeReversalStage#REVERSE_EDGES_DP_KEY} + * @throws {yfiles.system.ArgumentException} + * if the specified node does not belong to + * the specified graph. + */ + findReversedTreeEdges(graph:yfiles.layout.LayoutGraph,root:yfiles.algorithms.Node,reversedEdges:yfiles.algorithms.IDataAcceptor):void; + }; + /** + * A layout stage that can be used to "line-wrap" or "column-wrap" a graph layout. + * This stage both supports wrapping a layout at a given width (height) or wrapping + * the layout at a specific width (height) automatically so that the overall resulting + * aspect ratio will be close to a specifiable value. + * @see {@link yfiles.layout.GraphLayoutLineWrapper#fixedWidthLineBreaks} + * @see {@link yfiles.layout.GraphLayoutLineWrapper#fixedWidth} + * @see {@link yfiles.layout.GraphLayoutLineWrapper#targetRatio} + * @see {@link yfiles.layout.GraphLayoutLineWrapper#columnMode} + */ + export interface GraphLayoutLineWrapper extends yfiles.layout.AbstractLayoutStage{ + /** + * The space between edges that should be used for the additional routing. + * The default is 5. + */ + edgeSpacing:number; + /** + * Determines whether this algorithm should not wrap lines or rows, but columns. + * If set to true, the layout will be wrapped vertically and new columns will + * be appended to the right of the first column. + * The {@link yfiles.layout.GraphLayoutLineWrapper#fixedWidth} property will be interpreted as a fixed height, in that case, of course. + * The default is false. + */ + columnMode:boolean; + /** + * The space between adjacent lines of the wrapped graph layout. + * The default is 10. + */ + spacing:number; + /** + * Specifies whether lines should be going from left to right and right to left + * in an alternating fashion. + * If set to true every second line will be rotated 180 degrees and + * ports will be adjusted correspondingly. + * The default is true + */ + mirror:boolean; + /** + * Specifies whether the algorithm should use the{@link yfiles.layout.GraphLayoutLineWrapper#fixedWidth fixed width} + * to determine line breaks. + * The default is false. + * @see {@link yfiles.layout.GraphLayoutLineWrapper#fixedWidth} + * @see {@link yfiles.layout.GraphLayoutLineWrapper#targetRatio} + * @see {@link yfiles.layout.GraphLayoutLineWrapper#fixedWidth} + * @see {@link yfiles.layout.GraphLayoutLineWrapper#targetRatio} + */ + fixedWidthLineBreaks:boolean; + /** + * The desired target aspect ratio the algorithm should try to generate. + * This setting only affects the outcome if {@link yfiles.layout.GraphLayoutLineWrapper#fixedWidthLineBreaks} + * is set to false. + * The default is 1.0d. + */ + targetRatio:number; + /** + * The desired width of the lines to use if{@link yfiles.layout.GraphLayoutLineWrapper#fixedWidthLineBreaks} is set to + * true. + * Note that the algorithm will not necessarily be able to satisfy very small values since the nodes need to + * fit into a line completely. + *

+ * The default is 500 + *

+ * @see {@link yfiles.layout.GraphLayoutLineWrapper#fixedWidthLineBreaks} + * @see {@link yfiles.layout.GraphLayoutLineWrapper#fixedWidthLineBreaks} + */ + fixedWidth:number; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var GraphLayoutLineWrapper:{ + $class:yfiles.lang.Class; + new ():yfiles.layout.GraphLayoutLineWrapper; + }; + /** + * Layout stage that can be used to normalize the order of the elements within a graph. + * Amongst other factors, + * the results produced by layout algorithms usually depend on the order of the nodes and edges within a graph. + * Unfortunately, useful operations such as hiding or unhiding elements from a graph or + * simply invoking layout algorithms on a graph will have the potential side effect of changing that order. + * With this layout stage it is possible to establish a predefined order of nodes and edges within a graph to + * avoid non-deterministic layout behavior. Defining the order of nodes and edges is done by + * associating each node or edge in the graph with a Comparable value using DataProviders + * registered with the key {@link yfiles.layout.NormalizingGraphElementOrderStage#COMPARABLE_NODE_DP_KEY}, or {@link yfiles.layout.NormalizingGraphElementOrderStage#COMPARABLE_EDGE_DP_KEY} respectively. + * the DataProvider key + */ + export interface NormalizingGraphElementOrderStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var NormalizingGraphElementOrderStage:{ + $class:yfiles.lang.Class; + /** + * The DataProvider registered with this key must return a + * {@link yfiles.lang.IObjectComparable} object for each node thereby inducing a (global) order + * for nodes. + */ + COMPARABLE_NODE_DP_KEY:Object; + /** + * The DataProvider registered with this key must return a + * {@link yfiles.lang.IObjectComparable} object for each edge thereby inducing a (global) order + * for edges. + */ + COMPARABLE_EDGE_DP_KEY:Object; + new ():yfiles.layout.NormalizingGraphElementOrderStage; + WithCoreLayouter:{ + new (coreLayouter:yfiles.layout.ILayouter):yfiles.layout.NormalizingGraphElementOrderStage; + }; + /** + * Convenience method that assigns comparable values for each node and edge. + * The compared values + * are induced from the current ordering of the nodes and edges within the given graph. + */ + fillComparableMapFromGraph(graph:yfiles.algorithms.Graph,comparableNodeMap:yfiles.algorithms.IDataMap,comparableEdgeMap:yfiles.algorithms.IDataMap):void; + }; + /** + * This layout stage enforces a given minimum width/height of the nodes of a graph during the layout process. + * Therefore it temporarily enlarges nodes whose width/height fall below the specified minimum values. + */ + export interface MinNodeSizeStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var MinNodeSizeStage:{ + $class:yfiles.lang.Class; + /** + * Instantiates a new MinNodeSizeStage that wraps the given core layouter. + * @param {yfiles.layout.ILayouter} core The core layouter. + * @param {number} minWidth The minimum width of nodes that should be enforced. + * @param {number} minHeight The minimum height of nodes that should be enforced. + */ + ForSize:{ + new (core:yfiles.layout.ILayouter,minWidth:number,minHeight:number):yfiles.layout.MinNodeSizeStage; + }; + /** + * Instantiates a new MinNodeSizeStage that wraps the given core layouter. + * The minimum width/height of nodes is set to 1. + * @param {yfiles.layout.ILayouter} core The core layouter. + */ + new (core:yfiles.layout.ILayouter):yfiles.layout.MinNodeSizeStage; + }; + /** + * A composite layout stage that allows to express a layout stage + * as a chain of more basic layout stages. + */ + export interface CompositeLayoutStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Prepends a stage to this composite layout stage. + * Stages added with this method + * will be invoked before any other stages will be invoked. + */ + prependStage(stage:yfiles.layout.ILayoutStage):void; + /** + * The chain of layout stages that make up this composite layout stage. + */ + layoutStages:yfiles.algorithms.IList; + /** + * Appends a stage to the layout pipeline. + * Stages added with this method will be + * invoked just before the core layouter of the composite layout stage will be invoked. + */ + appendStage(stage:yfiles.layout.ILayoutStage):void; + /** + * Returns true. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#canLayout} + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Assigns a new graph layout to the given layout graph. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var CompositeLayoutStage:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of CompositeLayoutStage. + */ + new ():yfiles.layout.CompositeLayoutStage; + /** + * Creates a new instance of CompositeLayoutStage. + */ + FromOuterAndInnerStage:{ + new (outerStage:yfiles.layout.ILayoutStage,innerStage:yfiles.layout.ILayoutStage):yfiles.layout.CompositeLayoutStage; + }; + }; + /** + * This class is the default implementation for the NodeLabelLayout. + */ + export interface DefaultNodeLabelLayout extends Object,yfiles.layout.INodeLabelLayout{ + /** + * The bounding box of the label. + * @see Specified by {@link yfiles.layout.ILabelLayout#box}. + */ + box:yfiles.algorithms.YRectangle; + /** + * The box of the label. + * @see Specified by {@link yfiles.layout.ILabelLayout#orientedBox}. + */ + orientedBox:yfiles.algorithms.YOrientedRectangle; + /** + * The node label model associated with this label layout. + * @see Specified by {@link yfiles.layout.INodeLabelLayout#labelModel}. + */ + labelModel:yfiles.layout.INodeLabelModel; + /** + * The NodeLabelModel parameter that describes the position of the label layout. + * @see Specified by {@link yfiles.layout.ILabelLayout#modelParameter}. + */ + modelParameter:Object; + /** + * The node associated with this layout. + */ + node:yfiles.algorithms.Node; + } + var DefaultNodeLabelLayout:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of {@link yfiles.layout.DefaultNodeLabelLayout}. + * @param {yfiles.layout.INodeLabelModel} model the NodeLabel model for this label layout + * @param {Object} param + * the NodeLabelModel parameter that describes the position + * of the label layout. + * @param {yfiles.algorithms.YRectangle} box the bounds of this label layout + */ + FromRectangle:{ + new (model:yfiles.layout.INodeLabelModel,param:Object,box:yfiles.algorithms.YRectangle,node:yfiles.algorithms.Node):yfiles.layout.DefaultNodeLabelLayout; + }; + /** + * Creates a new instance of {@link yfiles.layout.DefaultNodeLabelLayout}. + * @param {yfiles.layout.INodeLabelModel} model the NodeLabel model for this label layout + * @param {Object} param the NodeLabelModel parameter that describes the position of the label layout. + * @param {yfiles.algorithms.YOrientedRectangle} orientedBox the bounds of this label layout + */ + FromOrientedRectangle:{ + new (model:yfiles.layout.INodeLabelModel,param:Object,orientedBox:yfiles.algorithms.YOrientedRectangle,node:yfiles.algorithms.Node):yfiles.layout.DefaultNodeLabelLayout; + }; + }; + /** + * This layout stage replaces bends with dummy nodes, calls the core layout + * algorithm and recreates the bends. + * Note that not all data provider values + * bound to the edges will be automatically adopted be the replacement edges. + * The adopted values must be provided by data providers registered with one of + * the following known keys: + * {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY}, + * {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}, + * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY}, + * {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY}. + */ + export interface BendConverter extends Object,yfiles.layout.ILayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Prepares the graph before calling the core layouter. + */ + prepare(graph:yfiles.layout.LayoutGraph):void; + /** + * Undoes the graph changes performed by {@link yfiles.layout.BendConverter#prepare} after the + * core layouter has finished. + */ + unprepare(graph:yfiles.layout.LayoutGraph):void; + /** + * The core layouter. + * @see Specified by {@link yfiles.layout.ILayoutStage#coreLayouter}. + */ + coreLayouter:yfiles.layout.ILayouter; + /** + * Specifies whether or not the edge group values of the original edge + * should be adopted by its replacement edges. + * The group node values + * are looked up in DataProviders registered with the keys + * {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} and + * {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}. + */ + adoptEdgeGroups:boolean; + /** + * Specifies whether or not the port constraint values of the original edge + * should be adopted by its replacement edges. + * The group node values + * are looked up in DataProviders registered with the keys + * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} and + * {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY}. + */ + adoptPortConstraints:boolean; + /** + * Specifies whether or not the selection state of the original edge + * should be adopted by its replacement edges. + * The selection state + * is looked up in DataProviders registered with the key + * returned by {@link yfiles.layout.BendConverter#selectedEdgesDpKey}. + * @see {@link yfiles.layout.BendConverter#selectedEdgesDpKey} + * @see {@link yfiles.layout.BendConverter#selectedEdgesDpKey} + */ + adoptSelection:boolean; + /** + * Callback method that will be invoked after new elements for the given edge + * have been added to the given graph. + * At this point the original edge is still + * in the graph./ + */ + addedPathForEdge(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge,dummyNodes:yfiles.algorithms.NodeList):void; + /** + * The DataProvider key to identify edges as + * selected. + *

+ * By default, {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY} is used. + *

+ * @see {@link yfiles.layout.BendConverter#adoptSelection} + * @see {@link yfiles.layout.BendConverter#adoptSelection} + * @throws {yfiles.system.ArgumentException} if the specified key is null. + * @see {@link yfiles.layout.BendConverter#adoptSelection} + * @see {@link yfiles.layout.BendConverter#adoptSelection} + */ + selectedEdgesDpKey:Object; + } + var BendConverter:{ + $class:yfiles.lang.Class; + /** + * DataProvider key used to specify the set of edges for which + * this stage will replace bends by nodes. + * If this + * data provider key is being used, then it + * must return for each edge in the input graph a boolean value indicating whether + * or not it should be handled by this layouter. + * If there is no data provider registered with this key, all edges will be handled. + */ + SCOPE_DP_KEY:Object; + /** + * Creates a new instance of BendConverter. + */ + new ():yfiles.layout.BendConverter; + /** + * Creates a new instance of BendConverter using the given size as + * the width and height for the dummy nodes. + */ + WithSize:{ + new (size:number):yfiles.layout.BendConverter; + }; + }; + /** + * A node label model that sets + * the labels at the opposite side of the outgoing edges of a node. + */ + export interface EdgeOppositeNodeLabelLayoutModel extends Object,yfiles.layout.INodeLabelModel{ + /** + * The default position, this is offset (0,0). + * @see Specified by {@link yfiles.layout.INodeLabelModel#defaultParameter}. + */ + defaultParameter:Object; + /** + * Returns the oriented position and bounds for a label of the specified size. + * @param {yfiles.algorithms.YDimension} labelSize the size of the label. + * @param {yfiles.layout.INodeLayout} nodeLayout the geometric description of the labeled node. + * @param {Object} param not used by this model + * @see Specified by {@link yfiles.layout.INodeLabelModel#getLabelPlacement}. + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Creates a model parameter that represents the given node label context best + * within this model. + * The created model parameter represents the closest parameter representation + * of the given oriented label bounds that can be achieved within this model. + * @param {yfiles.algorithms.YOrientedRectangle} labelBounds The bounds of the label for which a parameter representation is sought. + * @param {yfiles.layout.INodeLayout} nodeLayout The layout of the node to which the label belongs. + * @return {Object} + * A model parameter that can be passed to the + * {@link yfiles.layout.INodeLabelModel#getLabelPlacement} method. + * @see Specified by {@link yfiles.layout.INodeLabelModel#createModelParameter}. + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,nodeLayout:yfiles.layout.INodeLayout):Object; + /** + * Returns a list of candidate positions for the label. + * The list consists of exactly one position. + * @see Specified by {@link yfiles.layout.INodeLabelModel#getLabelCandidates}. + */ + getLabelCandidates(nl:yfiles.layout.INodeLabelLayout,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + } + var EdgeOppositeNodeLabelLayoutModel:{ + $class:yfiles.lang.Class; + new (g:yfiles.layout.LayoutGraph,n:yfiles.algorithms.Node):yfiles.layout.EdgeOppositeNodeLabelLayoutModel; + }; + /** + * A layout stage that improves the placement of edge labels. + * This layout stage + * expects that its core layouter calculates initial edge label layout data bound to the + * data provider key {@link yfiles.layout.LabelLayoutKeys#EDGE_LABEL_LAYOUT_DP_KEY}. Next, this stage tries to + * improve the position of the labels with respect to the preferred placement specifier of the + * labels. + * Most commonly, this layout stage is used in conjunction with the integrated edge + * labeling functionality of class {@link yfiles.hierarchic.HierarchicLayouter}. + */ + export interface LabelLayoutDataRefinement extends yfiles.layout.AbstractLayoutStage{ + /** + * The internal labeling algorithm used to improve the + * label positions. + */ + internalLabelingAlgorithm:yfiles.labeling.AbstractLabelingAlgorithm; + /** + * Returns true. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#canLayout} + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Assigns a new graph layout to the given layout graph. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var LabelLayoutDataRefinement:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of LabelLayoutDataImprovement. + */ + new ():yfiles.layout.LabelLayoutDataRefinement; + }; + /** + * This class implements a LayoutStage that can be used to adjust the final port + * assignments after a layout has been calculated. + * This can be useful if the port + * assignment calculated by the layout algorithm is insufficient. This stage uses + * {@link yfiles.algorithms.IDataProvider} instances bound to the graph using the keys defined in + * the {@link yfiles.layout.IIntersectionCalculator} interface to calculate the new port offsets. + * For each edge in the LayoutGraph instance the + * DataProviders are queried for an implementation of the + * {@link yfiles.layout.IIntersectionCalculator} interface. If the result is non-null, + * that implementation will be queried and if the result of the query is + * non-null, the returned point will be applied to the edge layout. + * For this layout stage to work use + * {@link yfiles.layout.CompositeLayoutStage#prependStage} or + * {@link yfiles.layout.CanonicMultiStageLayouter#prependStage} + * to add this layout stage and register appropriate {@link yfiles.algorithms.IDataProvider} + * implementations to the graph using the keys defined in {@link yfiles.layout.IIntersectionCalculator}. + * Note, that this class will not change the coordinates of a port if it is + * associated with a strong port constraint. + * @see {@link yfiles.layout.IIntersectionCalculator} + * @see {@link yfiles.layout.IntersectionCalculatorKeys#SOURCE_INTERSECTION_CALCULATOR_DP_KEY} + * @see {@link yfiles.layout.IntersectionCalculatorKeys#TARGET_INTERSECTION_CALCULATOR_DP_KEY} + * @see {@link yfiles.layout.PortConstraint} + */ + export interface PortCalculator extends yfiles.layout.AbstractLayoutStage,yfiles.layout.ILayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Performs the actual port calculation on the specified graph instance. + */ + calculatePorts(graph:yfiles.layout.LayoutGraph):void; + /** + * EPSILON used by {@link yfiles.layout.PortCalculator#equalsEps}. + * By default this is 0.2d. + */ + eps:number; + /** + * Callback method that determines whether two points are equal. + */ + equalsEps(x1:number,y1:number,x2:number,y2:number):boolean; + } + var PortCalculator:{ + $class:yfiles.lang.Class; + /** + * Creates a new PortCalculator without a core layouter. + */ + new ():yfiles.layout.PortCalculator; + /** + * Creates a new PortCalculator using the given layouter as the core of + * this layout stage. + */ + WithCoreLayouter:{ + new (core:yfiles.layout.ILayouter):yfiles.layout.PortCalculator; + }; + }; + /** + * Partial LayoutStage implementation that handles + * the management of the core layouter part. + */ + export interface AbstractLayoutStage extends Object,yfiles.layout.ILayoutStage{ + /** + * The core layouter. + * @see Specified by {@link yfiles.layout.ILayoutStage#coreLayouter}. + */ + coreLayouter:yfiles.layout.ILayouter; + /** + * Invokes the layout routine of the core layouter. + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * Queries the core layouter whether or not the given graph + * can be laid out. + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var AbstractLayoutStage:{ + $class:yfiles.lang.Class; + /** + * Default constructor. + */ + new ():yfiles.layout.AbstractLayoutStage; + /** + * Initializes this AbstractLayoutStage with the given core Layouter. + */ + WithCoreLayouter:{ + new (core:yfiles.layout.ILayouter):yfiles.layout.AbstractLayoutStage; + }; + }; + /** + * A hull layouter that invokes another layout algorithm on a copy of its input + * graph. + * After the layout process has finished the calculated layout + * will be either written back to the original graph or + * will be provided as a separate graph layout information + * in terms of the original input graph. + * This class also provides the possibility to perform arbitrary + * layout algorithms merely on a graph interface plus associated + * graph layout. This comes in handy if an application has its own + * graph and merely provides an graph interface adapter to the yFiles + * graph layout machinery. + */ + export interface BufferedLayouter extends yfiles.layout.AbstractLayoutStage{ + /** + * Invokes the core Layouter on a copy of the given graph. + * @return {yfiles.layout.IGraphLayout} the calculated graph layout for the given graph + */ + calcLayout(layoutGraph:yfiles.layout.LayoutGraph):yfiles.layout.IGraphLayout; + /** + * Invokes the core Layouter on a copy of the given graph. + * @return {yfiles.layout.IGraphLayout} the calculated graph layout for the given graph + */ + calcLayoutWithGraphAndLayout(graph:yfiles.algorithms.IGraphInterface,layout:yfiles.layout.IGraphLayout):yfiles.layout.IGraphLayout; + /** + * Invokes the core Layouter on a copy of the given graph. + * The calculated layout will be written back to the given graph. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(layoutGraph:yfiles.layout.LayoutGraph):void; + /** + * Invokes the core Layouter on a copy of the given graph. + * The calculated layout will be written back to the given graph. + */ + doLayoutWithGraphAndLayout(graph:yfiles.algorithms.IGraphInterface,layout:yfiles.layout.IGraphLayout):void; + /** + * Whether or not this layouter can layout the given graph. + * The result of this method will be provided by the associated + * core layouter. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#canLayout} + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + } + var BufferedLayouter:{ + $class:yfiles.lang.Class; + /** + * Instantiates a new BufferedLayouter. + * No core layouter will be bound this layouter yet. + */ + new ():yfiles.layout.BufferedLayouter; + /** + * Instantiates a new BufferedLayouter that wraps + * the given core layouter. + */ + WithCoreLayouter:{ + new (coreLayouter:yfiles.layout.ILayouter):yfiles.layout.BufferedLayouter; + }; + }; + /** + * This layout stage arranges the connected components of a graph. + *

+ * It is possible to specify a core layout algorithm that will + * be invoked on all connected components of the graph + * before this layouter arranges the components themselves. + *

+ *

+ * ComponentLayouter will handle hierarchically grouped graphs in a special way. + * The contents of a group node will always belong to the same component + * as the group node itself. + *

+ */ + export interface ComponentLayouter extends yfiles.layout.AbstractLayoutStage{ + /** + * Sets the preferred layout size for this layouter. + * @param {number} width the preferred width of the calculated graph layout. + * @param {number} height the preferred height of the calculated graph layout. + * @see {@link yfiles.layout.ComponentLayouter#preferredLayoutSize} + * @throws {yfiles.system.ArgumentException} when width or height is negative or zero. + */ + setPreferredLayoutSize(width:number,height:number):void; + /** + * The preferred layout size for this layouter. + * @throws {yfiles.system.ArgumentException} when the specified width or height is negative or zero. + * @see {@link yfiles.layout.ComponentLayouter#setPreferredLayoutSize} + */ + preferredLayoutSize:yfiles.algorithms.YDimension; + /** + * Determines if the preconditions for the graph layout algorithm + * are fulfilled, by applying them to the connected components. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#canLayout} + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Determines which nodes will belong to the same graph component. + * Additionally to normal connectedness a group node and all of its children + * will belong to the same component. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.INodeMap} compNumber + * return value that will hold the zero-based number + * of the component that it belongs to. The component number of + * Node v is compNum.getInt(v). + * @return {number} the number of connected components of this graph. + */ + findGraphComponents(graph:yfiles.layout.LayoutGraph,compNumber:yfiles.algorithms.INodeMap):number; + /** + * Calculate the layout. + * This is done by decomposing the graph in its connected components + * and applying the core layout algorithm on each component. + * @see {@link yfiles.layout.AbstractLayoutStage#coreLayouter} + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Calculates and returns the bounding box of a graph component including node halos. + * This method will be + * invoked for each component of the graph. Depending on the state of + * property labelAwarenessEnabled the returned bounding box will + * also take node and edge labels into account. + */ + calcBoundingBox(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.Rectangle2D; + /** + * Determines whether or not to take node and edge labels into account when + * calculating the bounding box of the graph components. + *

+ * By default this feature is enabled. + *

+ * @see {@link yfiles.layout.ComponentLayouter#calcBoundingBox} + */ + considerLabels:boolean; + /** + * Produces a non-overlapping component graph layout. + * This method moves the graph components in such a + * fashion that their bounding boxes do not + * overlap. The arrangement strategy used takes + * the ratio of the overall layout area into account. + * Subclasses may want to overwrite this method. + * @param {yfiles.layout.LayoutGraph} graph the layout graph. + * @param {yfiles.algorithms.NodeList[]} nodes array of type NodeList. The i-th NodeList contains all nodes of the i-th graph component. + * @param {yfiles.algorithms.EdgeList[]} edges array of type EdgeList. The i-th EdgeList contains all edges of the i-th graph component. + * @param {yfiles.algorithms.YRectangle[]} bbox array of type YRectangle. The i-th YRectangle contains the current bounding box of the i-th graph component. + * @param {yfiles.algorithms.Rectangle2D[]} boxes + * array of type Rectangle2D. The i-th Rectangle2D contains the extended bounding box of the i-th graph component. + * The method arranges these boxes in such a way that they do not overlap. Then the i-th graph component must be placed + * inside the i-th box. + */ + arrangeComponents(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList[],edges:yfiles.algorithms.EdgeList[],bbox:yfiles.algorithms.YRectangle[],boxes:yfiles.algorithms.Rectangle2D[]):void; + /** + * Specifies whether or not the separately laid out components of the input graph should be + * arranged by this class. + *

+ * By default this feature is enabled. + *

+ */ + componentArrangement:boolean; + /** + * Sets the origin for a subgraph. + */ + setOrigin(graph:yfiles.layout.LayoutGraph,nl:yfiles.algorithms.NodeList,el:yfiles.algorithms.EdgeList,org:yfiles.algorithms.YPoint,r:yfiles.algorithms.YRectangle):void; + /** + * The current grid spacing. + * Components will be moved by multiples of this value, thus keeping their offset to the grid. + * That way, components or parts of them that were placed on a grid before, will stay on their original grid. + * The grid spacing also influences the distance between the components. + *

+ * Note that this option keeps existing grid locations intact but won't correct the location of a component + * to the grid specified here. + *

+ *

+ * If grid spacing equals 0, the grid won't be considered at all. + *

+ */ + gridSpacing:number; + /** + * The current component spacing. + * This value represents the minimum + * allowed distance between the bounding boxes of to components. + */ + componentSpacing:number; + /** + * Determines whether or not grouping information bound to the graph will be + * used to calculate the components. + *

+ * The default value is true. + *

+ */ + groupingActive:boolean; + /** + * The component arrangement style used by this ComponentLayouter. + *

+ * The default is {@link yfiles.layout.ComponentArrangementStyles#ROWS}. + *

+ */ + style:yfiles.layout.ComponentArrangementStyles; + arrangeFields(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList[],edges:yfiles.algorithms.EdgeList[],bbox:yfiles.algorithms.YRectangle[],boxes:yfiles.algorithms.Rectangle2D[],circular:boolean,fill:boolean,fromSketch:boolean):void; + } + var ComponentLayouter:{ + $class:yfiles.lang.Class; + /** + * DataProvider key that can be used to determine which nodes should be laid out. + * Note that components will be laid out if and only if at least one of the nodes + * that make up the component returns true if queried through the + * DataProvider instance. If no such instance is registered with the graph, + * all components will be laid out by the core layout algorithm. + */ + LAYOUT_NODE_DP_KEY:Object; + /** + * DataProvider key that can be used to determine components by hand. + * The algorithm will use the {@link yfiles.algorithms.IDataProvider#get} method to query for + * object instances that will be used to determine components: + * If null is returned for a node that node's component will be determined as usual. + * If non-null values are returned, they will be compared using their natural order + * ({@link yfiles.lang.IObjectComparable}) to determine the component order. + */ + GIVEN_COMPONENT_DP_KEY:Object; + /** + * Initializes a new ComponentLayouter instance. + * @param {yfiles.layout.ILayouter} coreLayouter + * the layout algorithm that is invoked for connected + * components of the input graph. + * @see {@link yfiles.layout.ComponentLayouter#doLayout} + */ + WithCoreLayouter:{ + new (coreLayouter:yfiles.layout.ILayouter):yfiles.layout.ComponentLayouter; + }; + /** + * Initializes a new ComponentLayouter instance. + * @see {@link yfiles.layout.ComponentLayouter#setPreferredLayoutSize} + */ + new ():yfiles.layout.ComponentLayouter; + }; + /** + * An abstract base class for layout algorithms that + * provides services to simplify and decompose the input graph + * before it is passed to the core layout routine itself. + * Subclass layout algorithms have to provide implementations + * for the abstract methods + * {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + * and + * {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + * The maximal number of steps involved before and after the core layout + * will be invoked are summarized below. + *
    + *
  • Copy the input graph
  • + *
  • Hide all but the induced subgraph
  • + *
  • Decompose the graph into it's connected components. On each component + * perform the steps 3-11
  • + *
  • Prepare for an orientation change
  • + *
  • Hide parallel edges
  • + *
  • Hide self-loops
  • + *
  • Invoke core layouter on simplified graph
  • + *
  • Unhide and route self-loops
  • + *
  • Unhide and route parallel edges
  • + *
  • Complete orientation change of layout
  • + *
  • Arrange connected components of the graph
  • + *
  • Unhide non-induced subgraph
  • + *
  • Assign label positions
  • + *
  • Copy layout information back to original input graph or pass out + * layout information separately
  • + *
+ * Each of the phases above can be subdued if necessary. + */ + export interface CanonicMultiStageLayouter extends Object,yfiles.layout.ILayouter{ + /** + * Subclasses have to provide core layout code in this method. + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * Subclasses have to provide information whether or not they + * can layout the given graph. + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * This method throws an {@link yfiles.system.ArgumentException} if the width/height of the given node object is zero. + * It is called by the {@link yfiles.layout.CanonicMultiStageLayouter#doLayout} method for each node object in the input graph. + * @see {@link yfiles.layout.CanonicMultiStageLayouter#checkGroupNodeSize} + * @param {yfiles.layout.IGraphLayout} layout a graph layout object. + * @param {Object} node the node object to test. + * @throws {yfiles.system.ArgumentException} thrown if the width/height of the node object is zero. + */ + checkNodeSize(layout:yfiles.layout.IGraphLayout,node:Object):void; + /** + * This method throws an {@link yfiles.system.ArgumentException} if the width/height of the given group node object is zero. + * It is called by the {@link yfiles.layout.CanonicMultiStageLayouter#doLayout} method for each group node object in the input graph. + * @see {@link yfiles.layout.CanonicMultiStageLayouter#checkNodeSize} + * @param {yfiles.layout.IGraphLayout} layout a graph layout object. + * @param {Object} node the group node object to test. + * @throws {yfiles.system.ArgumentException} thrown if the width/height of the group node object is zero. + */ + checkGroupNodeSize(layout:yfiles.layout.IGraphLayout,node:Object):void; + /** + * Prepends a stage to the layout pipeline. + * Stage added with this method + * will be invoked before any other stages will be invoked. + */ + prependStage(stage:yfiles.layout.ILayoutStage):void; + /** + * Appends a stage to the layout pipeline. + * Stages added with this method will be + * invoked just before the core layouter will be invoked. + */ + appendStage(stage:yfiles.layout.ILayoutStage):void; + /** + * Removes a LayoutStage that has been previously added by the methods + * {@link yfiles.layout.CanonicMultiStageLayouter#appendStage} or {@link yfiles.layout.CanonicMultiStageLayouter#prependStage}. + */ + removeStage(stage:yfiles.layout.ILayoutStage):void; + /** + * The algorithm used for placing labels. + * Getter:By default an instance of class + * {@link yfiles.labeling.GreedyMISLabeling} will be returned. + * Setter:Note that + * assigning a new layout stage will not automatically activate it. + * To activate this stage use {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouterEnabled}. + */ + labelLayouter:yfiles.layout.ILayoutStage; + /** + * The LayoutStage used for routing + * Self-loops. + * By default an instance of class + * {@link yfiles.layout.SelfLoopLayouter} will be returned. + */ + selfLoopLayouter:yfiles.layout.ILayoutStage; + /** + * The LayoutStage responsible for routing + * parallel edges. + * By default an instance of class + * {@link yfiles.layout.ParallelEdgeLayouter} will be returned. + */ + parallelEdgeLayouter:yfiles.layout.ILayoutStage; + /** + * The LayoutStage responsible for laying out the + * connected components of the graph. + */ + componentLayouter:yfiles.layout.ILayoutStage; + /** + * The LayoutStage that is responsible for + * constraining the layout process to a subgraph + * of the target graph. + */ + subgraphLayouter:yfiles.layout.ILayoutStage; + /** + * The LayoutStage that is responsible for + * hiding away grouping information for the layout algorithm. + */ + groupNodeHider:yfiles.layout.ILayoutStage; + /** + * The LayoutStage that is responsible for + * changing the orientation of the computed layout. + */ + orientationLayouter:yfiles.layout.ILayoutStage; + /** + * Specifies whether or not the OrientationLayouter + * is enabled. + * By default it is activated but does not change + * orientation of the layout. + */ + orientationLayouterEnabled:boolean; + /** + * The main layout orientation. + * The layouter tries to arrange nodes + * in such a way that all edges point in the main layout direction. + *

+ * Note, the documentation for the other layout options assumes that the + * default layout orientation {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} is + * being used. + *

+ */ + layoutOrientation:yfiles.layout.LayoutOrientation; + /** + * Specifies whether or not the SelfLoopLayouter + * is enabled. + * By default it is enabled. + */ + selfLoopLayouterEnabled:boolean; + /** + * Specifies whether or not LabelLayouter + * is enabled. + * By default it is disabled. + */ + labelLayouterEnabled:boolean; + /** + * Specifies whether or not to hide away group nodes before the layout begins. + * By default this is enabled for instances that cannot deal with node + * groupings. + */ + hideGroupNodes:boolean; + /** + * Specifies whether or not ComponentLayouter + * is enabled. + * By default it is enabled. + */ + componentLayouterEnabled:boolean; + /** + * Specifies whether or not the ParallelEdgeLayouter + * is enabled. + * By default it is enabled. + */ + parallelEdgeLayouterEnabled:boolean; + /** + * Specifies whether or not the SubgraphLayouter + * is enabled. + * By default it is disabled. + */ + subgraphLayouterEnabled:boolean; + /** + * Disables all layout stages and performs only the core layouter. + */ + enableOnlyCore():void; + /** + * Calculates a layout for the given graph. + * The given graph will not be copied during the + * layout process and the layout will be + * immediately applied to the given graph. + * This method is not side effect free in the sense that + * the order of edges or nodes in the input graph + * may change during the layout process. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(layoutGraph:yfiles.layout.LayoutGraph):void; + /** + * Calculates a layout for the given graph interface + * and layout. + * The calculated layout will be written + * back to the given layout. + */ + doLayoutWithGraphAndLayout(graph:yfiles.algorithms.IGraphInterface,layout:yfiles.layout.IGraphLayout):void; + /** + * Returns a layout for the given layout graph. + * The given graph will not be modified by the layout process. + */ + calcLayout(layoutGraph:yfiles.layout.LayoutGraph):yfiles.layout.IGraphLayout; + /** + * Returns a layout for the given graph interface and layout. + * The given graph and layout will not be modified by the layout process. + */ + calcLayoutWithGraphAndLayout(graph:yfiles.algorithms.IGraphInterface,layout:yfiles.layout.IGraphLayout):yfiles.layout.IGraphLayout; + /** + * Tests whether or not the given graph can be laid out + * by this layouter. + * All stage layouters and the core layouter must + * be able to calculate the layout to make this test successful. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + } + var CanonicMultiStageLayouter:{ + $class:yfiles.lang.Class; + /** + * Constructs a new AbstractLayouter. + */ + new ():yfiles.layout.CanonicMultiStageLayouter; + }; + /** + * This Layouter will take several {@link yfiles.layout.ILayouter} implementations and will + * run these layout algorithms one after the other in the order in which they + * were added. + *

+ * This class can for example be used to bundle several layout steps and + * handover a single layouter to a {@link yfiles.layout.BufferedLayouter}. + *

+ */ + export interface SequentialLayouter extends Object,yfiles.layout.ILayouter{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Appends the given layouter to the end of the layouter chain. + * @param {yfiles.layout.ILayouter} layouter the layouter that should be appended to the chain. + */ + appendLayouter(layouter:yfiles.layout.ILayouter):void; + /** + * Appends the specified layouters to the end of the layouter chain. + * @param {yfiles.collections.ICollection.} layouters the layouters that should be appended to the chain. + */ + appendLayouters(layouters:yfiles.collections.ICollection):void; + /** + * A list of the layouters that are currently in the layout chain. + * Note: this will overwrite the current chain. + */ + layouters:yfiles.collections.IList; + /** + * Clears the layouter chain and therefore removes all layouters. + */ + clearLayouterChain():void; + } + var SequentialLayouter:{ + $class:yfiles.lang.Class; + new ():yfiles.layout.SequentialLayouter; + }; + /** + * This layout stage can be used to enforce that a layout algorithm will not change + * the relative coordinates of ports that are associated with a strong/fixed port constraint. + */ + export interface PortConstraintEnforcementStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var PortConstraintEnforcementStage:{ + $class:yfiles.lang.Class; + new ():yfiles.layout.PortConstraintEnforcementStage; + }; + export interface IntersectionCalculatorKeys extends Object{ + } + var IntersectionCalculatorKeys:{ + $class:yfiles.lang.Class; + /** + * Key to be used when registering a DataProvider to a graph instance that provides + * for each Edge object in a graph an IntersectionCalculator instance + * that is configured to calculate the intersection of the edge and the source + * node. + */ + SOURCE_INTERSECTION_CALCULATOR_DP_KEY:Object; + /** + * Key to be used when registering a DataProvider to a graph instance that provides + * for each Edge object in a graph an IntersectionCalculator instance + * that is configured to calculate the intersection of the edge and the target + * node. + */ + TARGET_INTERSECTION_CALCULATOR_DP_KEY:Object; + }; + /** + * Interface implemented by classes that are responsible for calculating the + * intersection point between an Edge and the visual representation of its + * source or target node. + * This interface is especially useful in conjunction with + * the {@link yfiles.layout.ILayoutStage}. + */ + export interface IIntersectionCalculator extends Object{ + /** + * Calculates an intersection point given the coordinates of a point lying on + * the last/first segment of an Edge and a normalized direction. + * If no such intersection can be found this method should return null. + * @param {yfiles.layout.INodeLayout} nl + * the currently calculated {@link yfiles.layout.INodeLayout} + * @param {number} xOffset + * the relative (to the node's center) + * x-coordinate of a point on the last line segment + * @param {number} yOffset the relative y-coordinate of a point on the last line segment + * @param {number} dx + * the x component of the normalized direction vector indicating the + * direction of the segment pointing towards the node + * @param {number} dy + * the y component of the normalized direction vector indicating the + * direction of the segment pointing towards the node + * @return {yfiles.algorithms.YPoint} + * the new relative (to the node's center) intersection coordinates or + * null if no such intersection could be found + * @see Specified by {@link yfiles.layout.IIntersectionCalculator#calculateIntersectionPoint}. + */ + calculateIntersectionPoint(nl:yfiles.layout.INodeLayout,xOffset:number,yOffset:number,dx:number,dy:number):yfiles.algorithms.YPoint; + } + var IIntersectionCalculator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface defines the properties of one label + * from the perspective of a labeling algorithm. + */ + export interface ILabelLayout extends Object{ + /** + * The bounding box of the label. + * @see Specified by {@link yfiles.layout.ILabelLayout#box}. + */ + box:yfiles.algorithms.YRectangle; + /** + * The box of the label. + * @see Specified by {@link yfiles.layout.ILabelLayout#orientedBox}. + */ + orientedBox:yfiles.algorithms.YOrientedRectangle; + /** + * The label model parameter that describes + * the position of this label. + * @see Specified by {@link yfiles.layout.ILabelLayout#modelParameter}. + */ + modelParameter:Object; + } + var ILabelLayout:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This is a general interface for algorithms that + * perform a layout process on a given layout graph. + */ + export interface ILayouter extends Object{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Convenience method that runs a layouter on a graph. + * This is a bridge method that delegates to {@link yfiles.graph.LayoutExtensions#doLayout}. + * @param {yfiles.graph.IGraph} graph The graph. + * @see {@link yfiles.graph.LayoutExtensions#applyLayoutWithControl} + * @see {@link yfiles.graph.LayoutExtensions#morphLayout} + */ + applyLayout(graph:yfiles.graph.IGraph):void; + } + var ILayouter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum SliderMode{ + /** + * Symbolic slider mode specifier. + * Chooses continuous label positions directly on the edge path. + */ + CENTER, + /** + * Symbolic slider mode specifier. + * Chooses continuous label positions along the sides of the edge path. + */ + SIDE + } + /** + * This interface defines the layout information of a graph. + */ + export interface IGraphLayout extends Object{ + /** + * Returns the layout information for a given node. + * @see Specified by {@link yfiles.layout.IGraphLayout#getNodeLayout}. + */ + getNodeLayout(node:Object):yfiles.layout.INodeLayout; + /** + * Returns the layout information for a given edge. + * @see Specified by {@link yfiles.layout.IGraphLayout#getEdgeLayout}. + */ + getEdgeLayout(edge:Object):yfiles.layout.IEdgeLayout; + /** + * Returns an array of layout information for all node labels + * belonging to the given node. + * @see Specified by {@link yfiles.layout.IGraphLayout#getNodeLabelLayout}. + */ + getNodeLabelLayout(node:Object):yfiles.layout.INodeLabelLayout[]; + /** + * Returns an array of layout information for all edge labels + * belonging to the given edge. + * @see Specified by {@link yfiles.layout.IGraphLayout#getEdgeLabelLayout}. + */ + getEdgeLabelLayout(edge:Object):yfiles.layout.IEdgeLabelLayout[]; + /** + * Returns the bounding box of the graph layout. + * That is the smallest rectangular area that contains all + * defined layout elements. If there are no elements in this + * graph layout, the resulting rectangle will have negative + * width and height. + * @see Specified by {@link yfiles.layout.IGraphLayout#getBoundingBox}. + */ + getBoundingBox():yfiles.algorithms.Rectangle; + } + var IGraphLayout:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum LabelAngleOnRightSideRotation{ + /** + * Angle interpretation specifier for edge labels whose descriptor {@link yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge}. Expresses that the angle + * should be interpreted as clockwise and therefore as co-rotating with the angle of labels that are + * left of or centered on edge. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide} + * @see {@link yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide} + */ + CLOCKWISE, + /** + * Angle interpretation specifier for edge labels whose descriptor {@link yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge}. Expresses that the angle + * should be interpreted as counter-clockwise and therefore as counter-rotating with the angle of + * labels that are left of or centered on edge. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide} + * @see {@link yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide} + */ + COUNTER_CLOCKWISE + } + export enum LabelAngleOnRightSideOffset{ + /** + * Angle offset specifier for edge labels whose descriptor {@link yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge}. Expresses that for labels + * right of edge no additional offset should be added to the angle offset. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide} + * @see {@link yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide} + */ + NONE, + /** + * Angle offset specifier for edge labels whose descriptor {@link yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge}. Expresses that for labels + * right of edge an additional offset of 180 degree should be added to the angle offset so that point symmetric label + * placements left and right of the edge can be attained. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide} + * @see {@link yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide} + */ + SEMI + } + /** + * This interface defines the properties of one edge label + * from the perspective of a labeling algorithm. + *

+ * Note: if you update the model parameter with {@link yfiles.layout.ILabelLayout#modelParameter} you should also + * update the corresponding {@link yfiles.layout.ILabelLayout#orientedBox oriented box} to avoid inconsistency. + *

+ */ + export interface IEdgeLabelLayout extends Object,yfiles.layout.ILabelLayout{ + /** + * The edge label model associated with this label layout. + * @see Specified by {@link yfiles.layout.IEdgeLabelLayout#labelModel}. + */ + labelModel:yfiles.layout.IEdgeLabelModel; + /** + * Preferred placement hints for layout algorithms. + * @see Specified by {@link yfiles.layout.IEdgeLabelLayout#preferredPlacementDescriptor}. + */ + preferredPlacementDescriptor:yfiles.layout.PreferredPlacementDescriptor; + } + var IEdgeLabelLayout:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface encapsulates the layout information for an edge. + * The layout information consists of + * the two end points of the edge layout and a sequence of control points + * that determine the visual path of the edge. + */ + export interface IEdgeLayout extends Object{ + /** + * Returns the number of control points of the edge. + * The source and target points are not included in the point count. + * @return {number} the number of control points + * @see Specified by {@link yfiles.layout.IEdgeLayout#pointCount}. + */ + pointCount():number; + /** + * Returns the control point at position index of + * the sequence. + * @see {@link yfiles.layout.IEdgeLayout#setPoint} + * @param {number} index position of the control point in the control point sequence. + * @return {yfiles.algorithms.YPoint} the absolute coordinates of the control point at the given index. + * @see Specified by {@link yfiles.layout.IEdgeLayout#getPoint}. + */ + getPoint(index:number):yfiles.algorithms.YPoint; + /** + * Sets the coordinates of the control point at position index of + * the sequence. + * The first control point in the sequence has index 0 + * and the last control point has index pointCount() - 1. + * @param {number} index position of the control point in the control point sequence. + * @param {number} x absolute x-coordinate of the control point at the given index. + * @param {number} y absolute y-coordinate of the control point at the given index. + * @see Specified by {@link yfiles.layout.IEdgeLayout#setPoint}. + */ + setPoint(index:number,x:number,y:number):void; + /** + * Adds a control point to the end of the control point sequence. + * @param {number} x the absolute x-coordinate of the control point. + * @param {number} y the absolute y-coordinate of the control point. + * @see Specified by {@link yfiles.layout.IEdgeLayout#addPoint}. + */ + addPoint(x:number,y:number):void; + /** + * Remove all control points from this edge layout. + * @see Specified by {@link yfiles.layout.IEdgeLayout#clearPoints}. + */ + clearPoints():void; + /** + * The relative coordinates of the first end point of this layout + * that is associated with the source node of the edge. + * Getter:The returned coordinates are relative to the center location of the source + * node of the edge. To obtain the absolute coordinates of the end point it + * is therefore necessary to add the center coordinates of the source node layout + * to the returned value. + * Setter:The given coordinates must be relative to the center location of the source + * node of the edge. + * @see {@link yfiles.layout.LayoutGraph#getCenterX} + * @see {@link yfiles.layout.LayoutGraph#getCenterY} + * @see {@link yfiles.layout.INodeLayout#x} + * @see {@link yfiles.layout.INodeLayout#width} + * @see {@link yfiles.layout.IEdgeLayout#targetPoint} + * @see Specified by {@link yfiles.layout.IEdgeLayout#sourcePoint}. + */ + sourcePoint:yfiles.algorithms.YPoint; + /** + * The relative coordinates of the second end point of this layout + * that is associated with the target node of the edge. + * Getter:The returned coordinates are relative to the center location of the target + * node of the edge. To obtain the absolute coordinates of the end point it + * is therefore necessary to add the center coordinates of the target node layout + * to the returned value. + * Setter:The given coordinates must be relative to the center location of the target + * node of the edge. + * @see {@link yfiles.layout.LayoutGraph#getCenterX} + * @see {@link yfiles.layout.LayoutGraph#getCenterY} + * @see {@link yfiles.layout.INodeLayout#x} + * @see {@link yfiles.layout.INodeLayout#width} + * @see Specified by {@link yfiles.layout.IEdgeLayout#targetPoint}. + */ + targetPoint:yfiles.algorithms.YPoint; + } + var IEdgeLayout:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This interface defines the properties of the model associated with an edge label + * layout. + *

+ * An edge label model provides a set of possible candidates for the placement of + * an edge label. + *

+ */ + export interface IEdgeLabelModel extends Object{ + /** + * A model parameter that encodes the default position of this model's + * allowed edge label positions. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#defaultParameter}. + */ + defaultParameter:Object; + /** + * Returns the bounds of the label for the position encoded + * by the given model parameter. + * @param {yfiles.algorithms.YDimension} labelSize The size of the label that should be placed. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceLayout The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetLayout The layout of the target node of the label owning edge. + * @param {Object} param + * The model parameter that describes the abstract position of the label within + * this model. + * The parameter must have been generated by this model. + * @return {yfiles.algorithms.YOrientedRectangle} The bounds of the label. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#getLabelPlacement}. + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Returns a list of {@link yfiles.layout.EdgeLabelCandidate} objects each of which describes + * a valid label position within this model. + * @param {yfiles.layout.IEdgeLabelLayout} labelLayout The label for which candidates should be generated. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceLayout The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetLayout The layout of the target node of the label owning edge. + * @return {yfiles.algorithms.YList} + * A list of {@link yfiles.layout.EdgeLabelCandidate} objects. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#getLabelCandidates}. + */ + getLabelCandidates(labelLayout:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * Creates a model parameter that represents the given edge label context best + * within this model. + * The created model parameter represents the closest parameter representation + * of the given label location that can be achieved within this model. + * @param {yfiles.algorithms.YOrientedRectangle} labelBounds The bounds of the label for which a parameter representation is sought. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceLayout The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetLayout The layout of the target node of the label owning edge. + * @return {Object} + * A model parameter that can be passed to the + * {@link yfiles.layout.IEdgeLabelModel#getLabelPlacement} + * method. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#createModelParameter}. + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout):Object; + } + var IEdgeLabelModel:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum PortSide{ + /** + * Weak constraint specifier. Indicates that any side of the + * node will do for the port direction. + */ + ANY, + /** + * Weak constraint specifier. Indicates that a port has to connect + * at the north side (i.e. top side) of a node. + */ + NORTH, + /** + * Weak constraint specifier. Indicates that a port has to connect + * at the south side (i.e. bottom side) of a node. + */ + SOUTH, + /** + * Weak constraint specifier. Indicates that a port has to connect + * at the east side (i.e. right side) of a node. + */ + EAST, + /** + * Weak constraint specifier. Indicates that a port has to connect + * at the west side (i.e. left side) of a node. + */ + WEST + } + export enum LabelSideReference{ + /** + * Side placement specifier for edge labels. Expresses that the preferred side + * (as specified by {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE} and + * {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE}) is interpreted relative + * to the edge flow. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#sideReference} + * @see {@link yfiles.layout.PreferredPlacementDescriptor#sideReference} + */ + RELATIVE_TO_EDGE_FLOW, + /** + * Side placement specifier for edge labels. Expresses that the preferred side + * (as specified by {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE} and + * {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE}) is interpreted absolute. + * On horizontal segments labels with preferred side + * {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE} are placed above the + * segment. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#sideReference} + * @see {@link yfiles.layout.PreferredPlacementDescriptor#sideReference} + */ + ABSOLUTE_WITH_LEFT_IN_NORTH, + /** + * Side placement specifier for edge labels. Expresses that the preferred side + * (as specified by {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE} and + * {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE}) is interpreted absolute. + * On horizontal segments labels with preferred side + * {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE} are placed above the + * segment. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#sideReference} + * @see {@link yfiles.layout.PreferredPlacementDescriptor#sideReference} + */ + ABSOLUTE_WITH_RIGHT_IN_NORTH + } + /** + * This is an interface for ranking LabelCandidates. + */ + export interface IProfitModel extends Object{ + /** + * Returns the profit for placing a label-candidate. + * Higher profit means higher probability that the candidate is chosen + * by a labeling algorithm. + * @param {yfiles.layout.LabelCandidate} candidate a label candidate + * @return {number} a value between 0 and 1. + * @see Specified by {@link yfiles.layout.IProfitModel#getProfit}. + */ + getProfit(candidate:yfiles.layout.LabelCandidate):number; + } + var IProfitModel:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Base class for candidate positions for labels. + */ + export interface LabelCandidate extends Object,yfiles.algorithms.IPlaneObject{ + /** + * The custom profit for this label candidate. + * The value is restricted to the interval [0,1] where 1 specifies the highest possible profit (default is 0). + * Note: the value is only considered if the labeling algorithm uses an optimization strategy (see {@link yfiles.labeling.MISLabelingAlgorithm#optimizationStrategy}). + * @throws {yfiles.system.ArgumentException} if the value lies not in the interval [0,1]. + */ + customProfit:number; + /** + * The model parameter that was used by the underlying model to + * generate this label candidate. + */ + modelParameter:Object; + /** + * The upper left corner of the label candidate bounds. + */ + location:yfiles.algorithms.YPoint; + /** + * The width and height of the label candidate bounds. + */ + size:yfiles.algorithms.YDimension; + /** + * The minimal x-coordinate of the label candidate bounds. + */ + x:number; + /** + * The minimal y-coordinate of the label candidate bounds. + */ + y:number; + /** + * The width of the label candidate bounds. + */ + width:number; + /** + * The height of the label candidate bounds. + */ + height:number; + /** + * The bounding box of this label candidate. + * @see Specified by {@link yfiles.algorithms.IPlaneObject#boundingBox}. + */ + boundingBox:yfiles.algorithms.YRectangle; + /** + * The real bounds of this label candidate. + */ + box:yfiles.algorithms.YOrientedRectangle; + /** + * The LabelLayout to which this candidate box belongs. + */ + owner:yfiles.layout.ILabelLayout; + /** + * Specifies whether this candidate is an internal node label, i.e. + * an label + * which resides inside the boundaries of a node. + */ + internal:boolean; + /** + * Sets the model parameters of the owner of this label candidate to the + * model parameters of this candidate box. + */ + propagate():void; + /** + * The penalty for a candidate position that overlaps the bounds of a node. + *

+ * The penalty should be a factor between 0 and 1, where 0 means that an overlap is considered unimportant and 1 + * means that an overlap is considered severe. + *

+ *

+ * By default node overlap penalty is set to 1. + *

+ */ + nodeOverlapPenalty:number; + /** + * The penalty value for a candidate position that overlaps the path of an edge. + *

+ * The penalty should be a factor between 0 and 1, where 0 means that an overlap is considered unimportant and 1 + * means that an overlap is considered severe. + *

+ *

+ * By default edge overlap penalty is set to 1. + *

+ */ + edgeOverlapPenalty:number; + /** + * The sum of node overlap penalty and edge overlap penalty. + * @see {@link yfiles.layout.LabelCandidate#edgeOverlapPenalty} + * @see {@link yfiles.layout.LabelCandidate#nodeOverlapPenalty} + */ + overlapPenalty:number; + /** + * The model parameter that was used by the underlying model to + * generate this label candidate. + */ + parameter:Object; + /** + * If this box had been chosen by the labeling algorithm. + */ + propagated:boolean; + toString():string; + } + var LabelCandidate:{ + $class:yfiles.lang.Class; + /** + * Returns a new instance of LabelCandidate. + * @param {yfiles.algorithms.YPoint} pos + * the location of the upper + * left corner of the candidate. + * @param {yfiles.algorithms.YDimension} size the size of the candidate. + * @param {Object} param + * the parameters of the labeling model + * associated with this candidate. + * @param {yfiles.layout.ILabelLayout} owner the label associated to the candidate. + */ + FromPointAndSize:{ + new (pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.ILabelLayout):yfiles.layout.LabelCandidate; + }; + /** + * Returns a new instance of LabelCandidate. + * @param {yfiles.algorithms.YPoint} pos + * the location of the upper + * left corner of the candidate. + * @param {yfiles.algorithms.YDimension} size the size of the candidate. + * @param {Object} param + * the parameters of the labeling model + * with this candidate. + * @param {yfiles.layout.ILabelLayout} owner the label associated to the candidate. + * @param {boolean} internal + * flag whether the candidate is + * allowed to overlap its own feature. + */ + FromPointAndSizeCanOverlap:{ + new (pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.ILabelLayout,internal:boolean):yfiles.layout.LabelCandidate; + }; + /** + * Returns a new instance of LabelCandidate. + * @param {yfiles.algorithms.YOrientedRectangle} labelBox the box that specifies the candidate's size and position. + * @param {Object} param + * the parameters of the labeling model + * with this candidate. + * @param {yfiles.layout.ILabelLayout} owner the label associated to the candidate. + * @param {boolean} internal + * flag whether the candidate is + * allowed to overlap its own feature. + */ + FromRectangleCanOverlap:{ + new (labelBox:yfiles.algorithms.YOrientedRectangle,param:Object,owner:yfiles.layout.ILabelLayout,internal:boolean):yfiles.layout.LabelCandidate; + }; + /** + * Returns a new instance of LabelCandidate. + * @param {yfiles.algorithms.YOrientedRectangle} labelBox the box that specifies the candidate's size and position. + * @param {Object} param + * the parameters of the labeling model + * with this candidate. + * @param {yfiles.layout.ILabelLayout} owner the label associated to the candidate. + */ + FromRectangle:{ + new (labelBox:yfiles.algorithms.YOrientedRectangle,param:Object,owner:yfiles.layout.ILabelLayout):yfiles.layout.LabelCandidate; + }; + }; + /** + * This layout stage ensures that layout algorithms that cannot handle port constraints keep the + * ports of edges with strong port constraints. + * Without this stage the port locations get lost. + *

+ * For each edge with strong port constraints, this stage simply stores the original port and restores it + * after applying the core layouter. + * Therefore, it either replaces the source/target port + * by the original port or adds the original port to the + * edge path calculated by the core layouter (see method {@link yfiles.layout.KeepStrongPortConstraintsStage#keepCalculatedPorts}). + *

+ */ + export interface KeepStrongPortConstraintsStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Specifies whether or not the final edge routes should contain the ports calculated by the core layouter. + * If this option is disabled, the + * layout stage simply replaces the current source/target ports (calculated by the core layouter) + * by the original ports (for strong ports only). Otherwise, the calculated ports are still contained in the + * edge paths. Note that for layout algorithms + * that produce non straight-line edge routes this option should always be enabled. + *

+ * By default this option is enabled. + *

+ */ + keepCalculatedPorts:boolean; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var KeepStrongPortConstraintsStage:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this layout stage. + */ + new ():yfiles.layout.KeepStrongPortConstraintsStage; + /** + * Creates a new instance of this layout stage using the specified layouter as core layouter. + * @param {yfiles.layout.ILayouter} core the core layouter. + */ + WithCoreLayouter :{ + new (core:yfiles.layout.ILayouter):yfiles.layout.KeepStrongPortConstraintsStage; + }; + }; + /** + * This interface describes the layout information for a node in the drawing + * of a graph. + * The layout information consists of the size and position of the node. + */ + export interface INodeLayout extends Object{ + /** + * X-Coordinate of the upper left corner of the node. + * @see Specified by {@link yfiles.layout.INodeLayout#x}. + */ + x:number; + /** + * Y-Coordinate of the upper left corner of the node. + * @see Specified by {@link yfiles.layout.INodeLayout#y}. + */ + y:number; + /** + * The width of the node. + * @see Specified by {@link yfiles.layout.INodeLayout#width}. + */ + width:number; + /** + * The height of the node. + * @see Specified by {@link yfiles.layout.INodeLayout#height}. + */ + height:number; + /** + * Sets the coordinates of the upper left corner of the node. + * @param {number} x the x-coordinates of the upper left corner. + * @param {number} y the y-coordinates of the upper left corner. + * @see Specified by {@link yfiles.layout.INodeLayout#setLocation}. + */ + setLocation(x:number,y:number):void; + /** + * Sets the size of the node. + * @param {number} width the width of the node. + * @param {number} height the height of the node. + * @see Specified by {@link yfiles.layout.INodeLayout#setSize}. + */ + setSize(width:number,height:number):void; + } + var INodeLayout:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface for a layouter that forms a stage of a larger layout + * process. + * It delegates the core layout process + * to another layouter. A layout stage may perform pre-processing steps + * before the core layouter gets called and post-processing steps after + * the layouter gets called. + */ + export interface ILayoutStage extends Object,yfiles.layout.ILayouter{ + /** + * The core layouter. + * @see Specified by {@link yfiles.layout.ILayoutStage#coreLayouter}. + */ + coreLayouter:yfiles.layout.ILayouter; + } + var ILayoutStage:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export interface LayouterKeys extends Object{ + } + var LayouterKeys:{ + $class:yfiles.lang.Class; + /** + * The data provider key used to look up a unique Object identifier + * (consistent with hashCode() and equals() ) for each node in a graph. + * Layout algorithms may use this information to provide consistent layouts + * for multiple runs. + * The looked up data provider should provide Object values + * for the nodes of that graph. These should be consistent with the Object.hashCode() + * and Object.equals() methods. + */ + NODE_ID_DP_KEY:Object; + /** + * The data provider key used to look up a unique Object identifier + * (consistent with hashCode() and equals() ) for each edge in a graph. + * Layout algorithms may use this information to provide consistent layouts + * for multiple runs. + * The looked up data provider should provide Object values + * for the edges of that graph. These should be consistent with the Object.hashCode() + * and Object.equals() methods. + */ + EDGE_ID_DP_KEY:Object; + /** + * The data provider key used to look up the selected + * state of the nodes of the graph to be laid out. + * A layout algorithm will try to retrieve a + * data provider from the graph to be laid out with this key. + * The looked up data provider should provide boolean values + * for the nodes of that graph. The boolean value should signal + * whether a node is to be considered as selected or not. + * Note that for several layouters this key is used for restricting the sphere of action, + * e.g. to layout the subgraph induced by the set of selected nodes in the + * SubgraphLayouter. + * However, it is often more convenient to use a specific data provider key for this + * purpose, for example if you want to combine two layouters of this kind which have to operate + * on different subsets of the graph. Thus, these layouters provide a method like + * setSubgraphNodesDpKey(Object) in the case of the SubgraphLayouter + * for using a different data provider. + */ + SELECTED_NODES_DP_KEY:Object; + /** + * The data provider key used to look up the selected + * state of the edges of the graph to be laid out. + * A layout algorithm will try to retrieve a + * data provider from the graph to be laid out with this key. + * The looked up data provider should provide boolean values + * for the edges of that graph. The boolean value should signal + * whether an edge is to be considered as selected or not. + * Note that for several layouters this key is used for restricting the sphere of action, + * e.g. to route only a subset of the edges by the OrthogonalEdgeRouter. + * However, it is often more convenient to use a specific data provider key for this + * purpose, for example if you want to combine two layouters of this kind which have to operate + * on different subsets of the graph. Thus, these layouters provide a method + * like setSelectedEdgesDpKey(Object) in the case of the OrthogonalEdgeRouter + * for using a different data provider. + */ + SELECTED_EDGES_DP_KEY:Object; + }; + /** + * This interface defines the properties of one edge label + * from the perspective of a labeling algorithm. + *

+ * Note: if you update the model parameter with {@link yfiles.layout.ILabelLayout#modelParameter} you should also + * update the corresponding {@link yfiles.layout.ILabelLayout#orientedBox oriented box} to avoid inconsistency. + *

+ */ + export interface INodeLabelLayout extends Object,yfiles.layout.ILabelLayout{ + /** + * The node label model associated with this label layout. + * @see Specified by {@link yfiles.layout.INodeLabelLayout#labelModel}. + */ + labelModel:yfiles.layout.INodeLabelModel; + } + var INodeLabelLayout:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum LabelAngleReference{ + /** + * Angle interpretation specifier for edge labels. Expresses that the angle should be interpreted absolute and + * not relative to the edge slope. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#angleReference} + * @see {@link yfiles.layout.PreferredPlacementDescriptor#angleReference} + */ + ABSOLUTE, + /** + * Angle interpretation specifier for edge labels. Expresses that the angle should be interpreted relative to + * the edge slope. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#angleReference} + * @see {@link yfiles.layout.PreferredPlacementDescriptor#angleReference} + */ + RELATIVE_TO_EDGE_FLOW + } + /** + * This interface defines the properties of the model + * associated with a node label layout. + *

+ * A node label model provides a set of possible + * candidates for the placement of a node label. + *

+ */ + export interface INodeLabelModel extends Object{ + /** + * A model parameter that encodes the default position of this model's + * allowed node label positions. + * @see Specified by {@link yfiles.layout.INodeLabelModel#defaultParameter}. + */ + defaultParameter:Object; + /** + * Returns the oriented label position and bounds encoded by the given model + * parameter. + * @param {yfiles.algorithms.YDimension} labelSize The size of the label that should be placed. + * @param {yfiles.layout.INodeLayout} nodeLayout The layout of the node to which the label belongs. + * @param {Object} param + * The model parameter that describes the abstract position of + * the label within this model. The parameter must have been generated by + * this model. + * @return {yfiles.algorithms.YOrientedRectangle} the oriented label position and bounds. + * @see Specified by {@link yfiles.layout.INodeLabelModel#getLabelPlacement}. + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Returns a list of {@link yfiles.layout.NodeLabelCandidate} objects each of which describes + * a valid label position within this model. + * @param {yfiles.layout.INodeLabelLayout} nl The label layout for which candidates should be generated. + * @param {yfiles.layout.INodeLayout} nodeLayout The layout of the node to which the label belongs. + * @return {yfiles.algorithms.YList} + * A list of {@link yfiles.layout.NodeLabelCandidate} objects. + * @see Specified by {@link yfiles.layout.INodeLabelModel#getLabelCandidates}. + */ + getLabelCandidates(nl:yfiles.layout.INodeLabelLayout,nodeLayout:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * Creates a model parameter that represents the given node label context best + * within this model. + * The created model parameter represents the closest parameter representation + * of the given oriented label bounds that can be achieved within this model. + * @param {yfiles.algorithms.YOrientedRectangle} labelBounds The bounds of the label for which a parameter representation is sought. + * @param {yfiles.layout.INodeLayout} nodeLayout The layout of the node to which the label belongs. + * @return {Object} + * A model parameter that can be passed to the + * {@link yfiles.layout.INodeLabelModel#getLabelPlacement} method. + * @see Specified by {@link yfiles.layout.INodeLabelModel#createModelParameter}. + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,nodeLayout:yfiles.layout.INodeLayout):Object; + } + var INodeLabelModel:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum RotatedDiscreteEdgeLabelPosition{ + /** + * Symbolic position specifier. + * Places the label near the source node. + * The label's position is to the left of or above the edge's path. + * @see {@link yfiles.layout.RotatedDiscreteEdgeLabelLayoutModel#positionRelativeToSegment} + */ + SHEAD, + /** + * Symbolic position specifier. + * Places the label near the middle of the edge's path. + * The label's position is to the left of or above the edge's path. + * @see {@link yfiles.layout.RotatedDiscreteEdgeLabelLayoutModel#positionRelativeToSegment} + */ + HEAD, + /** + * Symbolic position specifier. + * Places the label near the target node. + * The label's position is to the left of or above the edge's path. + * Places the label near the target node on the "head" side of the edge. + * @see {@link yfiles.layout.RotatedDiscreteEdgeLabelLayoutModel#positionRelativeToSegment} + */ + THEAD, + /** + * Symbolic position specifier. + * Places the label near the source node. + * The label's position is to the right of or below the edge's path. + * @see {@link yfiles.layout.RotatedDiscreteEdgeLabelLayoutModel#positionRelativeToSegment} + */ + STAIL, + /** + * Symbolic position specifier. + * Places the label near the middle of the edge's path. + * The label's position is to the right of or below the edge's path. + * @see {@link yfiles.layout.RotatedDiscreteEdgeLabelLayoutModel#positionRelativeToSegment} + */ + TAIL, + /** + * Symbolic position specifier. + * Places the label near the target node. + * The label's position is to the right of or below the edge's path. + * @see {@link yfiles.layout.RotatedDiscreteEdgeLabelLayoutModel#positionRelativeToSegment} + */ + TTAIL, + /** + * Symbolic position specifier. + * Places the label near the source node directly on the edge path. + */ + SCENTER, + /** + * Symbolic position specifier. + * Places the label near the middle of an edge directly on its path. + */ + CENTER, + /** + * Symbolic position specifier. + * Places the label near the target node directly on the edge path. + */ + TCENTER, + /** + * Position mask that constrains allowed positions to the two near the edge's + * end points. + * Namely, these are {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#HEAD} and {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#TAIL}. + * @see {@link yfiles.layout.RotatedDiscreteEdgeLabelLayoutModel#positionRelativeToSegment} + */ + TWO_POS, + /** + * Position mask that constrains allowed positions to {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#CENTER}. + */ + CENTERED, + /** + * Position mask that constrains allowed positions to a set of six positions on + * the "head" and "tail" sides of an edge. + * Namely, these are {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#SHEAD}, {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#HEAD}, {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#THEAD}, {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#STAIL}, + * {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#TAIL}, and {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#TTAIL}. + * @see {@link yfiles.layout.RotatedDiscreteEdgeLabelLayoutModel#positionRelativeToSegment} + */ + SIX_POS, + /** + * Position mask that constrains allowed positions to a set of three positions + * directly on the edge's path. + * Namely, these are {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#SCENTER}, {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#CENTER}, and {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#TCENTER}. + */ + THREE_CENTER + } + /** + * This class represents a row of a {@link yfiles.layout.PartitionGrid}. + * The results of the calculation of the geometry of the row will be placed + * into the instances of this class after the layout. + * @see {@link yfiles.layout.PartitionGrid} + */ + export interface RowDescriptor extends Object,yfiles.lang.IObjectComparable{ + /** + * The index of the row within the partition grid. + */ + index:number; + /** + * 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; + /** + * The minimum row height. + * The default is 0.0d. + * @throws {yfiles.system.ArgumentException} if minimumHeight is negative + */ + minimumHeight:number; + /** + * The top row insets where no element + * will lie in the resulting drawing. + * The default is 0.0d. + * @throws {yfiles.system.ArgumentException} if topInset is negative + */ + topInset:number; + /** + * The bottom row insets where no element + * will lie in the resulting drawing. + * The default is 0.0d. + * @throws {yfiles.system.ArgumentException} if bottomInset is negative + */ + bottomInset:number; + /** + * The computed height of the row + * after the layout has been calculated. + */ + computedHeight:number; + /** + * The original position (smaller y-coordinate) of the row. + */ + originalPosition:number; + /** + * The original height of the row. + */ + originalHeight:number; + /** + * The computed position (smaller y-coordinate) of the row + * after the layout has been calculated. + */ + computedPosition:number; + /** + * The tightness factor of the row. + * Getter:The default is 0.0d. + * Setter:The greater the value the + * more will the row to be forced to be of its minimal possible height. + * A value of 0.0d will disable compression of the row. + * A value of 1.0d will try to force the column to be of + * its {@link yfiles.layout.RowDescriptor#minimumHeight minimum height}. + * @throws {yfiles.system.ArgumentException} if tightness is out of the valid range + */ + tightness:number; + /** + * Specifies whether the index of this row is fixed or whether + * the algorithm should try to find the best possible position. + * Getter:The default is true + * Setter:

+ * For all rows where this property is set to true, the relative ordering given by the indices + * is preserved. The remaining rows may be resorted so that the overall edge lengths are minimized. + *

+ *

+ * By default, this feature is enabled.

+ */ + indexFixed:boolean; + } + var RowDescriptor:{ + $class:yfiles.lang.Class; + }; + /** + * Class for creating a partition grid, i.e., a grid that partitions the drawing area into rectangular partition cells. + * The grid consists of rows and columns that are created using the corresponding constructors of this class or method + * #addColumn or #addRow. The PartitionGrid object has to be registered to the graph using DataProvider key {@link yfiles.layout.PartitionGrid#PARTITION_GRID_DP_KEY}; + *

+ * Each node can be assigned to a {@link yfiles.layout.PartitionCellId} which represents a set of partition cells. + * The mapping has to be registered to the graph using DataProvider key {@link yfiles.layout.PartitionGrid#PARTITION_CELL_DP_KEY}. + * Simple partition cell identifiers which represent a single partition cell, i.e., a row-/column-pair, can be created + * using method {@link yfiles.layout.PartitionGrid#createCellIdForDescriptors} or {@link yfiles.layout.PartitionGrid#createCellId}. + *

+ *

+ * Nodes can also be mapped to a partition cell identifier that represents a multi-cell, i.e., a cell spanning multiple columns and rows. + * Please note, however, that multi-cells are not allowed to overlap each other. This means that the user has to ensure + * that each partition cell (row-/column-pair) is associated with at most one partition cell identifier. + * The multi-cell identifier can be created using methods {@link yfiles.layout.PartitionGrid#createCellSpanIdForDescriptors}, + * {@link yfiles.layout.PartitionGrid#createCellSpanId}, {@link yfiles.layout.PartitionGrid#createCellSpanIdForDescriptorLists}, + * {@link yfiles.layout.PartitionGrid#createColumnSpanId}, and {@link yfiles.layout.PartitionGrid#createRowSpanId}. + *

+ *

+ * Note: if at least one node is mapped to a multi-cell, enabling option {@link yfiles.layout.PartitionGrid#optimizeColumnOrder} + * or {@link yfiles.layout.PartitionGrid#optimizeRowOrder} has no effect. + *

+ *

+ * Note: A group node mapped to a multi-cell identifier represents the corresponding multi-cell, i.e., its boundary corresponds + * to the smallest rectangle containing all partition cells (rows and columns) specified by the multi-cell. + * The boundary does not depend on the + * partition cells associated with the group's descendants. Hence, each non-group descendant has to be manually + * assigned to one of the partition cells. + * Furthermore, edges incident to such a group node are not considered during the layout. + * Mapping a group node to a simple partition cell identifier has no effect. + *

+ */ + export interface PartitionGrid extends Object{ + /** + * Specifies whether the order of the columns should be chosen automatically. + * Getter:The default is true. + *

+ * Note: if at least one node is mapped to a multi-cell (i.e., a cell spanning multiple columns/rows), + * enabling this option has no effect. + *

+ * Setter:

+ * For all columns where {@link yfiles.layout.ColumnDescriptor#indexFixed} + * is set to true, the relative ordering given by the indices + * is preserved. The remaining columns may be resorted so that the overall edge lengths are minimized. + *

+ *

+ * Note: if at least one node is mapped to a multi-cell (i.e., a cell spanning multiple columns/rows), + * enabling this option has no effect. + *

+ */ + optimizeColumnOrder:boolean; + /** + * Specifies whether the order of the rows should be chosen automatically. + * Getter:The default is true. + *

+ * Note: if at least one node is mapped to a multi-cell (i.e., a cell spanning multiple columns/rows), + * enabling this option has no effect. + *

+ * Setter:

+ * For all rows where {@link yfiles.layout.RowDescriptor#indexFixed} + * is set to true, the relative ordering given by the indices + * is preserved. The remaining rows may be resorted so that the overall edge lengths are minimized. + *

+ *

+ * Note: if at least one node is mapped to a multi-cell (i.e., a cell spanning multiple columns/rows), + * enabling this option has no effect. + *

+ */ + optimizeRowOrder:boolean; + /** + * Creates a partition cell identifier that represents a cell spanning a whole column. + *

+ * A group node mapped to such a partition cell identifier represents the column, i.e., its enclosing boundary + * corresponds to that of the column. The boundary does not depend on the + * partition cells associated with the group's descendants. Hence, each non-group descendant has to be manually + * assigned to one of the partition cells. + * Furthermore, edges incident to such a group node are not considered during the layout. + *

+ * @param {number} columnIndex the column index of the column defining the cell + * @return {yfiles.layout.PartitionCellId} the partition cell identifier + */ + createColumnSpanId(columnIndex:number):yfiles.layout.PartitionCellId; + /** + * Creates a partition cell identifier that represents a multi-cell spanning multiple columns and rows. + *

+ * The partition cell identifier represents all cells defined by a + * row with index between fromRow and toRow (both including) and + * a column with index between fromCol and toCol (both including). + *

+ *

+ * A group node mapped to such a partition cell identifier represents the multi-cell, i.e., its boundary corresponds + * to the smallest rectangle containing all partition cells specified by the partition cell identifier. + * The boundary does not depend on the + * partition cells associated with the group's descendants. Hence, each non-group descendant has to be manually + * assigned to one of the partition cells. + * Furthermore, edges incident to such a group node are not considered during the layout. + *

+ * @param {number} fromRowIndex the row index of the topmost row defining the cell + * @param {number} fromColIndex the column index of the leftmost column defining the cell + * @param {number} toRowIndex the row index of the bottommost row defining the cell + * @param {number} toColIndex the column index of the rightmost column defining the cell + * @return {yfiles.layout.PartitionCellId} the partition cell identifier + */ + createCellSpanId(fromRowIndex:number,fromColIndex:number,toRowIndex:number,toColIndex:number):yfiles.layout.PartitionCellId; + /** + * Creates a partition cell identifier that represents a multi-cell spanning multiple columns and rows. + *

+ * The partition cell identifier represents all cells spanned by the columns of columnList and rows of rowList. + *

+ *

+ * A group node mapped to such a partition cell identifier represents the multi-cell, i.e., its boundary corresponds + * to the smallest rectangle containing all partition cells specified by the partition cell identifier. + * The boundary does not depend on the + * partition cells associated with the group's descendants. Hence, each non-group descendant has to be manually + * assigned to one of the partition cells. + * Furthermore, edges incident to such a group node are not considered during the layout. + *

+ * @param {yfiles.algorithms.ICollection} rowList the rows defining the cell + * @param {yfiles.algorithms.ICollection} columnList the columns defining the cell + * @return {yfiles.layout.PartitionCellId} the partition cell identifier + */ + createCellSpanIdForDescriptorLists(rowList:yfiles.algorithms.ICollection,columnList:yfiles.algorithms.ICollection):yfiles.layout.PartitionCellId; + /** + * Creates a partition cell identifier that represents a multi-cell spanning multiple columns and rows. + *

+ * The partition cell identifier represents all cells defined by a + * row between fromRow and toRow (both including) and + * a column between fromCol and toCol (both including). + *

+ *

+ * A group node mapped to such a partition cell identifier represents the multi-cell, i.e., its boundary corresponds + * to the smallest rectangle containing all partition cells specified by the partition cell identifier. + * The boundary does not depend on the + * partition cells associated with the group's descendants. Hence, each non-group descendant has to be manually + * assigned to one of the partition cells. + * Furthermore, edges incident to such a group node are not considered during the layout. + *

+ * @param {yfiles.layout.RowDescriptor} fromRow the topmost row defining the cell + * @param {yfiles.layout.ColumnDescriptor} fromCol the leftmost column defining the cell + * @param {yfiles.layout.RowDescriptor} toRow the bottommost row defining the cell + * @param {yfiles.layout.ColumnDescriptor} toCol the rightmost column defining the cell + * @return {yfiles.layout.PartitionCellId} the partition cell identifier + */ + createCellSpanIdForDescriptors(fromRow:yfiles.layout.RowDescriptor,fromCol:yfiles.layout.ColumnDescriptor,toRow:yfiles.layout.RowDescriptor,toCol:yfiles.layout.ColumnDescriptor):yfiles.layout.PartitionCellId; + /** + * Creates a partition cell identifier that represents a cell spanning a whole row. + *

+ * A group node mapped to such a partition cell identifier + * represents the row, i.e., its enclosing boundary corresponds to that of the row. + * The boundary does not depend on the + * partition cells associated with the group's descendants. Hence, each non-group descendant has to be manually + * assigned to one of the partition cells. + * Furthermore, edges incident to such a group node are not considered during the layout. + *

+ * @param {number} rowIndex the row index of the row defining the cell + * @return {yfiles.layout.PartitionCellId} the partition cell identifier + */ + createRowSpanId(rowIndex:number):yfiles.layout.PartitionCellId; + /** + * Adds a new row to the partition grid. + * The index of the row (as returned by {@link yfiles.layout.RowDescriptor#index}) is set to the size of the list returned by {@link yfiles.layout.PartitionGrid#rows}. + * @return {yfiles.layout.RowDescriptor} the new row. + */ + addRow():yfiles.layout.RowDescriptor; + /** + * Adds a new column to the partition grid. + * The index of the column (as returned by {@link yfiles.layout.ColumnDescriptor#index}) is set to the size of the list returned by {@link yfiles.layout.PartitionGrid#columns}. + * @return {yfiles.layout.ColumnDescriptor} the new column. + */ + addColumn():yfiles.layout.ColumnDescriptor; + /** + * Returns the row with the given index. + * @param {number} index the index of the row to be returned + * @return {yfiles.layout.RowDescriptor} the row with the given index or null if there is no such row + */ + getRow(index:number):yfiles.layout.RowDescriptor; + /** + * Returns the column with the given index. + * @param {number} index the index of the column to be returned + * @return {yfiles.layout.ColumnDescriptor} the column with the given index or null if there is no such column + */ + getColumn(index:number):yfiles.layout.ColumnDescriptor; + /** + * The rows of the partition grid. + */ + rows:yfiles.algorithms.YList; + /** + * The columns of the partition grid. + */ + columns:yfiles.algorithms.YList; + /** + * Creates a partition cell identifier that represents the cell defined by the given column and row. + * @param {yfiles.layout.RowDescriptor} rd the row defining the cell + * @param {yfiles.layout.ColumnDescriptor} cd the column defining the cell + * @return {yfiles.layout.PartitionCellId} the partition cell identifier + * @throws {yfiles.system.ArgumentException} if the given column/row is null. + */ + createCellIdForDescriptors(rd:yfiles.layout.RowDescriptor,cd:yfiles.layout.ColumnDescriptor):yfiles.layout.PartitionCellId; + /** + * Creates a partition cell identifier that represents the cell defined by the given column and row index. + * @param {number} rowIndex the row index of the row defining the cell + * @param {number} columnIndex the column index of the column defining the cell + * @return {yfiles.layout.PartitionCellId} the partition cell identifier + * @throws {yfiles.system.ArgumentException} if the given column/row index is not valid. + */ + createCellId(rowIndex:number,columnIndex:number):yfiles.layout.PartitionCellId; + /** + * A method that is called at the end of the {@link yfiles.layout.OrientationLayouter} stage. + * @param {yfiles.layout.OrientationLayouter} orientationLayouter the instance of the orientation layouter + * @param {yfiles.layout.OrientationLayouter.Transformer} transformer provides a method for transferring a point to its final position + * @see {@link yfiles.layout.OrientationLayouter} + */ + finalizeOrientationChange(orientationLayouter:yfiles.layout.OrientationLayouter,transformer:yfiles.layout.OrientationLayouter.Transformer):void; + /** + * A method that is called at the beginning of the {@link yfiles.layout.OrientationLayouter} stage. + * @param {yfiles.layout.OrientationLayouter} orientationLayouter the instance of the orientation layouter + * @param {yfiles.layout.OrientationLayouter.Transformer} transformer provides a method for transferring an original point to its temporary position + * @see {@link yfiles.layout.OrientationLayouter} + */ + prepareOrientationChange(orientationLayouter:yfiles.layout.OrientationLayouter,transformer:yfiles.layout.OrientationLayouter.Transformer):void; + } + var PartitionGrid:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key used to store the {@link yfiles.layout.PartitionGrid} structure. + * If the provider contains a partition grid structure + * this structure will be considered during layout (provided that the layout algorithm supports such constraints). + */ + PARTITION_GRID_DP_KEY:Object; + /** + * {@link yfiles.algorithms.IDataProvider} key used to store {@link yfiles.layout.PartitionCellId} + * instances for nodes of the graph. + * Each node is placed inside the columns/rows defined by the corresponding partition cell identifier. + * Instances can be shared among multiple nodes, but don't have to be shared. + * Note, that multi-cell identifiers (i.e., a identifier that represents multiple columns/rows) are not allowed to overlap each other. + * @see {@link yfiles.layout.PartitionCellId} + */ + PARTITION_CELL_DP_KEY:Object; + /** + * Constructs an empty partition grid. + */ + new ():yfiles.layout.PartitionGrid; + /** + * Constructs a partition grid with rowCount rows and columnCount columns. + * @param {number} rowCount the number of rows + * @param {number} columnCount the number of columns + */ + WithRowAndColumnCount:{ + new (rowCount:number,columnCount:number):yfiles.layout.PartitionGrid; + }; + /** + * Constructs a partition grid with rowCount rows and columnCount columns as well as the given insets and min sizes. + * @param {number} rowCount the number of rows + * @param {number} columnCount the number of columns + * @param {number} rowInsets the top and bottom insets of the rows + * @param {number} columnInsets the left and right insets of the columns + * @param {number} minRowSize the minimum row height + * @param {number} minColumnSize the minimum column width + */ + WithRowAndColumnCountAndSize:{ + new (rowCount:number,columnCount:number,rowInsets:number,columnInsets:number,minRowSize:number,minColumnSize:number):yfiles.layout.PartitionGrid; + }; + /** + * Returns the partition grid associated with the given graph. + * @param {yfiles.algorithms.Graph} graph the graph + * @return {yfiles.layout.PartitionGrid} the partition grid of the graph or null if the graph has no associated partition grid + */ + getPartitionGrid(graph:yfiles.algorithms.Graph):yfiles.layout.PartitionGrid; + /** + * Checks whether the nodes of the graph are assigned to at least two different partition rows. + * @deprecated For internal use only. Might be changed or removed in the future. + * @param {yfiles.algorithms.Graph} graph the input graph + * @return {boolean} true, if the nodes of the graph are assigned to at least two different partition rows. + */ + hasAtLeastTwoNonEmptyRows(graph:yfiles.algorithms.Graph):boolean; + }; + export enum InterEdgeRoutingStyle{ + /** + * Inter-edge routing style specifier. Adopts the edge layout from + * the core layouter. + */ + ADOPT, + /** + * Inter-edge routing style specifier. Routes the inter-edges in an orthogonal style. + */ + ORTHOGONAL, + /** + * Inter-edge routing style specifier. Routes the inter-edges as a straight line. + */ + STRAIGHTLINE + } + /** + * This interface defines data provider keys for those layout algorithms that can + * handle hierarchically grouped graphs. + * These keys define the parent-child relationship of nodes within the + * hierarchy and tag nodes that act as group nodes. + */ + export interface GroupingKeys extends Object{ + } + var GroupingKeys:{ + $class:yfiles.lang.Class; + /** + * This key is used to register a DataProvider instance with a graph, that + * associates each node instance with a unique (based on hashCode() and equals()) + * id. + */ + NODE_ID_DP_KEY:Object; + /** + * This key is used to actually describe the hierarchy of the nodes in the graph. + * For each node that is not at the top level of the hierarchy, the id of the containing + * node can be obtained through the data provider associated with this key. + */ + PARENT_NODE_ID_DP_KEY:Object; + /** + * This key is used to distinguish normal nodes from group nodes. + * For every node + * the DataProvider should return true iff the node is a group node (and therefore might + * have children. + */ + GROUP_DP_KEY:Object; + /** + * This key is used to provide insets for group nodes. + * Insets are used to provide + * space around the contents of a group node. This space can then be used for + * labels and other visual decorations. + * For each group node, a {@link yfiles.algorithms.Insets} (or a {@link yfiles.algorithms.Insets}) + * object can be provided using a data provider bound to the graph using this key. + */ + GROUP_NODE_INSETS_DP_KEY:Object; + /** + * This key is used to provide minimum sizes for nodes. + * For each node, a {@link yfiles.algorithms.YDimension} object can be provided using a + * data provider that is bound to the graph with this key. + */ + MINIMUM_NODE_SIZE_DP_KEY:Object; + }; + /** + * Instances of this class can be used by algorithms to efficiently query the structure + * of such type of graphs. + * The grouping information is provided through DataProviders, + * whose keys are defined in the GroupingKeys interface. + */ + export interface GraphGrouping extends Object{ + /** + * Initializes internal data structures. + * The state of the graph at the moment + * of this method invocation will be reflected by this instance. + */ + init():void; + /** + * The LayoutGraph instance this object provides information for. + *

This Grouping instance must have been created with a {@link yfiles.layout.LayoutGraph}

+ */ + layoutGraph:yfiles.layout.LayoutGraph; + /** + * The Graph instance this object provides information for. + */ + graph:yfiles.algorithms.Graph; + /** + * Factory method for a NodeMap. + */ + createInfoMap(graph:yfiles.algorithms.Graph):yfiles.algorithms.INodeMap; + /** + * Factory destructor method for a NodeMap. + */ + disposeInfoMap(graph:yfiles.algorithms.Graph,infoMap:yfiles.algorithms.INodeMap):void; + /** + * Returns the parent of the given node or null if the node + * is at the top of the hierarchy. + */ + getParent(node:yfiles.algorithms.Node):yfiles.algorithms.Node; + /** + * A node instance that can be used as a handle to the virtual root + * of the node hierarchy. + * This handle can be given to the getChildren() method + * to obtain the nodes, that are at the top level of the hierarchy. The instance + * is *not* part of the graph. + */ + root:yfiles.algorithms.Node; + /** + * Returns the children of the given group node as a NodeList. + */ + getChildren(parent:yfiles.algorithms.Node):yfiles.algorithms.NodeList; + /** + * Returns all descendants of the given group node as a NodeList. + * @param {yfiles.algorithms.Node} parent + * A group node. + * If null is given, the graph's root is used. + * @return {yfiles.algorithms.NodeList} + * A recursively built NodeList containing all descendants of the given group + * node. + */ + getDescendants(parent:yfiles.algorithms.Node):yfiles.algorithms.NodeList; + /** + * Determines if the given node is a group node. + * Group nodes *may* have children. + * Normal nodes never have children. + */ + isGroupNode(node:yfiles.algorithms.Node):boolean; + /** + * Determines if the given node is a group node with children. + */ + hasChildren(v:yfiles.algorithms.Node):boolean; + /** + * Determines if the given Edge is a normal edge, i.e. + * whether it does not cross + * any group node boundaries. + */ + isNormalEdge(e:yfiles.algorithms.Edge):boolean; + /** + * Convenience method that returns a list of all Edges crossing the group node + * boundary of the given group node in such a way, that there target is inside the + * group node and the source does not lie inside the group node. + */ + getEdgesGoingIn(groupNode:yfiles.algorithms.Node):yfiles.algorithms.EdgeList; + /** + * Convenience method that returns a list of all Edges crossing the group node + * boundary of the given group node in such a way, that there target is outside the + * group node and the source does not lie outside the group node. + */ + getEdgesGoingOut(groupNode:yfiles.algorithms.Node):yfiles.algorithms.EdgeList; + /** + * Convenience method that returns a node that can be used to represent + * node in the group inGroup, that is either the node + * itself if it is an immediate child of inGroup, or a node that + * is a child of inGroup and an ancestor of node at the + * same time or null if neither of the latter applies. + * @param {yfiles.algorithms.Node} node the node for which a representative will be returned + * @param {yfiles.algorithms.Node} inGroup the group to which the representative should belong. + */ + getRepresentative(node:yfiles.algorithms.Node,inGroup:yfiles.algorithms.Node):yfiles.algorithms.Node; + /** + * Disposes the data structures held by this instance. + * Calling this method renders this instance useless. + */ + dispose():void; + /** + * Returns the nearest common ancestor in the hierarchy structure. + *

+ * This method returns the nearest ancestor of n1 and + * n2 that contains both n1 and n2 or + * it returns {@link yfiles.layout.GraphGrouping#root} if no such node exists. + * In the special cases of n2 being a child of n1 + * (or vice versa) or if n1 == n2, the parent of n1 + * (or n2 respectively) is returned. + *

+ * @param {yfiles.algorithms.Node} n1 one of the two nodes whose common ancestor is determined. + * @param {yfiles.algorithms.Node} n2 one of the two nodes whose common ancestor is determined. + * @return {yfiles.algorithms.Node} + * The nearest common ancestor node, or {@link yfiles.layout.GraphGrouping#root}. + */ + getNearestCommonAncestor(n1:yfiles.algorithms.Node,n2:yfiles.algorithms.Node):yfiles.algorithms.Node; + } + var GraphGrouping:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of Grouping. + * Grouping instances + * provide a convenient way for all kind of algorithms to traverse the node + * grouping hierarchy. The hierarchy is cached during the call to this constructor. + * It is build using the information bound to the graph using the DataProviders + * that are registered with the graph instance. + * Grouping instances hold a state that with the graph instance that should be + * {@link yfiles.layout.GraphGrouping#dispose disposed} once the grouping instance is not needed anymore. + */ + new (graph:yfiles.algorithms.Graph):yfiles.layout.GraphGrouping; + /** + * A graph is considered to be grouped if the three low-level + * grouping data providers {@link yfiles.layout.GroupingKeys#GROUP_DP_KEY}, + * {@link yfiles.layout.GroupingKeys#NODE_ID_DP_KEY} and {@link yfiles.layout.GroupingKeys#PARENT_NODE_ID_DP_KEY} + * are registered. + * An instance of this class requires its graph to be grouped. + */ + isGrouped(graph:yfiles.algorithms.Graph):boolean; + /** + * A graph is considered to be flat if it is either not grouped + * or there is no group node that contains child nodes present in the graph. + * This method determines whether a graph is flat + */ + isFlat(graph:yfiles.algorithms.Graph):boolean; + }; + /** + * Represents an identifier for partition cells of the partition grid. + * @see {@link yfiles.layout.PartitionGrid} + */ + export interface PartitionCellId extends Object{ + /** + * A collection of elements of type Pair. + * Each pair consists of a column and a row defining a single partition cell. + * Note: a partition cell id that covers more than one partition cell can only be assigned to group nodes. + */ + cells:yfiles.algorithms.ICollection; + /** + * True if the partition cell id represents a multi-cell, i.e., whether or not it was created with method + * {@link yfiles.layout.PartitionGrid#createCellSpanIdForDescriptorLists}, + * {@link yfiles.layout.PartitionGrid#createCellSpanIdForDescriptors}, + * {@link yfiles.layout.PartitionGrid#createCellSpanId}, {@link yfiles.layout.PartitionGrid#createColumnSpanId} or + * {@link yfiles.layout.PartitionGrid#createRowSpanId}. + */ + isSpanning:boolean; + /** + * The first row associated with this partition cell id. + */ + row:yfiles.layout.RowDescriptor; + /** + * The first column associated with this partition cell id. + */ + column:yfiles.layout.ColumnDescriptor; + equals(o:Object):boolean; + hashCode():number; + } + export module PartitionCellId{ + /** + * Represents a single partition cell, i.e., a row-column pair. + */ + export interface Pair extends Object,yfiles.lang.IObjectComparable{ + /** + * The RowDescriptor associated with this partition cell. + */ + row:yfiles.layout.RowDescriptor; + /** + * The ColumnDescriptor associated with this partition cell. + */ + column:yfiles.layout.ColumnDescriptor; + /** + * 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; + equals(o:Object):boolean; + hashCode():number; + } + } + var PartitionCellId:{ + $class:yfiles.lang.Class; + }; + export enum SliderRatio{ + /** + * Symbolic ratio specifier. + * Valid only in conjunction with slider mode {@link yfiles.layout.SliderMode#CENTER}. + */ + CENTER, + /** + * Symbolic ratio specifier. + * Valid only in conjunction with slider mode {@link yfiles.layout.SliderMode#SIDE}. + * Determines a label to be right of or below the edge's path. + */ + TAIL, + /** + * Symbolic ratio specifier. + * Valid only in conjunction with slider mode {@link yfiles.layout.SliderMode#SIDE}. + * Determines a label to be left of or above the edge's path. + */ + HEAD, + /** + * Symbolic ratio specifier. + * Valid only in conjunction with slider mode {@link yfiles.layout.SliderMode#SIDE}. + * Determines a label to be left of the edge's path. + */ + LEFT, + /** + * Symbolic ratio specifier. + * Valid only in conjunction with slider mode {@link yfiles.layout.SliderMode#SIDE}. + * Determines a label to be right of the edge's path. + */ + RIGHT + } + export enum SelfloopStyle{ + /** + * Edge layout style modifier. + * Using this style, selfloops are routed in an orthogonal fashion, i.e., the route consists of an alternating + * sequence of horizontal and vertical line segments. + * This style can be set with method {@link yfiles.layout.SelfLoopLayouter#layoutStyle}. + * @see {@link yfiles.layout.SelfLoopLayouter#layoutStyle} + */ + ORTHOGONAL, + /** + * Edge layout style modifier. + * Using this style, the routes of selfloops are rounded. + * This style can be set with method {@link yfiles.layout.SelfLoopLayouter#layoutStyle}. + * @see {@link yfiles.layout.SelfLoopLayouter#layoutStyle} + */ + ROUNDED + } + export enum SwimlanesMode{ + /** + * Swim lane ordering mode specifier. Specifies that node grouping is ignored during the swim lane ordering + * optimization. + * @see {@link yfiles.layout.Swimlanes#arrangeSwimlanesWithOrderingMode} + */ + IGNORE_GROUPS, + /** + * Swim lane ordering mode specifier. Specifies that only node grouping is considered during the swim lane ordering + * optimization. + * @see {@link yfiles.layout.Swimlanes#arrangeSwimlanesWithOrderingMode} + */ + ONLY_GROUPS, + /** + * Swim lane ordering mode specifier. Specifies that both node grouping and edge length are considered during the swim + * lane ordering optimization. + * @see {@link yfiles.layout.Swimlanes#arrangeSwimlanesWithOrderingMode} + */ + MIXED + } + /** + * This class represents a column of a {@link yfiles.layout.PartitionGrid}. + * The results of the calculation of the geometry of the column will be placed + * into the instances of this class after the layout. + * @see {@link yfiles.layout.PartitionGrid} + */ + export interface ColumnDescriptor extends Object,yfiles.lang.IObjectComparable{ + /** + * The index of the column within the partition grid. + */ + index:number; + /** + * 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; + /** + * The minimum column width. + * The default is 0.0d. + * @throws {yfiles.system.ArgumentException} if minimumWidth is negative + */ + minimumWidth:number; + /** + * The left column insets where no element + * will lie in the resulting drawing. + * The default is 0.0d. + * @throws {yfiles.system.ArgumentException} if leftInset is negative + */ + leftInset:number; + /** + * The right column insets where no element + * will lie in the resulting drawing. + * The default is 0.0d. + * @throws {yfiles.system.ArgumentException} if rightInset is negative + */ + rightInset:number; + /** + * The computed width of the column + * after the layout has been calculated. + */ + computedWidth:number; + /** + * The original width of the column. + */ + originalWidth:number; + /** + * The original position (smaller x-coordinate) of the column. + */ + originalPosition:number; + /** + * The computed position (smaller x-coordinate) of the column + * after the layout has been calculated. + */ + computedPosition:number; + /** + * The tightness factor of the column. + * Getter:The default is 0.0d. + * Setter:The greater the value the + * more will the column to be forced to be of its minimal possible width. + * A value of 0.0d will disable compression of the column. + * A value of 1.0d will try to force the column to be of + * its {@link yfiles.layout.ColumnDescriptor#minimumWidth minimum width}. + * @throws {yfiles.system.ArgumentException} if tightness is out of the valid range + */ + tightness:number; + /** + * Specifies whether the index of this column is fixed or whether + * the algorithm should try to find the best possible position. + * Getter:The default is true + * Setter:

+ * For all columns where this property is set to true, the relative ordering given by the indices + * is preserved. The remaining columns may be resorted so that the overall edge lengths are minimized. + *

+ *

+ * By default, this feature is enabled.

+ */ + indexFixed:boolean; + } + var ColumnDescriptor:{ + $class:yfiles.lang.Class; + }; + /** + * Recursively traverses a hierarchically organized graph in a bottom-up fashion + * and applies the given layout algorithm (i.e. + * the core layouter) to the contents (direct children) + * of each group node. + * The size of the group nodes can be further determined by setting a customized + * GroupBoundsCalculator implementation. + *

+ * Note that this class can be run without a core layouter instance. + * In this case no layout is calculated, instead the group node bounds are merely + * adjusted to fit their respective contents. There are two alternatives for applying different layout styles + * to the contents of group nodes: + * 1. Map each group node to the corresponding layouter using data provider key {@link yfiles.layout.RecursiveGroupLayouter#GROUP_NODE_LAYOUTER_DP_KEY}. + * The content of the hierarchy root is laid out with the core layouter. + * 2. Alternatively you can use a {@link yfiles.layout.LayoutMultiplexer} as core layouter. + *

+ */ + export interface RecursiveGroupLayouter extends yfiles.layout.AbstractLayoutStage{ + /** + * Whether or not to consider the initial coordinates of the graph elements. + * This option should be enabled if the recursive group layouter uses a layouter that runs in "from sketch mode". + * If it is enabled, the recursive group layouter sets the coordinates of the node elements to their initial position + * before the corresponding layouter is called. + * By default this option is disabled. + */ + considerSketch:boolean; + /** + * Specifies whether or not temporary port candidates should be inserted for edges without such candidates. + * If we do not insert such port candidates, inter-edges (edges which traverse the boundary of a group node) + * always end at the border/center of the corresponding group node and, thus, are routed straight-line + * (see {@link yfiles.layout.RecursiveGroupLayouter#routeInterEdges}). + * Hence, enabling this option may produce more suitable edge routes if the layout algorithm applied + * to the content of a group node can handle port candidates. + * The default value is false. + * Note: predefined port candidates are always satisfied, even if this option is disabled + * (only if the applied layouter supports them). + * @see {@link yfiles.layout.RecursiveGroupLayouter#routeInterEdges} + * @see {@link yfiles.layout.RecursiveGroupLayouter#routeInterEdges} + */ + autoAssignPortCandidates:boolean; + /** + * Specifies whether or not port constraints should be temporarily replaced by port candidates. + * If port constraints are not replaced by port candidates, + * inter-edges (edges which traverse the boundary of a group node) always end at the border/center of the + * corresponding group node (even if those edges have port constraints) and, thus, are routed straight-line + * (see {@link yfiles.layout.RecursiveGroupLayouter#routeInterEdges}) without considering the constraint. + * Port candidates are automatically redirected to their original location. + * Hence, enabling this option may produce more suitable edge routes if the layout algorithm + * applied to the content of a group node can handle port candidates. + * The default value is true. + * @see {@link yfiles.layout.RecursiveGroupLayouter#routeInterEdges} + * @see {@link yfiles.layout.RecursiveGroupLayouter#routeInterEdges} + */ + replacePortConstraints:boolean; + /** + * Specifies whether or not group nodes without children are handled the same + * way as group nodes with children. + * Defaults to true. + * @see {@link yfiles.layout.RecursiveGroupLayouter#routeInterEdges} + * @see {@link yfiles.layout.RecursiveGroupLayouter#routeInterEdges} + */ + considerEmptyGroups:boolean; + /** + * The current edge router used to layout inter-edges. + * During layout edges that connect from outside a group + * node to the content inside (inter-edges) are temporarily connected to the group node itself. Hence, they are routed + * when the original graph structure is restored using this edge router. + *

+ * It is required that a suitable {@link yfiles.layout.RecursiveGroupLayouter#interEdgesDpKey selection key} is specified. The same + * selection key must be used to set the sphere of action for the edge router. + *

+ *

+ * By default, no edge router is specified. + *

+ * @see {@link yfiles.layout.RecursiveGroupLayouter#interEdgesDpKey} + * @see {@link yfiles.layout.RecursiveGroupLayouter#interEdgesDpKey} + */ + interEdgeRouter:yfiles.layout.ILayouter; + /** + * The key that is used to mark the inter-edges to be routed. + * Note that this layouter automatically marks these edges and registers the DataProvider using the specified key. + * The key should be used by the specified inter-edge router to obtain the edges to be routed. + *

+ * By default, {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY} is used. + *

+ * @see {@link yfiles.layout.RecursiveGroupLayouter#interEdgeRouter} + * @throws {yfiles.system.ArgumentException} if the specified key is null. + * @see {@link yfiles.layout.RecursiveGroupLayouter#interEdgeRouter} + */ + interEdgesDpKey:Object; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * This method is called after calculating the overall layout and reroutes the inter-edges, + * i.e., edges which traverse the boundary of a group node. + * More precisely, if those edges do not have port candidates or the applied layout algorithm does not + * support this kind of constraints, + * the route of inter-edges always ends at the border/center of the corresponding group node. + * This method identifies such edges and routes them using the specified edge router. By default, these edges are + * routed straight-line. + * @param {yfiles.layout.LayoutGraph} graph the input graph. + * @param {yfiles.algorithms.EdgeList} interEdges the edges which traverse the boundary of a group node. + * @see {@link yfiles.layout.RecursiveGroupLayouter#autoAssignPortCandidates} + * @see {@link yfiles.layout.RecursiveGroupLayouter#replacePortConstraints} + * @see {@link yfiles.layout.RecursiveGroupLayouter#interEdgeRouter} + */ + routeInterEdges(graph:yfiles.layout.LayoutGraph,interEdges:yfiles.algorithms.EdgeList):void; + /** + * The currently installed GroupBoundsCalculator instance. + */ + groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; + } + var RecursiveGroupLayouter:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key used to retrieve a {@link yfiles.layout.ILayouter} + * instance for each group node. + * The specified layouter instance is applied to the content of the group node. + * For the top level elements the core layouter is used. + * If the data provider returns "null" the corresponding group node is handled non-recursive, i.e., + * the group node and its content is laid out with the {@link yfiles.layout.ILayouter} + * instance specified by the nearest predecessor of the group node (with respect to the grouping hierarchy) which is associated with a layouter. + * If the content of a group node should not be changed, the group node can be associated with a "null" layouter, + * e.g., constant {@link yfiles.layout.RecursiveGroupLayouter#NULL_LAYOUTER}. + */ + GROUP_NODE_LAYOUTER_DP_KEY:Object; + /** + * A constant that represents a layouter implementation that does nothing. + */ + NULL_LAYOUTER:yfiles.layout.ILayouter; + /** + * Creates a new instance of RecursiveGroupLayouter. + */ + new ():yfiles.layout.RecursiveGroupLayouter; + /** + * Creates a new instance of RecursiveGroupLayouter using the given layout + * algorithm. + */ + WithCoreLayouter:{ + new (core:yfiles.layout.ILayouter):yfiles.layout.RecursiveGroupLayouter; + }; + /** + * Creates a new instance of RecursiveGroupLayouter using the given layout + * algorithm and GroupBoundsCalculator implementation. + */ + WithCoreLayouterAndCalculator:{ + new (core:yfiles.layout.ILayouter,gbc:yfiles.layout.IGroupBoundsCalculator):yfiles.layout.RecursiveGroupLayouter; + }; + }; + export enum RowAlignment{ + /** + * Constant which can be used for + * {@link yfiles.layout.LayoutTool#arrangeRectangleRowsWithAlignment}. + * Rectangles in one row will be aligned with the leading edge. + */ + LEADING, + /** + * Constant which can be used for + * {@link yfiles.layout.LayoutTool#arrangeRectangleRowsWithAlignment}. + * Rectangles in one row will be aligned to the trailing edge. + */ + TRAILING, + /** + * Constant which can be used for + * {@link yfiles.layout.LayoutTool#arrangeRectangleRowsWithAlignment}. + * Rectangles in one row will be justified in the row. + */ + JUSTIFIED, + /** + * Constant which can be used for + * {@link yfiles.layout.LayoutTool#arrangeRectangleRowsWithAlignment}. + * Rectangles in one row will be centered on the row. + */ + CENTER + } + export enum RotatedSliderMode{ + /** + * Symbolic slider mode specifier. + * Chooses continuous label positions directly on the edge path. + */ + CENTER, + /** + * Symbolic slider mode specifier. + * Chooses continuous label positions along both sides of the edge path. + */ + SIDE, + /** + * Symbolic slider mode specifier. + * Chooses continuous label positions along a side of the edge path. + */ + SINGLE_SIDE + } + export enum LayoutOrientation{ + /** + * Orientation specifier. Layout will be oriented from top to bottom, + * which is the default for all layout algorithms. + */ + TOP_TO_BOTTOM, + /** + * Orientation specifier. Layout will be from left to right, which means + * that the layout will be rotated by 90 degrees counterclockwise + */ + LEFT_TO_RIGHT, + /** + * Orientation specifier. Layout will be from right to left, which means + * that the layout will be rotated by 90 degrees clockwise + */ + RIGHT_TO_LEFT, + /** + * Orientation specifier. Layout will be from bottom to top, which means + * that the layout will be flipped along the x axis. + */ + BOTTOM_TO_TOP + } + /** + * This class can be used as a decorating stage for layout algorithms that + * cannot handle node groups. + * Before calling the core layout algorithms, this + * class will augment the graph structure. For each node that belongs to a group, + * a so-called "parent-edge" will be temporarily inserted into the graph. + */ + export interface ParentEdgeAugmentationStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true if the core layouter can layout the augmented graph. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#canLayout} + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var ParentEdgeAugmentationStage:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of ParentEdgeAugmentationStage. + */ + new ():yfiles.layout.ParentEdgeAugmentationStage; + }; + /** + * Implementations of this interface are responsible for calculating the bounds + * of a group node during a layout process. + */ + export interface IGroupBoundsCalculator extends Object{ + /** + * This method is called during the layout process. + * It calculates the bounds for + * the given groupNode instance that contains the children. + * @param {yfiles.layout.LayoutGraph} graph the graph instance for which the bounds will be calculated + * @param {yfiles.algorithms.Node} groupNode the group node whose bounds will be calculated + * @param {yfiles.algorithms.NodeList} children a list of nodes which reside inside the group node + * @return {yfiles.algorithms.Rectangle2D} a Rectangle2D instance that describes the bounds of the group node. + * @see Specified by {@link yfiles.layout.IGroupBoundsCalculator#calculateBounds}. + */ + calculateBounds(graph:yfiles.layout.LayoutGraph,groupNode:yfiles.algorithms.Node,children:yfiles.algorithms.NodeList):yfiles.algorithms.Rectangle2D; + } + var IGroupBoundsCalculator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A layout stage for hierarchically grouped graphs. + * Activating this stage + * removes all group nodes and adjacent edges from the graph before + * passing it on to its core layouter. + * After the core layouter has arranged the graph, the hidden elements + * will be reinserted in the graph again. + */ + export interface GroupNodeHider extends yfiles.layout.AbstractLayoutStage{ + /** + * Specifies whether or not group nodes without children will be hidden. + * Defaults to true. + */ + hidingEmptyGroupNodes:boolean; + /** + * Hides the group nodes and adjacent edges from the graph. + * Furthermore this method removes all grouping related DataProviders from the input graph. + */ + hideGroupNodes(graph:yfiles.layout.LayoutGraph):void; + /** + * Unhides group nodes and adjacent edges from the graph that were previously hidden using method + * {@link yfiles.layout.GroupNodeHider#hideGroupNodes}. + * Furthermore this method restores all + * previously removed grouping related DataProviders on the input graph. + */ + unhideGroupNodes(graph:yfiles.layout.LayoutGraph):void; + /** + * The currently installed GroupBoundsCalculator instance. + */ + groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var GroupNodeHider:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of GroupNodeHider. + */ + new ():yfiles.layout.GroupNodeHider; + /** + * Creates a new instance of GroupNodeHider. + * @param {yfiles.layout.ILayouter} coreLayouter the core layouter used by this layout stage. + */ + WithCoreLayouter:{ + new (coreLayouter:yfiles.layout.ILayouter):yfiles.layout.GroupNodeHider; + }; + }; + /** + * Convenience implementation which allows for custom insets for each group node. + * Insets are provided through a DataProvider which must be registered with the + * graph prior to the invocation of the layout algorithm. + */ + export interface InsetsGroupBoundsCalculator extends Object,yfiles.layout.IGroupBoundsCalculator{ + /** + * Specifies whether the bounds calculation for group nodes takes labels of the + * group's content nodes into account. + *

+ * Defaults to false. + *

+ */ + considerNodeLabelsEnabled:boolean; + /** + * Specifies whether the bounds calculation for group nodes takes labels of the group's content edges into account. + *

+ * Defaults to false + *

+ */ + considerEdgeLabels:boolean; + /** + * Specifies whether the bounds calculation for group nodes takes node halos of the + * group's content nodes into account. + *

+ * Defaults to true. + *

+ */ + considerNodeHalos:boolean; + /** + * This method is called during the layout process. + * It calculates the bounds for + * the given groupNode instance that contains the children. + * @param {yfiles.layout.LayoutGraph} graph the graph instance for which the bounds will be calculated + * @param {yfiles.algorithms.Node} groupNode the group node whose bounds will be calculated + * @param {yfiles.algorithms.NodeList} children a list of nodes which reside inside the group node + * @return {yfiles.algorithms.Rectangle2D} a Rectangle2D instance that describes the bounds of the group node. + * @see Specified by {@link yfiles.layout.IGroupBoundsCalculator#calculateBounds}. + */ + calculateBounds(graph:yfiles.layout.LayoutGraph,groupNode:yfiles.algorithms.Node,children:yfiles.algorithms.NodeList):yfiles.algorithms.Rectangle2D; + /** + * This method enlarges the given graph bounds by the insets associated with the given group node. + */ + createEnlargedBounds(graph:yfiles.layout.LayoutGraph,groupNode:yfiles.algorithms.Node,children:yfiles.algorithms.NodeList,bounds:yfiles.algorithms.Rectangle2D):yfiles.algorithms.Rectangle2D; + /** + * Calculates and returns the united bounds of the given nodes only, + * no labels or adjacent edges are considered. + */ + getNodeBounds(graph:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList):yfiles.algorithms.Rectangle2D; + /** + * The default insets. + */ + defaultInsets:yfiles.algorithms.Insets; + /** + * The DataProvider key that is used to get the insets for the nodes. + */ + groupNodeInsetsDpKey:Object; + } + var InsetsGroupBoundsCalculator:{ + $class:yfiles.lang.Class; + /** + * Constructs an instance that uses insets provided through the + * data provider registered at the input graph with the public key + * {@link yfiles.layout.GroupingKeys#GROUP_NODE_INSETS_DP_KEY}. + */ + new ():yfiles.layout.InsetsGroupBoundsCalculator; + /** + * Constructs an instance that uses the specified insets as the default if + * the data provider contains no insets information for a specific node. + */ + FromInsets:{ + new (insets:yfiles.algorithms.Insets):yfiles.layout.InsetsGroupBoundsCalculator; + }; + /** + * Constructs an instance using the given DataProvider key. + */ + InsetsGroupBoundsCalculator:{ + new (insetsDataProviderKey:Object):yfiles.layout.InsetsGroupBoundsCalculator; + }; + /** + * Constructs an instance using the given DataProvider key and default insets. + */ + FromInsetsDataProviderKeyAndDefaultInsets:{ + new (insetsDataProviderKey:Object,defaultInsets:yfiles.algorithms.Insets):yfiles.layout.InsetsGroupBoundsCalculator; + }; + }; + /** + * This subclass of {@link yfiles.layout.InsetsGroupBoundsCalculator} does not + * only allow custom insets for each group node, but also makes sure to keep provided minimum + * sizes registered for each node that are provided through a DataProvider which must be + * registered with the graph prior to the invocation of the layout algorithm. + * By default {@link yfiles.layout.GroupingKeys#MINIMUM_NODE_SIZE_DP_KEY} is used as the data provider key, but one can + * also determine another using the according constructor or method {@link yfiles.layout.MinimumSizeGroupBoundsCalculator#minimumNodeSizeDpKey}. + */ + export interface MinimumSizeGroupBoundsCalculator extends yfiles.layout.InsetsGroupBoundsCalculator{ + /** + * This method is called during the layout process. + * It calculates the bounds for + * the given groupNode instance that contains the children. + * @param {yfiles.layout.LayoutGraph} graph the graph instance for which the bounds will be calculated + * @param {yfiles.algorithms.Node} groupNode the group node whose bounds will be calculated + * @param {yfiles.algorithms.NodeList} children a list of nodes which reside inside the group node + * @return {yfiles.algorithms.Rectangle2D} a Rectangle2D instance that describes the bounds of the group node. + * @see Specified by {@link yfiles.layout.IGroupBoundsCalculator#calculateBounds}. + */ + calculateBounds(graph:yfiles.layout.LayoutGraph,groupNode:yfiles.algorithms.Node,children:yfiles.algorithms.NodeList):yfiles.algorithms.Rectangle2D; + /** + * A value that describes how the node will be resized horizontally if the calculated width + * of {@link yfiles.layout.InsetsGroupBoundsCalculator} is smaller than + * the minimal width that is provided for the node. + * The default value is 0.5, which means the node will grow equally to the left and to the right, + * while the center stays put. + */ + xAlignment:number; + /** + * A value that describes how the node will be resized vertically if the calculated height + * of {@link yfiles.layout.InsetsGroupBoundsCalculator} is smaller than + * the minimal height that is provided for the node. + * The default value is 0.5, which means the node will grow equally upwards and downwards, + * while the center stays put. + */ + yAlignment:number; + /** + * The DataProvider key that is used to get the minimum sizes for the nodes. + */ + minimumNodeSizeDpKey:Object; + /** + * The default minimum size for nodes. + *

+ * By default this is a YDimension with length 0 and + * width 0. + *

+ */ + defaultMinimumNodeSize:yfiles.algorithms.YDimension; + } + var MinimumSizeGroupBoundsCalculator:{ + $class:yfiles.lang.Class; + /** + * Constructs an instance that uses the minimum size provided through the data provider registered at the input + * graph with the public key {@link yfiles.layout.GroupingKeys#MINIMUM_NODE_SIZE_DP_KEY}. + */ + new ():yfiles.layout.MinimumSizeGroupBoundsCalculator; + /** + * Constructs an instance using the given DataProvider key. + * @param {Object} minSizeDataProviderKey + * a DataProvider key that is used to get the + * minimum sizes for the nodes. + */ + ForKey:{ + new (minSizeDataProviderKey:Object):yfiles.layout.MinimumSizeGroupBoundsCalculator; + }; + }; + /** + * A special component layouter that handles hierarchically grouped graphs + * in a special way. + * Unlike {@link yfiles.layout.ComponentLayouter} this layout stage allows + * isolated subgraphs within a group to be laid out as a separate component. + * The orthogonal group layouter uses + * this layout stage as component layouter. + */ + export interface IsolatedGroupComponentLayouter extends yfiles.layout.ComponentLayouter{ + /** + * Returns true, iff the coreLayouter returns true for all components + * of the graph. + * @see Overrides {@link yfiles.layout.ComponentLayouter#canLayout} + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Determines which nodes will belong to the same graph component. + * Unlike {@link yfiles.layout.ComponentLayouter} this implementation identifies + * isolated subgraphs within a group also as separate components. + */ + findIsolatedGraphComponents(graph:yfiles.layout.LayoutGraph,compNumber:yfiles.algorithms.INodeMap):number; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var IsolatedGroupComponentLayouter:{ + $class:yfiles.lang.Class; + /** + * Create a new instance of IsolatedGroupComponentLayouter. + * @param {yfiles.layout.ILayouter} coreLayouter + * the core layouter being invoked for each component + * of the graph. + */ + WithCoreLayouter:{ + new (coreLayouter:yfiles.layout.ILayouter):yfiles.layout.IsolatedGroupComponentLayouter; + }; + /** + * Create a new instance of IsolatedGroupComponentLayouter. + */ + new ():yfiles.layout.IsolatedGroupComponentLayouter; + }; + export enum OperationType{ + /** + * Operation type constant. Specifies that the graph should be + * mirrored along the x-axis. + * @see {@link yfiles.layout.GraphTransformer#operation} + * @see {@link yfiles.layout.GraphTransformer#operation} + */ + MIRROR_XAXIS, + /** + * Operation type constant. Specifies that the graph should be + * mirrored along the y-axis. + * @see {@link yfiles.layout.GraphTransformer#operation} + * @see {@link yfiles.layout.GraphTransformer#operation} + */ + MIRROR_YAXIS, + /** + * Operation type constant. Specifies that the graph should be + * rotated. + * @see {@link yfiles.layout.GraphTransformer#operation} + * @see {@link yfiles.layout.GraphTransformer#operation} + */ + ROTATE, + /** + * Operation type constant. Specifies that the graph should be + * scaled. + * @see {@link yfiles.layout.GraphTransformer#operation} + * @see {@link yfiles.layout.GraphTransformer#operation} + */ + SCALE, + /** + * Operation type constant. Specifies that the graph should be + * translated. + * @see {@link yfiles.layout.GraphTransformer#operation} + * @see {@link yfiles.layout.GraphTransformer#operation} + */ + TRANSLATE + } + /** + * This class represents a constraint for either a source or target port + * of an edge. + * Objects of type PortConstraint are expected to be returned by + * data providers that are registered by the keys defined in the + * interface {@link yfiles.layout.PortConstraintKeys}. + * A port constraint expresses at what position an edge is allowed + * to connect to either its source or target node. + * A weak port constraint limits the position of the port + * to a particular side of a node. + * Additionally, a strong port constraint fixes the position of the + * port completely to the position of the current port coordinates. + * For example, PortConstraint p = PortConstraint.create(PortConstraint.NORTH) + * expresses that an edge should connect at the north side of a node. It is + * a weak constraint. + * On the other hand p = PortConstraint.create(PortConstraint.NORTH, true) + * expresses that an edge should not only connect at the north side of a node + * but also should use the current port coordinates. This is a strong constraint. + */ + export interface PortConstraint extends Object{ + /** + * true if this PortConstraint represents + * a strong constraint and false otherwise. + */ + strong:boolean; + /** + * The side of a node at which a port should connect. + */ + side:yfiles.layout.PortSide; + /** + * Specifies whether or not this port constraint has + * the weak constraint side {@link yfiles.layout.PortSide#NORTH} associated + * with it. + */ + atNorth:boolean; + /** + * Specifies whether or not this port constraint has + * the weak constraint side {@link yfiles.layout.PortSide#SOUTH} associated + * with it. + */ + atSouth:boolean; + /** + * Specifies whether or not this port constraint has + * the weak constraint side {@link yfiles.layout.PortSide#EAST} associated + * with it. + */ + atEast:boolean; + /** + * Specifies whether or not this port constraint has + * the weak constraint side {@link yfiles.layout.PortSide#WEST} associated + * with it. + */ + atWest:boolean; + /** + * Specifies whether or not this port constraint has + * the weak constraint side {@link yfiles.layout.PortSide#ANY} associated + * with it. + */ + atAnySide:boolean; + hashCode():number; + /** + * Tests for equality based on the strong attribute and the + * side attribute. + */ + equals(other:Object):boolean; + /** + * Returns a string representation of this object. + */ + toString():string; + } + var PortConstraint:{ + $class:yfiles.lang.Class; + /** + * Creates the empty constraint, that allows ports to connect at any side of a + * node. + */ + CreateDefault:{ + new ():yfiles.layout.PortConstraint; + }; + /** + * Creates the weak constraint, that allows ports to connect to a specific side + * of a node. + * @param {yfiles.layout.PortSide} side + * weak constraint specifier. One of {@link yfiles.layout.PortSide#ANY}, {@link yfiles.layout.PortSide#NORTH}, + * {@link yfiles.layout.PortSide#SOUTH}, {@link yfiles.layout.PortSide#EAST} or {@link yfiles.layout.PortSide#WEST}. + */ + FromSide:{ + new (side:yfiles.layout.PortSide):yfiles.layout.PortConstraint; + }; + /** + * Creates a constraint, that allows ports to connect to a specific side + * of a node. + * @param {yfiles.layout.PortSide} side + * weak constraint specifier. One of {@link yfiles.layout.PortSide#ANY}, {@link yfiles.layout.PortSide#NORTH}, + * {@link yfiles.layout.PortSide#SOUTH}, {@link yfiles.layout.PortSide#EAST} or {@link yfiles.layout.PortSide#WEST}. + * @param {boolean} strong + * whether the layouter should use the current port coordinates + * (strong constraint) + */ + new (side:yfiles.layout.PortSide,strong:boolean):yfiles.layout.PortConstraint; + /** + * Returns whether or not there are non-trivial + * source or target port constraints associated with the + * given edge. + * The data provider keys + * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} + * and {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} + * are used to lookup the data providers in the given graph. + */ + hasPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):boolean; + /** + * Returns whether or not there is a non-trivial + * source port constraint associated with the + * given edge. + * The data provider key + * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} + * is used to lookup the source port constraint data + * provider in the given graph. + */ + hasSPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):boolean; + /** + * Returns whether or not there is a non-trivial + * target port constraint associated with the + * given edge. + * The data provider key + * {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY} + * is used to lookup the source port constraint data + * provider in the given graph. + */ + hasTPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):boolean; + /** + * Returns the source port constraint associated with the + * given edge. + * The data provider key + * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} + * is used to lookup the source port constraint data + * provider in the given graph. + */ + getSPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):yfiles.layout.PortConstraint; + /** + * Returns the target port constraint associated with the + * given edge. + * The data provider key + * {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} + * is used to lookup the source port constraint data + * provider in the given graph. + */ + getTPC(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):yfiles.layout.PortConstraint; + /** + * Creates a weak port constraint. + * @param {yfiles.layout.PortSide} side + * One of {@link yfiles.layout.PortSide#ANY}, {@link yfiles.layout.PortSide#NORTH}, + * {@link yfiles.layout.PortSide#SOUTH}, {@link yfiles.layout.PortSide#EAST} or {@link yfiles.layout.PortSide#WEST}. + */ + createWeak(side:yfiles.layout.PortSide):yfiles.layout.PortConstraint; + /** + * Creates a port constraint. + * The boolean value defines whether it is a + * strong or weak one. + * @param {yfiles.layout.PortSide} side + * One of {@link yfiles.layout.PortSide#ANY}, {@link yfiles.layout.PortSide#NORTH}, {@link yfiles.layout.PortSide#SOUTH}, {@link yfiles.layout.PortSide#EAST} or {@link yfiles.layout.PortSide#WEST}. + * @param {boolean} strong defines whether it is a strong or weak PortConstraint. + */ + create(side:yfiles.layout.PortSide,strong:boolean):yfiles.layout.PortConstraint; + }; + /** + * A layout stage that filters out all graph elements + * that are not part of a subgraph that is induced by + * the selected nodes of the input graph. + */ + export interface SubgraphLayouter extends yfiles.layout.AbstractLayoutStage{ + /** + * The DataProvider key which determines the nodes that + * induce the subgraph to be laid out. + *

+ * By default, {@link yfiles.layout.LayouterKeys#SELECTED_NODES_DP_KEY} is used. + *

+ * @throws {yfiles.system.ArgumentException} if the specified key is null. + */ + subgraphNodesDpKey:Object; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + } + var SubgraphLayouter:{ + $class:yfiles.lang.Class; + WithCoreLayouter:{ + new (coreLayouter:yfiles.layout.ILayouter):yfiles.layout.SubgraphLayouter; + }; + new ():yfiles.layout.SubgraphLayouter; + }; + /** + * Helper class for swimlanes. + */ + export interface Swimlanes extends Object{ + } + export module Swimlanes{ + /** + * Class that internally represents a swim lane. + */ + export interface SwimlaneRepresentant extends Object{ + /** + * The current position of the represented swim lane. + * @see {@link yfiles.layout.Swimlanes.SwimlaneRepresentant#allowRearrangement} + * @see {@link yfiles.layout.Swimlanes.SwimlaneRepresentant#allowRearrangement} + */ + swimlanePos:number; + /** + * Specifies whether the represented swim lane can be rearranged. + * For all swim lanes with rearrangement set to false, the relative ordering given by {@link yfiles.layout.Swimlanes.SwimlaneRepresentant#swimlanePos} is preserved. The remaining swim lanes may be rearranged. + * @see {@link yfiles.layout.Swimlanes.SwimlaneRepresentant#swimlanePos} + */ + allowRearrangement:boolean; + } + } + var Swimlanes:{ + $class:yfiles.lang.Class; + SwimlaneRepresentant:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of SwimlaneRepresentant. + * @param {number} swimlanePos denotes the current position of the represented swim lane. + * @param {boolean} allowRearrangement + * true if the represented swim lane may be rearranged (see {@link yfiles.layout.Swimlanes.SwimlaneRepresentant#allowRearrangement}) + */ + new (swimlanePos:number,allowRearrangement:boolean):yfiles.layout.Swimlanes; + }; + /** + * Calculates an ordering of the swim lanes such that: + * 1) the number of swim lanes traversed by edges is reduced. + * 2) the number of swim lanes spanned by group nodes (see + * {@link yfiles.layout.GraphGrouping}) is reduced. (Note, that a group node can span a swim lane without having a + * descendant in it.) + * @param {yfiles.algorithms.Graph} graph the input graph. + * @param {yfiles.algorithms.IDataProvider} node2Swimlane + * a DataProvider assigning an object of class {@link yfiles.layout.Swimlanes.SwimlaneRepresentant} to each node in the + * graph. Two nodes v,w are in the same swim lane if they are assigned to the same swim lane + * representative. After calling this method, method {@link yfiles.layout.Swimlanes.SwimlaneRepresentant#swimlanePos} + * returns for each swim lane representative an integer value (>= 0) denoting the optimized + * position of the associated swim lane. + * @see {@link yfiles.layout.Swimlanes.SwimlaneRepresentant} + * @see {@link yfiles.layout.GraphGrouping} + */ + arrangeSwimlanes(graph:yfiles.algorithms.Graph,node2Swimlane:yfiles.algorithms.IDataProvider):void; + /** + * Calculates an ordering of the swim lanes such that: + * 1) the number of swim lanes traversed by edges is reduced. + * 2) the number of swim lanes spanned by group nodes (see + * {@link yfiles.layout.GraphGrouping}) is reduced. (Note, that a group node can span a swim lane without having a + * descendant in it.) + * @param {yfiles.algorithms.Graph} graph the input graph. + * @param {yfiles.algorithms.IDataProvider} node2Swimlane + * a DataProvider assigning an object of class {@link yfiles.layout.Swimlanes.SwimlaneRepresentant} to each node in the + * graph. Two nodes v,w are in the same swim lane if they are assigned to the same swim lane + * representative. After calling this method, method {@link yfiles.layout.Swimlanes.SwimlaneRepresentant#swimlanePos} + * returns for each swim lane representative an integer value (>= 0) denoting the optimized + * position of the associated swim lane. + * @param {number} iterations the number of iterations performed by the heuristic. The default value is 5. + * @param {yfiles.layout.SwimlanesMode} mode + * swim lane ordering mode specifier. Possible values are {@link yfiles.layout.SwimlanesMode#MIXED} (default), {@link yfiles.layout.SwimlanesMode#ONLY_GROUPS} and {@link yfiles.layout.SwimlanesMode#IGNORE_GROUPS}. + * @see {@link yfiles.layout.Swimlanes.SwimlaneRepresentant} + * @see {@link yfiles.layout.GraphGrouping} + */ + arrangeSwimlanesWithOrderingMode(graph:yfiles.algorithms.Graph,node2Swimlane:yfiles.algorithms.IDataProvider,iterations:number,mode:yfiles.layout.SwimlanesMode):void; + }; + /** + * Provides geometric transforms for (sub-)graphs. + * This module provides the following kinds of geometric transforms + * on graphs or subgraphs. + *
    + *
  • Mirroring along X-axis
  • + *
  • Mirroring along Y-axis
  • + *
  • Rotation by angle
  • + *
  • Scaling by factor. (Node size scaling optional)
  • + *
  • Translating
  • + *
+ *

+ * Here is an sample output of the layouter that rotated the inner + * nine nodes of the grid by 45 degrees. + *

+ *
+ */ + export interface GraphTransformer extends yfiles.layout.CanonicMultiStageLayouter,yfiles.layout.ILayoutStage{ + /** + * The core layouter. + * @see Specified by {@link yfiles.layout.ILayoutStage#coreLayouter}. + */ + coreLayouter:yfiles.layout.ILayouter; + /** + * Specifies whether or not ComponentLayouter is enabled. + * By default it is disabled. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#componentLayouterEnabled} + */ + componentLayouterEnabled:boolean; + /** + * The transformation operation this layouter performs. + *

+ * By default the SCALE operation is set. + *

+ * @see {@link yfiles.layout.OperationType#MIRROR_XAXIS} + * @see {@link yfiles.layout.OperationType#MIRROR_YAXIS} + * @see {@link yfiles.layout.OperationType#ROTATE} + * @see {@link yfiles.layout.OperationType#SCALE} + * @see {@link yfiles.layout.OperationType#TRANSLATE} + */ + operation:yfiles.layout.OperationType; + /** + * The angle of rotation. + * The angle must be given in degrees. + * This feature is only meaningful for the ROTATE operation. + *

+ * By default the rotation angle is 0.0. + *

+ */ + rotationAngle:number; + /** + * Specifies whether or not the best fit rotation angle will be applied. + * Also, to apply the best fit rotation + * angle, the operation type of this layouter must be set to {@link yfiles.layout.OperationType#ROTATE}. + *

+ * Use {@link yfiles.layout.GraphTransformer#setPreferedLayoutSize} to specify the preferred + * aspect ratio of the resulting layout. + *

+ */ + bestFitRotationEnabled:boolean; + /** + * Sets the preferred layout size for this layouter. + */ + setPreferedLayoutSize(width:number,height:number):void; + /** + * Specifies whether or not to scale node sizes. + *

+ * By default this feature is disabled. + *

+ */ + scaleNodeSize:boolean; + /** + * The uniform scaling factor used for the SCALE + * operation. + *

+ * By default the scaling factor is set to 1.0 + *

+ */ + scaleFactor:number; + /** + * Sets the scaling factors for the x-coordinates and y-coordinates + * used for the SCALE operation. + *

+ * By default the scaling factors are set to 1.0 + *

+ */ + setScaleFactors(xFactor:number,yFactor:number):void; + /** + * The scaling factor used for the y-coordinate. + */ + scaleFactorY:number; + /** + * The scaling factor used for the x-coordinate. + */ + scaleFactorX:number; + /** + * The horizontal translation distance. + * A positive value + * means the graph is moved to the right; a negative value means the graph + * is moved to the left. Defaults to 0. + * @see {@link yfiles.layout.GraphTransformer#translateY} + * @see {@link yfiles.layout.GraphTransformer#translateY} + * @see {@link yfiles.layout.OperationType#TRANSLATE} + * @see {@link yfiles.layout.GraphTransformer#operation} + * @see {@link yfiles.layout.GraphTransformer#translateY} + * @see {@link yfiles.layout.GraphTransformer#translateY} + * @see {@link yfiles.layout.OperationType#TRANSLATE} + * @see {@link yfiles.layout.GraphTransformer#operation} + */ + translateX:number; + /** + * The vertical translation distance. + * A positive value + * means the graph is moved downwards; a negative value means the graph + * is moved upwards. Defaults to 0. + * @see {@link yfiles.layout.GraphTransformer#translateX} + * @see {@link yfiles.layout.GraphTransformer#translateX} + * @see {@link yfiles.layout.OperationType#TRANSLATE} + * @see {@link yfiles.layout.GraphTransformer#operation} + * @see {@link yfiles.layout.GraphTransformer#translateX} + * @see {@link yfiles.layout.GraphTransformer#translateX} + * @see {@link yfiles.layout.OperationType#TRANSLATE} + * @see {@link yfiles.layout.GraphTransformer#operation} + */ + translateY:number; + /** + * Returns always true. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Performs the selected transformation. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + } + var GraphTransformer:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of graph transformer. + */ + new ():yfiles.layout.GraphTransformer; + /** + * Performs a rotation of the given graph such that its + * resulting bounding box (approximately) fits best to + * the given area bounds. + */ + applyBestFitRotationAngle(graph:yfiles.layout.LayoutGraph,width:number,height:number):number; + /** + * Returns a rotation angle that, if applied to the given graph, + * would minimize the zoom-level needed to display the graph in + * an area of the given dimension. + */ + findBestFitRotationAngle(graph:yfiles.layout.LayoutGraph,width:number,height:number):number; + /** + * Scales the coordinates of the given graph in such a way + * that the resulting bounding box of the graph approximately equals + * the bounds of the given rectangle. + *

+ * Note that this operation won't have any effects, if there is + * only one node in the graph or if there are nodes that are bigger + * than the requested bounding box size. + *

+ *

+ * The x- and y-scaling factors are returned + * in a double array of size 2. + * The first value of the array is the x-scaling factor + * that has was used and the second value is the y-scaling + * factor. + *

+ */ + scaleToRect(g:yfiles.layout.LayoutGraph,rect:yfiles.algorithms.Rectangle):number[]; + /** + * Assures that the given graph fits into the given rectangular bounds. + * If the bounding box fits in the rectangle, nothing is done. + * Otherwise the graph is scaled and optionally moved to fit. + * This algorithm does not modify the node's sizes. + * Note that this operation won't have any effects, + * if there are nodes that are bigger + * than the requested bounding box size. + * @param {yfiles.layout.LayoutGraph} graph the graph to modify + * @param {number} x the upper left x coordinate of the bounds + * @param {number} y the upper left y coordinate of the bounds + * @param {number} w the width of the bounds + * @param {number} h the height of the bounds + */ + setMaximalBounds(graph:yfiles.layout.LayoutGraph,x:number,y:number,w:number,h:number):void; + /** + * Translates the layout coordinates by the vector (dx,dy). + */ + translate(g:yfiles.layout.LayoutGraph,dx:number,dy:number):void; + }; + /** + * Factory that provides methods to create, add and remove node/edge labels for {@link yfiles.layout.LayoutGraph}s. + * It can be used, e.g., to temporarily add labels during layout calculation. + * Note that original labels which are removed during a layout calculation + * have to be re-added when the layout calculation is done. Otherwise + * {@link yfiles.layout.BufferedLayouter buffered layout calculations} and + * {@link yfiles.layout.LayoutTool#applyGraphLayout delayed layout results} + * will most likely produce incorrect results or break down with + * ClassCastExceptions. + *

+ * An instance of the factory can be obtained with method {@link yfiles.layout.LayoutTool#getLabelFactory}. + * This method uses the added protected {@link yfiles.layout.LayoutGraph#createLabelFactory} method to create the factory. + *

+ * Note that each factory instance is bound to a specific graph instance, i.e., you can only create, add and remove + * labels for the graph specified in method {@link yfiles.layout.LayoutTool#getLabelFactory getLabelFactory}. + *

+ */ + export interface ILabelLayoutFactory extends Object{ + /** + * The graph associated with this label factory instance. + * @see Specified by {@link yfiles.layout.ILabelLayoutFactory#graph}. + */ + graph:yfiles.layout.LayoutGraph; + /** + * Adds the given node label layout to the given node. + * The given label layout has to be created with method {@link yfiles.layout.ILabelLayoutFactory#createNodeLabelLayout} + * or {@link yfiles.layout.ILabelLayoutFactory#createNodeLabelLayoutWithNodeLayoutAndModel}. + *

+ * Note, implementations of this method must ensure that re-adding temporarily + * removed original labels during + * {@link yfiles.layout.BufferedLayouter buffered layout calculations} + * automatically restores the original order of labels at the given node. + * Otherwise the layout calculation will most likely produce incorrect results + * or break down with ClassCastExceptions. + *

+ * @param {yfiles.algorithms.Node} node the given node. + * @param {yfiles.layout.INodeLabelLayout} labelLayout the node label layout that should be added to the given node. + * @see {@link yfiles.layout.ILabelLayoutFactory#createNodeLabelLayout} + * @see {@link yfiles.layout.ILabelLayoutFactory#createNodeLabelLayoutWithNodeLayoutAndModel} + * @throws {yfiles.system.ArgumentException} if the given label layout has already been added to the graph. + * @see Specified by {@link yfiles.layout.ILabelLayoutFactory#addNodeLabelLayout}. + */ + addNodeLabelLayout(node:yfiles.algorithms.Node,labelLayout:yfiles.layout.INodeLabelLayout):void; + /** + * Removes the given node label layout from the given node. + *

+ * Note that original labels which are removed during a layout calculation + * have to be re-added when the layout calculation is done. Otherwise + * {@link yfiles.layout.BufferedLayouter buffered layout calculations} and + * {@link yfiles.layout.LayoutTool#applyGraphLayout delayed layout results} + * will most likely produce incorrect results or break down with + * ClassCastExceptions. + *

+ * @param {yfiles.algorithms.Node} node the given node. + * @param {yfiles.layout.INodeLabelLayout} labelLayout the label layout that should be removed from the given node. + * @see {@link yfiles.layout.ILabelLayoutFactory#addEdgeLabelLayout} + * @see Specified by {@link yfiles.layout.ILabelLayoutFactory#removeNodeLabelLayout}. + */ + removeNodeLabelLayout(node:yfiles.algorithms.Node,labelLayout:yfiles.layout.INodeLabelLayout):void; + /** + * Creates a new label layout for the given node. + * Note that calling this method has no effect on the node's labels. + * The returned label layout has to be added to the node using method {@link yfiles.layout.ILabelLayoutFactory#addNodeLabelLayout}. + *

+ * This method should create a label layout with a + * {@link yfiles.layout.INodeLabelModel} that supports the desired oriented label + * box exactly as given. + *

+ * @param {yfiles.algorithms.Node} node the given node. + * @param {yfiles.algorithms.YOrientedRectangle} orientedBox the box specifying the size and location of the label. + * @return {yfiles.layout.INodeLabelLayout} a new node label layout. + * @see {@link yfiles.layout.ILabelLayoutFactory#addNodeLabelLayout} + * @see Specified by {@link yfiles.layout.ILabelLayoutFactory#createNodeLabelLayout}. + */ + createNodeLabelLayout(node:yfiles.algorithms.Node,orientedBox:yfiles.algorithms.YOrientedRectangle):yfiles.layout.INodeLabelLayout; + /** + * Creates a new label layout for the given node. + * Note that calling this method has no effect on the node's labels. + * The returned label layout has to be added to the node using method {@link yfiles.layout.ILabelLayoutFactory#addNodeLabelLayout}. + *

+ * Note that the oriented box associated with the created node label layout (see method + * {@link yfiles.layout.ILabelLayout#orientedBox}) may differ from the given oriented box, i.e., + * the box associated with the label layout corresponds to the closest box (with respect to the given box) + * that is valid in the specified node label model. + *

+ * @param {yfiles.algorithms.Node} node the given node. + * @param {yfiles.algorithms.YOrientedRectangle} orientedBox the box specifying the size and location of the label. + * @param {yfiles.layout.INodeLabelModel} model specifies the model of the created node label. + * @return {yfiles.layout.INodeLabelLayout} a new node label layout. + * @see {@link yfiles.layout.ILabelLayoutFactory#addNodeLabelLayout} + * @see Specified by {@link yfiles.layout.ILabelLayoutFactory#createNodeLabelLayoutWithNodeLayoutAndModel}. + */ + createNodeLabelLayoutWithNodeLayoutAndModel(node:yfiles.algorithms.Node,orientedBox:yfiles.algorithms.YOrientedRectangle,model:yfiles.layout.INodeLabelModel):yfiles.layout.INodeLabelLayout; + /** + * Adds the given edge label layout to the given edge. + * The given label layout has to be created with method + * {@link yfiles.layout.ILabelLayoutFactory#createEdgeLabelLayout} or + * {@link yfiles.layout.ILabelLayoutFactory#createEdgeLabelLayoutWithEdgeLayoutModelAndPreferredPlacement}. + *

+ * Note, implementations of this method must ensure that re-adding temporarily + * removed original labels during + * {@link yfiles.layout.BufferedLayouter buffered layout calculations} + * automatically restores the original order of labels at the given edge. + * Otherwise the layout calculation will most likely produce incorrect results + * or break down with ClassCastExceptions. + *

+ * @param {yfiles.algorithms.Edge} edge the given edge. + * @param {yfiles.layout.IEdgeLabelLayout} labelLayout the edge label layout that should be added to the given edge. + * @see {@link yfiles.layout.ILabelLayoutFactory#createEdgeLabelLayout} + * @see {@link yfiles.layout.ILabelLayoutFactory#createEdgeLabelLayoutWithEdgeLayoutModelAndPreferredPlacement} + * @throws {yfiles.system.ArgumentException} if the given label layout has already been added to the graph. + * @see Specified by {@link yfiles.layout.ILabelLayoutFactory#addEdgeLabelLayout}. + */ + addEdgeLabelLayout(edge:yfiles.algorithms.Edge,labelLayout:yfiles.layout.IEdgeLabelLayout):void; + /** + * Removes the given edge label layout from the given edge. + *

+ * Note that original labels which are removed during a layout calculation + * have to be re-added when the layout calculation is done. Otherwise + * {@link yfiles.layout.BufferedLayouter buffered layout calculations} and + * {@link yfiles.layout.LayoutTool#applyGraphLayout delayed layout results} + * will most likely produce incorrect results or break down with ClassCastExceptions. + *

+ * @param {yfiles.algorithms.Edge} edge the given edge. + * @param {yfiles.layout.IEdgeLabelLayout} labelLayout the label layout that should be removed from the given edge. + * @see {@link yfiles.layout.ILabelLayoutFactory#addEdgeLabelLayout} + * @see Specified by {@link yfiles.layout.ILabelLayoutFactory#removeEdgeLabelLayout}. + */ + removeEdgeLabelLayout(edge:yfiles.algorithms.Edge,labelLayout:yfiles.layout.IEdgeLabelLayout):void; + /** + * Creates a new label layout for the given edge. + * Note that calling this method has no effect on the edge's labels. + * The returned label layout has to be added to the edge using method {@link yfiles.layout.ILabelLayoutFactory#addEdgeLabelLayout}. + *

+ * This method should create a label layout with a + * {@link yfiles.layout.IEdgeLabelModel} that supports the desired oriented label + * box exactly as given. + *

+ * @param {yfiles.algorithms.Edge} edge the given edge. + * @param {yfiles.algorithms.YOrientedRectangle} orientedBox the box specifying the size and location of the label. + * @return {yfiles.layout.IEdgeLabelLayout} a new edge label layout. + * @see {@link yfiles.layout.ILabelLayoutFactory#addEdgeLabelLayout} + * @see Specified by {@link yfiles.layout.ILabelLayoutFactory#createEdgeLabelLayout}. + */ + createEdgeLabelLayout(edge:yfiles.algorithms.Edge,orientedBox:yfiles.algorithms.YOrientedRectangle):yfiles.layout.IEdgeLabelLayout; + /** + * Creates a new label layout for the given edge. + * Note that calling this method has no effect on the edge's labels. + * The returned label layout has to be added to the edge using method {@link yfiles.layout.ILabelLayoutFactory#addEdgeLabelLayout}. + *

+ * Note that the oriented box associated with the created edge label layout (see method + * {@link yfiles.layout.ILabelLayout#orientedBox}) may differ from the given oriented box, i.e., + * the box associated with the label layout corresponds to the closest box (with respect to the given box) + * that is valid in the specified edge label model. + *

+ * @param {yfiles.algorithms.Edge} edge the given edge. + * @param {yfiles.algorithms.YOrientedRectangle} orientedBox the box specifying the size and location of the label. + * @param {yfiles.layout.IEdgeLabelModel} model specifies the model of the created edge label. + * @param {yfiles.layout.PreferredPlacementDescriptor} descriptor + * specifies the preferred placement descriptor of the created label. If this value is + * null, the default descriptor is used. + * @return {yfiles.layout.IEdgeLabelLayout} a new edge label layout. + * @see {@link yfiles.layout.ILabelLayoutFactory#addEdgeLabelLayout} + * @see Specified by {@link yfiles.layout.ILabelLayoutFactory#createEdgeLabelLayoutWithEdgeLayoutModelAndPreferredPlacement}. + */ + createEdgeLabelLayoutWithEdgeLayoutModelAndPreferredPlacement(edge:yfiles.algorithms.Edge,orientedBox:yfiles.algorithms.YOrientedRectangle,model:yfiles.layout.IEdgeLabelModel,descriptor:yfiles.layout.PreferredPlacementDescriptor):yfiles.layout.IEdgeLabelLayout; + } + var ILabelLayoutFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class represents a candidate for an edge's ports. + * It may be a fixed port, where the exact port coordinates are given or a + * free variant where the coordinates may be chosen arbitrarily. Additionally valid + * in- respectively outgoing directions may be specified for edges connecting to + * that PortCandidate's Port and a cost penalty may be specified that indicates the + * cost associated with the usage of the port. + * @see {@link yfiles.layout.PortCandidateSet} + */ + export interface PortCandidate extends Object{ + /** + * Determines whether this instance lies in the given direction. + * @param {yfiles.layout.PortDirection} directionMask the mask of directions as defined by the constants in this class. + * @return {boolean} whether this instance specifies on of the given directions + */ + isInDirection(directionMask:yfiles.layout.PortDirection):boolean; + /** + * The direction mask for this instance. + * @see {@link yfiles.layout.PortCandidate#getDirectionForLayoutOrientation} + */ + direction:yfiles.layout.PortDirection; + /** + * Specifies whether this instance describes a fixed or + * {@link yfiles.layout.PortConstraint#strong strong} port. + */ + fixed:boolean; + /** + * The x offset of the port with respect to the corresponding node's center. + * @see {@link yfiles.layout.PortCandidate#fixed} + * @see {@link yfiles.layout.PortCandidate#getXOffsetForLayoutOrientation} + */ + xOffset:number; + /** + * The y offset of the port with respect to the corresponding node's center. + * @see {@link yfiles.layout.PortCandidate#fixed} + * @see {@link yfiles.layout.PortCandidate#getXOffsetForLayoutOrientation} + */ + yOffset:number; + hashCode():number; + /** + * A utility method for converting this instance to a {@link yfiles.layout.PortConstraint}. + * @return {yfiles.layout.PortConstraint} a PortConstraint that matches this PortCandidate + * @see {@link yfiles.layout.PortCandidate#toPortConstraintForLayoutOrientation} + */ + toPortConstraint():yfiles.layout.PortConstraint; + /** + * A utility method for converting this instance to a {@link yfiles.layout.PortConstraint} + * interpreted for the given {@link yfiles.layout.OrientationLayouter#orientation layout orientation}. + * @return {yfiles.layout.PortConstraint} a PortConstraint that matches this PortCandidate + * @see {@link yfiles.layout.PortCandidate#toPortConstraint} + */ + toPortConstraintForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):yfiles.layout.PortConstraint; + /** + * Tests for equality based on the internal attributes. + */ + equals(other:Object):boolean; + /** + * The cost associated with the usage of this PortCandidate. + */ + cost:number; + /** + * Returns the direction constant with respect to the given {@link yfiles.layout.OrientationLayouter#orientation layout orientation}. + * @param {yfiles.layout.LayoutOrientation} layoutOrientation the orientation for which the direction should be interpreted. + * @return {yfiles.layout.PortDirection} + * the {@link yfiles.layout.PortCandidate#direction} with respect to the orientation. + * @see {@link yfiles.layout.PortCandidate#direction} + */ + getDirectionForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):yfiles.layout.PortDirection; + /** + * Yields the X-offset with respect for the given {@link yfiles.layout.OrientationLayouter#orientation layout orientation} + * and {@link yfiles.layout.OrientationLayouter#mirrorMask mirror mask}. + * @param {yfiles.layout.LayoutOrientation} layoutOrientation The orientation for which to interpret the x offset. + * @param {yfiles.layout.MirrorMask} mirrorMask The mirror mask for which to interpret the x offset. + * @return {number} The x offset. + * @see {@link yfiles.layout.PortCandidate#xOffset} + * @see {@link yfiles.layout.PortCandidate#getXOffsetForLayoutOrientation} + */ + getXOffsetForLayoutOrientationWithMask(layoutOrientation:yfiles.layout.LayoutOrientation,mirrorMask:yfiles.layout.MirrorMask):number; + /** + * Yields the Y-offset with respect for the given {@link yfiles.layout.OrientationLayouter#orientation layout orientation} + * and {@link yfiles.layout.OrientationLayouter#mirrorMask mirror mask}. + * @param {yfiles.layout.LayoutOrientation} layoutOrientation The orientation for which to interpret the y offset. + * @param {yfiles.layout.MirrorMask} mirrorMask The mirror mask for which to interpret the y offset. + * @return {number} The y offset. + * @see {@link yfiles.layout.PortCandidate#yOffset} + * @see {@link yfiles.layout.PortCandidate#getYOffsetForLayoutOrientation} + */ + getYOffsetForLayoutOrientationWithMask(layoutOrientation:yfiles.layout.LayoutOrientation,mirrorMask:yfiles.layout.MirrorMask):number; + /** + * Yields the X-offset with respect for the given {@link yfiles.layout.OrientationLayouter#orientation layout orientation}. + * @param {yfiles.layout.LayoutOrientation} layoutOrientation The orientation for which to interpret the x offset. + * @return {number} The x offset. + * @see {@link yfiles.layout.PortCandidate#xOffset} + */ + getXOffsetForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):number; + /** + * Yields the Y-offset with respect for the given {@link yfiles.layout.OrientationLayouter#orientation layout orientation}. + * @param {yfiles.layout.LayoutOrientation} layoutOrientation The orientation for which to interpret the x offset. + * @return {number} The y offset. + * @see {@link yfiles.layout.PortCandidate#yOffset} + */ + getYOffsetForLayoutOrientation(layoutOrientation:yfiles.layout.LayoutOrientation):number; + /** + * Returns a human-readable string representation of this PortCandidate. + */ + toString():string; + } + var PortCandidate:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key that holds a {@link yfiles.algorithms.ICollection} of {@link yfiles.layout.PortCandidate}s for the + * source port of each edge. + */ + SOURCE_PC_LIST_DP_KEY:Object; + /** + * {@link yfiles.algorithms.IDataProvider} key that holds a {@link yfiles.algorithms.ICollection} of {@link yfiles.layout.PortCandidate}s for the + * target port of each edge. + */ + TARGET_PC_LIST_DP_KEY:Object; + /** + * Creates a new instance of PortCandidate using the given values. + * Clients use the factory methods instead. + * @see {@link yfiles.layout.PortCandidate#createCandidateFixedWithCost} + */ + FromOffsetWithCost:{ + new (xOffset:number,yOffset:number,fixed:boolean,directionMask:yfiles.layout.PortDirection,cost:number):yfiles.layout.PortCandidate; + }; + /** + * Creates a new instance of PortCandidate using the given values. + * Clients use the factory methods instead. + * @see {@link yfiles.layout.PortCandidate#createCandidateFixed} + */ + FromOffsetWithDirection:{ + new (xOffset:number,yOffset:number,directionMask:yfiles.layout.PortDirection):yfiles.layout.PortCandidate; + }; + /** + * Creates a new instance of PortCandidate using the given direction. + * Clients use the factory methods instead. + * @see {@link yfiles.layout.PortCandidate#createCandidate} + */ + new (directionMask:yfiles.layout.PortDirection):yfiles.layout.PortCandidate; + /** + * Creates a new instance of PortCandidate using the given values. + * Clients use the factory methods instead. + * @see {@link yfiles.layout.PortCandidate#createCandidateFixedWithCost} + */ + FromDirectionWithCost:{ + new (directionMask:yfiles.layout.PortDirection,cost:number):yfiles.layout.PortCandidate; + }; + /** + * Factory method that returns an instance describing a non-fixed port with 0 cost penalty for the given + * direction. + * @param {yfiles.layout.PortDirection} directionMask a bitwise combination of the constants in this class. + */ + createCandidate(directionMask:yfiles.layout.PortDirection):yfiles.layout.PortCandidate; + /** + * Factory method that returns an instance describing a non-fixed port with the given + * cost penalty for the given + * direction. + * @param {yfiles.layout.PortDirection} directionMask a bitwise combination of the constants in this class. + * @param {number} cost the cost to associate with the usage of this port + */ + createCandidateWithCost(directionMask:yfiles.layout.PortDirection,cost:number):yfiles.layout.PortCandidate; + /** + * Factory method that returns an instance describing a fixed port with zero + * cost penalty for the given direction at the given offsets. + * @param {yfiles.layout.PortDirection} directionMask a bitwise combination of the constants in this class. + * @param {number} xOffset the x offset + * @param {number} yOffset the y offset + */ + createCandidateFixed(xOffset:number,yOffset:number,directionMask:yfiles.layout.PortDirection):yfiles.layout.PortCandidate; + /** + * Factory method that returns an instance describing a fixed port with the given + * cost penalty for the given + * direction at the given offset. + * @param {yfiles.layout.PortDirection} directionMask a bitwise combination of the constants in this class. + * @param {number} cost the cost to associate with the usage of this port + * @param {number} xOffset the x offset + * @param {number} yOffset the y offset + */ + createCandidateFixedWithCost(xOffset:number,yOffset:number,directionMask:yfiles.layout.PortDirection,cost:number):yfiles.layout.PortCandidate; + /** + * Factory method that returns an instance describing a non-fixed port with zero + * cost penalty for the direction specified by the given {@link yfiles.layout.PortConstraint}. + * @param {yfiles.layout.PortConstraint} fromPortConstraint the port constraint to obtain the direction from + */ + createCandidateFromConstraint(fromPortConstraint:yfiles.layout.PortConstraint):yfiles.layout.PortCandidate; + }; + /** + * This class contains algorithms which allow for zooming parts of a diagram only + * in a so-called fish-eye (radial) style. + * This type of zoom however will not + * introduce new bends for edges but will move the node centers and bends only. + */ + export interface GraphZoomer extends Object,yfiles.layout.ILayouter{ + /** + * Adds a zoom operation to the list of operations to be performed on the graph + * during the doLayout phase. + * @param {yfiles.algorithms.YPoint} center the center of the zoom + * @param {number} innerRadius + * the radius of the circle around the center inside which the zoom level is + * constantly set to zoomFactor + * @param {number} outerRadius + * the radius of the outer circle around the center outside of which the zoomFactor + * should be unchanged. This value must be greater than innerRadius + * @param {number} zoomFactor the zoomFactor inside the inner circle + */ + addRadialZoom(center:yfiles.algorithms.YPoint,innerRadius:number,outerRadius:number,zoomFactor:number):void; + /** + * Adds a zoom operation to the list of operations performed during the doLayout + * phase. + * This performs a zoom on a rectangular shape using the given radii and the + * ratio defining the rectangle. + * @param {yfiles.algorithms.YPoint} center the center of the zoom + * @param {number} innerRadius + * the radius of the rectangular shape around the center inside which the zoom level is + * constantly set to zoomFactor + * @param {number} outerRadius + * the radius of the outer rectangular shape around the center outside of which the zoomFactor + * should be unchanged. This value must be greater than innerRadius + * @param {number} zoomFactor the zoomFactor inside the inner rectangle + */ + addRectangularZoom(center:yfiles.algorithms.YPoint,innerRadius:number,outerRadius:number,ratio:number,zoomFactor:number):void; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as it's argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Assigns a new graph layout to the given layout graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + export module GraphZoomer{ + /** + * This interface can be implemented for custom zoom types. + */ + export interface IZoom extends Object{ + /** + * This method take a Point2D as an argument, modifies it according to its + * zoom policy and writes the modification back to the argument. + * @see Specified by {@link yfiles.layout.GraphZoomer.IZoom#modifyPosition}. + */ + modifyPosition(position:yfiles.algorithms.Point2D.Double):void; + } + } + var GraphZoomer:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of GraphZoomer. + */ + new ():yfiles.layout.GraphZoomer; + /** + * Convenience method which applies a radial zoom to the graph. + */ + zoomRadial(graph:yfiles.layout.LayoutGraph,centerX:number,centerY:number,innerRadius:number,outerRadius:number,zoomFactor:number):void; + /** + * Convenience method which applies a rectangular zoom to the graph. + */ + zoomRectangular(graph:yfiles.layout.LayoutGraph,centerX:number,centerY:number,innerRadius:number,outerRadius:number,ratio:number,zoomFactor:number):void; + /** + * Convenience method which applies a custom zoom to the graph. + */ + zoom(graph:yfiles.layout.LayoutGraph,zoom:yfiles.layout.GraphZoomer.IZoom):void; + }; + /** + * This class describes a set of possible {@link yfiles.layout.PortCandidate}s and their cardinality for a node-like entity. + */ + export interface PortCandidateSet extends Object{ + /** + * Adds another PortCandidate with capacity 1 to the set of PortCandidates. + * @param {yfiles.layout.PortCandidate} p the candidate to add. + */ + add(p:yfiles.layout.PortCandidate):void; + /** + * Adds another PortCandidate with the given capacity to the set of candidates. + * @param {yfiles.layout.PortCandidate} p the candidate to add + * @param {number} connections the maximum number of connections allowed to the candidate + */ + addWithCapacity(p:yfiles.layout.PortCandidate,connections:number):void; + /** + * The maximum number of connections this set allows or{@link Number#yfiles.system.Math#Int32MaxValue} if + * the number is unbound. + */ + connectionCount:number; + /** + * Removes the entry from the internal list of PortCandidate entries. + * @param {yfiles.layout.PortCandidateSet.IEntry} entry the entry to remove from this set of candidates. + */ + remove(entry:yfiles.layout.PortCandidateSet.IEntry):void; + /** + * An Iterator over the list of{@link yfiles.layout.PortCandidateSet.IEntry entries}. + */ + entries:yfiles.algorithms.IIterator; + /** + * Creates a CandidateMatcher instance that can be used to query {@link yfiles.layout.PortCandidateSet.IEntry entries} from. + * @return {yfiles.layout.PortCandidateSet.ICandidateMatcher} a fresh matching instance that reflects the current state of this set of candidates. + */ + createMatcher():yfiles.layout.PortCandidateSet.ICandidateMatcher; + /** + * Calculates the cost for each entry for the given edge configuration. + */ + getCost(entry:yfiles.layout.PortCandidateSet.IEntry,edge:yfiles.algorithms.Edge,source:boolean,xOffset:number,yOffset:number):number; + /** + * Returns the priority of the given entry. + * The higher the priority the sooner it will be chosen by the {@link yfiles.layout.PortCandidateSet.ICandidateMatcher}. + */ + getPriority(entry:yfiles.layout.PortCandidateSet.IEntry,edge:yfiles.algorithms.Edge,source:boolean):number; + } + export module PortCandidateSet{ + /** + * The interface that is used by {@link yfiles.layout.PortCandidateSet} to retrieve {@link yfiles.layout.PortCandidate}s from. + * @see {@link yfiles.layout.PortCandidateSet#createMatcher} + */ + export interface ICandidateMatcher extends Object{ + /** + * Returns the next best matching {@link yfiles.layout.PortCandidateSet.IEntry} for the given parameters. + * @param {yfiles.algorithms.Edge} edge the edge that will connect to the port + * @param {boolean} source whether the edge connects to the node with its source side + * @param {number} xOffset the preferred x offset of the connection point (relative to the node's center) + * @param {number} yOffset the preferred y offset of the connection point (relative to the node's center) + * @param {number} directionMask + * a bitwise combination of the constants defined in {@link yfiles.layout.PortCandidate} + * indicating the preferred connection points + * @return {yfiles.layout.PortCandidateSet.IEntry} the next best entry with respect to the constraints and the costs + * @see Specified by {@link yfiles.layout.PortCandidateSet.ICandidateMatcher#findMatchingCandidateForEdgeAtOffset}. + */ + findMatchingCandidateForEdgeAtOffset(edge:yfiles.algorithms.Edge,source:boolean,xOffset:number,yOffset:number,directionMask:number):yfiles.layout.PortCandidateSet.IEntry; + /** + * Returns the next best matching {@link yfiles.layout.PortCandidateSet.IEntry} for the given parameters. + * @param {yfiles.algorithms.Edge} edge the edge that will connect to the port + * @param {boolean} source whether the edge connects to the node with its source side + * @param {number} directionMask + * a bitwise combination of the constants defined in {@link yfiles.layout.PortCandidate} + * indicating the preferred connection points + * @return {yfiles.layout.PortCandidateSet.IEntry} the next best entry with respect to the constraints and the costs + * @see Specified by {@link yfiles.layout.PortCandidateSet.ICandidateMatcher#findMatchingCandidateForEdge}. + */ + findMatchingCandidateForEdge(edge:yfiles.algorithms.Edge,source:boolean,directionMask:number):yfiles.layout.PortCandidateSet.IEntry; + /** + * Returns the next best matching {@link yfiles.layout.PortCandidateSet.IEntry}. + * @return {yfiles.layout.PortCandidateSet.IEntry} the next best entry with respect to the costs + * @see Specified by {@link yfiles.layout.PortCandidateSet.ICandidateMatcher#findMatchingCandidate}. + */ + findMatchingCandidate():yfiles.layout.PortCandidateSet.IEntry; + } + /** + * An interface that is returned by the find methods in {@link yfiles.layout.PortCandidateSet.ICandidateMatcher} + * and the {@link yfiles.layout.PortCandidateSet#entries} method. + * This interface provides access to the actual {@link yfiles.layout.PortCandidate} and the maximum number of connections + * allowed for that instance. + */ + export interface IEntry extends Object{ + /** + * The associated PortCandidate. + * @see Specified by {@link yfiles.layout.PortCandidateSet.IEntry#portCandidate}. + */ + portCandidate:yfiles.layout.PortCandidate; + /** + * The maximum number of connections allowed for the port candidate. + * @see Specified by {@link yfiles.layout.PortCandidateSet.IEntry#connections}. + */ + connections:number; + } + } + var PortCandidateSet:{ + $class:yfiles.lang.Class; + /** + * A {@link yfiles.algorithms.IDataProvider} key used to associate instances of this class with nodes in a graph. + */ + NODE_DP_KEY:Object; + /** + * Creates a new and empty instance of PortCandidateSet. + * @see {@link yfiles.layout.PortCandidateSet#add} + * @see {@link yfiles.layout.PortCandidateSet#addWithCapacity} + */ + new ():yfiles.layout.PortCandidateSet; + }; + /** + * An edge label model that allows placement of labels at a set of continuous positions + * along both sides of an edge or directly on the edge path. + *

+ * The set of positions can be influenced by specifying the density value that controls + * the spacing between adjacent label positions. + * Furthermore, it's possible to specify distance values that control the distance + * between label and edge and between label and nodes. + *

+ */ + export interface SliderEdgeLabelLayoutModel extends Object,yfiles.layout.IEdgeLabelModel{ + /** + * The model's slider mode. + */ + mode:yfiles.layout.SliderMode; + /** + * Sets the minimum and maximum distances between the label's bounding box and + * the edge's path. + * @param {number} minDistance The minimal distance between label and edge. + * @param {number} maxDistance The maximal distance between label and edge. + * @see {@link yfiles.layout.SliderEdgeLabelLayoutModel#maximumDistance} + * @see {@link yfiles.layout.SliderEdgeLabelLayoutModel#minimumDistance} + * @see {@link yfiles.layout.SliderEdgeLabelLayoutModel#maximumDistance} + * @see {@link yfiles.layout.SliderEdgeLabelLayoutModel#minimumDistance} + */ + setDistances(minDistance:number,maxDistance:number):void; + /** + * The maximum distance between the label's bounding box and + * the edge's path. + *

+ * By default, a maximum distance of 1.0 is set. + *

+ * @see {@link yfiles.layout.SliderEdgeLabelLayoutModel#setDistances} + * @see {@link yfiles.layout.SliderEdgeLabelLayoutModel#setDistances} + */ + maximumDistance:number; + /** + * The minimum distance between the label's bounding box and + * the edge's path. + *

+ * By default, a minimum distance of 1.0 is set. + *

+ * @see {@link yfiles.layout.SliderEdgeLabelLayoutModel#setDistances} + * @see {@link yfiles.layout.SliderEdgeLabelLayoutModel#setDistances} + */ + minimumDistance:number; + /** + * The density to generate label candidate positions. + *

+ * A density value of 1.0 (which is the default) generates the + * most possible candidate positions without overlap. + *

+ */ + density:number; + /** + * The minimal distance between the label's bounding box and a node's + * borders. + */ + nodeBorderDistance:number; + /** + * A model parameter that encodes the default position of this model's + * allowed edge label positions. + * The default positions for both slider edge label models are relative to the + * first edge segment, either at the beginning of the segment ({@link yfiles.layout.SliderMode#SIDE} + * model) or at its middle ({@link yfiles.layout.SliderMode#CENTER} model). + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#defaultParameter}. + */ + defaultParameter:Object; + /** + * Returns the bounds of the label for the position encoded + * by the given model parameter. + * @param {yfiles.algorithms.YDimension} labelSize The size of the label that should be placed. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceLayout The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetLayout The layout of the target node of the label owning edge. + * @param {Object} param + * The model parameter that describes the abstract position of the label within + * this model. + * The parameter must have been generated by this model. + * @return {yfiles.algorithms.YOrientedRectangle} The bounds of the label. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#getLabelPlacement}. + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,para:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Returns a list of candidate positions for the given edge label. + * The number of candidates and their respective locations are computed depending + * on the geometries of both label and edge. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#getLabelCandidates}. + */ + getLabelCandidates(label:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * Creates a model parameter that represents the given edge label context best + * within this model. + * The created model parameter represents the closest parameter representation + * of the given label location that can be achieved within this model. + * @param {yfiles.algorithms.YOrientedRectangle} labelBounds The bounds of the label for which a parameter representation is sought. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceLayout The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetLayout The layout of the target node of the label owning edge. + * @return {Object} + * A model parameter that can be passed to the + * {@link yfiles.layout.IEdgeLabelModel#getLabelPlacement} + * method. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#createModelParameter}. + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):Object; + /** + * Returns the offset vector for a given edge label and a given edge segment. + * The offset vector describes where to move a label candidate such that it keeps + * a certain distance to the edge's path. + * @param {number} dx x-coordinates delta for an edge segment. + * @param {number} dy y-coordinates delta for an edge segment. + * @param {number} width The label's width. + * @param {number} height The label's height. + * @param {yfiles.layout.SliderRatio} labelPosition + * One of the symbolic ratio specifiers {@link yfiles.layout.SliderRatio#CENTER}, {@link yfiles.layout.SliderRatio#LEFT}, + * or {@link yfiles.layout.SliderRatio#RIGHT}. + * @return {yfiles.algorithms.YVector} An offset vector. + */ + getOffsetVec(dx:number,dy:number,width:number,height:number,labelPosition:yfiles.layout.SliderRatio):yfiles.algorithms.YVector; + } + export module SliderEdgeLabelLayoutModel{ + /** + * Encodes the model parameters for the two slider edge label models specified + * by {@link yfiles.layout.SliderMode#CENTER} and {@link yfiles.layout.SliderMode#SIDE}. + */ + export interface ModelParameter extends Object{ + /** + * The index of the edge segment relative to which the label is placed. + * The index is zero-based and starts at the edge's source end. + * Let s denote the number of edge segments. + * Then, a negative index value i denotes the segment with index s + i. + */ + segmentNumber:number; + /** + * The label's ratio with respect to the length of the edge segment + * relative to which it is placed. + */ + ratio:number; + /** + * The offset vector between the label and the edge segment relative + * to which it is placed. + * The offset vector describes the distance between the edge segment and the + * label's upper-left corner. + */ + offsetVector:yfiles.algorithms.YVector; + /** + * The label's symbolic ratio specifier, i.e., one of{@link yfiles.layout.SliderRatio#CENTER}, + * {@link yfiles.layout.SliderRatio#LEFT}, or {@link yfiles.layout.SliderRatio#RIGHT}. + */ + labelPosition:number; + /** + * The label's absolute ratio with respect to the entire length of the + * edge path. + */ + absRatio:number; + } + } + var SliderEdgeLabelLayoutModel:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of SliderEdgeLabelModel. + * @param {yfiles.layout.SliderMode} mode + * Determines which slider mode to use. + * Possible values are either {@link yfiles.layout.SliderMode#CENTER} or {@link yfiles.layout.SliderMode#SIDE}. + */ + new (mode:yfiles.layout.SliderMode):yfiles.layout.SliderEdgeLabelLayoutModel; + ModelParameter:{ + $class:yfiles.lang.Class; + /** + * Returns a new instance of ModelParameter that has the given characteristics. + * @param {number} s The index of the edge segment relative to which the label should be placed. + * @param {number} r + * The label's ratio with respect to the length of the edge segment relative + * to which it should be placed. + * @param {yfiles.algorithms.YVector} v + * The offset vector between the label and the edge segment relative to which + * it should be placed. + * @param {number} p + * One of the symbolic ratio specifiers {@link yfiles.layout.SliderRatio#CENTER}, {@link yfiles.layout.SliderRatio#LEFT}, + * or {@link yfiles.layout.SliderRatio#RIGHT}. + * @param {number} aRatio + * The label's absolute ratio with respect to the entire length of the edge + * path. + * Note that this value is derived from the ratio value. + */ + new (s:number,r:number,v:yfiles.algorithms.YVector,p:number,aRatio:number):yfiles.layout.SliderEdgeLabelLayoutModel; + }; + }; + export enum NodeAlignment{ + /** + * Node alignment policy that results in top aligned nodes for + * vertical alignment and left aligned nodes for horizontal alignments. + * @see {@link yfiles.layout.LayoutTool#alignNodeLayouts} + */ + LEADING, + /** + * Node alignment policy that results in center aligned nodes. + * @see {@link yfiles.layout.LayoutTool#alignNodeLayouts} + */ + CENTERED, + /** + * Node alignment policy that results in bottom aligned nodes for + * vertical alignment and right aligned nodes for horizontal alignments. + * @see {@link yfiles.layout.LayoutTool#alignNodeLayouts} + */ + TRAILING, + /** + * Node alignment policy that results in vertically or horizontally + * distributed nodes. In this context, distributed means that the + * vertical (or horizontal) extensions of nodes do not overlap independent + * of their horizontal (or vertical) position. + * @see {@link yfiles.layout.LayoutTool#alignNodeLayouts} + */ + DISTRIBUTED + } + /** + * This LayoutStage removes all collinear bends found in the graph. + * The algorithms traverses each edge path from source + * to target and removes for each triple of consecutive collinear bends the middle one. + */ + export interface RemoveColinearBendsStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * The current scale, to which this stage will refer, when checking for collinearity. + * Default value is 2.0. Which means that values are rounded to the second position after the decimal point. + * If the rounded values of an edge are leading to a collinear bend, this bend will be removed. + */ + scale:number; + /** + * The current state of the remove straight only property. + * In the first case, the angle at the middle bend must be 180 degrees, while in the second case, the + * angle can be either 180 degrees or 0 degree. The default is false. + */ + removeStraightOnly:boolean; + /** + * Removes collinear bends of the edges. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var RemoveColinearBendsStage:{ + $class:yfiles.lang.Class; + new ():yfiles.layout.RemoveColinearBendsStage; + }; + /** + * This interface defines keys used to associate {@link yfiles.algorithms.IDataProvider DataProviders} + * that provide port constraints for all edges of the input graph. + * The associated DataProvider can return an object of type + * {@link yfiles.layout.PortConstraint} for an edge. + * LayoutAlgorithms implementing this interface indicate that they will + * try to obey the port constraints provided by these keys. + */ + export interface PortConstraintKeys extends Object{ + } + var PortConstraintKeys:{ + $class:yfiles.lang.Class; + /** + * Key used to associate a {@link yfiles.algorithms.IDataProvider} that provides source port + * constraints for edges of the input graph. + * The associated DataProvider can return an object of type + * {@link yfiles.layout.PortConstraint} for an edge. + */ + SOURCE_PORT_CONSTRAINT_DP_KEY:Object; + /** + * Key used to associate a {@link yfiles.algorithms.IDataProvider} that provides target port + * constraints for edges of the input graph. + * The associated DataProvider can return an object of type + * {@link yfiles.layout.PortConstraint} for an edge. + */ + TARGET_PORT_CONSTRAINT_DP_KEY:Object; + /** + * Key used to associate a {@link yfiles.algorithms.IDataProvider} that provides source port + * group information for edges of the input graph. + * The associated DataProvider can return any object or null. + * Edge sharing a source group identifier will share a common bus near the source + * or at a common source node + * if possible. + * null is not interpreted as a group identifier. + */ + SOURCE_GROUP_ID_DP_KEY:Object; + /** + * Key used to associate a {@link yfiles.algorithms.IDataProvider} that provides target port + * group information for edges of the input graph. + * The associated DataProvider can return any object or null. + * Edge sharing a target group identifier will share a common bus near the target + * or at a common target node + * if possible. + * null is not interpreted as a group identifier. + */ + TARGET_GROUP_ID_DP_KEY:Object; + }; + /** + * A descriptor that holds preferred placement information for automatic edge labeling. + *

+ * It provides methods to specify + *

    + *
  • the placement along the edge ({@link yfiles.layout.LabelPlacements#AT_SOURCE}, {@link yfiles.layout.LabelPlacements#AT_CENTER}, {@link yfiles.layout.LabelPlacements#AT_TARGET})
  • + *
  • the side of the edge ({@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE}, {@link yfiles.layout.LabelPlacements#ON_EDGE}, {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE})
  • + *
  • the reference of the side ({@link yfiles.layout.LabelSideReference#RELATIVE_TO_EDGE_FLOW}, {@link yfiles.layout.LabelSideReference#ABSOLUTE_WITH_LEFT_IN_NORTH}, {@link yfiles.layout.LabelSideReference#ABSOLUTE_WITH_RIGHT_IN_NORTH})
  • + *
  • the angle of the label
  • + *
  • the reference of the angle ({@link yfiles.layout.LabelAngleReference#ABSOLUTE}, {@link yfiles.layout.LabelAngleReference#RELATIVE_TO_EDGE_FLOW})
  • + *
  • the rotation behavior for label on the right side of the edge ({@link yfiles.layout.LabelAngleOnRightSideRotation#CLOCKWISE}, {@link yfiles.layout.LabelAngleOnRightSideRotation#COUNTER_CLOCKWISE})
  • + *
  • the angle offset for label on the right side of the edge ({@link yfiles.layout.LabelAngleOnRightSideOffset#NONE}, {@link yfiles.layout.LabelAngleOnRightSideOffset#SEMI})
  • + *
  • the distance between the label and its edge segment
  • + *
+ *

+ */ + export interface PreferredPlacementDescriptor extends Object{ + /** + * The preferred placement along the edge. + * Default is {@link yfiles.layout.LabelPlacements#AT_CENTER}. + * @throws {yfiles.system.InvalidOperationException} + * if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable}. + */ + placeAlongEdge:yfiles.layout.LabelPlacements; + /** + * The preferred side of the edge. + * Default is {@link yfiles.layout.LabelPlacements#ON_EDGE}. + * @throws {yfiles.system.InvalidOperationException} + * if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable}. + */ + sideOfEdge:yfiles.layout.LabelPlacements; + /** + * Specifies how to interpret the preferred side as given by {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE} and {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE}. + * Default is {@link yfiles.layout.LabelSideReference#RELATIVE_TO_EDGE_FLOW}. + * @throws {yfiles.system.InvalidOperationException} + * if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable}. + * @throws {yfiles.system.ArgumentException} + * if the specified value has not at least + * one of the required bits set. + */ + sideReference:yfiles.layout.LabelSideReference; + /** + * The angle (in radians) for the label rotation. + * How this angle is applied is specified by {@link yfiles.layout.PreferredPlacementDescriptor#angleReference}, {@link yfiles.layout.PreferredPlacementDescriptor#angleRotationOnRightSide} and {@link yfiles.layout.PreferredPlacementDescriptor#angleOffsetOnRightSide}. Default is + * 0. + * @throws {yfiles.system.InvalidOperationException} + * if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable}. + */ + angle:number; + /** + * Specifies the reference of the angle given by {@link yfiles.layout.PreferredPlacementDescriptor#angle}. + * Default is + * {@link yfiles.layout.LabelAngleReference#ABSOLUTE}. + * @throws {yfiles.system.InvalidOperationException} + * if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable}. + * @throws {yfiles.system.ArgumentException} + * if the specified value has not at least + * one of the required bits set. + */ + angleReference:yfiles.layout.LabelAngleReference; + /** + * Specifies how the angle is applied to labels on the right side in respect of the labels of the left side of the + * edge. + * Default is {@link yfiles.layout.LabelAngleOnRightSideRotation#CLOCKWISE}. + * @throws {yfiles.system.InvalidOperationException} + * if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable}. + * @throws {yfiles.system.ArgumentException} + * if the specified value has not at least + * one of the required bits set. + */ + angleRotationOnRightSide:yfiles.layout.LabelAngleOnRightSideRotation; + /** + * The angle offset for labels that are placed on the right side of the edge. + * Default is {@link yfiles.layout.LabelAngleOnRightSideOffset#NONE}. + * @throws {yfiles.system.InvalidOperationException} + * if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable}. + * @throws {yfiles.system.ArgumentException} + * if the specified value has not at least + * one of the required bits set. + */ + angleOffsetOnRightSide:yfiles.layout.LabelAngleOnRightSideOffset; + /** + * The preferred distance between a label and the corresponding edge segment. + * If the given distance is < 0, the distance is not fixed, i.e., it is chosen by the automatic labeling algorithm. + * Default is -1. + * @throws {yfiles.system.ArgumentException} if the specified value is infinite or NaN. + * @throws {yfiles.system.InvalidOperationException} + * if this instance is {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen immutable}. + */ + distanceToEdge:number; + /** + * If one of the preferred placements for this label is at source. + */ + isAtSource:boolean; + /** + * If one of the preferred placements for this label is at center. + */ + isAtCenter:boolean; + /** + * If one of the preferred placements for this label is at target. + */ + isAtTarget:boolean; + /** + * If one of the preferred sides for this label is left of the edge. + */ + isLeftOfEdge:boolean; + /** + * If one of the preferred sides for this label is on the edge. + */ + isOnEdge:boolean; + /** + * If one of the preferred sides for this label is right of the edge. + */ + isRightOfEdge:boolean; + /** + * If one of the angle interpretations is to interpret the angle absolute. + */ + isAngleAbsolute:boolean; + /** + * If one of the angle interpretations is to interpret the angle relative to the edge slope. + */ + isAngleRelativeToEdgeFlow:boolean; + /** + * If one of the angle interpretations is to interpret the angle of labels that are right of the edge as + * co-rotating with the labels left of or centered on edge, i.e. + * the angle of all labels is interpreted + * clockwise. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge} + */ + isAngleOnRightSideCoRotating:boolean; + /** + * If one of the angle interpretations is to interpret the angle of labels that are right of the edge as + * counter-rotating with the labels left of or centered on edge, i.e. + * the angle of labels left or centered on + * edge is interpreted clockwise while the angle of labels right of edge is interpreted counter-clockwise. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge} + */ + isAngleOnRightSideCounterRotating:boolean; + /** + * If one of the angle interpretations is to add no additional angle offset to labels that are right of the + * edge. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge} + */ + isAngleOffsetOnRightSideZero:boolean; + /** + * If one of the angle interpretations is to add an additional angle offset of 180 degree to labels that are + * right of the edge. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#isRightOfEdge} + */ + isAngleOffsetOnRightSide180:boolean; + /** + * If the preferred side specified by{@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE} and {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE} is interpreted relative to the edge flow. + */ + isSideRelativeToEdgeFlow:boolean; + /** + * If the preferred side specified by{@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE} and {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE} is interpreted absolute and on horizontal segments, labels with preferred + * side {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE} are placed above the segment. + */ + isSideAbsoluteWithLeftInNorth:boolean; + /** + * If the preferred side specified by{@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE} and {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE} is interpreted absolute and on horizontal segments, labels with preferred + * side {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE} are placed above the segment. + */ + isSideAbsoluteWithRightInNorth:boolean; + toString():string; + equals(o:Object):boolean; + hashCode():number; + /** + * Returns whether or not this is an immutable descriptor instance. + * If this instance is immutable, all set methods will throw an + * {@link yfiles.system.InvalidOperationException} when invoked. + * @return {boolean} + * true if this instance is immutable; false + * otherwise. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#freeze} + */ + isFrozen():boolean; + /** + * Makes this instance immutable. + * If this instance is immutable, all set methods will throw an + * {@link yfiles.system.InvalidOperationException} when invoked. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen} + */ + freeze():void; + } + var PreferredPlacementDescriptor:{ + $class:yfiles.lang.Class; + /** + * Creates a mutable instance of this descriptor. + */ + new ():yfiles.layout.PreferredPlacementDescriptor; + /** + * Creates a mutable copy of the given PreferredPlacementDescriptor. + * @param {yfiles.layout.PreferredPlacementDescriptor} descriptor PreferredPlacementDescriptor to make a copy from + */ + FromDescriptor:{ + new (descriptor:yfiles.layout.PreferredPlacementDescriptor):yfiles.layout.PreferredPlacementDescriptor; + }; + /** + * Returns an immutable descriptor instance for the specified placement. + * Descriptor instances returned by this method will use default values + * for all properties but {@link yfiles.layout.PreferredPlacementDescriptor#placeAlongEdge placement along edge} + * and {@link yfiles.layout.PreferredPlacementDescriptor#sideOfEdge side of edge}. + * @param {yfiles.layout.LabelPlacements} placement + * an ORed combination of + * {@link yfiles.layout.LabelPlacements#ANYWHERE}, {@link yfiles.layout.LabelPlacements#AT_SOURCE}, + * {@link yfiles.layout.LabelPlacements#AT_TARGET}, or {@link yfiles.layout.LabelPlacements#AT_CENTER} and + * {@link yfiles.layout.LabelPlacements#LEFT_OF_EDGE}, {@link yfiles.layout.LabelPlacements#RIGHT_OF_EDGE}, or + * {@link yfiles.layout.LabelPlacements#ON_EDGE}. + * @return {yfiles.layout.PreferredPlacementDescriptor} an immutable descriptor instance for the specified placement. + * @see {@link yfiles.layout.PreferredPlacementDescriptor#isFrozen} + */ + newSharedInstance(placement:yfiles.layout.LabelPlacements):yfiles.layout.PreferredPlacementDescriptor; + }; + /** + * An rotated edge label model that allows placement of rotated labels at some positions along an edge. + *

+ * It's possible to specify a distance value that controls the distance between the label and edge. + * Furthermore, there's the possibility to mask out* arbitrary edge label candidates. This can either be done by + * specifying predefined candidate masks or by OR-ing allowed label candidates to a user defined mask. + *

+ */ + export interface RotatedDiscreteEdgeLabelLayoutModel extends Object,yfiles.layout.IEdgeLabelModel{ + /** + * The bit mask specifying the valid positions for edge labels. + *

+ * Defaults to {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#SIX_POS}. + *

+ */ + candidateMask:yfiles.layout.RotatedDiscreteEdgeLabelPosition; + /** + * Specifies whether or not the label position mask should be interpreted relative to the edge segment. + * If this value is set to false (default value), the position mask is interpreted in a geometric sense. + * Note: this option is only relevant for non-center positions. + */ + positionRelativeToSegment:boolean; + /** + * Specifies whether or not edge labels are automatically rotated + * according to the angle of the corresponding reference edge segment. + *

+ * By default, this feature is enabled. + *

+ */ + autoRotationEnabled:boolean; + /** + * Determines whether or not edge labels get flipped if they would be upside down in their current position. + *

+ * By default, this feature is disabled. + *

+ */ + autoFlipping:boolean; + /** + * The angle (measured in radians) of the label model. + * The angle is applied in clockwise direction. + */ + angle:number; + /** + * The distance between the label's box and the edge's path. + */ + distance:number; + /** + * A model parameter that encodes the default position of this model's allowed edge label positions. + * Default positions are (in descending order): + *
    + *
  • {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#CENTER}
  • + *
  • {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#SCENTER}
  • + *
  • {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#TAIL}
  • + *
  • {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#STAIL}
  • + *
+ * Descending order means that whenever two or more of the above default positions + * are part of the allowed positions, then the model parameter encodes the one that is listed first. + * Note that the model parameter encodes {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#CENTER} when none of the above + * default positions is part of the allowed positions. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#defaultParameter}. + */ + defaultParameter:Object; + /** + * Creates a model parameter that represents the given edge label context best + * within this model. + * The created model parameter represents the closest parameter representation + * of the given label location that can be achieved within this model. + * @param {yfiles.algorithms.YOrientedRectangle} labelBounds The bounds of the label for which a parameter representation is sought. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceLayout The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetLayout The layout of the target node of the label owning edge. + * @return {Object} + * A model parameter that can be passed to the + * {@link yfiles.layout.IEdgeLabelModel#getLabelPlacement} + * method. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#createModelParameter}. + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):Object; + /** + * Checks if the given model parameter encodes an edge label position that is + * valid in this model. + * @param {Object} parameter the model parameter to check. + * @return {boolean} + * true if the specified object is a valid parameter + * for this model and encodes a valid position according to this model's + * {@link yfiles.layout.RotatedDiscreteEdgeLabelLayoutModel#candidateMask candidate mask}; false otherwise. + */ + isParameterValid(parameter:Object):boolean; + /** + * Returns the bounds of the label for the position encoded + * by the given model parameter. + * @param {yfiles.algorithms.YDimension} labelSize The size of the label that should be placed. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceLayout The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetLayout The layout of the target node of the label owning edge. + * @param {Object} param + * The model parameter that describes the abstract position of the label within + * this model. + * The parameter must have been generated by this model. + * @return {yfiles.algorithms.YOrientedRectangle} The bounds of the label. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#getLabelPlacement}. + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Returns a list of {@link yfiles.layout.EdgeLabelCandidate} objects each of which describes + * a valid label position within this model. + * @param {yfiles.layout.IEdgeLabelLayout} labelLayout The label for which candidates should be generated. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceLayout The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetLayout The layout of the target node of the label owning edge. + * @return {yfiles.algorithms.YList} + * A list of {@link yfiles.layout.EdgeLabelCandidate} objects. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#getLabelCandidates}. + */ + getLabelCandidates(label:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * Returns the coordinates of the upper-left corner of the given label position. + * @param {yfiles.algorithms.YDimension} labelSize The size of the label that should be placed. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceNode The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetNode The layout of the target node of the label owning edge. + * @param {yfiles.layout.DiscreteEdgeLabelPosition} pos + * A label position (given by a symbolic position specifier) that is valid in + * this model. + * @return {yfiles.algorithms.YOrientedRectangle} The coordinates of the upper-left corner of a label position. + */ + getLabelPlacementAtPosition(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,pos:yfiles.layout.DiscreteEdgeLabelPosition):yfiles.algorithms.YOrientedRectangle; + } + var RotatedDiscreteEdgeLabelLayoutModel:{ + $class:yfiles.lang.Class; + /** + * Returns a new instance of RotatedDiscreteEdgeLabelModel. + * Position mask {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#SIX_POS} is used to define the allowed positions for + * an edge label. + */ + new ():yfiles.layout.RotatedDiscreteEdgeLabelLayoutModel; + /** + * Returns a new instance of RotatedDiscreteEdgeLabelModel. + * @param {yfiles.layout.RotatedDiscreteEdgeLabelPosition} candidateMask Position mask that defines the allowed positions for an edge label. + */ + WithPosition:{ + new (candidateMask:yfiles.layout.RotatedDiscreteEdgeLabelPosition):yfiles.layout.RotatedDiscreteEdgeLabelLayoutModel; + }; + /** + * Returns a model parameter that encodes the specified position. + * @param {number} position + * one of + *
    + *
  • {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#SHEAD},
  • + *
  • {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#HEAD},
  • + *
  • {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#THEAD},
  • + *
  • {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#STAIL},
  • + *
  • {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#TAIL},
  • + *
  • {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#TTAIL},
  • + *
  • {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#SCENTER},
  • + *
  • {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#CENTER},
  • + *
  • {@link yfiles.layout.RotatedDiscreteEdgeLabelPosition#TCENTER}
  • + *
+ * @return {Object} a model parameter that encodes the specified position. + * @throws {yfiles.system.ArgumentException} + * if the specified position is not one + * of the symbolic position constants defined in this class. + */ + createPositionParameter(position:number):Object; + /** + * Returns the symbolic position specifier that is encoded by the specified + * model parameter. + * @param {Object} parameter the model parameter that encodes the position. + * @return {number} + * the symbolic position specifier that is encoded by the specified + * model parameter. + * @throws {yfiles.system.ArgumentException} + * if the specified model parameter is not + * valid for this model. + */ + getPosition(parameter:Object):number; + }; + /** + * A layout algorithm that routes the self-loops (reflexive edges) of a graph. + * By default, this layouter routes self-loops in an orthogonal fashion. + * It places the self-loop in the least crowded quadrant around a node. + *

+ * A core layout algorithm can be specified for this class. + * In that case, the performed layout process of this class is subdivided into four + * stages: + *

+ *
    + *
  • Remove all self-loops of the input graph
  • + *
  • Invoke the core layouter on the now self-loops free graph
  • + *
  • Reinsert all formerly removed self-loops of the graph
  • + *
  • Layout the self-loops of the input graph
  • + *
+ */ + export interface SelfLoopLayouter extends yfiles.layout.AbstractLayoutStage{ + /** + * The number of points that are used to round the corner of the selfloops. + * If this value is set to one + * the corners are drawn orthogonal. This value is only considered if style {@link yfiles.layout.SelfloopStyle#ROUNDED} is used. + * @see {@link yfiles.layout.SelfloopStyle#ROUNDED} + */ + cornerApproximationPointsCount:number; + /** + * The distance between two adjacent paths that run in parallel. + * This value is only considered for layout style {@link yfiles.layout.SelfloopStyle#ROUNDED}. + * @see {@link yfiles.layout.SelfloopStyle#ROUNDED} + */ + lineDistance:number; + /** + * Whether or not smart selfloop placement should be enabled. + * If this option is enabled, selfloops are placed on one of the four corners of the corresponding node. For the choice of the corner + * the algorithm considers all incident edges. + * Otherwise the selfloops are always placed at the upper left corner of the corresponding node. + */ + smartSelfloopPlacement:boolean; + /** + * The layout style to be used. + * Possible values are {@link yfiles.layout.SelfloopStyle#ORTHOGONAL} (default) and {@link yfiles.layout.SelfloopStyle#ROUNDED}. + * @see {@link yfiles.layout.SelfloopStyle#ORTHOGONAL} + * @see {@link yfiles.layout.SelfloopStyle#ROUNDED} + */ + layoutStyle:yfiles.layout.SelfloopStyle; + /** + * Lays out the given graph. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Whether or not this layouter can layout the given graph. + * Returns true if the core layouter can handle the given graph + * after all of its self-loops (reflexive) edges have been hidden. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#canLayout} + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Lays out the self-loops of the given graph. + * This method will be called after the core layouter has + * laid out the graph and all self-loops have been reinserted + * in the graph again. + */ + layoutSelfLoops(graph:yfiles.layout.LayoutGraph):void; + /** + * Specifies whether this algorithm should keep the existing layout of all self-loops. + * If this property is set, the {@link yfiles.layout.SelfLoopLayouter#KEEP_SELF_LOOP_LAYOUT_DP_KEY} data provider + * will be ignored. + * No layout for any self-loop will be calculated, instead the existing self-loop + * layout will be moved with its node. + * The default is false. + */ + keepAllSelfloopLayouts:boolean; + } + var SelfLoopLayouter:{ + $class:yfiles.lang.Class; + /** + * This {@link yfiles.algorithms.IDataProvider} key can be used to register a {@link yfiles.algorithms.IDataProvider} + * with the graph to be laid out. + * This algorithm will query for each self-loop + * the boolean value from the data provider to determine whether the current layout + * of the self-loop should be kept. I.e., if the DataProvider instance + * obtained from the graph using this key returns true for a self-loop, + * that self-loop will not be laid out by this stage but the bends will be moved + * by that stage according to the movement of their node. + * @see {@link yfiles.layout.SelfLoopLayouter#keepAllSelfloopLayouts} + */ + KEEP_SELF_LOOP_LAYOUT_DP_KEY:Object; + /** + * Instantiates a new SelfLoopLayouter. + */ + new ():yfiles.layout.SelfLoopLayouter; + /** + * Instantiates a new SelfLoopLayouter. + * The core layout routine + * will be delegated to the given layouter. + */ + WithCoreLayouter:{ + new (coreLayouter:yfiles.layout.ILayouter):yfiles.layout.SelfLoopLayouter; + }; + }; + /** + * Provides configuration services for the port constraints of a graph. + */ + export interface PortConstraintConfigurator extends Object{ + /** + * Creates and returns a port constraint for the given edge. + * The side constraint is setup according to the current drawing of the edge. + * @param {boolean} source + * if true a source port constraint for the given + * edge will be created, otherwise a target port constraint. + * @param {boolean} strong + * if true a strong port constraint is created, + * otherwise a weak port constraint is created. + */ + createPortConstraintFromSketchForEdge(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge,source:boolean,strong:boolean):yfiles.layout.PortConstraint; + /** + * Creates weak port constraints for all edges of the given graph. + * @param {yfiles.algorithms.IEdgeMap} spcMap an edge map that will be used to store the source port constraints of the edges. + * @param {yfiles.algorithms.IEdgeMap} tpcMap an edge map that will be used to store the target port constraints of the edges. + */ + createPortConstraintsFromSketchForGraph(graph:yfiles.layout.LayoutGraph,spcMap:yfiles.algorithms.IEdgeMap,tpcMap:yfiles.algorithms.IEdgeMap):void; + /** + * Creates port constraints for some edges of the given graph. + * @param {yfiles.algorithms.IEdgeCursor} ec EdgeCursor that provides access to the edges for which to set port constraints. + * @param {yfiles.algorithms.IEdgeMap} spcMap an edge map that will be used to store the source port constraints of the edges. + * @param {boolean} strongSP whether or not to assign strong source port constraints + * @param {yfiles.algorithms.IEdgeMap} tpcMap an edge map that will be used to store the target port constraints of the edges. + * @param {boolean} strongTP whether or not to assign strong target port constraints + */ + createPortConstraintsFromSketchForEdges(graph:yfiles.layout.LayoutGraph,ec:yfiles.algorithms.IEdgeCursor,spcMap:yfiles.algorithms.IEdgeMap,strongSP:boolean,tpcMap:yfiles.algorithms.IEdgeMap,strongTP:boolean):void; + } + var PortConstraintConfigurator:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of PortConstraintConfigurator. + */ + new ():yfiles.layout.PortConstraintConfigurator; + }; + /** + * An edge label model that allows placement of labels at a set of continuous positions + * along both sides of an edge or directly on the edge path. + *

+ * The set of positions can be influenced by specifying the density value that controls + * the spacing between adjacent label positions. + * Furthermore, it's possible to specify distance values that control the distance + * between label and edge and between label and nodes. + *

+ */ + export interface RotatedSliderEdgeLabelLayoutModel extends Object,yfiles.layout.IEdgeLabelModel{ + /** + * The model's slider mode. + */ + mode:yfiles.layout.RotatedSliderMode; + /** + * A value indicating whether the distance to the edge is interpreted + * relatively to the edge's path. + * If this value is set, the label is placed + * to the left of the edge segment (relative to the segment direction) if + * distance is less than 0 and to the right of the + * edge segment if distance is greater than 0. + * If this value is not set, the label is placed below the edge segment (in + * geometric sense) if distance ls less than 0 and + * above the edge segment if distance is greater than + * 0. + *

+ * The default value is true. + *

+ * @see {@link yfiles.layout.RotatedSliderEdgeLabelLayoutModel#distance} + * @see {@link yfiles.layout.RotatedSliderEdgeLabelLayoutModel#distance} + */ + distanceRelativeToEdge:boolean; + /** + * The distance between the label's box and the edge's path. + * The interpretation of positive/negative values depends on property + * {@link yfiles.layout.RotatedSliderEdgeLabelLayoutModel#distanceRelativeToEdge distanceRelativeToEdge}. + * @see {@link yfiles.layout.RotatedSliderEdgeLabelLayoutModel#distanceRelativeToEdge} + * @see {@link yfiles.layout.RotatedSliderEdgeLabelLayoutModel#distanceRelativeToEdge} + * @see {@link yfiles.layout.RotatedSliderEdgeLabelLayoutModel#distanceRelativeToEdge} + * @see {@link yfiles.layout.RotatedSliderEdgeLabelLayoutModel#distanceRelativeToEdge} + */ + distance:number; + /** + * Specifies whether or not edge labels are automatically rotated according to + * the angle of the corresponding reference edge segment. + *

+ * By default, this feature is enabled. + *

+ */ + autoRotationEnabled:boolean; + /** + * Determines whether or not edge labels get flipped if they would be upside down in their current position. + *

+ * By default, this feature is disabled. + *

+ */ + autoFlipping:boolean; + /** + * The angle (measured in radians) of the label model. + * The angle is applied in clockwise direction. + */ + angle:number; + /** + * A model parameter that encodes the default position of this model's + * allowed edge label positions. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#defaultParameter}. + */ + defaultParameter:Object; + /** + * Returns the bounds of the label for the position encoded + * by the given model parameter. + * @param {yfiles.algorithms.YDimension} labelSize The size of the label that should be placed. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceLayout The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetLayout The layout of the target node of the label owning edge. + * @param {Object} param + * The model parameter that describes the abstract position of the label within + * this model. + * The parameter must have been generated by this model. + * @return {yfiles.algorithms.YOrientedRectangle} The bounds of the label. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#getLabelPlacement}. + */ + getLabelPlacement(labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,para:Object):yfiles.algorithms.YOrientedRectangle; + /** + * Returns a list of candidate positions for the given edge label. + * The number of candidates and their respective locations are computed depending + * on the geometries of both label and edge. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#getLabelCandidates}. + */ + getLabelCandidates(label:yfiles.layout.IEdgeLabelLayout,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):yfiles.algorithms.YList; + /** + * Creates a model parameter that represents the given edge label context best + * within this model. + * The created model parameter represents the closest parameter representation + * of the given label location that can be achieved within this model. + * @param {yfiles.algorithms.YOrientedRectangle} labelBounds The bounds of the label for which a parameter representation is sought. + * @param {yfiles.layout.IEdgeLayout} edgeLayout The layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceLayout The layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetLayout The layout of the target node of the label owning edge. + * @return {Object} + * A model parameter that can be passed to the + * {@link yfiles.layout.IEdgeLabelModel#getLabelPlacement} + * method. + * @see Specified by {@link yfiles.layout.IEdgeLabelModel#createModelParameter}. + */ + createModelParameter(labelBounds:yfiles.algorithms.YOrientedRectangle,edgeLayout:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):Object; + } + var RotatedSliderEdgeLabelLayoutModel:{ + $class:yfiles.lang.Class; + /** + * Returns a new instance of RotatedSliderEdgeLabelModel. + * @param {yfiles.layout.RotatedSliderMode} mode + * Determines which slider mode to use. + * Possible values are {@link yfiles.layout.RotatedSliderMode#CENTER}, {@link yfiles.layout.RotatedSliderMode#SINGLE_SIDE} or {@link yfiles.layout.RotatedSliderMode#SIDE}. + */ + new (mode:yfiles.layout.RotatedSliderMode):yfiles.layout.RotatedSliderEdgeLabelLayoutModel; + }; + export enum EdgeFlow{ + /** + * Edge flow specifier used by method {@link yfiles.layout.LayoutTool#determineEdgeFlowDirection}. + * This value specifies that the flow direction of most edges is up. + * @see {@link yfiles.layout.LayoutTool#determineEdgeFlowDirection} + */ + UP, + /** + * Edge flow specifier used by method {@link yfiles.layout.LayoutTool#determineEdgeFlowDirection}. + * This value specifies that the flow direction of most edges is down. + * @see {@link yfiles.layout.LayoutTool#determineEdgeFlowDirection} + */ + DOWN, + /** + * Edge flow specifier used by method {@link yfiles.layout.LayoutTool#determineEdgeFlowDirection}. + * This value specifies that the flow direction of most edges is left. + * @see {@link yfiles.layout.LayoutTool#determineEdgeFlowDirection} + */ + LEFT, + /** + * Edge flow specifier used by method {@link yfiles.layout.LayoutTool#determineEdgeFlowDirection}. + * This value specifies that the flow direction of most edges is right. + * @see {@link yfiles.layout.LayoutTool#determineEdgeFlowDirection} + */ + RIGHT, + /** + * Edge flow specifier used by method {@link yfiles.layout.LayoutTool#determineEdgeFlowDirection}. + * This value specifies that there is no main flow direction. + * @see {@link yfiles.layout.LayoutTool#determineEdgeFlowDirection} + */ + NONE + } + /** + * A layout algorithm that routes parallel edges (edges that connect the same pair of nodes) of a graph. + * A core layout algorithm can be specified for this class. In that case the performed layout process of this class + * is subdivided into four stages: + *
    + *
  • Remove parallel edges from the input graph. + * If there are parallel edges between two nodes v and w than + * only one of these edges will remain in the graph. The remaining edge is called the leading edge and + * is the representative of the other edges.
  • + *
  • Invoke the core layouter on the now parallel edge free graph.
  • + *
  • Reinsert all formerly removed edges of the graph.
  • + *
  • Route the parallel edges such that they run in parallel + * to their leading edge which was routed by the core layouter.
  • + *
+ */ + export interface ParallelEdgeLayouter extends yfiles.layout.AbstractLayoutStage{ + /** + * Holds the list of parallel edges that are hidden from the core layouter. + */ + hiddenEdges:yfiles.algorithms.EdgeList; + /** + * EdgeMap that associates a hidden edge with the unique parallel edge not hidden from the core layouter. + */ + parallelEdges:yfiles.algorithms.IEdgeMap; + /** + * Specifies whether or not edges should be considered as directed. + * In directed mode only edges that have the same source and target node will be routed + * in parallel (e.g., two edges (v,w) and (w,v) won't be routed in parallel). + * In undirected mode, all edges connecting the same pair of nodes + * will be routed in parallel. By default this feature is disabled. + */ + directedMode:boolean; + /** + * Specifies whether or not the line distances between parallel edges should be determined automatically according to + * the nodes' bounds. + * If enabled, the line distances are chosen such that all parallel edges can be drawn straight-line and still connect + * to the nodes' bounds. By default this feature is enabled. + */ + adaptiveLineDistances:boolean; + /** + * The distance between two adjacent paths that run in parallel. + * Note: if adaptive line distances are used (see {@link yfiles.layout.ParallelEdgeLayouter#adaptiveLineDistances}) the real distance may + * be less than the given line distance. + */ + lineDistance:number; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * This method assigns a layout to parallel edges. + * The layout for each parallel edge follows the + * layout of the one edge not being removed from the core layouter. + */ + layoutParallelEdges(graph:yfiles.layout.LayoutGraph,parallelEdges:yfiles.algorithms.IEdgeMap):void; + /** + * This method detects parallel edges of the given graph. + * From each set of parallel edges + * it hides all but one edge from the given graph. + */ + findAndHideParallelEdges(graph:yfiles.algorithms.Graph):void; + /** + * Specifies whether or not to join end points of parallel edges. + * If enabled all lines end at the same point. By default, this feature is disabled. + */ + joinEnds:boolean; + /** + * The absolute distance from the end point of the lines to the first + * parallel segments if end joining is enabled. + */ + absJoinEndDistance:number; + /** + * The relative distance from the end point of the lines to the first + * parallel segments if end joining is enabled. + * The length will be relative to the corresponding original + * segment's length. + */ + relJoinEndDistance:number; + /** + * Specifies whether this layouter will adjust the leading edge to obtain more symmetric results. + * By default, this feature is enabled. + */ + adjustLeadingEdge:boolean; + } + var ParallelEdgeLayouter:{ + $class:yfiles.lang.Class; + /** + * A {@link yfiles.algorithms.IDataProvider} key that can be used to tell the stage whether edges should be included in + * or excluded from the calculation. + * For every {@link yfiles.algorithms.Edge} instance the provider + * should yield {@link yfiles.algorithms.IDataProvider#getBool boolean} values to indicate whether an + * edge should be laid out. + * If no data provider is registered for the given key, all edges will be laid out. + */ + SCOPE_DP_KEY:Object; + /** + * A {@link yfiles.algorithms.IDataProvider} key that can be used to specify which parallel edge should be used + * as leading edge, i.e., as the edge whose layout is used to obtain the layout of the corresponding parallel edges. + * For every {@link yfiles.algorithms.Edge} instance the provider should yield {@link yfiles.algorithms.IDataProvider#getBool boolean} values + * to indicate whether an edge is a leading edge. + */ + LEADING_EDGE_DP_KEY:Object; + /** + * Creates a new instance of ParallelEdgeLayouter for the given core layouter. + * @see {@link yfiles.layout.AbstractLayoutStage#coreLayouter} + */ + WithCoreLayouter:{ + new (coreLayouter:yfiles.layout.ILayouter):yfiles.layout.ParallelEdgeLayouter; + }; + /** + * Creates a new instance of ParallelEdgeLayouter with no core layouter assigned. + */ + new ():yfiles.layout.ParallelEdgeLayouter; + }; + /** + * This class represents a drawing of a graph. + */ + export interface LayoutGraph extends yfiles.algorithms.Graph,yfiles.layout.IGraphLayout{ + /** + * 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; + /** + * Creates a new {@link yfiles.layout.ILabelLayoutFactory}. + */ + createLabelFactory():yfiles.layout.ILabelLayoutFactory; + /** + * Returns the layout information for a node in the drawing. + * @param {yfiles.algorithms.Node} node a node in the drawing. + * @return {yfiles.layout.INodeLayout} the layout information for node. + */ + getLayoutForNode(node:yfiles.algorithms.Node):yfiles.layout.INodeLayout; + /** + * Returns the layout information for an edge in the drawing. + * @param {yfiles.algorithms.Edge} edge a edge in the drawing. + * @return {yfiles.layout.IEdgeLayout} the layout information for edge. + */ + getLayoutForEdge(edge:yfiles.algorithms.Edge):yfiles.layout.IEdgeLayout; + /** + * Returns + * NodeLabelLayout objects which describe the layouts + * of the labels that belong to the given node. + * @param {yfiles.algorithms.Node} node a node in the drawing. + * @return {yfiles.layout.INodeLabelLayout[]} the node label layout information for node. + */ + getLabelLayoutForNode(node:yfiles.algorithms.Node):yfiles.layout.INodeLabelLayout[]; + /** + * Returns + * EdgeLabelLayout objects which describe the layouts + * of the labels that belong to the given edge. + * @param {yfiles.algorithms.Edge} edge an edge in the drawing. + * @return {yfiles.layout.IEdgeLabelLayout[]} the edge label layout information for edge. + */ + getLabelLayoutForEdge(edge:yfiles.algorithms.Edge):yfiles.layout.IEdgeLabelLayout[]; + /** + * Returns the node which is described by a given label layout. + */ + getFeatureNode(labelLayout:yfiles.layout.INodeLabelLayout):yfiles.algorithms.Node; + /** + * Returns the edge which is described by a given label layout. + */ + getFeatureEdge(labelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.algorithms.Edge; + /** + * Returns the layout information for a node in the drawing. + * @param {Object} node a node in the drawing. + * @return {yfiles.layout.INodeLayout} the layout information for node. + * @see Specified by {@link yfiles.layout.IGraphLayout#getNodeLayout}. + */ + getNodeLayout(node:Object):yfiles.layout.INodeLayout; + /** + * Returns the layout information for an edge in the drawing. + * @param {Object} edge a edge in the drawing. + * @return {yfiles.layout.IEdgeLayout} the layout information for edge. + * @see Specified by {@link yfiles.layout.IGraphLayout#getEdgeLayout}. + */ + getEdgeLayout(edge:Object):yfiles.layout.IEdgeLayout; + /** + * Returns + * NodeLabelLayout objects which describe the layouts + * of the labels that belong to the given node. + * @param {Object} node a node in the drawing. + * @return {yfiles.layout.INodeLabelLayout[]} the node label layout information for node. + * @see Specified by {@link yfiles.layout.IGraphLayout#getNodeLabelLayout}. + */ + getNodeLabelLayout(node:Object):yfiles.layout.INodeLabelLayout[]; + /** + * Returns + * EdgeLabelLayout objects which describe the layouts + * of the labels that belong to the given edge. + * @param {Object} edge an edge in the drawing. + * @return {yfiles.layout.IEdgeLabelLayout[]} the edge label layout information for edge. + * @see Specified by {@link yfiles.layout.IGraphLayout#getEdgeLabelLayout}. + */ + getEdgeLabelLayout(edge:Object):yfiles.layout.IEdgeLabelLayout[]; + /** + * Returns the center x-coordinate of the given node. + */ + getCenterX(v:yfiles.algorithms.Node):number; + /** + * Returns the center y-coordinate of the given node. + */ + getCenterY(v:yfiles.algorithms.Node):number; + /** + * Returns the position of a node in a drawing. + * The position is defined by the center of the node. + * @param {yfiles.algorithms.Node} node a node in the graph + * @return {yfiles.algorithms.YPoint} the center of the node in the drawing of the node + */ + getCenter(node:yfiles.algorithms.Node):yfiles.algorithms.YPoint; + /** + * Returns the upper left x-coordinate of the given node. + */ + getX(v:yfiles.algorithms.Node):number; + /** + * Returns the upper left y-coordinate of the given node. + */ + getY(v:yfiles.algorithms.Node):number; + /** + * Returns the position of the node in a drawing. + * The position is defined by the upper left corner of the node. + * @param {yfiles.algorithms.Node} node a node in the graph + * @return {yfiles.algorithms.YPoint} the upper left corner of the drawing of the node + */ + getLocation(node:yfiles.algorithms.Node):yfiles.algorithms.YPoint; + /** + * Returns the width of the given node. + */ + getWidth(v:yfiles.algorithms.Node):number; + /** + * Returns the height of the given node. + */ + getHeight(v:yfiles.algorithms.Node):number; + /** + * Returns the size of the node in a drawing. + * @param {yfiles.algorithms.Node} node a node in the graph. + * @return {yfiles.algorithms.YDimension} the size of the node. + */ + getSize(node:yfiles.algorithms.Node):yfiles.algorithms.YDimension; + /** + * Returns the bounding box of a node. + * @param {yfiles.algorithms.Node} node a node in the graph. + * @return {yfiles.algorithms.YRectangle} a box. + */ + getRectangle(node:yfiles.algorithms.Node):yfiles.algorithms.YRectangle; + /** + * Sets the position of a node in a drawing. + * The position is defined by the center of the node. + * @param {yfiles.algorithms.Node} node a node in the graph + * @param {yfiles.algorithms.YPoint} position the center of the node in the drawing of the node + */ + setCenter(node:yfiles.algorithms.Node,position:yfiles.algorithms.YPoint):void; + /** + * Sets the center coordinates of the given node. + */ + setCenterCoords(v:yfiles.algorithms.Node,x:number,y:number):void; + /** + * Sets the size of the given node. + */ + setSize(v:yfiles.algorithms.Node,w:number,h:number):void; + /** + * Set the size of the node in a drawing. + * @param {yfiles.algorithms.Node} node a node in the graph + * @param {yfiles.algorithms.YDimension} size the size of the node. + */ + setSizeWithDimension(node:yfiles.algorithms.Node,size:yfiles.algorithms.YDimension):void; + /** + * Sets the upper left coordinates of the given node. + */ + setLocationCoords(v:yfiles.algorithms.Node,x:number,y:number):void; + /** + * Set the position of the node in a drawing. + * The position is defined by the upper left corner of the node. + * @param {yfiles.algorithms.Node} node a node in the graph + * @param {yfiles.algorithms.YPoint} position the upper left corner of the drawing of the node + */ + setLocation(node:yfiles.algorithms.Node,position:yfiles.algorithms.YPoint):void; + /** + * Moves the location of a node by a given vector. + * @param {yfiles.algorithms.Node} node a node in the graph + * @param {number} dx the x-component of the vector + * @param {number} dy the y-component of the vector + */ + moveBy(node:yfiles.algorithms.Node,dx:number,dy:number):void; + /** + * Returns the control points of an edge. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @return {yfiles.algorithms.YPointPath} the sequence of control points. + */ + getPoints(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPointPath; + /** + * Returns the control points of an edge. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @return {yfiles.algorithms.YList} the sequence of control points as a YList + */ + getPointList(edge:yfiles.algorithms.Edge):yfiles.algorithms.YList; + /** + * Returns the path of an edge. + * The path of an edge is the position of the source port, + * followed by the positions of the bends, followed by the position + * of the target port. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @return {yfiles.algorithms.YPointPath} the path + */ + getPath(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPointPath; + /** + * Returns the path of an edge. + * The path of an edge is the position of the source port, + * followed by the positions of the bends, followed by the position + * of the target port. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @return {yfiles.algorithms.YList} the path as a YList + */ + getPathList(edge:yfiles.algorithms.Edge):yfiles.algorithms.YList; + /** + * Sets the path of an edge. + * The path of an edge is the position of the source port, + * followed by the positions of the bends, followed by the position + * of the target port. Both source and target port are expected to be given + * in absolute coordinates. + * Precondition: The length of the path must be 2 at least. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @param {yfiles.algorithms.YPointPath} path the path sequence. + */ + setPath(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YPointPath):void; + /** + * Sets the path of an edge. + * The path of an edge is the position of the source port, + * followed by the positions of the bends, followed by the position + * of the target port. Both source and target port are expected to be given + * in absolute coordinates. + * Precondition: The length of the path must be 2 at least. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @param {yfiles.algorithms.YList} path the path sequence given as a YList + */ + setPathWithPointList(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList):void; + /** + * Sets the control points of an edge. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @param {yfiles.algorithms.YPointPath} points the sequence of control points. + */ + setPoints(edge:yfiles.algorithms.Edge,points:yfiles.algorithms.YPointPath):void; + /** + * Sets the control points of an edge. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @param {yfiles.algorithms.YList} points the sequence of control points as a YList + */ + setPointsWithPointList(edge:yfiles.algorithms.Edge,points:yfiles.algorithms.YList):void; + /** + * Set the two end points of an edge in absolute coordinates. + * @param {yfiles.algorithms.Edge} edge an edge in the graph. + * @param {yfiles.algorithms.YPoint} source the port on the source side of the edge. + * @param {yfiles.algorithms.YPoint} target the port on the target side of the edge. + */ + setEndPointsAbs(edge:yfiles.algorithms.Edge,source:yfiles.algorithms.YPoint,target:yfiles.algorithms.YPoint):void; + /** + * Returns the coordinates of the source end point of an edge + * in relative coordinates to the center of the source node. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + */ + getSourcePointRel(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; + /** + * Returns the coordinates of the target end point of an edge + * in relative coordinates to the center of the target node. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + */ + getTargetPointRel(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; + /** + * Sets the coordinates of the source end point of an edge + * in relative coordinates to the center of the source node. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @param {yfiles.algorithms.YPoint} point + */ + setSourcePointRel(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; + /** + * Sets the coordinates of the target end point of an edge + * in relative coordinates to the center of the target node. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + */ + setTargetPointRel(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; + /** + * Returns the coordinates of the source end point of an edge + * in absolute coordinates. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + */ + getSourcePointAbs(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; + /** + * Returns the coordinates of the target end point of an edge + * in absolute coordinates. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + */ + getTargetPointAbs(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; + /** + * Sets the coordinates of the source end point of an edge + * in absolute coordinates. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @param {yfiles.algorithms.YPoint} point + */ + setSourcePointAbs(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; + /** + * Sets the coordinates of the target end point of an edge + * in absolute coordinates. + * @param {yfiles.algorithms.Edge} edge an edge in the graph + * @param {yfiles.algorithms.YPoint} point + */ + setTargetPointAbs(edge:yfiles.algorithms.Edge,point:yfiles.algorithms.YPoint):void; + /** + * A list, which contains the edges of the graph. + */ + edgeList:yfiles.algorithms.EdgeList; + /** + * Returns the bounding box of the diagram. + * This is the smallest rectangle containing the entire diagram. + * If the graph does not contain any nodes (and therefore no edges either), + * the bounding box will have negative width and/or height. + * @see Specified by {@link yfiles.layout.IGraphLayout#getBoundingBox}. + */ + getBoundingBox():yfiles.algorithms.Rectangle; + } + var LayoutGraph:{ + $class:yfiles.lang.Class; + /** + * Creates a new Layout Graph. + */ + new ():yfiles.layout.LayoutGraph; + /** + * Creates a copy of the given subgraph. + */ + FromLayoutGraph:{ + new (argGraph:yfiles.layout.LayoutGraph):yfiles.layout.LayoutGraph; + }; + /** + * Creates a copy of the given subgraph. + */ + FromGraphForSubset:{ + new (graph:yfiles.layout.LayoutGraph,nodeSubset:yfiles.algorithms.ICursor):yfiles.layout.LayoutGraph; + }; + }; + /** + * Implements the ranking for edge and node labels for Graph2D. + * Node label positions have no ranking for the moment, they are all + * equal to 1. + */ + export interface LabelRanking extends Object,yfiles.layout.IProfitModel{ + /** + * Returns the profit for placing a label-candidate. + * Higher profit means higher probability that the candidate is chosen + * by a labeling algorithm. + * @param {yfiles.layout.LabelCandidate} candidate a label candidate + * @return {number} a value between 0 and 1. + * @see Specified by {@link yfiles.layout.IProfitModel#getProfit}. + */ + getProfit(candidate:yfiles.layout.LabelCandidate):number; + } + var LabelRanking:{ + $class:yfiles.lang.Class; + }; + /** + * An implementation of the copy factory interface used by {@link yfiles.algorithms.GraphCopier} + * that can be used by implementations of {@link yfiles.layout.LayoutGraph}. + */ + export interface LayoutGraphCopyFactory extends Object,yfiles.algorithms.GraphCopier.ICopyFactory{ + /** + * 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; + /** + * Callback that copies the labels for a given node. + */ + copyNodeLabels(originalLayoutGraph:yfiles.layout.LayoutGraph,originalNode:yfiles.algorithms.Node,targetGraph:yfiles.layout.LayoutGraph,newNode:yfiles.algorithms.Node):void; + /** + * Copies the node label's layout. + */ + copyNodeLabelLayout(nodeLabelLayout:yfiles.layout.INodeLabelLayout):yfiles.layout.INodeLabelLayout; + /** + * 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 {@link yfiles.layout.DefaultLayoutGraph}. + * @see Specified by {@link yfiles.algorithms.GraphCopier.ICopyFactory#createGraph}. + */ + createGraph():yfiles.algorithms.Graph; + /** + * Callback that copies the labels for a given edge. + */ + copyEdgeLabels(originalLayoutGraph:yfiles.layout.LayoutGraph,originalEdge:yfiles.algorithms.Edge,layoutGraph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; + /** + * Copies the edge label's layout. + */ + copyEdgeLabelLayout(edgeLabelLayout:yfiles.layout.IEdgeLabelLayout):yfiles.layout.IEdgeLabelLayout; + /** + * 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(originalGraph:yfiles.algorithms.Graph,newGraph: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(originalGraph:yfiles.algorithms.Graph,newGraph:yfiles.algorithms.Graph,nodeMap:yfiles.algorithms.IMap,edgeMap:yfiles.algorithms.IMap):void; + } + export module LayoutGraphCopyFactory{ + /** + * An implementation of the copy factory interface used by {@link yfiles.algorithms.GraphCopier} + * that can be used by implementations of {@link yfiles.layout.LayoutGraph} that are hierarchically grouped + * using {@link yfiles.layout.GroupingKeys}. + */ + export interface HierarchicGraphCopyFactory 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.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; + /** + * Factory method that creates an id for the given node. + * This implementation uses the destination node itself as the id for the node. + */ + createNodeId(srcId:Object,dst:yfiles.algorithms.Node):Object; + } + } + var LayoutGraphCopyFactory:{ + $class:yfiles.lang.Class; + HierarchicGraphCopyFactory:{ + $class:yfiles.lang.Class; + new ():yfiles.layout.LayoutGraphCopyFactory; + WithDelegatingFactory:{ + new (delegatingFactory:yfiles.algorithms.GraphCopier.ICopyFactory):yfiles.layout.LayoutGraphCopyFactory; + }; + }; + }; + /** + * This class is a container for several helper and utility functions for + * the LayoutGraph class. + * @see {@link yfiles.layout.LayoutGraph} + */ + export interface LayoutTool extends Object{ + } + var LayoutTool:{ + $class:yfiles.lang.Class; + /** + * Constraint specifier constant for the multi-row rectangle arrangement realized by + * {@link yfiles.layout.LayoutTool#arrangeRectangleMultiRowsWithAlignment} + * Both, height and width, are not limited in size by any constraint. + * The rectangles will be arranged in a way + * that the view ratio defined by the preferred height and width will be achieved. + */ + MULTI_ROW_NO_CONSTRAINT:number; + /** + * Constraint specifier constant for the multi-row rectangle arrangement realized by + * {@link yfiles.layout.LayoutTool#arrangeRectangleMultiRowsWithAlignment} + * Limits the height of the arrangement to the given preferred height value. + * If some rectangles are higher than + * allowed, then they are placed nevertheless, but the constraint will be still considered for the rest and not + * weakened to the height of the higher rectangles. Having one rectangle being higher than the constraint allows + * does always result in arrangements consisting only of a single top-level row. + */ + MULTI_ROW_HEIGHT_CONSTRAINT:number; + /** + * Constraint specifier constant for the multi-row rectangle arrangement realized by + * {@link yfiles.layout.LayoutTool#arrangeRectangleMultiRowsWithAlignment} + * Limits the width of the arrangement to the given preferred width value. + * If a rectangle is wider than + * allowed, then it will nevertheless be placed (in a row containing the rectangle alone), but the constraint + * will be still considered for other rows and not weakened. + */ + MULTI_ROW_WIDTH_CONSTRAINT:number; + /** + * Returns the label layout factory for the given graph. + * Note that the factory instance is bound to the specified graph instance, i.e., you can only create, add and remove + * labels for this graph. + * @param {yfiles.layout.LayoutGraph} graph the graph. + * @return {yfiles.layout.ILabelLayoutFactory} the label factory of the graph. + */ + getLabelFactory(graph:yfiles.layout.LayoutGraph):yfiles.layout.ILabelLayoutFactory; + /** + * Determines the main direction of the edge flow by analyzing the current layout of the graph. + * The method only considers edges for which the given DataProvider returns true. + * @param {yfiles.layout.LayoutGraph} graph the underlying graph. + * @param {yfiles.algorithms.IDataProvider} considerEdges the edges to consider. + * @return {yfiles.layout.EdgeFlow} + * the flow direction, i.e., {@link yfiles.layout.EdgeFlow#DOWN}, {@link yfiles.layout.EdgeFlow#LEFT}, {@link yfiles.layout.EdgeFlow#NONE}, {@link yfiles.layout.EdgeFlow#RIGHT} + * or {@link yfiles.layout.EdgeFlow#UP}. + */ + determineEdgeFlowDirection(graph:yfiles.layout.LayoutGraph,considerEdges:yfiles.algorithms.IDataProvider):yfiles.layout.EdgeFlow; + /** + * Returns true if most of the edges of the graph are routed orthogonal. + * The method only considers edges for which the given DataProvider returns true. + * @param {yfiles.layout.LayoutGraph} graph the underlying graph. + * @param {yfiles.algorithms.IDataProvider} considerEdges the edges to consider. + * @return {boolean} true if most of the edges of the graph are routed orthogonal. + */ + isUsingOrthogonalEdgeRoutes(graph:yfiles.layout.LayoutGraph,considerEdges:yfiles.algorithms.IDataProvider):boolean; + /** + * Returns true if most of the edges of the graph are routed octilinear. + * The method only considers edges for which the + * given DataProvider returns true. + *

+ * Note: for orthogonal layouts this method returns true. + *

+ * @param {yfiles.layout.LayoutGraph} graph the underlying graph. + * @param {yfiles.algorithms.IDataProvider} considerEdges the edges to consider. + * @return {boolean} true if most of the edges of the graph are routed octilinear. + */ + isUsingOctilinearEdgeRoutes(graph:yfiles.layout.LayoutGraph,considerEdges:yfiles.algorithms.IDataProvider):boolean; + /** + * Returns the distance between the centers of two nodes. + */ + getNodeDistance(graph:yfiles.layout.LayoutGraph,s:yfiles.algorithms.Node,t:yfiles.algorithms.Node):number; + /** + * Returns the length of path of a given edge. + * The path starts + * at the source point traverses through all control points and ends + * at the target point. + */ + getPathLength(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):number; + /** + * Reverses the layout of an edge. + * This method reverses the order of points + * and swaps source with target point. + */ + reverseEdgeLayout(el:yfiles.layout.IEdgeLayout):void; + /** + * Assigns a trivial path which has no control points to all edges in the + * specified graph and sets the edges' ports to the center of the + * corresponding nodes. + * Calling this method is equivalent to + *
+ * resetPaths(gd, true) + *
+ * @param {yfiles.layout.LayoutGraph} gd a graph diagram. + * @see {@link yfiles.layout.LayoutTool#resetPathsAndPorts} + */ + resetPaths(gd:yfiles.layout.LayoutGraph):void; + /** + * Assigns a trivial path which has no control points to all edges in the + * specified graph. + * @param {yfiles.layout.LayoutGraph} gd a graph diagram. + * @param {boolean} resetPorts + * if true, the ports of the edges are set + * to the center of the corresponding nodes. + */ + resetPathsAndPorts(gd:yfiles.layout.LayoutGraph,resetPorts:boolean):void; + /** + * Assigns a trivial path which has no control points to the specified edge + * and sets the edge's ports to the center of the corresponding node. + * Calling this method is equivalent to + *
+ * resetPath(gd, edge, true) + *
+ * @param {yfiles.layout.LayoutGraph} gd a graph diagram. + * @param {yfiles.algorithms.Edge} edge an edge in graph. + * @see {@link yfiles.layout.LayoutTool#resetEdgePath} + */ + resetPath(gd:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; + /** + * Assigns a trivial path which has no control points to the specified edge. + * @param {yfiles.layout.LayoutGraph} gd a graph diagram. + * @param {yfiles.algorithms.Edge} edge an edge in graph. + * @param {boolean} resetPorts + * if true, the ports of the edge are set + * to the center of the corresponding node. + */ + resetEdgePath(gd:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,resetPorts:boolean):void; + /** + * This helper method removes duplicate bends from all edges in the graph. + * @param {yfiles.layout.LayoutGraph} gd a graph diagram. + */ + removeDuplicateBends(gd:yfiles.layout.LayoutGraph):void; + /** + * This helper method removes duplicate bends from the given edge in the graph. + * @param {yfiles.layout.LayoutGraph} gd a graph diagram. + * @param {yfiles.algorithms.Edge} edge the edge. + */ + removeDuplicateBendsForEdge(gd:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; + /** + * Moves the edge points of the given edge by the vector (dx,dy). + */ + moveEdge(g:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,dx:number,dy:number):void; + /** + * Moves all edges accessible through the given edge cursor by the vector (dx,dy). + */ + moveEdges(g:yfiles.layout.LayoutGraph,edges:yfiles.algorithms.IEdgeCursor,dx:number,dy:number):void; + /** + * Moves the given node by the vector (dx,dy). + */ + moveNode(g:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,dx:number,dy:number):void; + /** + * Moves all nodes accessible through the given node cursor by the vector (dx,dy). + */ + moveNodes(g:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,dx:number,dy:number):void; + /** + * Moves the subgraph induced by edges accessible through the given edge cursor + * by the vector (dx,dy). + */ + moveSubgraphAtEdges(g:yfiles.layout.LayoutGraph,edges:yfiles.algorithms.IEdgeCursor,dx:number,dy:number):void; + /** + * Moves the subgraph induced by nodes accessible through the given node cursor + * by the vector (dx,dy). + */ + moveSubgraph(g:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.INodeCursor,dx:number,dy:number):void; + /** + * Returns the bounding box of the nodes and edges accessible through the given cursors. + */ + getBoundingBox(graph:yfiles.layout.LayoutGraph,nc:yfiles.algorithms.INodeCursor,ec:yfiles.algorithms.IEdgeCursor):yfiles.algorithms.Rectangle2D; + /** + * Returns the bounding box of the given node. + */ + getNodeBoundingBox(graph:yfiles.layout.LayoutGraph,n:yfiles.algorithms.Node):yfiles.algorithms.Rectangle2D; + /** + * Returns the bounding box of the nodes accessible through the given node cursor. + */ + getBoundingBoxForNodes(graph:yfiles.layout.LayoutGraph,nc:yfiles.algorithms.INodeCursor):yfiles.algorithms.Rectangle2D; + /** + * Returns the bounding box of the given edge. + */ + getEdgeBoundingBox(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):yfiles.algorithms.Rectangle2D; + /** + * Returns the bounding box of the edges accessible through the given edge cursor. + */ + getBoundingBoxForEdges(graph:yfiles.layout.LayoutGraph,ec:yfiles.algorithms.IEdgeCursor):yfiles.algorithms.Rectangle2D; + /** + * Returns the bounding box of the nodes and edges accessible through the given cursors. + * Optionally, the resulting bounding box will also include the bounds of + * all node and edge labels attached to the accessible nodes and edges. + */ + getBoundingBoxWithLabels(graph:yfiles.layout.LayoutGraph,nc:yfiles.algorithms.INodeCursor,ec:yfiles.algorithms.IEdgeCursor,includeLabels:boolean):yfiles.algorithms.Rectangle2D; + /** + * Returns the bounding box of the nodes and edges accessible through the given cursors. + * Optionally, the resulting bounding box will also include the bounds of + * all node and edge labels attached to the accessible nodes and edges. + */ + getBoundingBoxWithNodeAndEdgeLabels(graph:yfiles.layout.LayoutGraph,nc:yfiles.algorithms.INodeCursor,ec:yfiles.algorithms.IEdgeCursor,includeNodeLabels:boolean,includeEdgeLabels:boolean):yfiles.algorithms.Rectangle2D; + /** + * Returns the bounding box of the nodes and edges accessible through the given cursors. + * @param {yfiles.layout.LayoutGraph} graph The graph containing the nodes and edges to consider. + * @param {yfiles.algorithms.INodeCursor} nc The node cursor to access the nodes to consider. + * @param {yfiles.algorithms.IEdgeCursor} ec The edge cursor to access the edges to consider. + * @param {boolean} includeNodeLabels Whether the bounds calculation should take node labels into account. + * @param {boolean} includeEdgeLabels Whether the bounds calculation should take edge labels into account. + * @param {boolean} includeHalos Whether the bounds calculation should take node halos into account. + * @return {yfiles.algorithms.Rectangle2D} the bounding box of the nodes and edges accessible through the given cursors. + */ + getBoundingBoxWithNodeAndEdgeLabelsAndHalos(graph:yfiles.layout.LayoutGraph,nc:yfiles.algorithms.INodeCursor,ec:yfiles.algorithms.IEdgeCursor,includeNodeLabels:boolean,includeEdgeLabels:boolean,includeHalos:boolean):yfiles.algorithms.Rectangle2D; + /** + * Returns the upper left corner of the given label's paraxial bounding box + * as encoded by the specified model parameter. + * @param {yfiles.layout.INodeLabelModel} model the label model used to place the label. + * @param {yfiles.algorithms.YDimension} labelSize the size of the label that should be placed. + * @param {yfiles.layout.INodeLayout} nodeLayout the layout of the node to which the label belongs. + * @param {Object} param + * the model parameter that describes the abstract position of + * the label within the specified model. The parameter must have been + * generated by said model. + * @return {yfiles.algorithms.YPoint} the upper left corner of the label's bounding box. + * @see {@link yfiles.layout.INodeLabelModel#getLabelPlacement} + */ + getNodeLabelPlacement(model:yfiles.layout.INodeLabelModel,labelSize:yfiles.algorithms.YDimension,nodeLayout:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YPoint; + /** + * Returns the upper left corner of the given label's paraxial bounding box + * as encoded by the specified model parameter. + * @param {yfiles.layout.IEdgeLabelModel} model the label model used to place the label. + * @param {yfiles.algorithms.YDimension} labelSize the size of the label that should be placed. + * @param {yfiles.layout.IEdgeLayout} edgeLayout the layout of the edge to which the label belongs. + * @param {yfiles.layout.INodeLayout} sourceLayout the layout of the source node of the label owning edge. + * @param {yfiles.layout.INodeLayout} targetLayout the layout of the target node of the label owning edge. + * @param {Object} param + * the model parameter that describes the abstract position of + * the label within the specified model. The parameter must have been + * generated by said model. + * @return {yfiles.algorithms.YPoint} the upper left corner of the label's bounding box. + * @see {@link yfiles.layout.IEdgeLabelModel#getLabelPlacement} + */ + getEdgeLabelPlacement(model:yfiles.layout.IEdgeLabelModel,labelSize:yfiles.algorithms.YDimension,edgeLayout:yfiles.layout.IEdgeLayout,sourceLayout:yfiles.layout.INodeLayout,targetLayout:yfiles.layout.INodeLayout,param:Object):yfiles.algorithms.YPoint; + /** + * Sets the ports to the center of the nodes. + * @param {yfiles.layout.LayoutGraph} gd a graph diagram. + */ + resetPorts(gd:yfiles.layout.LayoutGraph):void; + /** + * This helper method clips the path of an edge on the bounding box + * of the start and end vertices. + */ + getEdgeClippedOnBBWithSourceAndTargetNode(edge:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout):yfiles.algorithms.YPointPath; + /** + * This helper method clips the path of an edge on the bounding box + * of the start and end vertices. + */ + getEdgeClippedOnBB(gd:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):yfiles.algorithms.YPointPath; + /** + * This helper method clips the path of an edge on the bounding box + * of the start and end vertices. + */ + getEdgeClippedOnBBWithSourceAndTargetNodeAndInset(edge:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,inset:number):yfiles.algorithms.YPointPath; + /** + * This helper method tests if the path of an edge is outside + * the bounding box of the start and end vertices. + */ + isEdgeOutsideNodes(gd:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):boolean; + /** + * This helper method tests if the path of an edge is outside + * the bounding box of the start and end vertices. + */ + isEdgeOutsideSourceAndTargetNode(edge:yfiles.layout.IEdgeLayout,sourceNode:yfiles.layout.INodeLayout,targetNode:yfiles.layout.INodeLayout,inset:number):boolean; + /** + * This helper method clips the path of the edge on the bounding box + * of the start and end points. + */ + clipEdgesOnBB(gd:yfiles.layout.LayoutGraph):void; + /** + * This helper method clips the path of the edge on the bounding box + * of the start and end points. + */ + clipEdgeOnBB(gd:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):void; + /** + * Returns the path of the layout of a specific edge as a String. + */ + edgeLayoutString(gd:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):string; + /** + * Round the values of the layout of a node. + */ + roundNodeLayout(gd:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; + /** + * Round the values of the control points and ports of an edge. + */ + roundEdgeLayout(gd:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):void; + /** + * Round the values of the layout of an entire layout. + */ + roundLayout(gd:yfiles.layout.LayoutGraph):void; + /** + * Routes two edges which are incident to the same nodes, in parallel. + * @see {@link yfiles.layout.LayoutTool#routeTwoEdgesParallelJoinEnds} + */ + routeTwoEdgesParallel(gd:yfiles.layout.LayoutGraph,e1:yfiles.algorithms.Edge,e2:yfiles.algorithms.Edge,lineDistance:number):void; + /** + * Routes two edges which are incident to the same nodes, in parallel. + * @param {yfiles.layout.LayoutGraph} gd the graph + * @param {yfiles.algorithms.Edge} e1 the leading edge + * @param {yfiles.algorithms.Edge} e2 the edge to be adjusted (may be e1) + * @param {number} lineDistance the distance between the two edges + * @param {boolean} joinEnds whether the end points should all be set to the end points of e1 + * @param {number} absJoinDist + * the absolute distance between the end points and the beginning to + * the parallel segment routing + * @param {number} relJoinDist + * the relative distance, measured relative to the length of the + * first/last segments + */ + routeTwoEdgesParallelJoinEnds(gd:yfiles.layout.LayoutGraph,e1:yfiles.algorithms.Edge,e2:yfiles.algorithms.Edge,lineDistance:number,joinEnds:boolean,absJoinDist:number,relJoinDist:number):void; + /** + * Routes a list of edges with are incident to the same nodes, in parallel. + * Invoking this method is equivalent to: + * routeEdgesParallel(gd, e1, list, lineDistance, false, false, 0.0d, 0.0d). + * @param {yfiles.layout.LayoutGraph} gd the graph + * @param {yfiles.algorithms.Edge} e1 the leading edge + * @param {yfiles.algorithms.EdgeList} list the list of edges that will be aligned to e1 + * @param {number} lineDistance the distance between two edges + * @see {@link yfiles.layout.LayoutTool#routeEdgesParallelJoinEnds} + */ + routeEdgesParallel(gd:yfiles.layout.LayoutGraph,e1:yfiles.algorithms.Edge,list:yfiles.algorithms.EdgeList,lineDistance:number):void; + /** + * Routes a list of edges which are incident to the same nodes, in parallel. + * @param {yfiles.layout.LayoutGraph} gd the graph + * @param {yfiles.algorithms.Edge} e1 the leading edge + * @param {yfiles.algorithms.EdgeList} list the list of edges that will be aligned to e1 + * @param {number} lineDistance the distance between two edges + * @param {boolean} adjustE1 whether e1 should be adjusted if the size of list is odd + * @param {boolean} joinEnds whether the end points should all be set to the end points of e1 + * @param {number} absJoinDist + * the absolute distance between the end points and the beginning to + * the parallel segment routing + * @param {number} relJoinDist + * the relative distance, measured relative to the length of the + * first/last segments + */ + routeEdgesParallelJoinEnds(gd:yfiles.layout.LayoutGraph,e1:yfiles.algorithms.Edge,list:yfiles.algorithms.EdgeList,lineDistance:number,adjustE1:boolean,joinEnds:boolean,absJoinDist:number,relJoinDist:number):void; + /** + * Routes a self-loop. + * @param {yfiles.algorithms.Edge} e An edge with e.source.equals(e.target). + */ + routeSelfLoop(gd:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):void; + /** + * Set the layout of two parallel edges with different direction identical. + * @param {yfiles.algorithms.Edge} e1 the edge for which the points are set. + * @param {yfiles.algorithms.Edge} e2 the template. + */ + assignReverseLayout(graph:yfiles.layout.LayoutGraph,e1:yfiles.algorithms.Edge,e2:yfiles.algorithms.Edge):void; + /** + * Returns the positions of the nodes of a graph's diagram. + */ + getNodePositions(gd:yfiles.layout.LayoutGraph):string; + /** + * This method assigns the position (0,0) to all nodes in the graph, + * and sets the edges to straight lines with ports in the center + * of the adjacent node. + */ + initDiagram(gd:yfiles.layout.LayoutGraph):void; + /** + * Reassigns the bounds of the rectangles in rects to fit in a + * large rectangle, whose bounds will be stored in finalRect. + * This procedure tries to generate a final rectangle, whose aspect ratio is + * as close as possible to viewRatio. This is achieved by + * arranging the rectangles in a rows. The number of used rows will be + * returned. + * This method invokes + * {@link yfiles.layout.LayoutTool#arrangeRectangleRowsWithAlignment arrangeRectangleRows} + * with {@link yfiles.layout.RowAlignment#LEADING} as the last argument. + * @param {yfiles.algorithms.Rectangle2D[]} rects the rectangles whose coordinates will be modified + * @param {yfiles.algorithms.Rectangle2D} finalRect the exact dimension will be placed in this rectangle + * @param {number} viewRatio the preferred ratio of the resulting bounds, must be greater than 0. + * @return {number} the number of used rows + */ + arrangeRectangleRows(rects:yfiles.algorithms.Rectangle2D[],finalRect:yfiles.algorithms.Rectangle2D,viewRatio:number):number; + /** + * Reassigns the bounds of the rectangles in rects to fit into a + * large rectangle, whose bounds will be stored in finalRect. + * This procedure tries to generate a final rectangle, whose aspect ratio is + * as close as possible to viewRatio. This is achieved by + * arranging the rectangles in a grid-like fashion. + * The dimension of this grid is returned. + * @param {yfiles.algorithms.Rectangle2D[]} rects the rectangles whose, coordinates will be modified + * @param {yfiles.algorithms.Rectangle2D} finalRect the exact dimension will be placed in this rectangle + * @param {number} viewRatio the preferred ratio of the grid, must be greater than 0. + * @return {yfiles.algorithms.YDimension} the dimension of the grid + */ + arrangeRectangleGrid(rects:yfiles.algorithms.Rectangle2D[],finalRect:yfiles.algorithms.Rectangle2D,viewRatio:number):yfiles.algorithms.YDimension; + /** + * Reassigns the bound of the rectangles in rects to fit in a large rectangle, whose bounds will be + * stored in finalRect. + * The rectangles will be placed within this bound arranged within rows, where + * each row may be split into more sub-rows. This often leads to more compact results than provided by the procedure + * used in {@link yfiles.layout.LayoutTool#arrangeRectangleRowsWithAlignment}. + * A row will be subdivided into more rows, if two successive rectangles to be placed in the row could be placed + * stacked within this row without making the row larger in height. + *

This method calls + * {@link yfiles.layout.LayoutTool#arrangeRectangleMultiRowsWithAlignment} + * with the last alignment parameter being {@link yfiles.layout.RowAlignment#LEADING}.

+ * @param {yfiles.algorithms.Rectangle2D[]} rects the rectangles to arrange (coordinates will be assigned). + * @param {yfiles.algorithms.Rectangle2D} finalRect the exact resulting dimension will be stored in this rectangle + * @param {number} preferredWidth the preferred width of the result finalRect, must be greater than 0. + * @param {number} preferredHeight the preferred height of the result finalRect, must be greater than 0. + * @param {boolean} compaction + * if true, then the algorithm tries to always minimize the resulting dimension, whilst respecting + * the given constraints. + * @param {number} constraintMode + * the width or height constraints to consider. Possible values are + * {@link yfiles.layout.LayoutTool#MULTI_ROW_NO_CONSTRAINT},{@link yfiles.layout.LayoutTool#MULTI_ROW_WIDTH_CONSTRAINT} + * and {@link yfiles.layout.LayoutTool#MULTI_ROW_HEIGHT_CONSTRAINT}. + * @return {number} the number of rows used + */ + arrangeRectangleMultiRows(rects:yfiles.algorithms.Rectangle2D[],finalRect:yfiles.algorithms.Rectangle2D,preferredWidth:number,preferredHeight:number,compaction:boolean,constraintMode:number):number; + /** + * Reassigns the bound of the rectangles in rects to fit in a large rectangle, whose bounds will be + * stored in finalRect. + * The rectangles will be placed within this bound arranged within rows, where + * each row may be split into more sub-rows. This often leads to more compact results than provided by the procedure + * used in {@link yfiles.layout.LayoutTool#arrangeRectangleRowsWithAlignment}. + * A row will be subdivided into more rows if two successive rectangles to be placed in the row could be placed + * stacked within this row without making the row larger in height. + * @param {yfiles.algorithms.Rectangle2D[]} rects the rectangles to arrange (coordinates will be assigned). + * @param {yfiles.algorithms.Rectangle2D} finalRect the exact resulting dimension will be stored in this rectangle + * @param {number} preferredWidth the preferred width of the result finalRect, must be greater than 0. + * @param {number} preferredHeight the preferred height of the result finalRect, must be greater than 0. + * @param {boolean} compaction + * if true, then the algorithm tries to always minimize the resulting dimension, whilst respecting + * the given constraints. + * @param {number} constraintMode + * the width or height constraints to consider. Possible values are + * {@link yfiles.layout.LayoutTool#MULTI_ROW_NO_CONSTRAINT},{@link yfiles.layout.LayoutTool#MULTI_ROW_WIDTH_CONSTRAINT} + * and {@link yfiles.layout.LayoutTool#MULTI_ROW_HEIGHT_CONSTRAINT}. + * @param {number} alignment + * the alignment policy to follow. Possible values are {@link yfiles.layout.RowAlignment#LEADING}, {@link yfiles.layout.RowAlignment#TRAILING} and + * {@link yfiles.layout.RowAlignment#CENTER}. The best results (regarding compactness) are achieved using {@link yfiles.layout.RowAlignment#LEADING}. + * Other alignment modes are ignored. + * @return {number} the number of rows used + */ + arrangeRectangleMultiRowsWithAlignment(rects:yfiles.algorithms.Rectangle2D[],finalRect:yfiles.algorithms.Rectangle2D,preferredWidth:number,preferredHeight:number,compaction:boolean,constraintMode:number,alignment:number):number; + /** + * Reassigns the bounds of the rectangles in rects to fit into a + * large rectangle, whose bounds will be stored in finalRect. + * This procedure tries to generate a final rectangle, whose aspect ratio is + * as close as possible to viewRatio. This is achieved by + * arranging the rectangles in rows. The number of generated rows is + * returned. + * @param {yfiles.layout.RowAlignment} alignment + * determines the alignment policy for rows, that are not + * completely filled + * @param {yfiles.algorithms.Rectangle2D[]} rects the rectangles whose coordinates will be modified + * @param {yfiles.algorithms.Rectangle2D} finalRect the exact dimension will be placed in this rectangle + * @param {number} viewRatio the preferred ratio of the resulting bounds, must be greater than 0. + * @return {number} the number of generated rows + */ + arrangeRectangleRowsWithAlignment(rects:yfiles.algorithms.Rectangle2D[],finalRect:yfiles.algorithms.Rectangle2D,viewRatio:number,alignment:yfiles.layout.RowAlignment):number; + /** + * Checks whether or not the path of an edge intersects the interior of + * a given rectangular area. + */ + pathIntersectsRect(graph:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge,rect:yfiles.algorithms.Rectangle2D):boolean; + /** + * Applies a GraphLayout to a LayoutGraph. + * Precondition: + * the GraphLayout data must be defined for + * elements in the given LayoutGraph. + */ + applyGraphLayout(graph:yfiles.layout.LayoutGraph,gl:yfiles.layout.IGraphLayout):void; + /** + * Aligns the specified nodes either vertically or horizontally according to + * the specified node alignment mode. + *

+ * For vertical arrangements, nodes are either + * {@link yfiles.layout.NodeAlignment#LEADING top-aligned}, + * {@link yfiles.layout.NodeAlignment#CENTERED center-aligned}, + * {@link yfiles.layout.NodeAlignment#TRAILING bottom-aligned}, or + * {@link yfiles.layout.NodeAlignment#DISTRIBUTED vertically distributed}. + *

+ * For horizontal arrangements, nodes are either + * {@link yfiles.layout.NodeAlignment#LEADING left-aligned}, + * {@link yfiles.layout.NodeAlignment#CENTERED center-aligned}, + * {@link yfiles.layout.NodeAlignment#TRAILING right-aligned}, or + * {@link yfiles.layout.NodeAlignment#DISTRIBUTED horizontally distributed}. + *

+ * In this context, distributed means that the specified nodes are + * placed in such a way that the projections of their bounds onto the + * vertical or horizontal coordinate axis do not overlap. E.g. after + * vertically distributing nodes, (n1.y + n1.height) <= n2.y + * for two consecutively placed nodes n1 and n2. + *

+ * @param {yfiles.layout.LayoutGraph} g the graph that contains the specified nodes. + * @param {yfiles.algorithms.NodeList} nodes a subset of the specified graph's nodes that is arranged. + * @param {yfiles.algorithms.Node} referenceNode + * if null, the common coordinate for + * aligning the specified nodes is calculated as the + * the vertical minimum (top-aligned), + * the vertical center, + * the vertical maximum (bottom-aligned), + * the horizontal minimum (left-aligned), + * the horizontal center, or + * the horizontal maximum (right-aligned) + * of the bounds of the specified nodes; otherwise the appropriate coordinate + * of the given reference node's bounds is used as common coordinate for + * aligning the specified nodes. + * The reference node is ignored when + * {@link yfiles.layout.NodeAlignment#DISTRIBUTED distributing} nodes. + * @param {boolean} vertical + * if true nodes are aligned (or distributed) + * according to their y-coordinates; otherwise nodes are aligned + * (or distributed) according to their x-coordinates. + * @param {yfiles.layout.NodeAlignment} mode + * one of
    + *
  • {@link yfiles.layout.NodeAlignment#LEADING},
  • + *
  • {@link yfiles.layout.NodeAlignment#CENTERED},
  • + *
  • {@link yfiles.layout.NodeAlignment#TRAILING}, or
  • + *
  • {@link yfiles.layout.NodeAlignment#DISTRIBUTED}.
  • + *
+ */ + alignNodeLayouts(g:yfiles.layout.LayoutGraph,nodes:yfiles.algorithms.NodeList,referenceNode:yfiles.algorithms.Node,vertical:boolean,mode:yfiles.layout.NodeAlignment):void; + /** + * Flips the orientation of a given rectangle, if its up vector points downward ({@link yfiles.algorithms.YOrientedRectangle#upY upY} > 0). + * That means, it rotates the rectangle by 180 degree without changing the rectangle's center. + * @param {yfiles.algorithms.YOrientedRectangle} rect the given rectangle. + * @return {boolean} true if the given rectangle was flipped and false otherwise. + */ + autoFlipBox(rect:yfiles.algorithms.YOrientedRectangle):boolean; + }; + /** + * This class delegates its layout calls to a core layout algorithm that is dynamically + * chosen at runtime by inspecting the nodes of the input graph. + *

+ * If a data provider is registered with the given graph using the look-up key {@link yfiles.layout.LayoutMultiplexer#LAYOUTER_DP_KEY} + * it is used to retrieve the {@link yfiles.layout.ILayouter} objects that are stored for the graph's + * nodes. + * If no such data provider is registered, this layout stage's core layouter (if + * any) is used for layout calculation of all nodes. + * Note that the first non-null Layouter retrieved from the data provider + * is used for all nodes. + *

+ *

+ * The main purpose of this class is to enable the use of individual layout algorithms + * for components (when used as the core layouter of class {@link yfiles.layout.ComponentLayouter}) + * or for the contents of group nodes (when used as the core layouter of class {@link yfiles.layout.RecursiveGroupLayouter}). + *

+ */ + export interface LayoutMultiplexer extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Returns the core layout algorithm associated with the + * nodes contained in the given graph. + * The default implementation + * looks up the layout algorithm in the data provider registered + * with the key {@link yfiles.layout.LayoutMultiplexer#LAYOUTER_DP_KEY}. + */ + getCoreLayouter(graph:yfiles.layout.LayoutGraph):yfiles.layout.ILayouter; + } + var LayoutMultiplexer:{ + $class:yfiles.lang.Class; + new ():yfiles.layout.LayoutMultiplexer; + /** + * Look-up key used to register a {@link yfiles.algorithms.IDataProvider} that provides a + * {@link yfiles.layout.ILayouter} object for each node of a graph. + */ + LAYOUTER_DP_KEY:Object; + }; + /** + * This class encapsulates layout data for a label. + * The data is used + * by clients to inform label aware layouters about labeling constraints like label size and + * preferred placement. Label aware layouters like + * on the other hand return the calculated label positions by assigning the + * corresponding bounds to the passed in label layout data. + * Data providers are being used to associate an array of LabelLayoutData with either + * the nodes or the edges of a layout graph. The data providers must be registered with the + * input graph by using one of the keys defined in {@link yfiles.layout.LabelLayoutKeys}. + */ + export interface LabelLayoutData extends Object{ + /** + * The{@link yfiles.algorithms.YOrientedRectangle oriented bounds} of the label. + */ + bounds:yfiles.algorithms.YOrientedRectangle; + /** + * Sets the {@link yfiles.algorithms.YOrientedRectangle#width width} and {@link yfiles.algorithms.YOrientedRectangle#height height} + * of the oriented {@link yfiles.layout.LabelLayoutData#bounds bounds} of this label. + * Note that {@link yfiles.layout.LabelLayoutData#width} and {@link yfiles.layout.LabelLayoutData#height} in contrast yield the width and height of the bounding + * box of the oriented bounds, which only coincide with the size of the oriented bounds in the case where the + * oriented bounds are not rotated. + */ + setSize(width:number,height:number):void; + /** + * The width of the label. + */ + width:number; + /** + * The height of the label. + */ + height:number; + /** + * Sets the coordinates of the upper-left corner of the bounding box of the label. + */ + setLocation(x:number,y:number):void; + /** + * The x-coordinate of the label's upper-left corner of the bounding box. + */ + x:number; + /** + * The y-coordinate of the label's upper-left corner of the bounding box. + */ + y:number; + /** + * The preferred placement for this label. + */ + preferredPlacement:yfiles.layout.LabelPlacements; + /** + * The preferred placement for this label. + * @throws {yfiles.system.ArgumentException} + * if the specified descriptor is + * null. + * @see {@link yfiles.layout.PreferredPlacementDescriptor} + * @see {@link yfiles.layout.LabelPlacements} + */ + preferredPlacementDescriptor:yfiles.layout.PreferredPlacementDescriptor; + /** + * Returns a string representation of this object. + */ + toString():string; + } + var LabelLayoutData:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of LabelLayoutData. + * {@link yfiles.layout.LabelPlacements#ANYWHERE} is used + * as preferred placement specifier. + * @param {number} width the width of the label + * @param {number} height the height of the label + */ + FromWidthAndHeight:{ + new (width:number,height:number):yfiles.layout.LabelLayoutData; + }; + /** + * Creates a new instance of LabelLayoutData. + * @param {number} width the width of the label + * @param {number} height the height of the label + * @param {yfiles.layout.LabelPlacements} preferredPlacement a preferred placement specifier + * @see {@link yfiles.layout.LabelLayoutData#preferredPlacement} + */ + FromWidthHeightWithPreferredPlacement:{ + new (width:number,height:number,preferredPlacement:yfiles.layout.LabelPlacements):yfiles.layout.LabelLayoutData; + }; + /** + * Creates a new instance of LabelLayoutData. + * @param {yfiles.algorithms.YOrientedRectangle} bounds + * the {@link yfiles.algorithms.YOrientedRectangle oriented bounds} of the label + * @see {@link yfiles.layout.LabelPlacements} + */ + FromRectangle:{ + new (bounds:yfiles.algorithms.YOrientedRectangle):yfiles.layout.LabelLayoutData; + }; + /** + * Creates a new instance of LabelLayoutData. + * @param {yfiles.algorithms.YOrientedRectangle} bounds + * the {@link yfiles.algorithms.YOrientedRectangle oriented bounds} of the label + * @param {yfiles.layout.LabelPlacements} preferredPlacement a preferred placement specifier + * @see {@link yfiles.layout.LabelPlacements} + * @see {@link yfiles.layout.LabelLayoutData#preferredPlacement} + */ + FromRectangleWithPreferredPlacement:{ + new (bounds:yfiles.algorithms.YOrientedRectangle,preferredPlacement:yfiles.layout.LabelPlacements):yfiles.layout.LabelLayoutData; + }; + /** + * Creates a new instance of LabelLayoutData. + * @param {yfiles.algorithms.YOrientedRectangle} bounds + * the {@link yfiles.algorithms.YOrientedRectangle oriented bounds} of the label + * @param {yfiles.layout.PreferredPlacementDescriptor} preferredPlacement a preferred placement specifier + * @see {@link yfiles.layout.LabelPlacements} + * @see {@link yfiles.layout.LabelLayoutData#preferredPlacementDescriptor} + * @throws {yfiles.system.ArgumentException} + * if the specified descriptor is + * null. + */ + FromRectangleWithPreferredPlacementDescriptor:{ + new (bounds:yfiles.algorithms.YOrientedRectangle,preferredPlacement:yfiles.layout.PreferredPlacementDescriptor):yfiles.layout.LabelLayoutData; + }; + }; + /** + * This class is a default implementation of the LabelLayout interface. + */ + export interface LabelLayoutImpl extends Object,yfiles.layout.ILabelLayout{ + /** + * The box of the label. + * @see Specified by {@link yfiles.layout.ILabelLayout#orientedBox}. + */ + orientedBox:yfiles.algorithms.YOrientedRectangle; + /** + * The bounding box of the label. + * @see Specified by {@link yfiles.layout.ILabelLayout#box}. + */ + box:yfiles.algorithms.YRectangle; + /** + * The label model parameter that describes + * the position of this label. + * @see Specified by {@link yfiles.layout.ILabelLayout#modelParameter}. + */ + modelParameter:Object; + } + var LabelLayoutImpl:{ + $class:yfiles.lang.Class; + }; + /** + * Layout stage that automatically translates label layout information provided by the standard + * label layout classes {@link yfiles.layout.IEdgeLabelLayout} and {@link yfiles.layout.INodeLabelLayout} to layout data + * of type {@link yfiles.layout.LabelLayoutData} that is accessible by the keys defined in class {@link yfiles.layout.LabelLayoutKeys}. + * One can use this layout stage as label layouter of a label aware layouter. This can be done by + * assigning the stage by an appropriate call to + * {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter setLabelLayouter}. + *

+ * When writing the {@link yfiles.layout.LabelLayoutData}, the {@link yfiles.layout.LabelLayoutData#bounds bounds} are set relative. + * In case of a node label the bounds' {@link yfiles.algorithms.YOrientedRectangle#anchor anchor} is relative + * to the center of the owning node. In case of an edge label the bounds' anchor is relative to the center + * of the source node of the owning edge. + *

+ *

+ * If {@link yfiles.layout.LabelLayoutTranslator#writeBackNodeLabels writing back node labels} and/or + * {@link yfiles.layout.LabelLayoutTranslator#writeBackEdgeLabels writing back edge labels} is enabled, the {@link yfiles.layout.LabelLayoutData} + * is written back to the {@link yfiles.layout.INodeLabelLayout}s and/or {@link yfiles.layout.IEdgeLabelLayout}s. + *

+ *

+ * Per default the {@link yfiles.layout.LabelLayoutData#bounds bounds} are now interpreted absolute but by activating + * {@link yfiles.layout.LabelLayoutTranslator#writeBackRelativeNodeLabelLocation} and/or {@link yfiles.layout.LabelLayoutTranslator#writeBackRelativeEdgeLabelLocation} + * this can be changed to interpret them relative as explained above. + *

+ * Note that care must be taken on the choice of label model that is used by the + * classes {@link yfiles.layout.IEdgeLabelLayout} and {@link yfiles.layout.INodeLabelLayout}. The calculated label positions + * must be consistent with the label positions allowed by the label model. The best label layout + * results are achieved by choosing {@link yfiles.layout.FreeEdgeLabelLayoutModel} for edge layouts and + * {@link yfiles.layout.FreeNodeLabelLayoutModel} for node layouts. + */ + export interface LabelLayoutTranslator extends Object,yfiles.layout.ILayoutStage{ + /** + * The core layouter. + * @see Specified by {@link yfiles.layout.ILayoutStage#coreLayouter}. + */ + coreLayouter:yfiles.layout.ILayouter; + /** + * Before invoking the core layouter this stage translates traditional + * label layout information to data provider based label layout data. + * Afterwards the calculated layout data will be written back to the + * original label layout. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Determines whether or not this stage should automatically flip edge label + * content depending on the label's rotation angle. + *

+ * More precisely, if this option is enabled and the up vector of the {@link yfiles.algorithms.YOrientedRectangle} associated with an + * {@link yfiles.layout.IEdgeLabelLayout} (see method {@link yfiles.layout.ILabelLayout#orientedBox}) points downward ({@link yfiles.algorithms.YOrientedRectangle#upY upY} > 0), + * this stage automatically flips the label, i.e., it rotates the label by 180 degree without changing + * the label's center. + *

+ *

+ * By default, this property is set to true. + *

+ * @see {@link yfiles.layout.LayoutTool#autoFlipBox} + * @see {@link yfiles.layout.LayoutTool#autoFlipBox} + */ + autoFlippingEnabled:boolean; + /** + * Specifies whether or not to reset the orientation of node labels. + * If this option is enabled, the up vector of the corresponding oriented + * box is set to (0,-1). Default value is false. + */ + resettingNodeLabelOrientation:boolean; + /** + * Specifies whether or not to reset the orientation of edge labels. + * If this option is enabled, the up vector of the corresponding oriented + * box is set to (0,-1). Default value is true. + */ + resettingEdgeLabelOrientation:boolean; + /** + * The returned result gets calculated by the core layouter. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Specifies whether edge labels are written back to their model. + * Defaults to true. + */ + writeBackEdgeLabels:boolean; + /** + * Specifies whether edge label{@link yfiles.layout.LabelLayoutData#bounds bounds} are interpreted relative when writing them + * back to the model. + *

+ * This option is only considered if {@link yfiles.layout.LabelLayoutTranslator#writeBackEdgeLabels} is set to true. + *

+ *

+ * Default is false. + *

+ */ + writeBackRelativeEdgeLabelLocation:boolean; + /** + * Specifies whether node labels are written back to their model. + * Defaults to false. + */ + writeBackNodeLabels:boolean; + /** + * Specifies whether node label{@link yfiles.layout.LabelLayoutData#bounds bounds} are interpreted relative when writing them + * back to the model. + *

+ * This option is only considered if {@link yfiles.layout.LabelLayoutTranslator#writeBackNodeLabels} is set to true. + *

+ *

+ * Default is false. + *

+ */ + writeBackRelativeNodeLabelLocation:boolean; + /** + * Specifies whether node label translation is enabled. + * Defaults to false. + */ + translateNodeLabels:boolean; + /** + * Specifies whether edge label translation is enabled. + * Defaults to true. + */ + translateEdgeLabels:boolean; + } + var LabelLayoutTranslator:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of LabelLayoutTranslator. + * Initially no core layouter will be bound to this layout stage. + */ + new ():yfiles.layout.LabelLayoutTranslator; + }; + /** + * This interface provides label-specific keys that can + * be used to add data providers to a layout graph. + * Label aware layout algorithms like + * may look for such data providers. + * Instead of setting up label layout data and data providers one can also use + * the layout stage {@link yfiles.layout.LabelLayoutTranslator} to automatically translate + * information provided by the standard label layout classes {@link yfiles.layout.IEdgeLabelLayout} and + * {@link yfiles.layout.INodeLabelLayout} to layout data accessible by the keys defined below. + */ + export interface LabelLayoutKeys extends Object{ + } + var LabelLayoutKeys:{ + $class:yfiles.lang.Class; + /** + * Key that is used to add or access a data provider to a graph that must + * return for each edge of the graph an array of type {@link yfiles.layout.LabelLayoutData}. + */ + EDGE_LABEL_LAYOUT_DP_KEY:Object; + /** + * Key that is used to add or access a data provider to a graph that must + * returns for each node of the graph an array of type {@link yfiles.layout.LabelLayoutData}. + */ + NODE_LABEL_LAYOUT_DP_KEY:Object; + /** + * Key that is used to store whether or not a label (i.e., an instance of {@link yfiles.layout.ILabelLayout}) + * should be considered during layout. + * A label is ignored if the data provider registered with this key is + * not null and {@link yfiles.algorithms.IDataProvider#getBool} returns true. + *

+ * Currently this key is directly considered by the following layout algorithms:. + * Furthermore, layout stage {@link yfiles.layout.LabelLayoutTranslator} only translates labels that should not be ignored. + *

+ */ + IGNORE_LABEL_DP_KEY:Object; + }; + /** + * A NodeHalo object specifies a rectangular area around a specific node. + * A layouter that supports node + * halos, keeps this area clear of graph elements, except the node labels of this specific node and the adjacent + * segments of its edges. All minimum distances to this node, which are used in the + * layout calculation e.g. minimal first segment length, will be extended by the halo size. + *

+ * This class defines a key used to associate a {@link yfiles.algorithms.IDataProvider} that provide node halos for all nodes of the + * input graph. + *

+ *

+ * See the developer's guide section on Node Halos for + * details about the individual algorithms that provide support for node halos. + *

+ */ + export interface NodeHalo extends Object{ + /** + * The halo size at the top side of the node. + */ + top:number; + /** + * The halo size at the left side of the node. + */ + left:number; + /** + * The halo size at the bottom side of the node. + */ + bottom:number; + /** + * The halo size at the right side of the node. + */ + right:number; + equals(o:Object):boolean; + hashCode():number; + } + var NodeHalo:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key that can be used to store {@link yfiles.layout.NodeHalo}-instances for the nodes + * that specify the sizes of the nodes' halos. + */ + NODE_HALO_DP_KEY:Object; + /** + * A constant holding a NodeHalo with zero size on each side. + */ + ZERO_HALO:yfiles.layout.NodeHalo; + /** + * Creates a NodeHalo object with the specified values. + * The values must not be negative, {@link Number#NaN} + * or {@link Number#POSITIVE_INFINITY}, otherwise the method will throw an IllegalArgumentException. + * @param {number} top The halo size at the top side of the node. + * @param {number} left The halo size at the left side of the node. + * @param {number} bottom The halo size at the bottom side of the node. + * @param {number} right The halo size at the right side of the node. + * @throws {yfiles.system.ArgumentException} + * if one of the values is negative, {@link Number#NaN} or {@link Number#POSITIVE_INFINITY} + */ + createFromTopLeftBottomAndRight(top:number,left:number,bottom:number,right:number):yfiles.layout.NodeHalo; + /** + * Creates a NodeHalo object with the specified value on each side of the node. + * The value must not be + * negative, {@link Number#NaN} or {@link Number#POSITIVE_INFINITY}, otherwise the method will throw an + * IllegalArgumentException. + * @param {number} value The halo size at each side of the node. + * @throws {yfiles.system.ArgumentException} + * if the value is negative, {@link Number#NaN} or {@link Number#POSITIVE_INFINITY} + */ + create(value:number):yfiles.layout.NodeHalo; + /** + * Checks whether a {@link yfiles.algorithms.IDataProvider} has been registered at the given graph, that holds + * NodeHalo instances. + * @param {yfiles.layout.LayoutGraph} graph The graph to check. + * @return {boolean} + * true if a {@link yfiles.algorithms.IDataProvider} has been registered at the given graph, that holds + * NodeHalo instances, false otherwise. + */ + hasHalos(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Returns the NodeHalo of the given node if available, otherwise a NodeHalo with zero size. + * @param {yfiles.layout.LayoutGraph} graph The graph containing the given node. + * @param {yfiles.algorithms.Node} node The node whose NodeHalo will be determined. + * @return {yfiles.layout.NodeHalo} + * the NodeHalo of the given node if available, otherwise a NodeHalo with zero + * size. + */ + getHalo(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):yfiles.layout.NodeHalo; + /** + * Returns a {@link yfiles.algorithms.YRectangle} instance with the bounds of the given node and if available its NodeHalo. + * @param {yfiles.layout.LayoutGraph} graph The graph containing the given node. + * @param {yfiles.algorithms.Node} node The node whose NodeHalo will be determined. + * @return {yfiles.algorithms.YRectangle} + * a {@link yfiles.algorithms.YRectangle} instance with the bounds of the given node and if available its NodeHalo + */ + getHaloBox(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):yfiles.algorithms.YRectangle; + }; + /** + * A layout stage for hierarchically grouped graphs. + * Activating this stage + * guarantees that a core layouter will keep the relative positions of nodes + * within the same group. + * Also, this stage is responsible for routing edges that connect nodes + * belonging to hierarchically unrelated groups. + *

+ * More precisely, the stage temporarily replaces fixed group nodes (see {@link yfiles.layout.FixedGroupLayoutStage#FIXED_GROUP_NODES_DP_KEY}) with normal + * nodes of the same size while the groups' content is removed from the graph during layout. + * The nodes are used as placeholders + * and to keep the relations to the remaining graph elements. Edges that connect from outside the group node to its + * content (inter-edges) are redirected such that they connect to the node that replaces the group. + * After layout, the group nodes are restored and the stage inserts the content at the new group position + * (derived from the position of the associated node). The content + * itself (including the edges between content nodes) remains unchanged and is only relocated. Furthermore, + * the inter-edges are connected to their original source/target and the stage reroutes them using the + * specified inter-edge routing algorithm (see {@link yfiles.layout.FixedGroupLayoutStage#orthogonalEdgeRouter}). + *

+ */ + export interface FixedGroupLayoutStage extends yfiles.layout.AbstractLayoutStage{ + /** + * The inter-edge routing style used by this layouter. + */ + interEdgeRoutingStyle:yfiles.layout.InterEdgeRoutingStyle; + /** + * The orthogonal edge router instance used to route + * the inter-edges orthogonally. + * Inter-edges that have to be routed with the specified routing algorithm + * will be marked using this stage's {@link yfiles.layout.FixedGroupLayoutStage#INTER_EDGES_DP_KEY} data provider + * key. + * @see {@link yfiles.layout.FixedGroupLayoutStage#INTER_EDGES_DP_KEY} + */ + orthogonalEdgeRouter:yfiles.layout.ILayouter; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var FixedGroupLayoutStage:{ + $class:yfiles.lang.Class; + /** + * This key can be used to select specific group nodes whose contents + * should keep their relative positions. + * A group node is considered selected in this context, if the + * corresponding DataProvider returns true for + * the node or any of its ancestor (group) nodes. + *

+ * Note: + * If there is no DataProvider for this key, all group nodes are + * considered selected. + *

+ */ + FIXED_GROUP_NODES_DP_KEY:Object; + /** + * This key is used to mark edges as inter-edges for orthogonal routing. + * The registered data provider's {@link yfiles.algorithms.IDataProvider#getBool getBool} method will return true for inter-edges (i.e. edges + * that have to be routed) and false for all other edges. + */ + INTER_EDGES_DP_KEY:Object; + /** + * Initializes a new instance of FixedGroupLayoutStage. + */ + new ():yfiles.layout.FixedGroupLayoutStage; + /** + * Initializes a new instance of FixedGroupLayoutStage with the + * given core layouter. + * @param {yfiles.layout.ILayouter} core the core layout algorithm for this stage. + */ + WithCoreLayouter:{ + new (core:yfiles.layout.ILayouter):yfiles.layout.FixedGroupLayoutStage; + }; + }; + /** + * This layout stage provides a framework for layouts that are based on a divide and conquer approach. + * The workings of this stage is subdivided into four stages: + *
    + *
  • + * The input graph is partitioned into smaller units. Implementations of this phase can + * be set using method {@link yfiles.layout.PartitionLayouter#partitionFinder}. + *
  • + *
  • + * Optionally, the graph partitions are laid out by an layout algorithm. Implementations of this phase can + * be set using method {@link yfiles.layout.AbstractLayoutStage#coreLayouter}. + *
  • + *
  • + * The graph partitions are independently arranged. Implementations of this phase can + * be set using method {@link yfiles.layout.PartitionLayouter#partitionPlacer}. + *
  • + *
  • + * Edges that connect nodes in different graph partitions will be routed. Implementations of this phase can + * be set using method {@link yfiles.layout.PartitionLayouter#interEdgeRouter} + *
  • + *
+ */ + export interface PartitionLayouter extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns {@link yfiles.layout.AbstractLayoutStage#canLayoutCore}. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#canLayout} + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * The currently set PartitionFinder instance. + */ + partitionFinder:yfiles.layout.PartitionLayouter.IPartitionFinder; + /** + * The currently set PartitionPlacer instance. + */ + partitionPlacer:yfiles.layout.PartitionLayouter.IPartitionPlacer; + /** + * The currently set InterEdgeRouter instance. + */ + interEdgeRouter:yfiles.layout.PartitionLayouter.IInterEdgeRouter; + } + export module PartitionLayouter{ + /** + * Implementations of this interface are responsible to partition the input graph. + */ + export interface IPartitionFinder extends Object{ + /** + * Returns a partition id for each node of an input graph. + * Nodes that share a common partition id + * will be considered to belong to the same partition. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.INodeMap} partitionIDMap used to return the resulting partition ids + * @see Specified by {@link yfiles.layout.PartitionLayouter.IPartitionFinder#findPartitions}. + */ + findPartitions(graph:yfiles.layout.LayoutGraph,partitionIDMap:yfiles.algorithms.INodeMap):void; + } + /** + * Implementations of this interface are responsible for arranging the graph partitions. + * Arranging a + * graph partition usually involves to apply a coordinate translation to all elements belonging to + * the partition in order to generate a non-overlapping node-arrangement. + */ + export interface IPartitionPlacer extends Object{ + /** + * Arranges the graph while taking partition ids and inter-edge information into account. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.IDataProvider} partitionIDDP the partition id for each node in the graph. + * @param {yfiles.algorithms.IDataProvider} interEdgeDP + * holds a boolean value for each edge of the graph indicating if the + * edge is an inter-edge or not. An inter-edge is an edge that connects nodes that do not + * belong to the same partition. + * @see Specified by {@link yfiles.layout.PartitionLayouter.IPartitionPlacer#placePartitions}. + */ + placePartitions(graph:yfiles.layout.LayoutGraph,partitionIDDP:yfiles.algorithms.IDataProvider,interEdgeDP:yfiles.algorithms.IDataProvider):void; + } + /** + * Implementations of this interface are responsible for routing inter-edges. + * An inter-edge is an edge that connects nodes that do not + * belong to the same partition. + */ + export interface IInterEdgeRouter extends Object{ + /** + * Routes inter-edges of the partitioned graph. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.IDataProvider} partitionIDDP the partition id for each node in the graph. + * @param {yfiles.algorithms.IDataProvider} interEdgeDP + * holds a boolean value for each edge of the graph indicating if the + * edge is an inter-edge or not. + * @see Specified by {@link yfiles.layout.PartitionLayouter.IInterEdgeRouter#routeInterEdges}. + */ + routeInterEdges(graph:yfiles.layout.LayoutGraph,partitionIDDP:yfiles.algorithms.IDataProvider,interEdgeDP:yfiles.algorithms.IDataProvider):void; + } + /** + * InterEdgeRouter implementation that routes inter-edges using + * {@link yfiles.router.ChannelEdgeRouter}. + */ + export interface ChannelInterEdgeRouter extends Object,yfiles.layout.PartitionLayouter.IInterEdgeRouter{ + /** + * true if this ChannelInterEdgeRouter + * is configured to route inter-partition edges only. + * By default, all edges are routed, i.e. routeInterEdgesOnly + * is set to false. + * @see {@link yfiles.layout.PartitionLayouter.ChannelInterEdgeRouter#routeInterEdges} + * @see {@link yfiles.layout.PartitionLayouter.ChannelInterEdgeRouter#routeInterEdges} + */ + routeInterEdgesOnly:boolean; + /** + * The{@link yfiles.algorithms.IDataProvider} key which is used to register the + * inter-edge data provider passed to + * {@link yfiles.layout.PartitionLayouter.ChannelInterEdgeRouter#routeInterEdges} + * on the given graph. + * Defaults to {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY}. + */ + interEdgeDPKey:Object; + /** + * The{@link yfiles.router.ChannelEdgeRouter} instance used to route inter-edges. + */ + channelEdgeRouter:yfiles.router.ChannelEdgeRouter; + /** + * The maximum relative distance between an edge and its closest + * node for edges routed outside the bounding box of all graph nodes. + * Getter:A negative value means that there is no restriction for the edge-node + * distance. + * Setter:The value is relative in the way that edges to the left or right + * of the nodes' bounding box must satisfy + * dist(edge, bounding box) <= (bounding box width) * margin + * and edges above or below the nodes' bounding box must satisfy + * dist(edge, bounding box) <= (bounding box height) * margin. + * Passing in a negative value effectively allow edges to be arbitrarily + * far from their closest nodes. + * By default margin is set to -1.0. + */ + margin:number; + /** + * Routes inter-edges of the partitioned graph. + * This implementation will register/deregister interEdgeDP + * on the specified input graph before/after doing any actual routing. + * @param {yfiles.layout.LayoutGraph} graph the input graph. + * @param {yfiles.algorithms.IDataProvider} partitionIDDP the partition id for each node in the graph. + * @param {yfiles.algorithms.IDataProvider} interEdgeDP + * holds a boolean value for each edge of the graph + * indicating if the edge is an inter-edge or not. + * @see {@link yfiles.layout.PartitionLayouter.ChannelInterEdgeRouter#interEdgeDPKey} + * @see {@link yfiles.layout.PartitionLayouter.ChannelInterEdgeRouter#interEdgeDPKey} + * @see Specified by {@link yfiles.layout.PartitionLayouter.IInterEdgeRouter#routeInterEdges}. + */ + routeInterEdges(graph:yfiles.layout.LayoutGraph,partitionIDDP:yfiles.algorithms.IDataProvider,interEdgeDP:yfiles.algorithms.IDataProvider):void; + } + /** + * InterEdgeRouter implementation that routes inter-edges using {@link yfiles.router.polyline.EdgeRouter}. + */ + export interface PolylineInterEdgeRouter extends Object,yfiles.layout.PartitionLayouter.IInterEdgeRouter{ + /** + * The DataProvider key to mark edges as + * selected. + *

+ * By default, {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY} is used. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#selectedEdgesDpKey} + * @see {@link yfiles.router.polyline.EdgeRouter#selectedEdgesDpKey} + * @throws {yfiles.system.ArgumentException} if the specified key is null. + * @see {@link yfiles.router.polyline.EdgeRouter#selectedEdgesDpKey} + * @see {@link yfiles.router.polyline.EdgeRouter#selectedEdgesDpKey} + */ + selectedEdgesDpKey:Object; + /** + * true if this PolylineInterEdgeRouter + * is configured to route inter-partition edges only. + * By default, all edges are routed, i.e. routeInterEdgesOnly + * is set to false. + * @see {@link yfiles.layout.PartitionLayouter.PolylineInterEdgeRouter#routeInterEdges} + * @see {@link yfiles.layout.PartitionLayouter.PolylineInterEdgeRouter#routeInterEdges} + */ + routeInterEdgesOnly:boolean; + /** + * Routes inter-edges of the partitioned graph. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.IDataProvider} partitionIDDP the partition id for each node in the graph. + * @param {yfiles.algorithms.IDataProvider} interEdgeDP + * holds a boolean value for each edge of the graph indicating if the + * edge is an inter-edge or not. + * @see Specified by {@link yfiles.layout.PartitionLayouter.IInterEdgeRouter#routeInterEdges}. + */ + routeInterEdges(graph:yfiles.layout.LayoutGraph,clusterIDDP:yfiles.algorithms.IDataProvider,interEdgeDP:yfiles.algorithms.IDataProvider):void; + /** + * The{@link yfiles.router.polyline.EdgeRouter} instance used to route inter-edges. + */ + edgeRouter:yfiles.router.polyline.EdgeRouter; + } + /** + * InterEdgeRouter implementation that routes inter-edges using {@link yfiles.router.OrthogonalEdgeRouter}. + */ + export interface OrthogonalInterEdgeRouter extends Object,yfiles.layout.PartitionLayouter.IInterEdgeRouter{ + /** + * The DataProvider key to mark edges as + * selected. + *

+ * By default, {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY} is used. + *

+ * @see {@link yfiles.router.OrthogonalEdgeRouter#selectedEdgesDpKey} + * @see {@link yfiles.router.OrthogonalEdgeRouter#selectedEdgesDpKey} + * @throws {yfiles.system.ArgumentException} if the specified key is null. + * @see {@link yfiles.router.OrthogonalEdgeRouter#selectedEdgesDpKey} + * @see {@link yfiles.router.OrthogonalEdgeRouter#selectedEdgesDpKey} + */ + selectedEdgesDpKey:Object; + /** + * Routes inter-edges of the partitioned graph. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.IDataProvider} partitionIDDP the partition id for each node in the graph. + * @param {yfiles.algorithms.IDataProvider} interEdgeDP + * holds a boolean value for each edge of the graph indicating if the + * edge is an inter-edge or not. + * @see Specified by {@link yfiles.layout.PartitionLayouter.IInterEdgeRouter#routeInterEdges}. + */ + routeInterEdges(graph:yfiles.layout.LayoutGraph,clusterIDDP:yfiles.algorithms.IDataProvider,interEdgeDP:yfiles.algorithms.IDataProvider):void; + /** + * The{@link yfiles.router.OrthogonalEdgeRouter} instance used to route inter-edges. + */ + orthogonalEdgeRouter:yfiles.router.OrthogonalEdgeRouter; + } + /** + * PartitionFinder implementation that uses {@link yfiles.algorithms.Groups#edgeBetweennessClusteringWithCost} + * as partition strategy. + */ + export interface EdgeBetweennessPartitionFinder extends Object,yfiles.layout.PartitionLayouter.IPartitionFinder{ + /** + * Returns a partition id for each node of an input graph. + * Nodes that share a common partition id + * will be considered to belong to the same partition. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.INodeMap} partitionIDMap used to return the resulting partition ids + * @see Specified by {@link yfiles.layout.PartitionLayouter.IPartitionFinder#findPartitions}. + */ + findPartitions(graph:yfiles.layout.LayoutGraph,clusterIDMap:yfiles.algorithms.INodeMap):void; + /** + * The maximum number of partitions that this class should return. + * By default there is no limit + * to the number of returned partitions. + */ + maximumPartitionCount:number; + /** + * The minimum number of partitions that this class should return. + * By default this value is set to 0. + */ + minimumPartitionCount:number; + } + /** + * PartitionPlacer implementation that uses {@link yfiles.layout.ComponentLayouter} to place + * the partitions. + */ + export interface ComponentPartitionPlacer extends Object,yfiles.layout.PartitionLayouter.IPartitionPlacer{ + /** + * Arranges the graph while taking partition ids and inter-edge information into account. + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.IDataProvider} partitionIDDP the partition id for each node in the graph. + * @param {yfiles.algorithms.IDataProvider} interEdgeDP + * holds a boolean value for each edge of the graph indicating if the + * edge is an inter-edge or not. An inter-edge is an edge that connects nodes that do not + * belong to the same partition. + * @see Specified by {@link yfiles.layout.PartitionLayouter.IPartitionPlacer#placePartitions}. + */ + placePartitions(graph:yfiles.layout.LayoutGraph,clusterIDDP:yfiles.algorithms.IDataProvider,interEdgeDP:yfiles.algorithms.IDataProvider):void; + /** + * The ComponentLayouter instance used to place the graph partitions. + */ + componentLayouter:yfiles.layout.ComponentLayouter; + } + } + var PartitionLayouter:{ + $class:yfiles.lang.Class; + new ():yfiles.layout.PartitionLayouter; + ChannelInterEdgeRouter:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this class. + */ + new ():yfiles.layout.PartitionLayouter; + }; + PolylineInterEdgeRouter:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this class. + */ + new ():yfiles.layout.PartitionLayouter; + }; + OrthogonalInterEdgeRouter:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this class. + */ + new ():yfiles.layout.PartitionLayouter; + }; + EdgeBetweennessPartitionFinder:{ + $class:yfiles.lang.Class; + new ():yfiles.layout.PartitionLayouter; + }; + ComponentPartitionPlacer:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this class. + */ + new ():yfiles.layout.PartitionLayouter; + }; + }; + /** + * A layout stage that performs changes the orientation + * of the layout that another algorithm calculates. + *

+ * For all {@link yfiles.layout.CanonicMultiStageLayouter}s it is highly recommended to use + * {@link yfiles.layout.CanonicMultiStageLayouter#orientationLayouter} for layout orientation changes and not to wrap + * the CanonicMultiStageLayouter with an OrientationLayouter, which may cause unwanted + * artifacts. + *

+ */ + export interface OrientationLayouter extends yfiles.layout.AbstractLayoutStage{ + /** + * The orientation of the layout. + * By default {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} is set. + */ + orientation:yfiles.layout.LayoutOrientation; + /** + * The mirror mask, that defines which orientations this layouter shall mirror. + * Setting a layout orientation can be seen as rotating the graph 90, 180 or 270 degrees. + * Afterwards the graph can be mirrored at the x-Axis (for horizontal layout orientations) or + * y-Axis (for vertical layout orientations). Which directions are mirrored can be defined by the given mask. + *

+ * By default a mirror mask is set, where {@link yfiles.layout.LayoutOrientation#BOTTOM_TO_TOP}, will be mirrored at the y-Axis. + *

+ * @see {@link yfiles.layout.MirrorMask#BOTTOM_TO_TOP} + * @see {@link yfiles.layout.MirrorMask#LEFT_TO_RIGHT} + * @see {@link yfiles.layout.MirrorMask#RIGHT_TO_LEFT} + * @see {@link yfiles.layout.MirrorMask#TOP_TO_BOTTOM} + * @see {@link yfiles.layout.MirrorMask#BOTTOM_TO_TOP} + * @see {@link yfiles.layout.MirrorMask#LEFT_TO_RIGHT} + * @see {@link yfiles.layout.MirrorMask#RIGHT_TO_LEFT} + * @see {@link yfiles.layout.MirrorMask#TOP_TO_BOTTOM} + */ + mirrorMask:yfiles.layout.MirrorMask; + /** + * Specifies whether or not the set orientation is a horizontal + * orientation, i.e. + * one of {@link yfiles.layout.LayoutOrientation#LEFT_TO_RIGHT} or + * {@link yfiles.layout.LayoutOrientation#RIGHT_TO_LEFT}. + */ + horizontalOrientation:boolean; + /** + * Specifies whether or not the position of the edge labels should be changed during orientation change. + * The core layouter should switch this off, when its integrated edge labeling is switched on. + * Default is true. + */ + considerEdgeLabels:boolean; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * This method will return whether the layouter will mirror the graph for a given layout orientation. + * @param {yfiles.layout.LayoutOrientation} orientation the layout orientation, for which to check the mirror state. + * @return {boolean} + *
  • true - if the layouter will mirror the graph at the corresponding axis + * (x-Axis for horizontal orientations, y-Axis for vertical orientations) for the given layout orientation.
  • + *
  • false - otherwise.
+ */ + isOrientationMirrored(orientation:yfiles.layout.LayoutOrientation):boolean; + /** + * Method that will be called before the core layouter gets activated. + * It prepares the layout for the desired orientation by rotating/mirroring + * the coordinates and bounds of the graph layout such that the core layouter + * can perform the layout in the canonical TOP_TO_BOTTOM manner. + */ + prepareOrientationChange(graph:yfiles.layout.LayoutGraph):void; + /** + * Method that will be called after the core layouter has been activated. + * It performs the inverse coordinate transformation that has been applied + * to the layout by method {@link yfiles.layout.OrientationLayouter#prepareOrientationChange}. + */ + completeOrientationChange(graph:yfiles.layout.LayoutGraph):void; + /** + * Transforms a point for the preparation or completion + * phase. + * @param {boolean} prepare + * if true then the transformation + * is for the preparation phase, otherwise for the completion phase. + * @see {@link yfiles.layout.OrientationLayouter#prepareTransform} + * @see {@link yfiles.layout.OrientationLayouter#completeTransform} + */ + transform(p:yfiles.algorithms.YPoint,prepare:boolean):yfiles.algorithms.YPoint; + /** + * Transforms a point for the preparation phase. + * @see {@link yfiles.layout.OrientationLayouter#prepareOrientationChange} + */ + prepareTransform(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; + /** + * Transforms a point for the completion phase. + * @see {@link yfiles.layout.OrientationLayouter#completeOrientationChange} + */ + completeTransform(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; + /** + * Create and return an insets object that is a geometric transform of the given insets. + * The transform will correspond to the currently set orientation. + */ + createOrientedInsets(insets:yfiles.algorithms.Insets):yfiles.algorithms.Insets; + /** + * Create and return a node halo object that is a geometric transform of the given node halo. + * The transform will correspond to the currently set orientation. + */ + createOrientedNodeHalo(halo:yfiles.layout.NodeHalo):yfiles.layout.NodeHalo; + /** + * Create and return an YDimension object that is a geometric transform of the given size. + * The transform will correspond to the currently set orientation. + */ + createOrientedNodeSize(nodeSize:yfiles.algorithms.YDimension):yfiles.algorithms.YDimension; + } + export module OrientationLayouter{ + /** + * Class that provides a method for transferring a point to its final position. + * Used for internal purposes. + */ + export interface Transformer extends Object{ + finalizeTransform(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; + initTransform(p:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; + } + } + var OrientationLayouter:{ + $class:yfiles.lang.Class; + /** + * Instantiates a new OrientationLayouter. + * the core layout routine + * will be delegated to the given layouter. + */ + WithCoreLayouter:{ + new (coreLayouter:yfiles.layout.ILayouter):yfiles.layout.OrientationLayouter; + }; + /** + * Instantiates a new OrientationLayouter. + */ + new ():yfiles.layout.OrientationLayouter; + /** + * Instantiates a new OrientationLayouter with a given orientation. + * @see {@link yfiles.layout.OrientationLayouter#orientation} + */ + FromOrientation:{ + new (orientation:yfiles.layout.LayoutOrientation):yfiles.layout.OrientationLayouter; + }; + }; + export enum MirrorMask{ + /** + * Constant that can be used to prevent any mirroring of layout orientations. + */ + NONE, + /** + * Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at + * their corresponding axis. Adding this constant to the mask will result in mirror the y-axis of the graph for layout + * orientation LayoutOrientation.TOP_TO_BOTTOM. + */ + TOP_TO_BOTTOM, + /** + * Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at + * their corresponding axis. Adding this constant to the mask will result in mirror the x-axis of the graph for layout + * orientation LayoutOrientation.RIGHT_TO_LEFT. + */ + RIGHT_TO_LEFT, + /** + * Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at + * their corresponding axis. Adding this constant to the mask will result in mirror the y-axis of the graph for layout + * orientation LayoutOrientation.BOTTOM_TO_TOP. + */ + BOTTOM_TO_TOP, + /** + * Constant that can be used to create the mirror mask, that defines which layout orientations shall be mirrored at + * their corresponding axis. Adding this constant to the mask will result in mirror the x-axis of the graph for layout + * orientation LayoutOrientation.LEFT_TO_RIGHT. + */ + LEFT_TO_RIGHT + } + /** + * This class represents a candidate position for label associated to a node + * in a graph. + */ + export interface NodeLabelCandidate extends yfiles.layout.LabelCandidate{ + } + var NodeLabelCandidate:{ + $class:yfiles.lang.Class; + /** + * Returns a new instance of NodeLabelCandidate. + * @param {yfiles.algorithms.YPoint} pos + * the location of the upper + * left corner of the candidate. + * @param {yfiles.algorithms.YDimension} size the size of the candidate. + * @param {Object} param + * the parameters of the labeling model + * associated with this candidate. + * @param {yfiles.layout.INodeLabelLayout} owner the label associated to the candidate. + */ + FromPositionAndSize:{ + new (pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.INodeLabelLayout):yfiles.layout.NodeLabelCandidate; + }; + /** + * Returns a new instance of NodeLabelCandidate. + * @param {yfiles.algorithms.YOrientedRectangle} orientedBox the box that specifies the candidate's size and position. + * @param {Object} param the parameters of the labeling model associated with this candidate. + * @param {yfiles.layout.INodeLabelLayout} owner the label associated to the candidate. + * @param {boolean} internal + * flag whether the candidate is inside the node, + * or outside. + */ + FromRectangle:{ + new (orientedBox:yfiles.algorithms.YOrientedRectangle,param:Object,owner:yfiles.layout.INodeLabelLayout,internal:boolean):yfiles.layout.NodeLabelCandidate; + }; + /** + * Returns a new instance of NodeLabelCandidate. + * @param {yfiles.algorithms.YPoint} pos + * the location of the upper + * left corner of the candidate. + * @param {yfiles.algorithms.YDimension} size the size of the candidate. + * @param {Object} param + * the parameters of the labeling model + * associated with this candidate. + * @param {yfiles.layout.INodeLabelLayout} owner the label associated to the candidate. + * @param {boolean} internal + * flag whether the candidate is inside the node, + * or outside. + */ + FromPositionAndSizeWithInternal:{ + new (pos:yfiles.algorithms.YPoint,size:yfiles.algorithms.YDimension,param:Object,owner:yfiles.layout.INodeLabelLayout,internal:boolean):yfiles.layout.NodeLabelCandidate; + }; + }; + /** + * This class is an default implementation of the NodeLabelLayout + * interface. + */ + export interface NodeLabelLayoutImpl extends yfiles.layout.LabelLayoutImpl,yfiles.layout.INodeLabelLayout{ + /** + * The node label model associated with this label layout. + * @see Specified by {@link yfiles.layout.INodeLabelLayout#labelModel}. + */ + labelModel:yfiles.layout.INodeLabelModel; + } + var NodeLabelLayoutImpl:{ + $class:yfiles.lang.Class; + new ():yfiles.layout.NodeLabelLayoutImpl; + }; + export enum PortDirection{ + /** + * Constant indicating a port in the north of a node. + */ + NORTH, + /** + * Constant indicating a port in the east of a node. + */ + EAST, + /** + * Constant indicating a port in the west of a node. + */ + WEST, + /** + * Constant indicating a port in the south of a node. + */ + SOUTH, + /** + * Constant indicating a port lying in the direction of the main flow of the edge or overall layout. + * The exact direction is domain specific. + */ + WITH_THE_FLOW, + /** + * Constant indicating a port lying in the opposite direction of the main flow of the edge or overall layout. + * The exact direction is domain specific. + */ + AGAINST_THE_FLOW, + /** + * Constant indicating a port lying to the left of the direction of the main flow + * of the edge or overall layout. + * The exact direction is domain specific. + */ + LEFT_IN_FLOW, + /** + * Constant indicating a port lying in the right of the direction of the main flow + * of the edge or overall layout. + * The exact direction is domain specific. + */ + RIGHT_IN_FLOW, + /** + * A bitwise combination of all possible direction constants. + */ + ANY + } + /** + * LayoutStage that assigns edges to the ports specified by {@link yfiles.layout.PortConstraint}s or {@link yfiles.layout.PortCandidate}s after + * calling the core layout. + * It can be used to adjust ports for layout algorithms that cannot handle such constraints. + *

+ * If PortCandidates are assigned for edges and nodes, this stage tries to match them. When there is no + * match, the PortCandidate with the lowest costs specified for the edge is chosen. + * While PortConstraints are also matched to PortCandidates at nodes and edges, it is not + * recommended to mix them because they belong to different concepts. + *

+ *

+ * Furthermore, option {@link yfiles.layout.PortCandidateAssignmentStage#pathCorrection} allows to specify whether the edge path should be + * corrected after correcting a port. + *

+ * @see {@link yfiles.layout.PortConstraint} + * @see {@link yfiles.layout.PortCandidate} + * @see {@link yfiles.layout.PortCandidateSet} + * @see {@link yfiles.layout.PortCandidateAssignmentStage#pathCorrection} + */ + export interface PortCandidateAssignmentStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Specifies whether or not this stage corrects the edge paths after moving the port to the location specified by a + * {@link yfiles.layout.PortConstraint} or {@link yfiles.layout.PortCandidate}s. + *

+ * If path correction is enabled, the edge will be rerouted within a specific area around its source/target node. + * Outside this area it will keep the route that was calculated by the {@link yfiles.layout.AbstractLayoutStage#coreLayouter core layouter}. + * When disabled, only the ports are moved which may be more suitable for initially straight edges. + *

+ *

+ * Note that the path correction uses a simple orthogonal routing strategy that is fast but may produce + * overlapping edge segments as well as edge-node intersections. + *

+ *

+ * By default this option is disabled. + *

+ */ + pathCorrection:boolean; + } + var PortCandidateAssignmentStage:{ + $class:yfiles.lang.Class; + new ():yfiles.layout.PortCandidateAssignmentStage; + WithCoreLayouter :{ + new (core:yfiles.layout.ILayouter):yfiles.layout.PortCandidateAssignmentStage; + }; + }; + } + export module licensing{ + } + export module markup{ + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface ArrayExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + type:yfiles.lang.Class; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + items:yfiles.objectcollections.IList; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var ArrayExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ArrayExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromType:{ + new (type:yfiles.lang.Class):yfiles.markup.ArrayExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromArray:{ + new (array:Object):yfiles.markup.ArrayExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface TypeExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + typeName:string; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + type:yfiles.lang.Class; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var TypeExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.TypeExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromTypeName:{ + new (typeName:string):yfiles.markup.TypeExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface MemberInfoValueSerializer extends yfiles.system.ValueSerializer{ + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.ValueSerializer#canConvertToString} + */ + canConvertToString(value:Object,context:yfiles.system.IValueSerializerContext):boolean; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.ValueSerializer#convertToString} + */ + convertToString(o:Object,vsc:yfiles.system.IValueSerializerContext):string; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.ValueSerializer#canConvertFromString} + */ + canConvertFromString(value:string,context:yfiles.system.IValueSerializerContext):boolean; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.ValueSerializer#convertFromString} + */ + convertFromString(value:string,context:yfiles.system.IValueSerializerContext):Object; + } + var MemberInfoValueSerializer:{ + $class:yfiles.lang.Class; + new ():yfiles.markup.MemberInfoValueSerializer; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface StaticExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + member:yfiles.system.MemberInfo; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var StaticExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.StaticExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromMember:{ + new (member:yfiles.system.MemberInfo):yfiles.markup.StaticExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface ListExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + items:yfiles.objectcollections.IList; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var ListExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ListExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromCollection:{ + new (enumerable:yfiles.objectcollections.ICollection):yfiles.markup.ListExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromEnumerable:{ + new (enumerable:yfiles.objectcollections.IEnumerable):yfiles.markup.ListExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface UndefinedExtension extends yfiles.system.MarkupExtension{ + /** + * Returns an object that is set as the value of the target property for this markup extension. + * @param {yfiles.support.ILookup} serviceProvider Object that can provide services for the markup extension. + * @return {Object} The object value to set on the property where the extension is applied. + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var UndefinedExtension:{ + $class:yfiles.lang.Class; + new ():yfiles.markup.UndefinedExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface GenericListExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + items:yfiles.objectcollections.IList; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + type:yfiles.lang.Class; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + copyItems(oldItems:yfiles.objectcollections.IList):void; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + getCollectionType(typeArgument:yfiles.lang.Class):yfiles.lang.Class; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var GenericListExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromType:{ + new (typeArgument:yfiles.lang.Class):yfiles.markup.GenericListExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromEnumerableAndType:{ + new (enumerable:yfiles.objectcollections.IEnumerable,typeArgument:yfiles.lang.Class):yfiles.markup.GenericListExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.GenericListExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface NullExtension extends yfiles.system.MarkupExtension{ + /** + * Returns an object that is set as the value of the target property for this markup extension. + * @param {yfiles.support.ILookup} serviceProvider Object that can provide services for the markup extension. + * @return {Object} The object value to set on the property where the extension is applied. + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var NullExtension:{ + $class:yfiles.lang.Class; + new ():yfiles.markup.NullExtension; + }; + export module common{ + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface PortExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + tag:Object; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + style:yfiles.drawing.IPortStyle; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + locationModelParameter:yfiles.graph.IPortLocationModelParameter; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var PortExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.common.PortExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + PortExtension:{ + new (parameter:yfiles.graph.IPortLocationModelParameter):yfiles.markup.common.PortExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface Wrapper extends Object{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + wrappee:Object; + } + var Wrapper:{ + $class:yfiles.lang.Class; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface GraphSettings extends Object{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + nodeDefaults:yfiles.graph.INodeDefaults; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + groupNodeDefaults:yfiles.graph.INodeDefaults; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + edgeDefaults:yfiles.graph.IEdgeDefaults; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + usePortCandidateProviders:boolean; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + applyTo(graph:yfiles.graph.IGraph):void; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + readFrom(graph:yfiles.graph.IGraph):void; + } + var GraphSettings:{ + $class:yfiles.lang.Class; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface TableExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + rows:yfiles.collections.ICollection; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + columns:yfiles.collections.ICollection; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + insets:yfiles.geometry.InsetsD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + relativeLocation:yfiles.geometry.PointD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + rowDefaults:yfiles.graph.IStripeDefaults; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + columnDefaults:yfiles.graph.IStripeDefaults; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var TableExtension:{ + $class:yfiles.lang.Class; + new ():yfiles.markup.common.TableExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface ColumnExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + columns:yfiles.collections.ICollection; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + style:yfiles.drawing.INodeStyle; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + minimumSize:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + size:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + insets:yfiles.geometry.InsetsD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + labels:yfiles.collections.ICollection; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + tag:Object; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var ColumnExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.common.ColumnExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface RowExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + rows:yfiles.collections.ICollection; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + minimumSize:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + size:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + insets:yfiles.geometry.InsetsD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + labels:yfiles.collections.ICollection; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + style:yfiles.drawing.INodeStyle; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + tag:Object; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var RowExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.common.RowExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface BendExtension extends yfiles.system.MarkupExtension{ + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + location:yfiles.geometry.PointD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + tag:Object; + } + var BendExtension:{ + $class:yfiles.lang.Class; + BendExtension:{ + new (location:yfiles.geometry.PointD):yfiles.markup.common.BendExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.common.BendExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface LabelExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + text:string; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + labelModelParameter:yfiles.graph.ILabelModelParameter; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + style:yfiles.drawing.ILabelStyle; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + preferredSize:yfiles.geometry.SizeD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + tag:Object; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var LabelExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.common.LabelExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + LabelExtension:{ + new (text:string):yfiles.markup.common.LabelExtension; + }; + }; + } + export module ui{ + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface RotatedSliderLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + location:yfiles.drawing.SliderParameterLocation; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + segmentIndex:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + segmentRatio:number; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var RotatedSliderLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.RotatedSliderLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromLocationAndModel:{ + new (location:yfiles.drawing.SliderParameterLocation,segmentIndex:number,segmentRatio:number):yfiles.markup.ui.RotatedSliderLabelModelParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromLocationSegmentIndexRatioAndModel:{ + new (location:yfiles.drawing.SliderParameterLocation,segmentIndex:number,segmentRatio:number,model:yfiles.drawing.RotatedSliderEdgeLabelModel):yfiles.markup.ui.RotatedSliderLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface SideSliderLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + location:yfiles.drawing.SliderParameterLocation; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + segmentIndex:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + segmentRatio:number; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var SideSliderLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.SideSliderLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromLocation:{ + new (location:yfiles.drawing.SliderParameterLocation,segmentIndex:number,segmentRatio:number):yfiles.markup.ui.SideSliderLabelModelParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromLocationSegmentIndexRatioAndModel:{ + new (location:yfiles.drawing.SliderParameterLocation,segmentIndex:number,segmentRatio:number,model:yfiles.graph.ILabelModel):yfiles.markup.ui.SideSliderLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface RotatingEdgeLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + ratio:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var RotatingEdgeLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.RotatingEdgeLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromLocationAndModel:{ + new (ratio:number,model:yfiles.graph.ILabelModel):yfiles.markup.ui.RotatingEdgeLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface SandwichParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + position:yfiles.input.HandlePositions; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var SandwichParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.SandwichParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPosition:{ + new (position:yfiles.input.HandlePositions):yfiles.markup.ui.SandwichParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPositionAndModel:{ + new (position:yfiles.input.HandlePositions,model:yfiles.graph.ILabelModel):yfiles.markup.ui.SandwichParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface SmartEdgeLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + location:yfiles.drawing.SliderParameterLocation; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + segmentIndex:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + segmentRatio:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + distance:number; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var SmartEdgeLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.SmartEdgeLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromLocationIndexDistanceAndRatio:{ + new (location:yfiles.drawing.SliderParameterLocation,segmentIndex:number,distance:number,segmentRatio:number):yfiles.markup.ui.SmartEdgeLabelModelParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromLocationIndexDistanceRatioAndModel:{ + new (location:yfiles.drawing.SliderParameterLocation,segmentIndex:number,distance:number,segmentRatio:number,model:yfiles.drawing.SmartEdgeLabelModel):yfiles.markup.ui.SmartEdgeLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface SegmentRatioParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.IPortLocationModel; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + index:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + ratio:number; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var SegmentRatioParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.SegmentRatioParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface NodeScaledParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + offset:yfiles.geometry.PointD; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var NodeScaledParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.NodeScaledParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromLocation:{ + new (offset:yfiles.geometry.PointD):yfiles.markup.ui.NodeScaledParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface SliderLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + location:yfiles.drawing.SliderParameterLocation; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + segmentIndex:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + segmentRatio:number; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var SliderLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.SliderLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromLocation:{ + new (location:yfiles.drawing.SliderParameterLocation,segmentIndex:number,segmentRatio:number):yfiles.markup.ui.SliderLabelModelParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromLocationSegmentIndexSegmentRatioAndModel:{ + new (location:yfiles.drawing.SliderParameterLocation,segmentIndex:number,segmentRatio:number,model:yfiles.graph.ILabelModel):yfiles.markup.ui.SliderLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface RotatedSideSliderLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + location:yfiles.drawing.SliderParameterLocation; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + segmentIndex:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + segmentRatio:number; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var RotatedSideSliderLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.RotatedSideSliderLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromLocationSegmentIndexAndRatio:{ + new (location:yfiles.drawing.SliderParameterLocation,segmentIndex:number,segmentRatio:number):yfiles.markup.ui.RotatedSideSliderLabelModelParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromLocationSegmentIndexRatioAndModel:{ + new (location:yfiles.drawing.SliderParameterLocation,segmentIndex:number,segmentRatio:number,model:yfiles.graph.ILabelModel):yfiles.markup.ui.RotatedSideSliderLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface ExteriorLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + position:yfiles.drawing.ExteriorLabelModel.Position_Interface; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var ExteriorLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.ExteriorLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPosition:{ + new (position:yfiles.drawing.ExteriorLabelModel.Position_Interface):yfiles.markup.ui.ExteriorLabelModelParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPositionAndModel:{ + new (position:yfiles.drawing.ExteriorLabelModel.Position_Interface,model:yfiles.graph.ILabelModel):yfiles.markup.ui.ExteriorLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface AnchoredParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + anchor:yfiles.geometry.PointD; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var AnchoredParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.AnchoredParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + AnchoredParameterExtension:{ + new (anchor:yfiles.geometry.PointD):yfiles.markup.ui.AnchoredParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface DescriptorWrapperLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + parameter:yfiles.graph.ILabelModelParameter; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.drawing.DescriptorWrapperLabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var DescriptorWrapperLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.DescriptorWrapperLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + DescriptorWrapperLabelModelParameterExtension:{ + new (parameter:yfiles.graph.ILabelModelParameter,model:yfiles.drawing.DescriptorWrapperLabelModel):yfiles.markup.ui.DescriptorWrapperLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface AnchoredLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + anchorLocation:yfiles.geometry.IPoint; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + angle:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var AnchoredLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.AnchoredLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + WithAnchorAndAngle:{ + new (anchorLocation:yfiles.geometry.IPoint,angle:number):yfiles.markup.ui.AnchoredLabelModelParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + WithAnchorAngleAndModel:{ + new (anchorLocation:yfiles.geometry.IPoint,angle:number,model:yfiles.graph.ILabelModel):yfiles.markup.ui.AnchoredLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface ArrowExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + pen:yfiles.system.Pen; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + brush:yfiles.system.Brush; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + cropLength:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + scale:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + type:yfiles.drawing.ArrowType; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var ArrowExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.ArrowExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + ArrowExtension:{ + new (type:yfiles.drawing.ArrowType):yfiles.markup.ui.ArrowExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromTypePenBrushScaleAndCropLength:{ + new (type:yfiles.drawing.ArrowType,pen:yfiles.system.Pen,brush:yfiles.system.Brush,scale:number,cropLength:number):yfiles.markup.ui.ArrowExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface DynamicAnchoredParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + anchor:yfiles.geometry.IPoint; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var DynamicAnchoredParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.DynamicAnchoredParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + DynamicAnchoredParameterExtension:{ + new (anchor:yfiles.geometry.IPoint):yfiles.markup.ui.DynamicAnchoredParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface GenericConverter extends yfiles.system.TypeConverter{ + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#canConvertToWithContext} + */ + canConvertToWithContext(context:yfiles.system.ITypeDescriptorContext,destinationType:yfiles.lang.Class):boolean; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.TypeConverter#convertToWithContextAndCulture} + */ + convertToWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object,destinationType:yfiles.lang.Class):Object; + } + var GenericConverter:{ + $class:yfiles.lang.Class; + new ():yfiles.markup.ui.GenericConverter; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface FreeEdgeLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + ratio:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + distance:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + angle:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var FreeEdgeLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.FreeEdgeLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromRatioDistanceAndAngle:{ + new (ratio:number,distance:number,angle:number):yfiles.markup.ui.FreeEdgeLabelModelParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromRatioDistanceAngleAndModel:{ + new (ratio:number,distance:number,angle:number,model:yfiles.graph.ILabelModel):yfiles.markup.ui.FreeEdgeLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface CompositeLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + parameter:yfiles.graph.ILabelModelParameter; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var CompositeLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.CompositeLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + CompositeLabelModelParameterExtension:{ + new (parameter:yfiles.graph.ILabelModelParameter,model:yfiles.graph.ILabelModel):yfiles.markup.ui.CompositeLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface BendAnchoredParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + index:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + fromSource:boolean; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var BendAnchoredParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.BendAnchoredParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + BendAnchoredParameterExtension:{ + new (index:number,fromSource:boolean):yfiles.markup.ui.BendAnchoredParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface FixedLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + anchorLocation:yfiles.geometry.PointD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + angle:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var FixedLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.FixedLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromAnchorAndAngle:{ + new (anchorLocation:yfiles.geometry.PointD,angle:number):yfiles.markup.ui.FixedLabelModelParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromAnchorAngleAndModel:{ + new (anchorLocation:yfiles.geometry.PointD,angle:number,model:yfiles.graph.ILabelModel):yfiles.markup.ui.FixedLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface StretchStripeLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + position:yfiles.drawing.StretchStripeLabelModel.Position_Interface; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var StretchStripeLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.StretchStripeLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPosition:{ + new (position:yfiles.drawing.StretchStripeLabelModel.Position_Interface):yfiles.markup.ui.StretchStripeLabelModelParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPositionAndModel:{ + new (position:yfiles.drawing.StretchStripeLabelModel.Position_Interface,model:yfiles.graph.ILabelModel):yfiles.markup.ui.StretchStripeLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface StripeLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + position:yfiles.drawing.StripeLabelModel.Position_Interface; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var StripeLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.StripeLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPosition:{ + new (position:yfiles.drawing.StripeLabelModel.Position_Interface):yfiles.markup.ui.StripeLabelModelParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPositionAndModel:{ + new (position:yfiles.drawing.StripeLabelModel.Position_Interface,model:yfiles.graph.ILabelModel):yfiles.markup.ui.StripeLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface InteriorStretchLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + position:yfiles.drawing.InteriorStretchLabelModel.Position_Interface; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var InteriorStretchLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.InteriorStretchLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPosition:{ + new (position:yfiles.drawing.InteriorStretchLabelModel.Position_Interface):yfiles.markup.ui.InteriorStretchLabelModelParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPositionAndModel:{ + new (position:yfiles.drawing.InteriorStretchLabelModel.Position_Interface,model:yfiles.graph.ILabelModel):yfiles.markup.ui.InteriorStretchLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface NinePositionsEdgeLabelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + position:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var NinePositionsEdgeLabelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.NinePositionsEdgeLabelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPosition:{ + new (position:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface):yfiles.markup.ui.NinePositionsEdgeLabelParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPositionAndModel:{ + new (position:yfiles.drawing.NinePositionsEdgeLabelModel.Position_Interface,model:yfiles.graph.ILabelModel):yfiles.markup.ui.NinePositionsEdgeLabelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface InteriorLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + position:yfiles.drawing.InteriorLabelModel.Position_Interface; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var InteriorLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.InteriorLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPosition:{ + new (position:yfiles.drawing.InteriorLabelModel.Position_Interface):yfiles.markup.ui.InteriorLabelModelParameterExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPositionAndModel:{ + new (position:yfiles.drawing.InteriorLabelModel.Position_Interface,model:yfiles.graph.ILabelModel):yfiles.markup.ui.InteriorLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface GenericLabelModelParameterPair extends Object{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + parameter:yfiles.graph.ILabelModelParameter; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + descriptor:yfiles.graph.ILabelCandidateDescriptor; + } + var GenericLabelModelParameterPair:{ + $class:yfiles.lang.Class; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface LayoutAnchoredLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + offset:yfiles.geometry.PointD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + angle:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var LayoutAnchoredLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.LayoutAnchoredLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromPositionAndModel:{ + new (offset:yfiles.geometry.PointD,angle:number,model:yfiles.graph.ILabelModel):yfiles.markup.ui.LayoutAnchoredLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface CenterAnchoredLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + offset:yfiles.geometry.PointD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + angle:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var CenterAnchoredLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.CenterAnchoredLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + ForModel:{ + new (offset:yfiles.geometry.PointD,angle:number,model:yfiles.graph.ILabelModel):yfiles.markup.ui.CenterAnchoredLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface RatioAnchoredLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + layoutRatio:yfiles.geometry.PointD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + layoutOffset:yfiles.geometry.PointD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + labelRatio:yfiles.geometry.PointD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + labelOffset:yfiles.geometry.PointD; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + angle:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.graph.ILabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var RatioAnchoredLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.RatioAnchoredLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromLocationAndModel:{ + new (layoutRatio:yfiles.geometry.PointD,layoutOffset:yfiles.geometry.PointD,labelRatio:yfiles.geometry.PointD,labelOffset:yfiles.geometry.PointD,angle:number,model:yfiles.graph.ILabelModel):yfiles.markup.ui.RatioAnchoredLabelModelParameterExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface GenericModelExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + parameters:yfiles.collections.List; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + defaultParameter:number; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var GenericModelExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.GenericModelExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromParameter:{ + new (defaultParameter:yfiles.graph.ILabelModelParameter):yfiles.markup.ui.GenericModelExtension; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromDefaultParameterAndParameters:{ + new (defaultParameter:yfiles.graph.ILabelModelParameter,parameters:yfiles.collections.List):yfiles.markup.ui.GenericModelExtension; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface GenericLabelModelParameterExtension extends yfiles.system.MarkupExtension{ + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + index:number; + /** + * Helper property for XAML usage. + * This property is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + model:yfiles.drawing.GenericLabelModel; + /** + * Helper method for XAML usage. + * This method is not meant to be used from within code but supports the writing and parsing of XAML code only. + * @see Overrides {@link yfiles.system.MarkupExtension#provideValue} + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var GenericLabelModelParameterExtension:{ + $class:yfiles.lang.Class; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + new ():yfiles.markup.ui.GenericLabelModelParameterExtension; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + FromModel:{ + new (index:number,model:yfiles.drawing.GenericLabelModel):yfiles.markup.ui.GenericLabelModelParameterExtension; + }; + }; + } + } + export module model{ + /** + * Simple query interface that returns an {@link yfiles.canvas.ICanvasObjectGroup} + * for a given item. + * @see {@link yfiles.model.CanvasGroupProviders} + */ + export interface ICanvasGroupProvider extends Object{ + /** + * Returns the canvas object group for the given canvas control and item. + * @param {yfiles.canvas.CanvasControl} canvas The canvas to return a group for. + * @param {T} forItem The item. + * @return {yfiles.canvas.ICanvasObjectGroup} The canvas object group. + * @see Specified by {@link yfiles.model.ICanvasGroupProvider#getCanvasObjectGroup}. + */ + getCanvasObjectGroup(canvas:yfiles.canvas.CanvasControl,forItem:T):yfiles.canvas.ICanvasObjectGroup; + } + var ICanvasGroupProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface for a collection that will notify registered event handlers + * of changes to its contents. + * @see {@link yfiles.model.DefaultCollectionModel} + */ + export interface ICollectionModel extends Object,yfiles.collections.ICollection{ + /** + * An event that will be triggered if an item has been added to this collection. + */ + addItemAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item has been added to this collection. + */ + removeItemAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item has been removed from this collection. + */ + addItemRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item has been removed from this collection. + */ + removeItemRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item in this collection has changed significantly. + * It is up to the implementation whether and when to trigger this event. + */ + addItemChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item in this collection has changed significantly. + * It is up to the implementation whether and when to trigger this event. + */ + removeItemChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + } + var ICollectionModel:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A {@link yfiles.model.ModelManager} implementation that manages the + * visual decoration of the focused element in a canvas. + * For the item that should be focused this class uses the {@link yfiles.support.ILookup} mechanism of + * the item to lookup an {@link yfiles.input.IFocusIndicatorInstaller} + * implementation which will do the actual installation of the decoration in the canvas. + */ + export interface FocusPaintManager extends yfiles.model.InstallerBasedModelManager,yfiles.system.INotifyPropertyChanged,yfiles.model.IModelItemInstaller{ + /** + * Gets or sets a value indicating whether this {@link yfiles.model.FocusPaintManager} is enabled. + * If the manager is disabled, it will not install the {@link yfiles.canvas.ICanvasObject}s into + * the associated {@link yfiles.canvas.CanvasControl}. + * Value: true if enabled; otherwise, false. + * @see {@link yfiles.model.FocusPaintManager#showFocusPolicy} + */ + enabled:boolean; + /** + * Called when this mode gets {@link yfiles.model.FocusPaintManager#enabled disabled}. + */ + onDisabled():void; + /** + * Called when this mode gets {@link yfiles.model.FocusPaintManager#enabled enabled}. + */ + onEnabled():void; + /** + * Gets or sets the {@link yfiles.input.IInputModeContext} to use for this instance. + * The value returned will be available via the lookup of + * {@link yfiles.model.IInstallerContext} passed to the {@link yfiles.model.IModelItemInstaller#install} + * method. + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * A property change event that gets fired when the {@link yfiles.model.FocusPaintManager#focusedItem} + * property has been changed. + */ + addPropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * A property change event that gets fired when the {@link yfiles.model.FocusPaintManager#focusedItem} + * property has been changed. + */ + removePropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Gets or sets the focused item, updates the canvas and fires the corresponding property change event. + * Value: The focused item, which can be null. + */ + focusedItem:T; + /** + * Gets or sets the show focus policy. The default is {@link yfiles.model.ShowFocusPolicy#WHEN_FOCUSED} + * Value: The show focus policy. Changing this property influences the visibility of the rendering + * depending on the current value of {@link yfiles.model.FocusPaintManager#focused} attribute. + * Note that the {@link yfiles.model.FocusPaintManager#enabled} property overrides the visibility. + */ + showFocusPolicy:yfiles.model.ShowFocusPolicy; + /** + * Gets or sets a value indicating whether the {@link yfiles.canvas.CanvasControl container} + * this manager is installed in currently is focused. + * Value: + * true if the container is currently focused; otherwise, false. + * Depending on the {@link yfiles.model.FocusPaintManager#showFocusPolicy}, this will influence the visibility of the rendering. + */ + focused:boolean; + /** + * Called when the {@link yfiles.model.FocusPaintManager#focused} property has changed. + * @see {@link yfiles.model.FocusPaintManager#focused} + */ + onFocusedChanged():void; + /** + * Callback method that is triggered when the focused item has changed. + * This method raises the {@link yfiles.model.FocusPaintManager#addPropertyChangedListener PropertyChanged} event. + * Subclasses overriding this method should make sure to invoke the + * super class implementation. + * @param {yfiles.system.PropertyChangedEventArgs} args a description of the event + * @see {@link yfiles.model.FocusPaintManager#focusedItem} + * @see {@link yfiles.model.FocusPaintManager#addPropertyChangedListener PropertyChanged} + */ + onPropertyChanged(args:yfiles.system.PropertyChangedEventArgs):void; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:T):void; + /** + * Factory method that creates the installer context. + * This implementation sets the {@link yfiles.model.InstallerContext#canvasObjectGroup} + * property to the value returned by the {@link yfiles.model.InstallerBasedModelManager#groupProvider}. + * Also the {@link yfiles.model.FocusPaintManager#inputModeContext} is added to the {@link yfiles.support.ILookup#lookup}. + * @param {T} member The item to create the context for. + * @return {yfiles.model.InstallerContext} A new instance. + * @see Overrides {@link yfiles.model.InstallerBasedModelManager#createInstallerContext} + */ + createInstallerContext(member:T):yfiles.model.InstallerContext; + /** + * Callback used by {@link yfiles.model.FocusPaintManager#install} to retrieve the installer for a given item. + * This implementation uses the {@link yfiles.support.ILookup#lookup} of the item. + * @param {T} item The item to find an installer for. + * @return {yfiles.input.IFocusIndicatorInstaller} An installer or null + */ + getFocusIndicatorInstaller(item:T):yfiles.input.IFocusIndicatorInstaller; + } + var FocusPaintManager:{ + $class:yfiles.lang.Class; + /** + * Creates a manager for the given input mode, reusing it's canvas and input mode context. + * @param {yfiles.input.AbstractInputMode} inputMode The input mode to use. + */ + FromInputMode:{ + new (inputMode:yfiles.input.AbstractInputMode):yfiles.model.FocusPaintManager; + }; + /** + * Creates an instance that for all selected items in the model dynamically + * installs a selection paint decoration. + * @param {yfiles.canvas.CanvasControl} canvas The canvas to add the selection marks to. + */ + FromCanvas:{ + new (canvas:yfiles.canvas.CanvasControl):yfiles.model.FocusPaintManager; + }; + }; + /** + * A {@link yfiles.model.ModelManager} implementation that manages the + * visual decorations of highlighted elements in a canvas. + * For each item that should be highlighted this class uses the {@link yfiles.support.ILookup} mechanism of + * the items to lookup an {@link yfiles.input.IHighlightInstaller} + * implementation which will do the actual installation of the decoration in the canvas. + */ + export interface HighlightPaintManager extends yfiles.model.InstallerBasedModelManager,yfiles.model.IModelItemInstaller{ + /** + * Gets or sets a value indicating whether this {@link yfiles.model.HighlightPaintManager} is enabled. + * If the manager is disabled, it will not install the {@link yfiles.canvas.ICanvasObject}s into + * the associated {@link yfiles.canvas.CanvasControl}. + * Value: true if enabled; otherwise, false. + */ + enabled:boolean; + /** + * Called when this mode gets {@link yfiles.model.HighlightPaintManager#enabled disabled}. + */ + onDisabled():void; + /** + * Called when this mode gets {@link yfiles.model.HighlightPaintManager#enabled enabled}. + */ + onEnabled():void; + /** + * Gets or sets the {@link yfiles.input.IInputModeContext} to use for this instance. + * The value returned will be available via the lookup of + * {@link yfiles.model.IInstallerContext} passed to the {@link yfiles.model.IModelItemInstaller#install} + * method. + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Gets or sets the selection model that determines which items are highlighted. + * May be null, in which case no elements are considered highlighted. + */ + selectionModel:yfiles.model.ISelectionModel; + /** + * Removes the provided item from this managers set of managed items. + * @param {T} item The item to remove. + * @see {@link yfiles.model.HighlightPaintManager#removeHighlight} + */ + remove(item:T):void; + /** + * Removes all highlights. + */ + clearHighlights():void; + /** + * Adds another highlight. + * @param {T} item The item to highlight. + */ + addHighlight(item:T):void; + /** + * Removes an item from the current highlight selection. + * @param {T} item The item whose highlight decorator will be removed. + */ + removeHighlight(item:T):void; + /** + * Adds an item to the current highlight selection. + * @param {T} item The item whose highlight decorator will added. + */ + addSelection(item:T):yfiles.model.IModelItemDescriptor; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:T):void; + /** + * Factory method that creates the installer context. + * This implementation sets the {@link yfiles.model.InstallerContext#canvasObjectGroup} + * property to the value returned by the {@link yfiles.model.InstallerBasedModelManager#groupProvider}. + * Also the {@link yfiles.model.HighlightPaintManager#inputModeContext} is added to the {@link yfiles.support.ILookup#lookup}. + * @param {T} member The item to create the context for. + * @return {yfiles.model.InstallerContext} A new instance. + * @see Overrides {@link yfiles.model.InstallerBasedModelManager#createInstallerContext} + */ + createInstallerContext(member:T):yfiles.model.InstallerContext; + /** + * Callback used by {@link yfiles.model.HighlightPaintManager#install} to retrieve the installer for a given item. + * This implementation uses the {@link yfiles.support.ILookup#lookup} of the item. + * @param {T} item The item to find an installer for. + * @return {yfiles.input.IHighlightInstaller} An installer or null + */ + getHighlightInstaller(item:T):yfiles.input.IHighlightInstaller; + } + var HighlightPaintManager:{ + $class:yfiles.lang.Class; + /** + * Creates a manager for the given input mode, reusing it's canvas and input mode context. + * @param {yfiles.input.AbstractInputMode} inputMode The input mode to use. + */ + FromInputMode:{ + new (inputMode:yfiles.input.AbstractInputMode):yfiles.model.HighlightPaintManager; + }; + /** + * Creates a manager for the given control. + * @param {yfiles.canvas.CanvasControl} canvas The canvas to install the highlights into. + */ + FromCanvas:{ + new (canvas:yfiles.canvas.CanvasControl):yfiles.model.HighlightPaintManager; + }; + /** + * Creates an instance that for all selected items in the model dynamically + * installs a selection paint decoration. + * @param {yfiles.canvas.CanvasControl} canvas The canvas to add the selection marks to. + * @param {yfiles.model.ISelectionModel.} selectionModel The model that determines which items are highlighted. + */ + FromCanvasAndSelectionModel:{ + new (canvas:yfiles.canvas.CanvasControl,selectionModel:yfiles.model.ISelectionModel):yfiles.model.HighlightPaintManager; + }; + }; + /** + * An extension to the {@link yfiles.collections.IEnumerable} interface + * that allows for indexed access and retrieval of the element count. + * This interface is like a rudimentary read-only {@link yfiles.collections.IList} + */ + export interface IListEnumerable extends Object,yfiles.collections.IEnumerable{ + /** + * Returns the number of elements in this collection. + * @see Specified by {@link yfiles.model.IListEnumerable#count}. + */ + count:number; + /** + * Returns the i-th element in the collection. + * @param {number} i the zero-based index of the item in this collection + * @return {T} the item for the given index + * @see Specified by {@link yfiles.model.IListEnumerable#getItem}. + */ + getItem(i:number):T; + } + var IListEnumerable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A simple interface for a typed dictionary-like implementation. + *
+ * Related Information in the Developers Guide: + *

+ * Using IMapper is described in the section + * Binding Data to Graph Elements. + *

+ * @see {@link yfiles.model.DictionaryMapper} + */ + export interface IMapper extends Object{ + /** + * Finds the associated value for the given key in the mapping or + * (re-)associates the given key with the value provided, removing previous associations. + * In order to remove an association the {@link yfiles.model.IMapper#removeItem} method should be + * preferred over calling this method using a default value. + * @param {K} key The key to use as the index. + * @see {@link yfiles.model.IMapper#removeItem} + * @see Specified by {@link yfiles.model.IMapper#getItem}. + */ + getItem(key:K):V; + /** + * Finds the associated value for the given key in the mapping or + * (re-)associates the given key with the value provided, removing previous associations. + * In order to remove an association the {@link yfiles.model.IMapper#removeItem} method should be + * preferred over calling this method using a default value. + * @param {K} key The key to use as the index. + * @see {@link yfiles.model.IMapper#removeItem} + * @see Specified by {@link yfiles.model.IMapper#getItem}. + */ + setItem(key:K,value:V):void; + /** + * Removes a previously created association with the given key. + * @param {K} key The key to remove from the mapping. + * @see Specified by {@link yfiles.model.IMapper#removeItem}. + */ + removeItem(key:K):void; + } + var IMapper:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Wraps a simple {@link yfiles.collections.IEnumerable} + * into a {@link yfiles.model.IListEnumerable}. + * This implementation is optimized for {@link yfiles.collections.IList} + * and {@link yfiles.collections.ICollection}, as well as {@link Object} + * {@link yfiles.collections.IEnumerable}s. + */ + export interface ListEnumerable extends Object,yfiles.model.IListEnumerable{ + /** + * Gets the backing enumerable. + * Value: The backing enumerable. + */ + backingEnumerable:yfiles.collections.IEnumerable; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Returns the number of elements in this collection. + * @see Specified by {@link yfiles.model.IListEnumerable#count}. + */ + count:number; + /** + * Returns the i-th element in the collection. + * @param {number} i the zero-based index of the item in this collection + * @return {T} the item for the given index + * @see Specified by {@link yfiles.model.IListEnumerable#getItem}. + */ + getItem(i:number):T; + } + var ListEnumerable:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with a backing {@link yfiles.collections.List} + * as the backing store. + */ + new ():yfiles.model.ListEnumerable; + /** + * Creates a new instance using the given backing enumerable. + * @param {yfiles.collections.IEnumerable.} backingEnumerable The enumerable to back this instance. + */ + FromEnumerable:{ + new (backingEnumerable:yfiles.collections.IEnumerable):yfiles.model.ListEnumerable; + }; + }; + /** + * Event argument class used by {@link yfiles.model.ICollectionModel} and + * similar that holds a specific item that is related to the event. + */ + export interface ItemEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the item that is the subject of the event. + */ + item:T; + } + var ItemEventArgs:{ + $class:yfiles.lang.Class; + /** + * Creates a new event argument for the given item. + * @param {T} item The item which is the subject of the event. + */ + new (item:T):yfiles.model.ItemEventArgs; + }; + export enum ShowFocusPolicy{ + /** + * Indicates that irrespectively of the keyboard focus, the focus should always be + * rendered for the {@link yfiles.model.FocusPaintManager#focusedItem}. + */ + ALWAYS, + /** + * Indicates that depending on the value of {@link yfiles.model.FocusPaintManager#focused}the focus should only be + * rendered if this property is set to true. + */ + WHEN_FOCUSED + } + /** + * An implementation of the {@link yfiles.model.ModelManager} class + * that automatically installs, updates and removes visual representations + * of items in a {@link yfiles.model.ICollectionModel}. + */ + export interface CollectionModelManager extends yfiles.model.InstallerBasedModelManager{ + /** + * Gets or sets a value indicating whether this {@link yfiles.model.CollectionModelManager} is enabled. + * If the manager is disabled, it will not install the {@link yfiles.canvas.ICanvasObject}s into + * the associated {@link yfiles.canvas.CanvasControl}. + * Value: true if enabled; otherwise, false. + */ + enabled:boolean; + /** + * Called when this mode gets {@link yfiles.model.CollectionModelManager#enabled disabled}. + */ + onDisabled():void; + /** + * Called when this mode gets {@link yfiles.model.CollectionModelManager#enabled enabled}. + */ + onEnabled():void; + /** + * Gets or sets the model of the items to display in the canvas. + * Setting the model will automatically remove the items installed for a previously installed + * model. Also the items contained in the new model will immediately be queried and + * installed into the canvas. + */ + collectionModel:yfiles.model.ICollectionModel; + /** + * Retrieves the main canvas object that has been registered for the given item + * or null. + * This implementation treats the first element in the array of canvas objects + * installed into the canvas for the item as the main object. + * @param {T} item The item to retrieve "the" canvas object for. + * @return {yfiles.canvas.ICanvasObject} A canvas object instance or null. + * @see {@link yfiles.model.ModelManager#installMember} + */ + getCanvasObject(item:T):yfiles.canvas.ICanvasObject; + /** + * This method may be called to update the visual representation of the given + * item. + * This will trigger a call to {@link yfiles.model.ModelManager#updateDescriptor} for the descriptor + * associated with the item. If there is no descriptor {@link yfiles.model.ModelManager#add} will + * be called. + * @param {T} item The item to update. + */ + update(item:T):void; + /** + * This method can be called to {@link yfiles.canvas.ICanvasObject#invalidate invalidate} + * the {@link yfiles.canvas.ICanvasObject}s that make up the visual representation of the given item. + * This will trigger a call to {@link yfiles.model.CollectionModelManager#invalidateDescriptor}. + * @param {T} item The item to invalidate the visual representation of. + */ + invalidate(item:T):void; + /** + * Callback used by {@link yfiles.model.CollectionModelManager#invalidate} to actually perform the {@link yfiles.canvas.ICanvasObject#invalidate} + * calls for the given descriptor. + * @param {yfiles.model.IModelItemDescriptor.} descriptor The descriptor to invalidate the canvas objects for. + */ + invalidateDescriptor(descriptor:yfiles.model.IModelItemDescriptor):void; + /** + * Obtains the descriptor associated with the given item using the + * internal mapper. + * @param {T} item The item to retrieve the descriptor handle for. + * @return {yfiles.model.IModelItemDescriptor.} The descriptor or null. + */ + getDescriptor(item:T):yfiles.model.IModelItemDescriptor; + /** + * Tries to find the item managed by this instance that is associated with + * the given canvas object. + * @param {yfiles.canvas.ICanvasObject} forObject The canvas object to query the corresponding model item for. + * @return {T} The item or null if no such item could be found. + */ + getItem(forObject:yfiles.canvas.ICanvasObject):T; + } + var CollectionModelManager:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance for the given canvas using the mapper to efficiently + * associate internal state for each item in the collection. + * @param {yfiles.canvas.CanvasControl} canvas The canvas to manage. + * @param {yfiles.model.IMapper.} mapper The mapper to use for mapping internal state. + * @see {@link yfiles.model.CollectionModelManager#collectionModel} + */ + FromCanvasAndMapper:{ + new (itemType:yfiles.lang.Class,canvas:yfiles.canvas.CanvasControl,mapper:yfiles.model.IMapper):yfiles.model.CollectionModelManager; + }; + /** + * Creates a new instance for the given canvas and collection using + * a simple {@link yfiles.model.DictionaryMapper} to + * associate internal state for each item in the collection. + * @param {yfiles.canvas.CanvasControl} canvas The canvas to manage. + * @param {yfiles.model.ICollectionModel.} model The model to manage. + * @see {@link yfiles.model.CollectionModelManager#collectionModel} + */ + FromCanvasAndModel:{ + new (itemType:yfiles.lang.Class,canvas:yfiles.canvas.CanvasControl,model:yfiles.model.ICollectionModel):yfiles.model.CollectionModelManager; + }; + /** + * Creates a new instance for the given canvas using the mapper to efficiently + * associate internal state for each item in the model. + * @param {yfiles.canvas.CanvasControl} canvas The canvas to manage. + * @param {yfiles.model.IMapper.} mapper The mapper to use for mapping internal state. + * @param {yfiles.model.ICollectionModel.} model The model to manage. + */ + FromCanvasModelAndMapper:{ + new (itemType:yfiles.lang.Class,canvas:yfiles.canvas.CanvasControl,model:yfiles.model.ICollectionModel,mapper:yfiles.model.IMapper):yfiles.model.CollectionModelManager; + }; + /** + * Creates an instance for the given canvas. + * @param {yfiles.canvas.CanvasControl} canvas The canvas to manage. + * @see {@link yfiles.model.CollectionModelManager#collectionModel} + */ + FromCanvas:{ + new (itemType:yfiles.lang.Class,canvas:yfiles.canvas.CanvasControl):yfiles.model.CollectionModelManager; + }; + }; + /** + * An implementation of the {@link yfiles.model.ModelManager} class + * that automatically installs, updates and removes visual representations + * of items in a {@link yfiles.model.ICollectionModel}. + */ + export interface InstallerBasedModelManager extends yfiles.model.ModelManager{ + /** + * Gets or sets the group provider that will be used in {@link yfiles.model.InstallerBasedModelManager#createInstallerContext} + * to determine the canvas group where the item should be installed into. + * By default this is an instance of {@link yfiles.model.CanvasGroupProviders#createTopGroupProvider}. + * Value: The group provider instance. + */ + groupProvider:yfiles.model.ICanvasGroupProvider; + /** + * Factory method that creates the installer context. + * @param {T} forItem The item to create the context for. + * @return {yfiles.model.InstallerContext} A new instance. + */ + createInstallerContext(forItem:T):yfiles.model.InstallerContext; + /** + * Adds an item installer to the list of installers that will be queried + * during an {@link yfiles.model.InstallerBasedModelManager#installMember} call. + * @param {yfiles.model.IModelItemInstaller.} installer An installer that is capable of installing + * an item of type T into the canvas. + */ + addInstaller(installer:yfiles.model.IModelItemInstaller):void; + /** + * Removes a previously registered installer from the list of installers. + * @param {yfiles.model.IModelItemInstaller.} installer The installer to remove. + */ + removeInstaller(installer:yfiles.model.IModelItemInstaller):void; + /** + * Effectively installs a member of the collection into the canvas + * using the internally held list of installers. + * @param {T} member The member to install. + * @return {yfiles.collections.IList.} The canvas objects that have been returned by the installers. + * @see Overrides {@link yfiles.model.ModelManager#installMember} + */ + installMember(member:T):yfiles.collections.IList; + } + var InstallerBasedModelManager:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance for the given canvas using the mapper to efficiently + * associate internal state for each item in the collection. + * @param {yfiles.canvas.CanvasControl} canvas The canvas to manage. + */ + new (canvas:yfiles.canvas.CanvasControl):yfiles.model.InstallerBasedModelManager; + }; + /** + * The interface that is used by {@link yfiles.model.BridgeManager} + * to {@link yfiles.model.BridgeManager#addObstacleProvider add obstacles} + * to list of obstacles that need to be taken into account during rendering. + * Typically the {@link yfiles.support.ILookup} context of styles + * will yield an implementation of this interface. + */ + export interface IObstacleProvider extends Object{ + /** + * Yield the obstacles that the item that provided this instance + * would add to the scene for the given {@link yfiles.drawing.IRenderContext}. + * The implementation should only yield a non-null + * {@link yfiles.drawing.GeneralPath} if it may be {@link yfiles.drawing.IVisibilityTest#isVisible visible} + * in the provided {@link yfiles.drawing.IRenderContext#clip}. + * @param {yfiles.drawing.IRenderContext} canvasContext The context for which the obstacles are queried. + * @return {yfiles.drawing.GeneralPath} A path that describes the obstacles or null if there + * are no obstacles for the given context. + * @see Specified by {@link yfiles.model.IObstacleProvider#getObstacles}. + */ + getObstacles(canvasContext:yfiles.drawing.IRenderContext):yfiles.drawing.GeneralPath; + } + var IObstacleProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Static utility class that provides simple factory methods for {@link yfiles.model.ICanvasGroupProvider} + * convenience implementations. + */ + export interface CanvasGroupProviders extends Object{ + } + var CanvasGroupProviders:{ + $class:yfiles.lang.Class; + /** + * Creates and returns an instance that always returns the provided group. + * The instance returned can be used for the canvas control the group has been + * created for only. + * @param {yfiles.canvas.ICanvasObjectGroup} group The group instance to return. + * @return {yfiles.model.ICanvasGroupProvider.} A group provider that always returns the group instance. + */ + createConstant(group:yfiles.canvas.ICanvasObjectGroup):yfiles.model.ICanvasGroupProvider; + /** + * Creates and returns an instance that will always return the root canvas group + * for the canvas it will be queried. + * The instance returned can be used for any canvas control. + * @return {yfiles.model.ICanvasGroupProvider.} + */ + createRootProvider():yfiles.model.ICanvasGroupProvider; + /** + * Creates and returns an instance that will always return the topmost canvas group + * for the canvas it will be queried. + * The instance returned can be used for any canvas control. + * @return {yfiles.model.ICanvasGroupProvider.} A provider that returns the top most group. + */ + createTopGroupProvider():yfiles.model.ICanvasGroupProvider; + /** + * Creates and returns an instance that will always return the bottom-most canvas group + * for the canvas it will be queried. + * The instance returned can be used for any canvas control. + * @return {yfiles.model.ICanvasGroupProvider.} A provider that returns the group that is closest to the back. + */ + createBackgroundGroupProvider():yfiles.model.ICanvasGroupProvider; + }; + /** + * Static utility class that provides simple factory methods for {@link yfiles.model.ICanvasGroupProvider} + * convenience implementations. + */ + export interface DefaultCanvasGroupProvider extends Object{ + } + var DefaultCanvasGroupProvider:{ + $class:yfiles.lang.Class; + /** + * Creates and returns an instance that always returns the provided group. + * The instance returned can be used for the canvas control the group has been + * created for only. + * @param {yfiles.canvas.ICanvasObjectGroup} group The group instance to return. + * @return {yfiles.model.ICanvasGroupProvider.} A group provider that always returns the group instance. + */ + createConstant(group:yfiles.canvas.ICanvasObjectGroup):yfiles.model.ICanvasGroupProvider; + /** + * Creates and returns an instance that will always return the root canvas group + * for the canvas it will be queried. + * The instance returned can be used for any canvas control. + * @return {yfiles.model.ICanvasGroupProvider.} + */ + createRootProvider():yfiles.model.ICanvasGroupProvider; + }; + /** + * An {@link yfiles.collections.IDictionary} based implementation of an {@link yfiles.model.IMapper} + * that can handle null and other default-value keys gracefully. + */ + export interface DictionaryMapper extends Object,yfiles.model.IMapper{ + /** + * Yields and enumerable over all entries in this (dictionary based) mapper. + */ + entries:yfiles.collections.IEnumerable>; + /** + * Gets or sets the default value to return if no specific value has been set for + * a given key. + */ + defaultValue:V; + /** + * Calls {@link yfiles.collections.Dictionary#clear} on the backing implementation. + */ + clear():void; + /** + * Removes a previously created association with the given key. + * @param {K} key The key to remove from the mapping. + * @see Specified by {@link yfiles.model.IMapper#removeItem}. + */ + removeItem(item:K):void; + /** + * Finds the associated value for the given key in the mapping or + * (re-)associates the given key with the value provided, removing previous associations. + * In order to remove an association the {@link yfiles.model.DictionaryMapper#removeItem} method should be + * preferred over calling this method using a default value. + * @param {K} key The key to use as the index. + * @see {@link yfiles.model.DictionaryMapper#removeItem} + * @see Specified by {@link yfiles.model.IMapper#getItem}. + */ + getItem(key:K):V; + /** + * Finds the associated value for the given key in the mapping or + * (re-)associates the given key with the value provided, removing previous associations. + * In order to remove an association the {@link yfiles.model.DictionaryMapper#removeItem} method should be + * preferred over calling this method using a default value. + * @param {K} key The key to use as the index. + * @see {@link yfiles.model.DictionaryMapper#removeItem} + * @see Specified by {@link yfiles.model.IMapper#getItem}. + */ + setItem(key:K,value:V):void; + } + var DictionaryMapper:{ + $class:yfiles.lang.Class; + /** + * Creates an instance using a {@link yfiles.collections.Dictionary} as the backing + * store. + * The value for the null item is stored separately. + */ + new ():yfiles.model.DictionaryMapper; + /** + * Creates an instance using the provided {@link yfiles.collections.Dictionary} as the backing + * store. + * The value for the null item is stored separately. + */ + WithDictionary:{ + new (dictionary:yfiles.collections.IDictionary):yfiles.model.DictionaryMapper; + }; + }; + /** + * An {@link yfiles.collections.IDictionary} based implementation of an {@link yfiles.model.IMapper} + * that can handle null keys gracefully and uses weak keys. + */ + export interface WeakDictionaryMapper extends Object,yfiles.model.IMapper{ + /** + * Gets or sets the default value to return if no specific value has been set for + * a given key. + */ + defaultValue:V; + /** + * Determines whether this mapper is currently backed by an empty dictionary. + */ + empty:boolean; + /** + * Calls {@link yfiles.collections.Dictionary#clear} on the backing implementation. + */ + clear():void; + /** + * Removes a previously created association with the given key. + * @param {K} key The key to remove from the mapping. + * @see Specified by {@link yfiles.model.IMapper#removeItem}. + */ + removeItem(item:K):void; + /** + * Finds the associated value for the given key in the mapping or + * (re-)associates the given key with the value provided, removing previous associations. + * In order to remove an association the {@link yfiles.model.WeakDictionaryMapper#removeItem} method should be + * preferred over calling this method using a default value. + * This implementation simply delegates to {@link yfiles.model.WeakDictionaryMapper#$setValue} + * and {@link yfiles.model.WeakDictionaryMapper#$getValue} respectively. + * @param {K} key The key to use as the index. + * @see {@link yfiles.model.WeakDictionaryMapper#removeItem} + * @see {@link yfiles.model.WeakDictionaryMapper#$getValue} + * @see {@link yfiles.model.WeakDictionaryMapper#$setValue} + * @see Specified by {@link yfiles.model.IMapper#getItem}. + */ + getItem(key:K):V; + /** + * Finds the associated value for the given key in the mapping or + * (re-)associates the given key with the value provided, removing previous associations. + * In order to remove an association the {@link yfiles.model.WeakDictionaryMapper#removeItem} method should be + * preferred over calling this method using a default value. + * This implementation simply delegates to {@link yfiles.model.WeakDictionaryMapper#$setValue} + * and {@link yfiles.model.WeakDictionaryMapper#$getValue} respectively. + * @param {K} key The key to use as the index. + * @see {@link yfiles.model.WeakDictionaryMapper#removeItem} + * @see {@link yfiles.model.WeakDictionaryMapper#$getValue} + * @see {@link yfiles.model.WeakDictionaryMapper#$setValue} + * @see Specified by {@link yfiles.model.IMapper#getItem}. + */ + setItem(key:K,value:V):void; + } + var WeakDictionaryMapper:{ + $class:yfiles.lang.Class; + /** + * Creates an instance using a {@link yfiles.collections.Dictionary} as the backing + * store. + * The value for the null item is stored separately. + */ + new ():yfiles.model.WeakDictionaryMapper; + }; + /** + * A simple default implementation of an {@link yfiles.model.ICollectionModel} + * that is backed by an ordinary {@link yfiles.collections.ICollection}. + */ + export interface DefaultCollectionModel extends Object,yfiles.model.ICollectionModel{ + /** + * Adds the item the the collection and triggers the {@link yfiles.model.DefaultCollectionModel#addItemAddedListener ItemAdded} + * event. + * This implementation calls the {@link yfiles.model.DefaultCollectionModel#onItemAdded} method. + * @param {T} item The item to add to the collection. + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:T):void; + /** + * Clears this collection, triggering an {@link yfiles.model.DefaultCollectionModel#addItemRemovedListener ItemRemoved} + * event for each element removed. + * @see {@link yfiles.model.DefaultCollectionModel#onItemRemoved} + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Checks for containment of the item in this collection. + * @param {T} item The item to check. + * @return {boolean} Whether the item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:T):boolean; + /** + * Copies the items to the given array. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:T[],arrayIndex:number):void; + /** + * Tries to remove the item from the collection and triggers the + * {@link yfiles.model.DefaultCollectionModel#addItemRemovedListener ItemRemoved} event. + * @param {T} item The item to remove. + * @return {boolean} Whether the item has been removed. + * @see {@link yfiles.model.DefaultCollectionModel#onItemRemoved} + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:T):boolean; + /** + * Returns the number of elements in this collection. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * Checks whether this collection is read only. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Returns an enumerator over the elements in this collection. + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Returns an enumerator over the elements in this collection. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Returns the collection used internally as the backing store. + * Normally code should not use this method to gain access to the + * collection in order to modify it. + * @return {yfiles.collections.ICollection.} The backing store of this collection model. + */ + getItems():yfiles.collections.ICollection; + /** + * Method that may be called by client code to trigger an {@link yfiles.model.DefaultCollectionModel#addItemChangedListener ItemChanged} + * event. + * @param {T} item The item to trigger the change event for. + * @see {@link yfiles.model.DefaultCollectionModel#onItemChanged} + */ + publishItemChanged(item:T):void; + /** + * Callback method that will trigger the {@link yfiles.model.DefaultCollectionModel#addItemChangedListener ItemChanged} + * event. + * @param {T} item The item that has changed. + */ + onItemChanged(item:T):void; + /** + * Callback method that will trigger the {@link yfiles.model.DefaultCollectionModel#addItemRemovedListener ItemRemoved} + * event. + * @param {T} item The item that has just been removed from the collection. + */ + onItemRemoved(item:T):void; + /** + * Callback method that will trigger the {@link yfiles.model.DefaultCollectionModel#addItemAddedListener ItemAdded} + * event. + * @param {T} item The item that has just been added to the collection. + */ + onItemAdded(item:T):void; + /** + * Event that will be triggered if an item has been added to this collection. + */ + addItemAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been added to this collection. + */ + removeItemAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been removed from this collection. + */ + addItemRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been removed from this collection. + */ + removeItemRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been changed inside this collection. + */ + addItemChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Event that will be triggered if an item has been changed inside this collection. + */ + removeItemChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + toString():string; + } + var DefaultCollectionModel:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using a {@link yfiles.collections.List} + * as the backing store. + */ + new ():yfiles.model.DefaultCollectionModel; + /** + * Creates a new instance using a provided collection + * as the backing store. + */ + FromBackingCollection:{ + new (items:yfiles.collections.ICollection):yfiles.model.DefaultCollectionModel; + }; + }; + /** + * Default implementation of an {@link yfiles.model.ISelectionModel} that + * is based on a second collection model to hold the selected elements. + */ + export interface DefaultSelectionModel extends Object,yfiles.model.ISelectionModel{ + /** + * Gets or sets the domain of the selection model. + * The domain describes items that can possibly be selected. + * This implementation automatically deselects items that get removed + * from the domain. + */ + domain:yfiles.model.ICollectionModel; + /** + * Provides a collection model view over the selected items. + */ + selection:yfiles.model.ICollectionModel; + /** + * Determines whether an item is selected by checking for the containment + * in the {@link yfiles.model.DefaultSelectionModel#selection}. + * @param {T} o The item to check + * @return {boolean} Whether the item is selected. + * @see Specified by {@link yfiles.model.ISelectionModel#isSelected}. + */ + isSelected(o:T):boolean; + /** + * Sets the selection state of the item. + * @see Specified by {@link yfiles.model.ISelectionModel#setSelected}. + */ + setSelected(o:T,selected:boolean):void; + /** + * Called when an item gets deselected. + * Triggers the {@link yfiles.model.DefaultSelectionModel#addItemDeselectedListener ItemDeselected} event. + * @param {T} o The item. + */ + onItemDeselected(o:T):void; + /** + * Called when an item gets selected. + * Triggers the {@link yfiles.model.DefaultSelectionModel#addItemSelectedListener ItemSelected} event. + * @param {T} o The item. + */ + onItemSelected(o:T):void; + /** + * Returns the number of selected items. + * @see Specified by {@link yfiles.model.ISelectionModel#count}. + */ + count:number; + /** + * Clears the selection. + * This is a convenience method that will set the selection state of all elements to + * unselected. + * @see {@link yfiles.model.ISelectionModel#addItemDeselectedListener ItemDeselected} + * @see Specified by {@link yfiles.model.ISelectionModel#clear}. + */ + clear():void; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * An event that will be triggered if an item changed its selection state from + * unselected to selected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + addItemSelectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * unselected to selected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + removeItemSelectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * selected to unselected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + addItemDeselectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * selected to unselected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + removeItemDeselectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + } + var DefaultSelectionModel:{ + $class:yfiles.lang.Class; + /** + * Creates a default selection model implementation that uses a {@link yfiles.model.DefaultCollectionModel} + * to hold the selection. + */ + new ():yfiles.model.DefaultSelectionModel; + }; + /** + * Utility class that provides convenience methods related to {@link yfiles.model.IMapper}. + */ + export interface Mappers extends Object{ + } + var Mappers:{ + $class:yfiles.lang.Class; + /** + * Create an implementation of {@link yfiles.model.IMapper} that delegates {@link yfiles.model.IMapper#getItem} getter calls to + * the provided handler. + * The implementation returned silently ignores calls to the {@link yfiles.model.IMapper#getItem} setter and + * {@link yfiles.model.IMapper#removeItem}. + * @param {function(K):V} mapperDelegate The delegate to delegate {@link yfiles.model.IMapper#getItem} getter calls to. + * @return {yfiles.model.IMapper.} An implementation that delegates to mapperDelegate. + */ + createMapper(mapperDelegate:(key:K)=>V):yfiles.model.IMapper; + /** + * Creates a constant mapper that will always return the constant. + * @param {V} constant The constant to return in {@link yfiles.model.IMapper#getItem} + * @return {yfiles.model.IMapper.} A new instance that will always return the same constant. + */ + createConstant(constant:V):yfiles.model.IMapper; + }; + /** + * Callback used by {@link yfiles.model.BridgeManager} + * to {@link yfiles.model.BridgeManager#addBridges add bridges} + * to a {@link yfiles.drawing.GeneralPath}. + * @see {@link yfiles.model.BridgeManager} + */ + export interface IAddBridgesCallback extends Object{ + /** + * Gets the {@link yfiles.model.CrossingStyle} to use in the given {@link yfiles.drawing.IRenderContext}. + * @param {yfiles.drawing.IRenderContext} context The context in which the crossing will be used. + * @return {yfiles.model.CrossingStyle} The style to use, or {@link yfiles.model.CrossingStyle#CUSTOM} in order + * to let {@link yfiles.model.BridgeManager} call {@link yfiles.model.IAddBridgesCallback#insertCustomBridge}. + * @see Specified by {@link yfiles.model.IAddBridgesCallback#getCrossingStyle}. + */ + getCrossingStyle(context:yfiles.drawing.IRenderContext):yfiles.model.CrossingStyle; + /** + * Gets the {@link yfiles.model.BridgeOrientationStyle} to use in the given {@link yfiles.drawing.IRenderContext}. + * @param {yfiles.drawing.IRenderContext} context The context in which the style will be used.. + * @return {yfiles.model.BridgeOrientationStyle} The style to use. Any value can be returned and will be ignored if the + * {@link yfiles.model.IAddBridgesCallback#getCrossingStyle crossing style} is set to {@link yfiles.model.CrossingStyle#CUSTOM}. + * @see Specified by {@link yfiles.model.IAddBridgesCallback#getOrientationStyle}. + */ + getOrientationStyle(context:yfiles.drawing.IRenderContext):yfiles.model.BridgeOrientationStyle; + /** + * Gets the width of the bridge for the given {@link yfiles.drawing.IRenderContext}. + * The width is the preferred length of the segment that will be removed from + * the original segment if it crosses an obstacle. + * That bridge will be made larger if multiple obstacle bridges would otherwise + * overlap. The bridge will be automatically made smaller if it happens to be near the end + * of a segment and would otherwise extend beyond the end of the segment. + * @param {yfiles.drawing.IRenderContext} context The context where the bridge will be created for. + * @return {number} The positive preferred width of the bridge. + * @see Specified by {@link yfiles.model.IAddBridgesCallback#getBridgeWidth}. + */ + getBridgeWidth(context:yfiles.drawing.IRenderContext):number; + /** + * Gets the height of the bridge for the given {@link yfiles.drawing.IRenderContext}. + * The height is the default height that will be used for drawing the + * non-{@link yfiles.model.CrossingStyle#CUSTOM custom} {@link yfiles.model.CrossingStyle}s. + * @param {yfiles.drawing.IRenderContext} context The context where the bridge will be created for. + * @return {number} The non-negative preferred basic unscaled height of the bridge. + * @see Specified by {@link yfiles.model.IAddBridgesCallback#getBridgeHeight}. + */ + getBridgeHeight(context:yfiles.drawing.IRenderContext):number; + /** + * Callback that will be used by the {@link yfiles.model.BridgeManager} if the + * {@link yfiles.model.IAddBridgesCallback#getCrossingStyle} method yields {@link yfiles.model.CrossingStyle#CUSTOM} + * to actually insert a bridge into the given {@link yfiles.drawing.GeneralPath}. + * When this method is called the {@link yfiles.drawing.GeneralPath}'s + * {@link yfiles.drawing.GeneralPath#lastCoordinate last} + * coordinates are not yet at startPoint. + * So most implementation should first {@link yfiles.drawing.GeneralPath#moveTo} + * that location. + * Also at the end of the call, implementation should make sure that the GeneralPath's + * end is at endPoint. + * The gapLength is provided for convenience so that + * the distance between startPoint and endPoint does not need to be calculated if it is + * needed for the drawing. + * @param {yfiles.drawing.IRenderContext} context The context for the call. + * @param {yfiles.drawing.GeneralPath} path The path to append the bridge segment to. + * @param {yfiles.geometry.PointD} startPoint The coordinates of the starting point of the bridge. + * @param {yfiles.geometry.PointD} endPoint The coordinates of the ending point of the bridge. + * @param {number} gapLength The distance between the starting point and the end point. + * @see Specified by {@link yfiles.model.IAddBridgesCallback#insertCustomBridge}. + */ + insertCustomBridge(context:yfiles.drawing.IRenderContext,path:yfiles.drawing.GeneralPath,startPoint:yfiles.geometry.PointD,endPoint:yfiles.geometry.PointD,gapLength:number):void; + } + var IAddBridgesCallback:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Helper managing class that can be used in conjunction with {@link yfiles.model.BridgeManager#canvasControl} + * instances to manage the calculation of bridges for paths over obstacles. + * This class will typically be used to {@link yfiles.canvas.CanvasControl#addPrepareRenderContextListener prepare} + * the {@link yfiles.drawing.IRenderContext} for rendering in a {@link yfiles.canvas.CanvasControl}. + * Setting the {@link yfiles.model.BridgeManager#canvasControl} property to a non-null value + * will register this class for the preparation of the context. It will make itself + * available via the {@link yfiles.support.ILookup#lookup} mechanism in the {@link yfiles.drawing.IRenderContext}. + * During the creation of the visuals, this instance can be queried and the + * {@link yfiles.model.BridgeManager#addBridges} method can be used to calculate bridges for a {@link yfiles.drawing.GeneralPath}. + * Initially {@link yfiles.model.IObstacleProvider} instances need to be registered with + * this instance via the {@link yfiles.model.BridgeManager#addObstacleProvider} instance so that crossings + * can be later determined between the path and the obstacles. + */ + export interface BridgeManager extends Object{ + /** + * Gets or sets the default implementation of the {@link yfiles.model.IAddBridgesCallback} + * that will be used if {@link yfiles.model.BridgeManager#addBridges} + * is invoked with a null callback argument. + * @see {@link yfiles.model.BridgeManager#defaultCrossingStyle} + * @see {@link yfiles.model.BridgeManager#defaultBridgeWidth} + * @see {@link yfiles.model.BridgeManager#defaultBridgeHeight} + * @see {@link yfiles.model.BridgeManager#insertDefaultCustomBridge} + */ + defaultCallback:yfiles.model.IAddBridgesCallback; + /** + * Gets or sets a value that determines whether curves + * ({@link yfiles.drawing.GeneralPath#cubicTo cubic} + * and {@link yfiles.drawing.GeneralPath#quadTo quadratic}) should + * be considered as obstacles. + * This can be a costly operation so the default is false. + */ + considerCurves:boolean; + /** + * Gets or sets a threshold value that determines below which zoom level, + * there should be no more bridge calculation. + * Since the calculation of the bridges is a costly operation if there are many + * items visible and bridges are not clearly visible at low zoom levels, it + * is convenient to disable the calculation of bridges for these zoom levels to + * speed up the rendering process. + * The default value is 0.3d. + */ + zoomThreshold:number; + /** + * Gets or sets the {@link yfiles.model.BridgeManager#crossingDetermination} mode + * that is used by this instance. + * By default the {@link yfiles.model.CrossingDetermination#HORIZONTAL_BRIDGES_VERTICAL} + * mode is set. + */ + crossingDetermination:yfiles.model.CrossingDetermination; + /** + * Gets or sets the {@link yfiles.model.BridgeManager#canvasControl} that should be managed + * by this instance. + * This method will {@link yfiles.model.BridgeManager#install} + * a {@link yfiles.canvas.CanvasControl#addPrepareRenderContextListener preparation stage} + * for the {@link yfiles.drawing.IRenderContext} in the provided {@link yfiles.model.BridgeManager#canvasControl} + * via the {@link yfiles.support.ILookup#lookup} mechanism. + */ + canvasControl:yfiles.canvas.CanvasControl; + /** + * Gets or sets the default {@link yfiles.model.CrossingStyle} that will + * be used by the default implementation of the {@link yfiles.model.IAddBridgesCallback} + * that is initially assigned to the {@link yfiles.model.BridgeManager#defaultCallback} property. + * The default value is {@link yfiles.model.CrossingStyle#ARC}. + * @see {@link yfiles.model.IAddBridgesCallback#getCrossingStyle} + */ + defaultCrossingStyle:yfiles.model.CrossingStyle; + /** + * Gets or sets the default width of a bridge that will + * be used by the default implementation of the {@link yfiles.model.IAddBridgesCallback} + * that is initially assigned to the {@link yfiles.model.BridgeManager#defaultCallback} property. + * The default value is 10.0d. Setting this value will + * adjust the {@link yfiles.model.BridgeManager#clipMargin}. + * @see {@link yfiles.model.IAddBridgesCallback#getBridgeWidth} + */ + defaultBridgeWidth:number; + /** + * Gets or sets the margin by which the {@link yfiles.drawing.IRenderContext#clip} + * should be enlarged to accommodate for clipped away lines being taken into + * account for bridge calculation. + * This value should be set to at least half the value of + * {@link yfiles.model.IAddBridgesCallback#getBridgeWidth the width of the bridges} + * used in this context. This is because obstacles might otherwise be clipped + * from the view and not taken into account for the calculation of the bridges. + * By default this value will be 2 more than half of the {@link yfiles.model.BridgeManager#defaultBridgeWidth}. + */ + clipMargin:number; + /** + * Gets or sets the default height of a bridge that will + * be used by the default implementation of the {@link yfiles.model.IAddBridgesCallback} + * that is initially assigned to the {@link yfiles.model.BridgeManager#defaultCallback} property. + * The default value is 5.0d. + * @see {@link yfiles.model.IAddBridgesCallback#getBridgeHeight} + */ + defaultBridgeHeight:number; + /** + * Gets or sets the default {@link yfiles.model.BridgeOrientationStyle} for bridges that will + * be used by the default implementation of the {@link yfiles.model.IAddBridgesCallback} + * that is initially assigned to the {@link yfiles.model.BridgeManager#defaultCallback} property. + * The default is {@link yfiles.model.BridgeOrientationStyle#UP}. + * @see {@link yfiles.model.IAddBridgesCallback#getOrientationStyle} + */ + defaultBridgeOrientationStyle:yfiles.model.BridgeOrientationStyle; + /** + * Disposes of this instance by resetting the {@link yfiles.model.BridgeManager#canvasControl} property + * to null. + */ + dispose():void; + /** + * Adds another pair of an {@link yfiles.model.IObstacleProvider} implementation + * and an item that will later be passed to the {@link yfiles.model.IObstacleProvider#getObstacles} + * method to determine the initial obstacles for this instance. + * The {@link yfiles.model.IObstacleProvider#getObstacles} method will be invoked + * during construction of the obstacles. + * @param {yfiles.model.IObstacleProvider} provider The provider instance to use for later queries. + * @see {@link yfiles.model.BridgeManager#registerObstacles} + * @see {@link yfiles.model.BridgeManager#removeObstacleProvider} + */ + addObstacleProvider(provider:yfiles.model.IObstacleProvider):void; + /** + * Removes a previously {@link yfiles.model.BridgeManager#addObstacleProvider added} + * {@link yfiles.model.IObstacleProvider} from the list of registered providers. + * @param {yfiles.model.IObstacleProvider} provider The provider instance to remove from this instance. + * @see {@link yfiles.model.BridgeManager#addObstacleProvider} + */ + removeObstacleProvider(provider:yfiles.model.IObstacleProvider):void; + /** + * Core method that will add bridges to a {@link yfiles.drawing.GeneralPath} + * using the {@link yfiles.model.IAddBridgesCallback} callback to determine the type of the bridges. + * This method may return path itself if no crossings have been determined. + * Otherwise it will return a new path instance that has the bridges added at the corresponding places. + * @param {yfiles.drawing.IRenderContext} context The context to use. + * @param {yfiles.drawing.GeneralPath} path The path to calculate the bridged variant for. + * @param {yfiles.model.IAddBridgesCallback} callback The callback or null that determines the appearance of the bridges. + * @return {yfiles.drawing.GeneralPath} The path that might have been augmented by the bridges. + */ + addBridges(context:yfiles.drawing.IRenderContext,path:yfiles.drawing.GeneralPath,callback:yfiles.model.IAddBridgesCallback):yfiles.drawing.GeneralPath; + /** + * Called to initialize the context with the obstacles. + * @param {yfiles.drawing.IRenderContext} context The context that will be used to store the obstacles with. + * @see {@link yfiles.model.BridgeManager#registerObstacle} + * @see {@link yfiles.model.BridgeManager#registerObstacleLine} + */ + registerObstacles(context:yfiles.drawing.IRenderContext):void; + /** + * Convenience method that can be called to dynamically register an obstacle + * path with the context during the rendering. + * Normally all obstacles will be registered initially by method {@link yfiles.model.BridgeManager#registerObstacles}. + * This method can be called during the rendering phase to register additional obstacles at + * a later point in time. + * @param {yfiles.drawing.IRenderContext} context The context to register the obstacles with. + * @param {yfiles.drawing.GeneralPath} path The path that describes the obstacles. + * @see {@link yfiles.model.BridgeManager#registerObstacleLine} + */ + registerObstacle(context:yfiles.drawing.IRenderContext,path:yfiles.drawing.GeneralPath):void; + /** + * Convenience method that can be called to dynamically register a single obstacle + * line with the context during the rendering. + * Normally all obstacles will be registered initially by method {@link yfiles.model.BridgeManager#registerObstacles}. + * This method can be called during the rendering phase to register additional obstacles at + * a later point in time. + * @param {yfiles.drawing.IRenderContext} context The context to register the obstacles with. + * @param {yfiles.geometry.PointD} p1 The coordinates of the first point of the line. + * @param {yfiles.geometry.PointD} p2 The coordinates of the second point of the line. + * @see {@link yfiles.model.BridgeManager#registerObstacleLine} + */ + registerObstacleLine(context:yfiles.drawing.IRenderContext,p1:yfiles.geometry.PointD,p2:yfiles.geometry.PointD):void; + /** + * Convenience method that can be called to dynamically register a single obstacle + * quadratic curve with the context during the rendering. + * Normally all obstacles will be registered initially by method {@link yfiles.model.BridgeManager#registerObstacles}. + * This method can be called during the rendering phase to register additional obstacles at + * a later point in time. + * @param {yfiles.drawing.IRenderContext} context The context to register the obstacles with. + * @param {yfiles.geometry.PointD} p1 The coordinates of the starting point of the line. + * @param {yfiles.geometry.PointD} cp The coordinates of the control point of the curve. + * @param {yfiles.geometry.PointD} p2 The coordinates of the ending point of the line. + * @see {@link yfiles.model.BridgeManager#registerObstacleLine} + */ + registerObstacleQuadCurve(context:yfiles.drawing.IRenderContext,p1:yfiles.geometry.PointD,cp:yfiles.geometry.PointD,p2:yfiles.geometry.PointD):void; + /** + * Convenience method that can be called to dynamically register a single obstacle + * cubic curve with the context during the rendering. + * Normally all obstacles will be registered initially by method {@link yfiles.model.BridgeManager#registerObstacles}. + * This method can be called during the rendering phase to register additional obstacles at + * a later point in time. + * @param {yfiles.drawing.IRenderContext} context The context to register the obstacles with. + * @param {yfiles.geometry.PointD} p1 The coordinates of the starting point of the line. + * @param {yfiles.geometry.PointD} cp1 The coordinates of the first control point of the curve. + * @param {yfiles.geometry.PointD} cp2 The coordinates of the second control point of the curve. + * @param {yfiles.geometry.PointD} p2 The coordinates of the ending point of the line. + * @see {@link yfiles.model.BridgeManager#registerObstacleLine} + */ + registerObstacleCubicCurve(context:yfiles.drawing.IRenderContext,p1:yfiles.geometry.PointD,cp1:yfiles.geometry.PointD,cp2:yfiles.geometry.PointD,p2:yfiles.geometry.PointD):void; + /** + * Gets a hash code that describes the current state of the obstacles. + * This method can be used to see whether the obstacles have changed their coordinates + * since the last call. + * @param {yfiles.drawing.IRenderContext} context The context to inspect. + * @return {number} A hash of the state of the obstacles. + */ + getObstacleHash(context:yfiles.drawing.IRenderContext):number; + /** + * Reverts the {@link yfiles.model.BridgeManager#install} method. + * @param {yfiles.canvas.CanvasControl} canvas The canvas control. + */ + uninstall(canvas:yfiles.canvas.CanvasControl):void; + /** + * Installs this manager for the specified canvas control. + * @param {yfiles.canvas.CanvasControl} canvas The canvas control. + */ + install(canvas:yfiles.canvas.CanvasControl):void; + /** + * Implementation that will be called by the default value of the {@link yfiles.model.BridgeManager#defaultCallback} + * to satisfy requests to {@link yfiles.model.IAddBridgesCallback#insertCustomBridge}. + * This implementation will insert a gap style bridge by first + * creating a {@link yfiles.drawing.GeneralPath#lineTo line} + * to startPoint and then + * {@link yfiles.drawing.GeneralPath#moveTo moving} to endPoint. + * @param {yfiles.drawing.IRenderContext} context The context for the call. + * @param {yfiles.drawing.GeneralPath} path The path to append the next segment to. + * @param {yfiles.geometry.PointD} startPoint The coordinates of the starting point of the bridge. + * @param {yfiles.geometry.PointD} endPoint The coordinates of the ending point of the bridge. + * @param {number} gapLength The distance between the starting point and the end point. + * @see {@link yfiles.model.IAddBridgesCallback#insertCustomBridge} + */ + insertDefaultCustomBridge(context:yfiles.drawing.IRenderContext,path:yfiles.drawing.GeneralPath,startPoint:yfiles.geometry.PointD,endPoint:yfiles.geometry.PointD,gapLength:number):void; + } + var BridgeManager:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.model.BridgeManager} class. + * Initially the {@link yfiles.model.BridgeManager#defaultCallback} will be set to an instance + * that will delegate to the set of Default properties in this class + * and the {@link yfiles.model.BridgeManager#insertDefaultCustomBridge} method respectively. + */ + new ():yfiles.model.BridgeManager; + }; + /** + * An implementation of the {@link yfiles.model.IModelItemInstaller} interface + * that will use a fixed {@link yfiles.canvas.ICanvasObjectDescriptor} for + * each item that is assignable a specific type. + */ + export interface TypeBasedItemInstaller extends Object,yfiles.model.IModelItemInstaller{ + /** + * Gets or sets the group to install the items in the canvas at. + */ + group:yfiles.canvas.ICanvasObjectGroup; + /** + * Gets or sets the descriptor to use for installing the item. + */ + descriptor:yfiles.canvas.ICanvasObjectDescriptor; + /** + * Gets or sets the type to filter items that can be installed by this instance. + */ + type:yfiles.lang.Class; + /** + * This implementation does nothing. + */ + installInCanvas(canvas:yfiles.canvas.CanvasControl):void; + /** + * This implementation does nothing. + */ + uninstallFromCanvas(canvas:yfiles.canvas.CanvasControl):void; + /** + * Returns true if the type of the item is assignable to {@link yfiles.model.TypeBasedItemInstaller#type}. + */ + canInstall(item:T,canvas:yfiles.canvas.CanvasControl):boolean; + /** + * Adds the given item to the canvas using the {@link yfiles.model.TypeBasedItemInstaller#descriptor}. + * The item will be registered as the user object. + * @param {T} item The item to install + * @param {yfiles.model.IInstallerContext} context The context to {@link yfiles.model.IInstallerContext#addInstalled add} the item into. + * @return {void} An array containing one element. + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:T):void; + } + var TypeBasedItemInstaller:{ + $class:yfiles.lang.Class; + /** + * Creates an instance using the given descriptor and + * using the type to determine whether it {@link yfiles.model.TypeBasedItemInstaller#canInstall} + * an item. + * @param {yfiles.canvas.ICanvasObjectDescriptor} descriptor + * @param {yfiles.lang.Class} type + */ + new (descriptor:yfiles.canvas.ICanvasObjectDescriptor,type:yfiles.lang.Class):yfiles.model.TypeBasedItemInstaller; + }; + /** + * Simple handle interface used by {@link yfiles.model.ModelManager}. + */ + export interface IModelItemDescriptor extends Object{ + /** + * The item this descriptor handle is associated with. + * @see Specified by {@link yfiles.model.IModelItemDescriptor#item}. + */ + item:T; + /** + * The list of canvas objects that have been associated with the item. + * @see Specified by {@link yfiles.model.IModelItemDescriptor#canvasObjects}. + */ + canvasObjects:yfiles.collections.IList; + } + var IModelItemDescriptor:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A {@link yfiles.model.ModelManager} implementation that manages the + * visual decorations of selected elements in a canvas. + * For each item in the {@link yfiles.model.SelectionPaintManager#model} that is marked as selected by + * the {@link yfiles.model.SelectionPaintManager#selectionModel} this class uses the {@link yfiles.support.ILookup} mechanism of + * the items to lookup an {@link yfiles.model.ISelectionInstaller} + * implementation which will do the actual installation of the decoration in the canvas. + */ + export interface SelectionPaintManager extends yfiles.model.InstallerBasedModelManager,yfiles.model.IModelItemInstaller{ + /** + * Gets or sets a value indicating whether this {@link yfiles.model.SelectionPaintManager} is enabled. + * If the manager is disabled, it will not install the {@link yfiles.canvas.ICanvasObject}s into + * the associated {@link yfiles.canvas.CanvasControl}. + * Value: true if enabled; otherwise, false. + */ + enabled:boolean; + /** + * Called when this mode gets {@link yfiles.model.SelectionPaintManager#enabled disabled}. + */ + onDisabled():void; + /** + * Called when this mode gets {@link yfiles.model.SelectionPaintManager#enabled enabled}. + */ + onEnabled():void; + /** + * Gets or sets the selection model that determines which items are selected. + * May be null, in which case no elements are considered selected. + */ + selectionModel:yfiles.model.ISelectionModel; + /** + * Gets or sets the model that describes the domain for the selection. + * Only item contained in this model can be rendered as selected. + */ + model:yfiles.model.ICollectionModel; + /** + * Removes the provided item from this managers set of managed items. + * @param {T} item The item to remove. + * @see {@link yfiles.model.SelectionPaintManager#removeSelection} + */ + remove(item:T):void; + /** + * Removes an item from the current selection. + * @param {T} item The item whose selection decorator will be removed. + */ + removeSelection(item:T):void; + /** + * Adds an item to the current selection. + * @param {T} item The item whose selection decorator will added. + */ + addSelection(item:T):yfiles.model.IModelItemDescriptor; + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * This method delegates to the {@link yfiles.model.ISelectionInstaller}'s + * {@link yfiles.model.IModelItemInstaller#install} method. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @param {T} item The item to install. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see {@link yfiles.model.SelectionPaintManager#getSelectionInstaller} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:T):void; + /** + * Callback used by {@link yfiles.model.SelectionPaintManager#install} to retrieve the installer for a given item. + * This implementation uses the {@link yfiles.support.ILookup#lookup} of the item. + * @param {T} item The item to find an installer for. + * @return {yfiles.model.ISelectionInstaller} An installer or null + */ + getSelectionInstaller(item:T):yfiles.model.ISelectionInstaller; + } + var SelectionPaintManager:{ + $class:yfiles.lang.Class; + /** + * Creates an instance that for all selected items in the model dynamically + * installs a selection paint decoration. + * @param {yfiles.canvas.CanvasControl} canvas The canvas to add the selection marks to. + * @param {yfiles.model.ICollectionModel.} model The model that holds the domain. + * @param {yfiles.model.ISelectionModel.} selectionModel The model that determines which items are selected. + */ + new (canvas:yfiles.canvas.CanvasControl,model:yfiles.model.ICollectionModel,selectionModel:yfiles.model.ISelectionModel):yfiles.model.SelectionPaintManager; + }; + export enum CrossingStyle{ + /** + * The style that indicates that there should be a gap left in the path. + */ + GAP, + /** + * The style that makes the crossing look like the upper half of a rectangle being inserted into the path. + */ + RECTANGLE, + /** + * The style that makes the crossing look like the upper half of a rectangle being inserted into the path, where + * the height has been scaled to keep the aspect ratio for greater widths. + */ + RECTANGLE_SCALED, + /** + * The style that for each crossing inserts two sides of a triangle into the path. + */ + TWO_SIDES, + /** + * The style that for each crossing inserts two sides of a triangle into the path, + * where the height has been scaled to keep the aspect ratio for greater widths. + */ + TWO_SIDES_SCALED, + /** + * The style that for each crossing inserts two quarter circle arcs into the path, that are connected + * by a straight line. + */ + ARC, + /** + * The style that for each crossing inserts a half circle into the path. + */ + ARC_SCALED, + /** + * The style that will use the {@link yfiles.model.IAddBridgesCallback#insertCustomBridge} + * method to insert the bridge. + */ + CUSTOM + } + export enum CrossingDetermination{ + /** + * Makes horizontal segments bridge over vertical obstacles. + * Horizontal segments do not cross each other, as well as vertical ones will not cross each other. + * Horizontal segment are segments with a slope between 1 and -1. All others are vertical segments. + * For non-parallel intersecting pairs of segments there does not need to be a crossing unless + * only one of them is vertical. + */ + HORIZONTAL_BRIDGES_VERTICAL, + /** + * Makes vertical segments bridge over vertical obstacles. + * Horizontal segments do not cross each other, as well as vertical ones will not cross each other. + * Horizontal segment are segments with a slope between 1 and -1. All others are vertical segments. + * For non-parallel intersecting pairs of segments there does not need to be a crossing unless + * only one of them is horizontal. + */ + VERTICAL_BRIDGES_HORIZONTAL, + /** + * Makes more horizontal edges bridge over edges which are less horizontal. + * The smaller the absolute slope of an edge, the more horizontal it is. + * For each non-parallel intersecting pair of segments, there will be a crossing. + */ + MORE_HORIZONTAL_BRIDGES_LESS_HORIZONTAL, + /** + * Makes more vertical edges bridge over edges which are less vertical. + * The larger the absolute slope of an edge, the more vertical it is. + * For each non-parallel intersecting pair of segments, there will be a crossing. + */ + MORE_VERTICAL_BRIDGES_LESS_VERTICAL + } + export enum BridgeOrientationStyle{ + /** + * Adds a bridge to the right of the flow of the path. + */ + FLOW_RIGHT, + /** + * Adds a bridge to the left of the flow of the path. + */ + FLOW_LEFT, + /** + * Adds a bridge in the direction of the positive axes. + */ + POSITIVE, + /** + * Adds a bridge in the direction of the negative axes. + */ + NEGATIVE, + /** + * Adds bridges that point to the right. + */ + LEFT, + /** + * Adds bridges that point to the left. + */ + RIGHT, + /** + * Adds bridges that point upwards. + */ + UP, + /** + * Adds bridges that point downwards. + */ + DOWN + } + /** + * Extension method class for {@link yfiles.model.IInstallerContext}. + */ + export interface InstallerContextExtensions extends Object{ + } + var InstallerContextExtensions:{ + $class:yfiles.lang.Class; + /** + * Convenience extension method that {@link yfiles.canvas.CanvasControl#addToGroup} + * the given user object using the descriptor and the group to the {@link yfiles.canvas.CanvasControl} + * and {@link yfiles.model.IInstallerContext#addInstalled adds} the result to the installer + * context at the same time. + * @param {yfiles.model.IInstallerContext} context The context to use and add the canvas object to. + * @param {Object} userObject The user object. + * @param {yfiles.canvas.ICanvasObjectDescriptor} descriptor The descriptor. + * @param {yfiles.canvas.ICanvasObjectGroup} canvasObjectGroup The canvas object group. + * @return {yfiles.canvas.ICanvasObject} The canvas object, that has already been {@link yfiles.model.IInstallerContext#addInstalled added} + * to the context. + */ + addToGroup(context:yfiles.model.IInstallerContext,userObject:Object,descriptor:yfiles.canvas.ICanvasObjectDescriptor,canvasObjectGroup:yfiles.canvas.ICanvasObjectGroup):yfiles.canvas.ICanvasObject; + /** + * Convenience extension method that {@link yfiles.canvas.CanvasControl#addToGroup} + * the given user object using the descriptor and the group provided by the {@link yfiles.model.IInstallerContext#canvasObjectGroup} + * property to the {@link yfiles.canvas.CanvasControl} + * and {@link yfiles.model.IInstallerContext#addInstalled adds} the result to the installer + * context at the same time. + * @param {yfiles.model.IInstallerContext} context The context to use and add the canvas object to. + * @param {Object} userObject The user object. + * @param {yfiles.canvas.ICanvasObjectDescriptor} descriptor The descriptor. + * @return {yfiles.canvas.ICanvasObject} The canvas object, that has already been {@link yfiles.model.IInstallerContext#addInstalled added} + * to the context. + */ + add(context:yfiles.model.IInstallerContext,userObject:Object,descriptor:yfiles.canvas.ICanvasObjectDescriptor):yfiles.canvas.ICanvasObject; + }; + /** + * Simple basic implementation of the {@link yfiles.model.IInstallerContext} interface. + * @see {@link yfiles.model.InstallerContext#reset} + */ + export interface InstallerContext extends Object,yfiles.model.IInstallerContext{ + /** + * Provides additional optional information to implementations of the {@link yfiles.model.IModelItemInstaller} + * interface. + * @param {yfiles.lang.Class} type The type to query + * @return {Object} A corresponding value or null. + * @see {@link yfiles.model.InstallerContext#lookupCallback} + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Gets the canvas into which the items shall be installed. + * Value: The canvas to {@link yfiles.canvas.CanvasControl#add} + * instances. + * @see Specified by {@link yfiles.model.IInstallerContext#canvas}. + */ + canvas:yfiles.canvas.CanvasControl; + /** + * Gets the suggested canvas object group to install the items into. + * Value: The suggested canvas object group. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see Specified by {@link yfiles.model.IInstallerContext#canvasObjectGroup}. + */ + canvasObjectGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * Adds the installed object to the {@link yfiles.model.InstallerContext#installedObjects} list. + * @param {yfiles.canvas.ICanvasObject} canvasObject The object to add to the installed objects list. + * @see Specified by {@link yfiles.model.IInstallerContext#addInstalled}. + */ + addInstalled(canvasObject:yfiles.canvas.ICanvasObject):void; + /** + * Gets or sets the lookup callback to optionally use in the {@link yfiles.model.InstallerContext#lookup} + * method. + * Value: The lookup callback or null. + */ + lookupCallback:(subject:Object,type:yfiles.lang.Class)=>Object; + /** + * Gets or sets the list to use for storing the installed objects. + * Value: The backing list of objects. + */ + installedObjects:yfiles.collections.IList; + /** + * Resets this instance by calling the {@link yfiles.collections.ICollection#clear} method + * on {@link yfiles.model.InstallerContext#installedObjects}. + */ + reset():void; + } + var InstallerContext:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.model.InstallerContext} class + * using the provided canvas. + * @param {yfiles.canvas.CanvasControl} canvas The canvas to use for {@link yfiles.model.InstallerContext#canvas}. + */ + FromCanvas:{ + new (canvas:yfiles.canvas.CanvasControl):yfiles.model.InstallerContext; + }; + /** + * Initializes a new instance of the {@link yfiles.model.InstallerContext} class + * using the provided canvas and the backing store for the + * {@link yfiles.model.InstallerContext#installedObjects} property. + * @param {yfiles.canvas.CanvasControl} canvas The canvas to use for {@link yfiles.model.InstallerContext#canvas}. + * @param {yfiles.collections.IList.} installedObjects The backing store to use for {@link yfiles.model.InstallerContext#installedObjects}. + */ + FromCanvasAndInstalledObjects:{ + new (canvas:yfiles.canvas.CanvasControl,installedObjects:yfiles.collections.IList):yfiles.model.InstallerContext; + }; + }; + /** + * The context object that is passed to {@link yfiles.model.IModelItemInstaller}, + * {@link yfiles.model.ISelectionInstaller}, {@link yfiles.input.IHighlightInstaller}, etc. + * This context object carries the {@link yfiles.canvas.CanvasControl}, the {@link yfiles.canvas.ICanvasObjectGroup} + * and additional optional information via the {@link yfiles.support.ILookup#lookup} method. + * Most importantly, it contains the {@link yfiles.model.IInstallerContext#addInstalled} method which + * needs to be used by the callees to notify the caller of installed items. + * @see {@link yfiles.model.InstallerContextExtensions} + */ + export interface IInstallerContext extends Object,yfiles.support.ILookup{ + /** + * Gets the canvas into which the items shall be installed. + * Value: The canvas to {@link yfiles.canvas.CanvasControl#add} + * instances. + * @see Specified by {@link yfiles.model.IInstallerContext#canvas}. + */ + canvas:yfiles.canvas.CanvasControl; + /** + * Gets the suggested canvas object group to install the items into. + * Value: The suggested canvas object group. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see Specified by {@link yfiles.model.IInstallerContext#canvasObjectGroup}. + */ + canvasObjectGroup:yfiles.canvas.ICanvasObjectGroup; + /** + * This method collects the {@link yfiles.canvas.ICanvasObject}s that the callee + * has created in the {@link yfiles.canvas.CanvasControl}. + * It is essential to the functionality of the framework that client code calls this method + * for each {@link yfiles.canvas.CanvasControl#addToGroup added} + * canvas object. + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @param {yfiles.canvas.ICanvasObject} canvasObject The canvas object that has been added by the implementation. + * @see Specified by {@link yfiles.model.IInstallerContext#addInstalled}. + */ + addInstalled(canvasObject:yfiles.canvas.ICanvasObject):void; + /** + * Convenience extension method that {@link yfiles.canvas.CanvasControl#addToGroup} + * the given user object using the descriptor and the group to the {@link yfiles.canvas.CanvasControl} + * and {@link yfiles.model.IInstallerContext#addInstalled adds} the result to the installer + * context at the same time. + * This is a bridge method that delegates to {@link yfiles.model.InstallerContextExtensions#addToGroup}. + * @param {Object} userObject The user object. + * @param {yfiles.canvas.ICanvasObjectDescriptor} descriptor The descriptor. + * @param {yfiles.canvas.ICanvasObjectGroup} canvasObjectGroup The canvas object group. + * @return {yfiles.canvas.ICanvasObject} The canvas object, that has already been {@link yfiles.model.IInstallerContext#addInstalled added} + * to the context. + */ + addToGroup(userObject:Object,descriptor:yfiles.canvas.ICanvasObjectDescriptor,canvasObjectGroup:yfiles.canvas.ICanvasObjectGroup):yfiles.canvas.ICanvasObject; + /** + * Convenience extension method that {@link yfiles.canvas.CanvasControl#addToGroup} + * the given user object using the descriptor and the group provided by the {@link yfiles.model.IInstallerContext#canvasObjectGroup} + * property to the {@link yfiles.canvas.CanvasControl} + * and {@link yfiles.model.IInstallerContext#addInstalled adds} the result to the installer + * context at the same time. + * This is a bridge method that delegates to {@link yfiles.model.InstallerContextExtensions#add}. + * @param {Object} userObject The user object. + * @param {yfiles.canvas.ICanvasObjectDescriptor} descriptor The descriptor. + * @return {yfiles.canvas.ICanvasObject} The canvas object, that has already been {@link yfiles.model.IInstallerContext#addInstalled added} + * to the context. + */ + add(userObject:Object,descriptor:yfiles.canvas.ICanvasObjectDescriptor):yfiles.canvas.ICanvasObject; + } + var IInstallerContext:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The interface used by items that belong to a model, that most + * of the utility classes for the {@link yfiles.canvas.CanvasControl} + * can deal with. + * This interface is a combining interface that adds no additional + * functionality to the {@link yfiles.support.ILookup} and {@link yfiles.support.ITagOwner} + * interfaces. + */ + export interface IModelItem extends Object,yfiles.support.ILookup,yfiles.support.ITagOwner{ + } + var IModelItem:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface for a class that installs visual representations of items + * in a canvas control. + * This interface is used by {@link yfiles.model.ModelManager} and the like. + */ + export interface IModelItemInstaller extends Object{ + /** + * This the main method of the interface that performs the installation of an item's + * visual representation in the {@link yfiles.canvas.CanvasControl canvas} by adding {@link yfiles.canvas.ICanvasObject}s. + * It is important for the caller that the implementation calls {@link yfiles.model.IInstallerContext#addInstalled} + * for each item that it installs into the canvas. + * @param {T} item The item to install. + * @param {yfiles.model.IInstallerContext} context The context to install the item into and + * {@link yfiles.model.IInstallerContext#addInstalled add installed} items to. + * @see {@link yfiles.model.InstallerContextExtensions#add} + * @see {@link yfiles.model.InstallerContextExtensions#addToGroup} + * @see Specified by {@link yfiles.model.IModelItemInstaller#install}. + */ + install(context:yfiles.model.IInstallerContext,item:T):void; + } + var IModelItemInstaller:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface that models the selection state of a set of items. + * This interface extends the {@link yfiles.collections.IEnumerable} interface + * for convenient enumeration of the selected items. + * Use the {@link yfiles.collections.IEnumerable#getEnumerator} to get all selected items. + */ + export interface ISelectionModel extends Object,yfiles.collections.IEnumerable{ + /** + * Determines whether an item is currently selected. + * @param {T} o The item to check. + * @return {boolean} Whether it is currently selected. + * @see Specified by {@link yfiles.model.ISelectionModel#isSelected}. + */ + isSelected(o:T):boolean; + /** + * Sets the selection state of an item. + * If the state changes, this will trigger the {@link yfiles.model.ISelectionModel#addItemSelectedListener ItemSelected} or + * {@link yfiles.model.ISelectionModel#addItemDeselectedListener ItemDeselected} events respectively. + * @param {T} o The object to set the selection state for. + * @param {boolean} selected Whether to select the object. + * @see Specified by {@link yfiles.model.ISelectionModel#setSelected}. + */ + setSelected(o:T,selected:boolean):void; + /** + * Returns the number of selected items. + * @see Specified by {@link yfiles.model.ISelectionModel#count}. + */ + count:number; + /** + * An event that will be triggered if an item changed its selection state from + * unselected to selected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + addItemSelectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * unselected to selected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + removeItemSelectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * selected to unselected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + addItemDeselectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item changed its selection state from + * selected to unselected. + * @see {@link yfiles.model.ISelectionModel#setSelected} + */ + removeItemDeselectedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Clears the selection. + * This is a convenience method that will set the selection state of all elements to + * unselected. + * @see {@link yfiles.model.ISelectionModel#addItemDeselectedListener ItemDeselected} + * @see Specified by {@link yfiles.model.ISelectionModel#clear}. + */ + clear():void; + } + var ISelectionModel:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An abstract implementation of a utility class that manages + * the visual representations of items in a {@link yfiles.canvas.CanvasControl}. + */ + export interface ModelManager extends Object{ + /** + * The canvas instance this instance is managing. + */ + _canvas:yfiles.canvas.CanvasControl; + /** + * Gets the canvas instance this instance is managing. + */ + canvas:yfiles.canvas.CanvasControl; + /** + * Abstract method that actually adds the visual representation of an item + * to the canvas. + * @param {T} member The item whose visual representation is to be added to the canvas. + * @return {yfiles.collections.IList.} A non-null but possibly empty list of canvas objects this instance has added to the canvas for the given item. + */ + installMember(member:T):yfiles.collections.IList; + /** + * Simple implementation that removes all of the given canvasObjects. + * @param {yfiles.model.IModelItemDescriptor.} descriptor The descriptor as obtained from a previous {@link yfiles.model.ModelManager#add} call. + * @param {yfiles.collections.IList.} canvasObjects The canvas objects that have been associated with the descriptor. + * @see {@link yfiles.canvas.ICanvasObject#remove} + */ + unInstall(descriptor:yfiles.model.IModelItemDescriptor,canvasObjects:yfiles.collections.IList):void; + /** + * Adds an item to the canvas. + * This method will call the {@link yfiles.model.ModelManager#installMember} method + * and create a {@link yfiles.model.IModelItemDescriptor} handle + * that can later be used to remove or update the + * item's visual representation from or in the canvas. + * @param {T} o The item to add to the canvas. + * @return {yfiles.model.IModelItemDescriptor.} A handle that can be used for the {@link yfiles.model.ModelManager#removeDescriptor} and {@link yfiles.model.ModelManager#updateDescriptor} methods. + * This method may return null to indicate that nothing was installed. + */ + add(o:T):yfiles.model.IModelItemDescriptor; + /** + * Removes the canvas objects associated with the given descriptor handle. + * @param {yfiles.model.IModelItemDescriptor.} desc The handle as obtained from {@link yfiles.model.ModelManager#add} + */ + removeDescriptor(desc:yfiles.model.IModelItemDescriptor):void; + /** + * Updates the item in the canvas by uninstalling and reinstalling it + * into the canvas. + * @param {yfiles.model.IModelItemDescriptor.} desc The descriptor to update. + */ + updateDescriptor(desc:yfiles.model.IModelItemDescriptor):boolean; + /** + * Checks whether this descriptor is currently being managed by this instance. + * @param {yfiles.model.IModelItemDescriptor.} desc The descriptor handle. + * @return {boolean} Whether the descriptor is actively managed by this instance. + */ + containsDescriptor(desc:yfiles.model.IModelItemDescriptor):boolean; + } + var ModelManager:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that will manage the items for the given canvas. + * @param {yfiles.canvas.CanvasControl} canvas The canvas to manage. + */ + new (canvas:yfiles.canvas.CanvasControl):yfiles.model.ModelManager; + }; + /** + * An interface for objects that can install a visual representation of + * a selection decoration of an item in the model displayed in a canvas. + * This interface is a tagging sub interface of the {@link yfiles.model.IModelItemInstaller} + * which fixes the type of the items to {@link Object}. + * This interface is used for {@link yfiles.support.ILookup#lookup} operations. + * @see {@link yfiles.model.SelectionPaintManager} + * @see {@link yfiles.input.IHighlightInstaller} + */ + export interface ISelectionInstaller extends Object,yfiles.model.IModelItemInstaller{ + } + var ISelectionInstaller:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A utility class that offers various implementations of interfaces + * that can be used by different {@link yfiles.input.IInputMode} implementations. + */ + export interface InputModeController extends Object{ + /** + * Gets or sets the {@link yfiles.input.IInputModeContext} that is used by this instance. + * @see {@link yfiles.model.InputModeController#getHandles} + */ + inputModeContext:yfiles.input.IInputModeContext; + /** + * Gets an implementation of the {@link yfiles.input.IPositionHandler} interface + * that is a live composite of all position handler interfaces provided by + * the currently selected items. + */ + selectedItemsPositionHandler:yfiles.input.IPositionHandler; + /** + * Gets an implementation of the {@link yfiles.drawing.IHitTestable} interface that + * is a live composite of all IHitTestable implementations of the currently + * selected items that also provide a {@link yfiles.input.IPositionHandler} or {@link yfiles.geometry.IMovable} implementation. + */ + selectedMovableItemsHitTestable:yfiles.drawing.IHitTestable; + /** + * Gets an implementation of the {@link yfiles.drawing.IHitTestable} interface that + * is a live composite of all IHitTestable implementations of the currently + * unselected items that also provide a {@link yfiles.input.IPositionHandler} or {@link yfiles.geometry.IMovable} implementation. + */ + unselectedMovableItemsHitTestable:yfiles.drawing.IHitTestable; + /** + * Gets an implementation of the {@link yfiles.drawing.IHitTestable} interface that + * is a live composite of all IHitTestable implementations of the currently + * selected items. + */ + selectedItemHitTestable:yfiles.drawing.IHitTestable; + /** + * Gets an implementation of the {@link yfiles.geometry.IMovable} interface that + * is a live composite of all IMovable implementations of the currently + * selected items. + */ + selectedItemsMovable:yfiles.geometry.IMovable; + /** + * Gets an implementation of the {@link yfiles.drawing.IHitTestable} interface that + * is a live composite of all IHitTestable implementations of the items contained + * in the model. + */ + itemHitTestable:yfiles.drawing.IHitTestable; + /** + * Gets an implementation of the {@link yfiles.drawing.IHitTestable} interface that + * is a live composite of all IHitTestable implementations of the currently + * selected items. + */ + selectedItemsHitTestable:yfiles.drawing.IHitTestable; + /** + * Gets an implementation of the {@link yfiles.drawing.IHitTestable} interface that + * is a live composite of all IHitTestable implementations of the currently + * unselected items. + */ + unselectedItemHitTestable:yfiles.drawing.IHitTestable; + /** + * Gets or sets the selection model, that will be used by all implementations + * that use the selection state of an item. + */ + selectionModel:yfiles.model.ISelectionModel; + /** + * Returns the {@link yfiles.input.IHandle}s for a given element. + * This implementation delegates to {@link yfiles.model.InputModeController#getHandleProvider}, unless + * {@link yfiles.model.InputModeController#useHandlesPredicate} has been defined and + * yields false if queried using t. + * @param {yfiles.input.IInputModeContext} context The context for which the handles shall be queried. + * @param {T} t The element to retrieve handles for. + * @return {yfiles.collections.IEnumerable.} An enumerable or null. + * @see {@link yfiles.model.InputModeController#useHandlesPredicate} + */ + getHandles(context:yfiles.input.IInputModeContext,t:T):yfiles.collections.IEnumerable; + /** + * Gets or sets a {@link system.Predicate} that determines whether + * the handles of the given item should be used or discarded. + * @see {@link yfiles.model.InputModeController#getHandles} + */ + useHandlesPredicate:(obj:T)=>boolean; + /** + * Gets or sets a {@link system.Predicate} that determines whether + * the given items should be allowed to move. + */ + allowMovingPredicate:(obj:T)=>boolean; + /** + * Gets or sets the collection model this instance acts upon. + */ + collectionModel:yfiles.model.ICollectionModel; + /** + * Gets a live collection over the {@link yfiles.input.IHandle} implementations that + * have been obtained from the selected items in the collection. + */ + selectedItemsHandles:yfiles.model.ICollectionModel; + /** + * Gets the {@link yfiles.input.IHandleProvider} for a given item. + * @param {T} item The item to query the provider from. + * @return {yfiles.input.IHandleProvider} The provider or null. + */ + getHandleProvider(item:T):yfiles.input.IHandleProvider; + /** + * Gets or sets the canvas to use. + */ + canvas:yfiles.canvas.CanvasControl; + /** + * Disposes this instance. + */ + dispose():void; + } + var InputModeController:{ + $class:yfiles.lang.Class; + /** + * Creates an instance that can be used for the given collection model. + * @param {yfiles.model.ICollectionModel.} collectionModel The model to get the entities from. + * @param {yfiles.input.IInputModeContext} inputModeContext The context to use for queries that require an input mode context. + */ + new (collectionModel:yfiles.model.ICollectionModel,inputModeContext:yfiles.input.IInputModeContext):yfiles.model.InputModeController; + }; + } + export module multipage{ + /** + * Callback that is invoked when a {@link yfiles.multipage.MultiPageLayouter} has calculated + * a new multi-page layout. + */ + export interface ILayoutCallback extends Object{ + /** + * Invoked from {@link yfiles.multipage.MultiPageLayouter#doLayout} + * when a new multi-page layout has been calculated. + * @param {yfiles.multipage.MultiPageLayout} result the result of the layout calculation. + * @see Specified by {@link yfiles.multipage.ILayoutCallback#layoutDone}. + */ + layoutDone(result:yfiles.multipage.MultiPageLayout):void; + } + var ILayoutCallback:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Interface that offers access to the information objects of graph elements. + */ + export interface IElementInfoManager extends Object{ + /** + * Returns the node information object of the given node. + * @param {yfiles.algorithms.Node} n the node for which the information object should be returned. + * @return {yfiles.multipage.INodeInfo} the node information object of the given node. + * @see Specified by {@link yfiles.multipage.IElementInfoManager#getNodeInfo}. + */ + getNodeInfo(n:yfiles.algorithms.Node):yfiles.multipage.INodeInfo; + /** + * Returns the edge information object of the given edge. + * @param {yfiles.algorithms.Edge} e the edge for which the information object should be returned. + * @return {yfiles.multipage.IEdgeInfo} the edge information object of the given edge. + * @see Specified by {@link yfiles.multipage.IElementInfoManager#getEdgeInfo}. + */ + getEdgeInfo(e:yfiles.algorithms.Edge):yfiles.multipage.IEdgeInfo; + /** + * Returns the node label layout information object of the given node label layout. + * @param {yfiles.layout.INodeLabelLayout} nll the node label layout for which the information object should be returned. + * @return {yfiles.multipage.INodeLabelInfo} the node label information object of the given node label layout. + * @see Specified by {@link yfiles.multipage.IElementInfoManager#getNodeLabelInfo}. + */ + getNodeLabelInfo(nll:yfiles.layout.INodeLabelLayout):yfiles.multipage.INodeLabelInfo; + /** + * Returns the edge label information object of the given edge label layout. + * @param {yfiles.layout.IEdgeLabelLayout} ell the edge label layout for which the information object should be returned. + * @return {yfiles.multipage.IEdgeLabelInfo} the edge label information object of the given edge label layout. + * @see Specified by {@link yfiles.multipage.IElementInfoManager#getEdgeLabelInfo}. + */ + getEdgeLabelInfo(ell:yfiles.layout.IEdgeLabelLayout):yfiles.multipage.IEdgeLabelInfo; + } + var IElementInfoManager:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Factory used by class {@link yfiles.multipage.MultiPageLayouter} to create special nodes and edges. + */ + export interface IElementFactory extends Object{ + /** + * Callback method for creating a node of type {@link yfiles.multipage.NodeType#CONNECTOR}. + * Note: all implementations have to use method {@link yfiles.multipage.LayoutContext#createNode} to create the node. + * @param {yfiles.multipage.LayoutContext} context + * an object providing relevant layout information, e.g., the current graph as well as + * various information about the graph elements. + * @param {yfiles.algorithms.YList} edgesIds + * a list that contains the ids of edges that are split by this connector. Note: multi-edges + * (edges connecting the same nodes) may be split by the same connector pair. + * @param {Object} representedNodeId the id of the node that is represented by this connector. + * @return {yfiles.algorithms.Node} the created connector node + * @see {@link yfiles.multipage.NodeType#CONNECTOR} + * @see {@link yfiles.multipage.LayoutContext#createNode} + * @see {@link yfiles.multipage.INodeInfo#representedNode} + * @see Specified by {@link yfiles.multipage.IElementFactory#createConnectorNode}. + */ + createConnectorNode(context:yfiles.multipage.LayoutContext,edgesIds:yfiles.algorithms.YList,representedNodeId:Object):yfiles.algorithms.Node; + /** + * Callback method for creating a node of type {@link yfiles.multipage.NodeType#PROXY_REFERENCE}. + * Note: all implementations have to use method {@link yfiles.multipage.LayoutContext#createNode} to create the node. + * @param {yfiles.multipage.LayoutContext} context + * an object providing relevant layout information, e.g., the current graph as well as + * various information about the graph elements. + * @param {Object} referringProxyId the id of the proxy to which the created node refers to. + * @return {yfiles.algorithms.Node} the new proxy reference node. + * @see {@link yfiles.multipage.NodeType#PROXY_REFERENCE} + * @see {@link yfiles.multipage.LayoutContext#createNode} + * @see {@link yfiles.multipage.NodeType#PROXY} + * @see Specified by {@link yfiles.multipage.IElementFactory#createProxyReferenceNode}. + */ + createProxyReferenceNode(context:yfiles.multipage.LayoutContext,referringProxyId:Object):yfiles.algorithms.Node; + /** + * Callback method for creating a node of type {@link yfiles.multipage.NodeType#PROXY}. + * Note: all implementations have to use method {@link yfiles.multipage.LayoutContext#createNode} to create the node. + * @param {yfiles.multipage.LayoutContext} context + * an object providing relevant layout information, e.g., the current graph as well as + * various information about the graph elements. + * @param {Object} origNodeId the id of the node for which a proxy has to be created. + * @return {yfiles.algorithms.Node} the proxy. + * @see {@link yfiles.multipage.LayoutContext#createNode} + * @see {@link yfiles.multipage.NodeType#PROXY} + * @see Specified by {@link yfiles.multipage.IElementFactory#createProxyNode}. + */ + createProxyNode(context:yfiles.multipage.LayoutContext,origNodeId:Object):yfiles.algorithms.Node; + /** + * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#CONNECTOR}. + * The edge should connect the given connector and opposite node. + * Note: all implementations have to use method {@link yfiles.multipage.LayoutContext#createEdge} + * to create the edge. + * @param {yfiles.multipage.LayoutContext} context + * an object providing relevant layout information, e.g., the current graph as well as + * various information about the graph elements. + * @param {yfiles.algorithms.Node} connector the endpoint of the edge that represents the connector node. + * @param {yfiles.algorithms.Node} opposite the other endpoint of the edge. + * @param {Object} origEdgeId the id of the edge that is split by the connector edge. + * @param {boolean} atTarget whether or not the connector node is the target of the edge. + * @return {yfiles.algorithms.Edge} the created connector edge. + * @see {@link yfiles.multipage.EdgeType#CONNECTOR} + * @see {@link yfiles.multipage.LayoutContext#createEdge} + * @see Specified by {@link yfiles.multipage.IElementFactory#createConnectorEdge}. + */ + createConnectorEdge(context:yfiles.multipage.LayoutContext,connector:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,origEdgeId:Object,atTarget:boolean):yfiles.algorithms.Edge; + /** + * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#PROXY_REFERENCE}. + * This (undirected) edge should connect the given proxy reference and opposite node. + * Note: all implementations have to use method {@link yfiles.multipage.LayoutContext#createEdge} + * to create the edge. + * @param {yfiles.multipage.LayoutContext} context + * an object providing relevant layout information, e.g., the current graph as well as + * various information about the graph elements. + * @param {yfiles.algorithms.Node} proxyReference + * the endpoint of the edge that represents the proxy + * reference node. + * @param {yfiles.algorithms.Node} opposite the other endpoint of the new edge. + * @param {Object} referencingCopyId + * the id of the proxy node that is referenced by the + * proxy reference node. + * @return {yfiles.algorithms.Edge} the created proxy reference edge. + * @see {@link yfiles.multipage.EdgeType#PROXY_REFERENCE} + * @see {@link yfiles.multipage.NodeType#PROXY_REFERENCE} + * @see {@link yfiles.multipage.LayoutContext#createEdge} + * @see Specified by {@link yfiles.multipage.IElementFactory#createProxyReferenceEdge}. + */ + createProxyReferenceEdge(context:yfiles.multipage.LayoutContext,proxyReference:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,referencingCopyId:Object):yfiles.algorithms.Edge; + /** + * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#PROXY}. + * The edge should connect the given proxy node and opposite node. + * Note: all implementations have to use method {@link yfiles.multipage.LayoutContext#createEdge} + * to create the edge. + * @param {yfiles.multipage.LayoutContext} context + * an object providing relevant layout information, e.g., the current graph as well as + * various information about the graph elements. + * @param {yfiles.algorithms.Node} proxyNode the endpoint of the edge that represents the proxy node. + * @param {yfiles.algorithms.Node} opposite the other endpoint of the new edge. + * @param {Object} replacingEdgeId the id of the related edge that is connected to the original node. + * @param {Object} origNodeId the id of the original node to which the proxy node refers to. + * @return {yfiles.algorithms.Edge} the created proxy edge. + * @see {@link yfiles.multipage.EdgeType#PROXY} + * @see {@link yfiles.multipage.NodeType#PROXY} + * @see {@link yfiles.multipage.LayoutContext#createEdge} + * @see Specified by {@link yfiles.multipage.IElementFactory#createProxyEdge}. + */ + createProxyEdge(context:yfiles.multipage.LayoutContext,proxyNode:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,replacingEdgeId:Object,origNodeId:Object):yfiles.algorithms.Edge; + } + var IElementFactory:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A class that holds all information related to a node. + */ + export interface INodeInfo extends Object{ + /** + * The represented node (always a node of the input graph). + * That is, + * if the related node has type {@link yfiles.multipage.NodeType#CONNECTOR connector} this method returns the neighbor of the matching connector node, + * if the related node has type {@link yfiles.multipage.NodeType#PROXY proxy} it returns the corresponding original node, + * if the related node has type {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference} it returns null, + * and, otherwise, it returns the corresponding node in the input graph. + * @see Specified by {@link yfiles.multipage.INodeInfo#representedNode}. + */ + representedNode:yfiles.algorithms.Node; + /** + * The page of the related node. + * This information is available after the layout. + * @see Specified by {@link yfiles.multipage.INodeInfo#pageNo}. + */ + pageNo:number; + /** + * The type of the related node. + * @see Specified by {@link yfiles.multipage.INodeInfo#type}. + */ + type:yfiles.multipage.NodeType; + /** + * The unique id of the related node. + * @see Specified by {@link yfiles.multipage.INodeInfo#id}. + */ + id:Object; + /** + * The referencing node. + * That is, if the related node has type {@link yfiles.multipage.NodeType#CONNECTOR connector} + * this method returns the opposite connector node, if the related node has + * type {@link yfiles.multipage.NodeType#PROXY_REFERENCE proxy reference} it returns the + * corresponding proxy node, if the related node has type + * {@link yfiles.multipage.NodeType#PROXY proxy} it returns the corresponding proxy reference + * node; otherwise it returns null. + * @see Specified by {@link yfiles.multipage.INodeInfo#referencingNode}. + */ + referencingNode:yfiles.algorithms.Node; + } + var INodeInfo:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Layout algorithm that subdivides the input graph into several + * {@link yfiles.layout.LayoutGraph}s (called page graphs) such that the layout of each graph + * fits the {@link yfiles.multipage.MultiPageLayouter#maxPageSize + * specified maximum page + * size + * }. + *

+ * To guarantee that no information is lost, the layout algorithm replaces edges + * between nodes on different pages by so-called connector nodes + * (see {@link yfiles.multipage.NodeType#CONNECTOR}). + * Furthermore, it may replicate (proxy) nodes and insert elements called proxy + * reference nodes to refers to such proxies (see {@link yfiles.multipage.NodeType#PROXY} + * and {@link yfiles.multipage.NodeType#PROXY_REFERENCE}). + *

+ * Unlike other yFiles layout algorithms, MultiPageLayouter does + * not modify its input graph but returns its result as a + * {@link yfiles.multipage.MultiPageLayout}. To be able to profit as much as + * possible from existing layout support, MultiPageLayouter + * implements the {@link yfiles.layout.ILayouter} interface although method + * {@link yfiles.layout.ILayouter#doLayout doLayout} does not specify a + * return value. Therefore client code has to + * {@link yfiles.multipage.MultiPageLayouter#layoutCallback register} a {@link yfiles.multipage.ILayoutCallback} + * that is notified of MultiPageLayouter results. + *

+ * Note: + * Client code must register data providers for keys {@link yfiles.multipage.MultiPageLayouter#NODE_ID_DP_KEY}, + * {@link yfiles.multipage.MultiPageLayouter#EDGE_ID_DP_KEY}, {@link yfiles.multipage.MultiPageLayouter#NODE_LABEL_ID_DP_KEY}, and + * {@link yfiles.multipage.MultiPageLayouter#EDGE_LABEL_ID_DP_KEY} before calling + * {@link yfiles.multipage.MultiPageLayouter#doLayout} or + * {@link yfiles.multipage.MultiPageLayouter#calcLayout}. + *

+ */ + export interface MultiPageLayouter extends yfiles.layout.AbstractLayoutStage{ + /** + * Specifies whether or not the specified labeling stage is enabled. + * By default it is disabled. + * @see {@link yfiles.multipage.MultiPageLayouter#labelLayouter} + * @see {@link yfiles.multipage.MultiPageLayouter#labelLayouter} + */ + labelLayouterEnabled:boolean; + /** + * Creates an element factory for multi-page layouts. + * Called from {@link yfiles.multipage.MultiPageLayouter#elementFactory} if no factory has been explicitly + * set using {@link yfiles.multipage.MultiPageLayouter#elementFactory}. + * @return {yfiles.multipage.IElementFactory} + * a {@link yfiles.multipage.DefaultElementFactory} instance. + */ + createElementFactory():yfiles.multipage.IElementFactory; + /** + * The element factory that is used to create special nodes and edges + * in a multi-page layout. + * @see {@link yfiles.multipage.MultiPageLayouter#createElementFactory} + * @see {@link yfiles.multipage.IElementFactory} + * @see {@link yfiles.multipage.MultiPageLayouter#createElementFactory} + * @see {@link yfiles.multipage.IElementFactory} + */ + elementFactory:yfiles.multipage.IElementFactory; + /** + * The callback that is notified upon completion of multi-page layout + * calculation runs. + */ + layoutCallback:yfiles.multipage.ILayoutCallback; + /** + * The bit mask that is used to define edge bundles. + * All multi-edges (edges with same endpoints) belonging to the same edge bundle are + * split by the same connector pair (see {@link yfiles.multipage.NodeType#CONNECTOR}). + * Possible values are {@link yfiles.multipage.EdgeBundleMode#DISTINGUISH_TYPES}, {@link yfiles.multipage.EdgeBundleMode#DISTINGUISH_DIRECTIONS} and + * {@link yfiles.multipage.EdgeBundleMode#DISTINGUISH_MULTI_EDGES}. + */ + edgeBundleModeMask:yfiles.multipage.EdgeBundleMode; + /** + * How to handle node grouping. + * Possible values are {@link yfiles.multipage.GroupingMode#IGNORE}, {@link yfiles.multipage.GroupingMode#ALL_NODES} and + * {@link yfiles.multipage.GroupingMode#ORIGINAL_NODES_ONLY}. + */ + groupMode:yfiles.multipage.GroupingMode; + /** + * The preferred time limit (in milliseconds) set for the layout algorithm. + * Note that restricting the maximal duration may result in a worse layout quality. + * Furthermore, the actual runtime may exceed the maximal duration since the layout algorithm + * still has to find a valid solution. + */ + preferredMaximalDuration:number; + /** + * The algorithm that is used for placing labels. + * Getter:By default an instance of class {@link yfiles.labeling.GreedyMISLabeling} will be returned that considers edge labels only. + * Setter:Note that assigning a new layout stage will not automatically + * activate it. To activate this stage use {@link yfiles.multipage.MultiPageLayouter#labelLayouterEnabled}. + */ + labelLayouter:yfiles.layout.ILayoutStage; + /** + * Calculates a new multi-page layout for the specified graph. + * This method calls {@link yfiles.multipage.MultiPageLayouter#calcLayout} and notifies + * the registered {@link yfiles.multipage.MultiPageLayouter#layoutCallback layout callback} of the + * calculated result. + *

+ * Warning: + * Unlike other implementations of the + * {@link yfiles.layout.ILayouter#doLayout} method, the result + * of the layout calculation will not be applied to the input graph. + *

+ * @param {yfiles.layout.LayoutGraph} graph the input graph. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Calculates a new multi-page layout for the specified graph. + * @param {yfiles.layout.LayoutGraph} graph the input graph. + * @return {yfiles.multipage.MultiPageLayout} an object that represents the results of the layout run. + * @see {@link yfiles.multipage.MultiPageLayout} + */ + calcLayout(graph:yfiles.layout.LayoutGraph):yfiles.multipage.MultiPageLayout; + /** + * Called during a postprocessing step that reduces the number of connectors. + * A pair of connectors can be removed + * if both connector nodes are placed on the same page. + * This method removes both connector nodes and restores the original edges. It calls method + * {@link yfiles.multipage.MultiPageLayouter#routeRestoredEdges} to route these edges. + * @param {yfiles.algorithms.Node} connector1 the first connector of the connector pair. + * @param {yfiles.algorithms.Node} connector2 the second connector of the connector pair. + * @param {yfiles.algorithms.YList} originalEdgeIds the ids of the original edges that have to be restored. + * @param {yfiles.multipage.LayoutContext} context the current layout context. + * @return {boolean} + * whether or not the removal of the connector pair was successful. + * If the method returns false the graph was not changed, i.e., the connector pair was not removed. + * @see {@link yfiles.multipage.MultiPageLayouter#routeRestoredEdges} + */ + removeConnectorPair(connector1:yfiles.algorithms.Node,connector2:yfiles.algorithms.Node,originalEdgeIds:yfiles.algorithms.YList,context:yfiles.multipage.LayoutContext):boolean; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * The maximum size allowed for a single page. + * The default value is width = height = 1000. + * Note that a large page size may increase runtime significantly. + * To limit runtime use method {@link yfiles.multipage.MultiPageLayouter#preferredMaximalDuration}. + * @see {@link yfiles.multipage.MultiPageLayouter#preferredMaximalDuration} + */ + maxPageSize:yfiles.algorithms.YDimension; + /** + * Called to improve layout results. + * The marked nodes have to be placed without changing the coordinates of the fixed (non-marked) elements, + * without exceeding the specified maximum page size and without violating basic layout properties. + * @param {yfiles.layout.LayoutGraph} graph the graph to layout. + * @param {yfiles.algorithms.IDataProvider} incrementalNodesDP + * a DataProvider that marks nodes that should be placed (nodes for which getBool() + * returns true). The position of the other nodes is not allowed to change. + * @param {yfiles.multipage.LayoutContext} context the current layout context. + * @see {@link yfiles.multipage.LayoutContext} + */ + doIncrementalLayout(graph:yfiles.layout.LayoutGraph,incrementalNodesDP:yfiles.algorithms.IDataProvider,context:yfiles.multipage.LayoutContext):void; + /** + * Called by method {@link yfiles.multipage.MultiPageLayouter#removeConnectorPair} + * to route the restored edges. + * @param {yfiles.layout.LayoutGraph} graph the relevant graph. + * @param {yfiles.algorithms.IDataProvider} selectedEdgesDP marks the edges that should be rerouted. + * @param {yfiles.algorithms.YRectangle} boundingRectangle the edge routes should be fully contained within this rectangle. + * @see {@link yfiles.multipage.MultiPageLayouter#removeConnectorPair} + */ + routeRestoredEdges(graph:yfiles.layout.LayoutGraph,selectedEdgesDP:yfiles.algorithms.IDataProvider,boundingRectangle:yfiles.algorithms.YRectangle):void; + } + var MultiPageLayouter:{ + $class:yfiles.lang.Class; + /** + * Allows to specify a cluster id (an object) for each node. + * Nodes with the same cluster id should preferably be + * placed on the same page. + */ + NODE_CLUSTER_ID_DP_KEY:Object; + /** + * Used to map each node of the input graph to a unique id. + * Note: this DataProvider has to be specified by the user! + */ + NODE_ID_DP_KEY:Object; + /** + * Used to map each edge of the input graph to a unique id. + * Note: this DataProvider has to be specified by the user! + */ + EDGE_ID_DP_KEY:Object; + /** + * Used to map each edge label of the input graph to a unique id. + * Note: this DataProvider has to be specified by the user! + */ + EDGE_LABEL_ID_DP_KEY:Object; + /** + * Used to map each node label of the input graph to a unique id. + * Note: this DataProvider has to be specified by the user! + */ + NODE_LABEL_ID_DP_KEY:Object; + /** + * Allows to specify the edge kind (an object). + * Multi-edges (edges with same endpoints) of different kind are distinguished if + * {@link yfiles.multipage.MultiPageLayouter#edgeBundleModeMask} & {@link yfiles.multipage.EdgeBundleMode#DISTINGUISH_TYPES} == 1. + * @see {@link yfiles.multipage.EdgeBundleMode#DISTINGUISH_TYPES} + * @see {@link yfiles.multipage.MultiPageLayouter#edgeBundleModeMask} + */ + EDGE_TYPE_DP_KEY:Object; + /** + * Creates an instance of this layouter. + * @param {yfiles.layout.ILayouter} core the layouter used to layout a page. + */ + new (core:yfiles.layout.ILayouter):yfiles.multipage.MultiPageLayouter; + }; + /** + * Class that represents the layout context. + */ + export interface LayoutContext extends Object,yfiles.multipage.IElementInfoManager{ + /** + * All methods of the {@link yfiles.multipage.IElementFactory} have to use this method to create an edge. + * @param {yfiles.algorithms.Node} source the source of the edge. + * @param {yfiles.algorithms.Node} target the target of the edge. + * @param {Object} sameDataElementId + * the id of the edge whose data should be copied to the created edge + * (or null if no data should be copied). + * @return {yfiles.algorithms.Edge} the created edge. + * @see {@link yfiles.multipage.IElementFactory} + */ + createEdge(source:yfiles.algorithms.Node,target:yfiles.algorithms.Node,sameDataElementId:Object):yfiles.algorithms.Edge; + /** + * All methods of the {@link yfiles.multipage.IElementFactory} have to use this method to create a node. + * @param {Object} sameDataElementId + * the id of the node whose data should be copied to the created node + * (or null if no data should be copied). + * @return {yfiles.algorithms.Node} the created node. + * @see {@link yfiles.multipage.IElementFactory} + */ + createNode(sameDataElementId:Object):yfiles.algorithms.Node; + /** + * Adds a label to a node. + * @param {yfiles.layout.INodeLabelLayout} label the label that should be added to the node. + * @param {yfiles.algorithms.Node} labeledElement the node the label should be added to. + */ + addNodeLabel(label:yfiles.layout.INodeLabelLayout,labeledElement:yfiles.algorithms.Node):void; + /** + * Adds a label to an edge. + * @param {yfiles.layout.IEdgeLabelLayout} label the label that should be added to the edge. + * @param {yfiles.algorithms.Edge} labeledElement the edge the label should be added to. + */ + addEdgeLabel(label:yfiles.layout.IEdgeLabelLayout,labeledElement:yfiles.algorithms.Edge):void; + /** + * Removes a label from a node. + * @param {yfiles.layout.INodeLabelLayout} label the label that should be removed. + * @param {yfiles.algorithms.Node} labeledElement the node owning the label. + */ + removeNodeLabel(label:yfiles.layout.INodeLabelLayout,labeledElement:yfiles.algorithms.Node):boolean; + /** + * Removes a label from an edge. + * @param {yfiles.layout.IEdgeLabelLayout} label the label that should be removed. + * @param {yfiles.algorithms.Edge} labeledElement the edge owning the label. + */ + removeEdgeLabel(label:yfiles.layout.IEdgeLabelLayout,labeledElement:yfiles.algorithms.Edge):boolean; + /** + * The relevant graph. + */ + graph:yfiles.layout.LayoutGraph; + /** + * The layouter object that belongs to this layout context. + */ + layouter:yfiles.multipage.MultiPageLayouter; + /** + * Returns the node of a page graph (a graph that represents the result of the multi page layout) + * with the given id or null if there is no such node. + * @param {Object} id the id of the node that should be returned. + * @return {yfiles.algorithms.Node} the node of a page graph with the given id or null if there is no such node. + */ + getPageNode(id:Object):yfiles.algorithms.Node; + /** + * Returns the edge of a page graph (a graph that represents the result of the multi page layout) + * with the given id or null if there is no such edge. + * @param {Object} id the id of the edge that should be returned. + * @return {yfiles.algorithms.Edge} the edge of a page graph with the given id or null if there is no such edge. + */ + getPageEdge(id:Object):yfiles.algorithms.Edge; + /** + * Returns the node of the input graph with the given id or null if there is no such node. + * @param {Object} id the id of the node that should be returned. + * @return {yfiles.algorithms.Node} the node of the input graph with the given id or null if there is no such node. + */ + getOriginalNode(id:Object):yfiles.algorithms.Node; + /** + * Returns the edge of the input graph with the given id or null if there is no such edge. + * @param {Object} id the id of the edge that should be returned. + * @return {yfiles.algorithms.Edge} the edge of the input graph with the given id or null if there is no such edge. + */ + getOriginalEdge(id:Object):yfiles.algorithms.Edge; + /** + * Returns the edge label information object of the given edge label layout. + * @param {yfiles.layout.IEdgeLabelLayout} ell the edge label layout for which the information object should be returned. + * @return {yfiles.multipage.IEdgeLabelInfo} the edge label information object of the given edge label layout. + * @see Specified by {@link yfiles.multipage.IElementInfoManager#getEdgeLabelInfo}. + */ + getEdgeLabelInfo(ell:yfiles.layout.IEdgeLabelLayout):yfiles.multipage.IEdgeLabelInfo; + /** + * Returns the node label layout information object of the given node label layout. + * @param {yfiles.layout.INodeLabelLayout} nll the node label layout for which the information object should be returned. + * @return {yfiles.multipage.INodeLabelInfo} the node label information object of the given node label layout. + * @see Specified by {@link yfiles.multipage.IElementInfoManager#getNodeLabelInfo}. + */ + getNodeLabelInfo(nll:yfiles.layout.INodeLabelLayout):yfiles.multipage.INodeLabelInfo; + /** + * Returns the node information object of the given node. + * @param {yfiles.algorithms.Node} n the node for which the information object should be returned. + * @return {yfiles.multipage.INodeInfo} the node information object of the given node. + * @see Specified by {@link yfiles.multipage.IElementInfoManager#getNodeInfo}. + */ + getNodeInfo(n:yfiles.algorithms.Node):yfiles.multipage.INodeInfo; + /** + * Returns the edge information object of the given edge. + * @param {yfiles.algorithms.Edge} e the edge for which the information object should be returned. + * @return {yfiles.multipage.IEdgeInfo} the edge information object of the given edge. + * @see Specified by {@link yfiles.multipage.IElementInfoManager#getEdgeInfo}. + */ + getEdgeInfo(e:yfiles.algorithms.Edge):yfiles.multipage.IEdgeInfo; + } + var LayoutContext:{ + $class:yfiles.lang.Class; + }; + /** + * A class that holds all information related to a node label. + */ + export interface INodeLabelInfo extends Object{ + /** + * The unique id of the related node label. + * @see Specified by {@link yfiles.multipage.INodeLabelInfo#id}. + */ + id:Object; + } + var INodeLabelInfo:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A class that holds all information related to an edge label. + */ + export interface IEdgeLabelInfo extends Object{ + /** + * The unique id of the related edge label. + * @see Specified by {@link yfiles.multipage.IEdgeLabelInfo#id}. + */ + id:Object; + } + var IEdgeLabelInfo:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum EdgeType{ + /** + * Edge type specifier. + * This value specifies that the edge is a normal edge, i.e., it does not belong to another type. + * @see {@link yfiles.multipage.IEdgeInfo#type} + */ + NORMAL, + /** + * Edge type specifier. + * This value specifies that the edge is connected to a connector node (a node of type + * {@link yfiles.multipage.NodeType#CONNECTOR}), i.e., it represents an edge of the input graph + * whose endpoints lie on different pages. + * @see {@link yfiles.multipage.IEdgeInfo#representedEdge} + * @see {@link yfiles.multipage.IEdgeInfo#type} + * @see {@link yfiles.multipage.NodeType#CONNECTOR} + */ + CONNECTOR, + /** + * Edge type specifier. + * This value specifies that the edge is connected to a proxy reference node + * (a node of type {@link yfiles.multipage.NodeType#PROXY_REFERENCE}), i.e., a node that + * refers to a proxy of an original node lying on another page. + * @see {@link yfiles.multipage.IEdgeInfo#type} + * @see {@link yfiles.multipage.NodeType#PROXY_REFERENCE} + */ + PROXY_REFERENCE, + /** + * Edge type specifier. + * This value specifies that the edge is connected to a proxy node (a node of + * type {@link yfiles.multipage.NodeType#PROXY}), i.e., a node that is a proxy of an + * original node lying on another page. + * @see {@link yfiles.multipage.IEdgeInfo#type} + * @see {@link yfiles.multipage.NodeType#PROXY} + */ + PROXY + } + /** + * Default implementation of an ElementFactory. + * @see {@link yfiles.multipage.IElementFactory} + */ + export interface DefaultElementFactory extends Object,yfiles.multipage.IElementFactory{ + /** + * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#CONNECTOR}. + * The edge should connect the given connector and opposite node. + * Note: all implementations have to use method {@link yfiles.multipage.LayoutContext#createEdge} + * to create the edge. + * @param {yfiles.multipage.LayoutContext} context + * an object providing relevant layout information, e.g., the current graph as well as + * various information about the graph elements. + * @param {yfiles.algorithms.Node} connector the endpoint of the edge that represents the connector node. + * @param {yfiles.algorithms.Node} opposite the other endpoint of the edge. + * @param {Object} origEdgeId the id of the edge that is split by the connector edge. + * @param {boolean} atTarget whether or not the connector node is the target of the edge. + * @return {yfiles.algorithms.Edge} the created connector edge. + * @see {@link yfiles.multipage.EdgeType#CONNECTOR} + * @see {@link yfiles.multipage.LayoutContext#createEdge} + * @see Specified by {@link yfiles.multipage.IElementFactory#createConnectorEdge}. + */ + createConnectorEdge(context:yfiles.multipage.LayoutContext,connector:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,origEdgeId:Object,atTarget:boolean):yfiles.algorithms.Edge; + /** + * Callback method for creating a node of type {@link yfiles.multipage.NodeType#CONNECTOR}. + * Note: all implementations have to use method {@link yfiles.multipage.LayoutContext#createNode} to create the node. + * @param {yfiles.multipage.LayoutContext} context + * an object providing relevant layout information, e.g., the current graph as well as + * various information about the graph elements. + * @param {yfiles.algorithms.YList} edgesIds + * a list that contains the ids of edges that are split by this connector. Note: multi-edges + * (edges connecting the same nodes) may be split by the same connector pair. + * @param {Object} representedNodeId the id of the node that is represented by this connector. + * @return {yfiles.algorithms.Node} the created connector node + * @see {@link yfiles.multipage.NodeType#CONNECTOR} + * @see {@link yfiles.multipage.LayoutContext#createNode} + * @see {@link yfiles.multipage.INodeInfo#representedNode} + * @see Specified by {@link yfiles.multipage.IElementFactory#createConnectorNode}. + */ + createConnectorNode(context:yfiles.multipage.LayoutContext,edgeIds:yfiles.algorithms.YList,representedNodeId:Object):yfiles.algorithms.Node; + /** + * Callback method for creating a node of type {@link yfiles.multipage.NodeType#PROXY_REFERENCE}. + * Note: all implementations have to use method {@link yfiles.multipage.LayoutContext#createNode} to create the node. + * @param {yfiles.multipage.LayoutContext} context + * an object providing relevant layout information, e.g., the current graph as well as + * various information about the graph elements. + * @param {Object} referringProxyId the id of the proxy to which the created node refers to. + * @return {yfiles.algorithms.Node} the new proxy reference node. + * @see {@link yfiles.multipage.NodeType#PROXY_REFERENCE} + * @see {@link yfiles.multipage.LayoutContext#createNode} + * @see {@link yfiles.multipage.NodeType#PROXY} + * @see Specified by {@link yfiles.multipage.IElementFactory#createProxyReferenceNode}. + */ + createProxyReferenceNode(context:yfiles.multipage.LayoutContext,referringProxyId:Object):yfiles.algorithms.Node; + /** + * Callback method for creating a node of type {@link yfiles.multipage.NodeType#PROXY}. + * Note: all implementations have to use method {@link yfiles.multipage.LayoutContext#createNode} to create the node. + * @param {yfiles.multipage.LayoutContext} context + * an object providing relevant layout information, e.g., the current graph as well as + * various information about the graph elements. + * @param {Object} origNodeId the id of the node for which a proxy has to be created. + * @return {yfiles.algorithms.Node} the proxy. + * @see {@link yfiles.multipage.LayoutContext#createNode} + * @see {@link yfiles.multipage.NodeType#PROXY} + * @see Specified by {@link yfiles.multipage.IElementFactory#createProxyNode}. + */ + createProxyNode(context:yfiles.multipage.LayoutContext,origNodeId:Object):yfiles.algorithms.Node; + /** + * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#PROXY_REFERENCE}. + * This (undirected) edge should connect the given proxy reference and opposite node. + * Note: all implementations have to use method {@link yfiles.multipage.LayoutContext#createEdge} + * to create the edge. + * @param {yfiles.multipage.LayoutContext} context + * an object providing relevant layout information, e.g., the current graph as well as + * various information about the graph elements. + * @param {yfiles.algorithms.Node} proxyReference + * the endpoint of the edge that represents the proxy + * reference node. + * @param {yfiles.algorithms.Node} opposite the other endpoint of the new edge. + * @param {Object} referencingCopyId + * the id of the proxy node that is referenced by the + * proxy reference node. + * @return {yfiles.algorithms.Edge} the created proxy reference edge. + * @see {@link yfiles.multipage.EdgeType#PROXY_REFERENCE} + * @see {@link yfiles.multipage.NodeType#PROXY_REFERENCE} + * @see {@link yfiles.multipage.LayoutContext#createEdge} + * @see Specified by {@link yfiles.multipage.IElementFactory#createProxyReferenceEdge}. + */ + createProxyReferenceEdge(context:yfiles.multipage.LayoutContext,proxyReference:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,referencingCopyId:Object):yfiles.algorithms.Edge; + /** + * Callback method for creating an edge of type {@link yfiles.multipage.EdgeType#PROXY}. + * The edge should connect the given proxy node and opposite node. + * Note: all implementations have to use method {@link yfiles.multipage.LayoutContext#createEdge} + * to create the edge. + * @param {yfiles.multipage.LayoutContext} context + * an object providing relevant layout information, e.g., the current graph as well as + * various information about the graph elements. + * @param {yfiles.algorithms.Node} proxyNode the endpoint of the edge that represents the proxy node. + * @param {yfiles.algorithms.Node} opposite the other endpoint of the new edge. + * @param {Object} replacingEdgeId the id of the related edge that is connected to the original node. + * @param {Object} origNodeId the id of the original node to which the proxy node refers to. + * @return {yfiles.algorithms.Edge} the created proxy edge. + * @see {@link yfiles.multipage.EdgeType#PROXY} + * @see {@link yfiles.multipage.NodeType#PROXY} + * @see {@link yfiles.multipage.LayoutContext#createEdge} + * @see Specified by {@link yfiles.multipage.IElementFactory#createProxyEdge}. + */ + createProxyEdge(context:yfiles.multipage.LayoutContext,proxyNode:yfiles.algorithms.Node,opposite:yfiles.algorithms.Node,replacingEdgeId:Object,origNodeId:Object):yfiles.algorithms.Edge; + /** + * Returns the default size for nodes created by this factory. + * Called from + * {@link yfiles.multipage.DefaultElementFactory#createConnectorNode}, + * {@link yfiles.multipage.DefaultElementFactory#createProxyReferenceNode}, and/or + * {@link yfiles.multipage.DefaultElementFactory#createProxyNode}. + * Must return a non-null size with positive width and height. + * @param {yfiles.multipage.LayoutContext} context + * an object providing relevant layout information, + * e.g., the current graph as well as various information about the graph + * elements. + * @param {Object} id + * the element ID that was passed to the calling create + * method. + * @param {number} type the type of node to be created. + * @return {yfiles.algorithms.YDimension} the default size of the new node. + */ + getDefaultNodeSize(context:yfiles.multipage.LayoutContext,id:Object,type:number):yfiles.algorithms.YDimension; + } + var DefaultElementFactory:{ + $class:yfiles.lang.Class; + }; + /** + * Represents the result of a layout run of the {@link yfiles.multipage.MultiPageLayouter}. + */ + export interface MultiPageLayout extends Object,yfiles.multipage.IElementInfoManager{ + /** + * Returns the number of pages available in this MultiPageLayout. + * @return {number} the number of available pages. + * @see {@link yfiles.multipage.MultiPageLayout#getPage} + */ + pageCount():number; + /** + * Returns the layout graph on the given page. + * @param {number} pageNo + * the page for which the layout graph. + * Allowed value range is 0 <= pageNo < pageCount. + * @return {yfiles.layout.LayoutGraph} the layout graph on the given page. + * @throws {yfiles.system.IndexOutOfRangeException} + * if pageNo >= pageCount or + * pageNo < 0. + * @see {@link yfiles.multipage.MultiPageLayout#pageCount} + */ + getPage(pageNo:number):yfiles.layout.LayoutGraph; + /** + * Returns the edge information object of the given edge. + * @param {yfiles.algorithms.Edge} e the edge for which the information object should be returned. + * @return {yfiles.multipage.IEdgeInfo} the edge information object of the given edge. + * @see Specified by {@link yfiles.multipage.IElementInfoManager#getEdgeInfo}. + */ + getEdgeInfo(e:yfiles.algorithms.Edge):yfiles.multipage.IEdgeInfo; + /** + * Returns the node information object of the given node. + * @param {yfiles.algorithms.Node} n the node for which the information object should be returned. + * @return {yfiles.multipage.INodeInfo} the node information object of the given node. + * @see Specified by {@link yfiles.multipage.IElementInfoManager#getNodeInfo}. + */ + getNodeInfo(n:yfiles.algorithms.Node):yfiles.multipage.INodeInfo; + /** + * Returns the node label layout information object of the given node label layout. + * @param {yfiles.layout.INodeLabelLayout} nll the node label layout for which the information object should be returned. + * @return {yfiles.multipage.INodeLabelInfo} the node label information object of the given node label layout. + * @see Specified by {@link yfiles.multipage.IElementInfoManager#getNodeLabelInfo}. + */ + getNodeLabelInfo(nll:yfiles.layout.INodeLabelLayout):yfiles.multipage.INodeLabelInfo; + /** + * Returns the edge label information object of the given edge label layout. + * @param {yfiles.layout.IEdgeLabelLayout} ell the edge label layout for which the information object should be returned. + * @return {yfiles.multipage.IEdgeLabelInfo} the edge label information object of the given edge label layout. + * @see Specified by {@link yfiles.multipage.IElementInfoManager#getEdgeLabelInfo}. + */ + getEdgeLabelInfo(ell:yfiles.layout.IEdgeLabelLayout):yfiles.multipage.IEdgeLabelInfo; + } + var MultiPageLayout:{ + $class:yfiles.lang.Class; + }; + export enum GroupingMode{ + /** + * Node grouping specifier. + * This value specifies that group nodes are completely ignored. + * @see {@link yfiles.multipage.MultiPageLayouter#groupMode} + * @see {@link yfiles.multipage.MultiPageLayouter#groupMode} + */ + IGNORE, + /** + * Node grouping specifier. + * This value specifies that only original nodes are assigned in group nodes. + * @see {@link yfiles.multipage.MultiPageLayouter#groupMode} + * @see {@link yfiles.multipage.MultiPageLayouter#groupMode} + */ + ORIGINAL_NODES_ONLY, + /** + * Node grouping specifier. + * This value specifies that special nodes like, e.g., connector and proxy + * nodes are assigned to group nodes, too. + * @see {@link yfiles.multipage.MultiPageLayouter#groupMode} + * @see {@link yfiles.multipage.MultiPageLayouter#groupMode} + */ + ALL_NODES + } + /** + * A class that holds all information related to an edge. + */ + export interface IEdgeInfo extends Object{ + /** + * The unique id of the related edge. + * @see Specified by {@link yfiles.multipage.IEdgeInfo#id}. + */ + id:Object; + /** + * The type of the related edge. + * @see Specified by {@link yfiles.multipage.IEdgeInfo#type}. + */ + type:yfiles.multipage.EdgeType; + /** + * The original edge. + * That is, for edges of type {@link yfiles.multipage.EdgeType#CONNECTOR}, + * the edge of the input graph that was split by the connector edge is + * returned. + * @see {@link yfiles.multipage.EdgeType#CONNECTOR} + * @see Specified by {@link yfiles.multipage.IEdgeInfo#representedEdge}. + */ + representedEdge:yfiles.algorithms.Edge; + } + var IEdgeInfo:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum NodeType{ + /** + * Node type specifier. + * This value specifies that the node is a normal node, i.e., it does not belong to another type. + * @see {@link yfiles.multipage.INodeInfo#type} + */ + NORMAL, + /** + * Node type specifier. + * This value specifies that the node is a group node, i.e., a node that contains other nodes. + * @see {@link yfiles.multipage.INodeInfo#type} + */ + GROUP, + /** + * Node type specifier. + * This value specifies that the node is a proxy node, i.e., it is a copy of a normal node. + * @see {@link yfiles.multipage.INodeInfo#type} + * @see {@link yfiles.multipage.NodeType#NORMAL} + */ + PROXY, + /** + * Node type specifier. + * This value specifies that the node is a proxy reference node, i.e., it refers to a proxy node. + * @see {@link yfiles.multipage.INodeInfo#type} + * @see {@link yfiles.multipage.NodeType#PROXY} + */ + PROXY_REFERENCE, + /** + * Node type specifier. + * This value specifies that the node is a connector node, i.e., a node that represents a jump mark to another connector node. + * Such a connector pair is used to represent edges that connects two nodes on different pages. + * @see {@link yfiles.multipage.INodeInfo#type} + */ + CONNECTOR + } + export enum EdgeBundleMode{ + /** + * Edge bundle mode specifier. + * Used to define edge bundles. All multi-edges (edges with same endpoints) belonging to the same edge bundle are + * split by the same connector pair (see {@link yfiles.multipage.NodeType#CONNECTOR}). + * This value specifies that all multi-edges should be distinguished, i.e., a separate connector pair is used for each + * multi-edge. + * @see {@link yfiles.multipage.MultiPageLayouter#edgeBundleModeMask} + * @see {@link yfiles.multipage.MultiPageLayouter#edgeBundleModeMask} + */ + DISTINGUISH_MULTI_EDGES, + /** + * Edge bundle mode specifier. + * Used to define edge bundles. All multi-edges (edges with same endpoints) belonging to the same edge bundle are + * split by the same connector pair (see {@link yfiles.multipage.NodeType#CONNECTOR}). + * This value specifies that multi-edges should be distinguished if the have different directions. + * @see {@link yfiles.multipage.MultiPageLayouter#edgeBundleModeMask} + * @see {@link yfiles.multipage.MultiPageLayouter#edgeBundleModeMask} + */ + DISTINGUISH_DIRECTIONS, + /** + * Edge bundle mode specifier. + * Used to define edge bundles. All multi-edges (edges with same endpoints) belonging to the same edge bundle are + * split by the same connector pair (see {@link yfiles.multipage.NodeType#CONNECTOR}). + * This value specifies that multi-edges should be distinguished if they are of different (user specified) type, see + * {@link yfiles.multipage.MultiPageLayouter#EDGE_TYPE_DP_KEY}. + * @see {@link yfiles.multipage.MultiPageLayouter#edgeBundleModeMask} + * @see {@link yfiles.multipage.MultiPageLayouter#edgeBundleModeMask} + */ + DISTINGUISH_TYPES + } + } + export module objectcollections{ + /** + * Defines ways to iterate over the items contained in this type by providing a method to get an {@link yfiles.objectcollections.IEnumerator}. + * This interface exists for internal purposes, if possible the {@link yfiles.collections.IEnumerable} interface should be used instead. + */ + export interface IEnumerable extends Object{ + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Converts a untyped enumerable into an enumerable with the given type. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#ofType}. + * @return {yfiles.collections.IEnumerable.} A typed enumerable. + */ + getEnumerableOfType(type:yfiles.lang.Class):yfiles.collections.IEnumerable; + /** + * Casts the elements of the enumerable to the specified type and returns a typed {@link yfiles.collections.IEnumerable}. + * This is a bridge method that delegates to {@link yfiles.collections.EnumerableExtensions#cast}. + * @return {yfiles.collections.IEnumerable.} This implementation returns the original enumerable. + */ + getCastedEnumerable():yfiles.collections.IEnumerable; + } + var IEnumerable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Provides methods to iterate over a collection or list. + */ + export interface IEnumerator extends Object{ + /** + * Moves this enumerator to the next element. + * A newly created enumerator's {@link yfiles.objectcollections.IEnumerator#currentObject current position} is before the first element. Thus, this method + * must be called before first access to the {@link yfiles.objectcollections.IEnumerator#currentObject} property. The same applies to the state after + * calling {@link yfiles.objectcollections.IEnumerator#reset}. + * @return {boolean} true if the enumerator was moved to a valid position + * @see Specified by {@link yfiles.objectcollections.IEnumerator#moveNext}. + */ + moveNext():boolean; + /** + * Resets the enumerator to its starting state. + * In other words: sets the current position before the first element. + * @see Specified by {@link yfiles.objectcollections.IEnumerator#reset}. + */ + reset():void; + /** + * Gets the element at the enumerator's current position. + * This value is undefined if the enumerator is in initial state (after creation or {@link yfiles.objectcollections.IEnumerator#reset}) or has been moved past the + * end of the represented collection. + * @see Specified by {@link yfiles.objectcollections.IEnumerator#currentObject}. + */ + currentObject:Object; + } + var IEnumerator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A read-write collection of objects. + */ + export interface IList extends Object,yfiles.objectcollections.ICollection{ + /** + * Determines the index of the given item in the {@link yfiles.objectcollections.IList}. + * @param {Object} item The object to get the index for + * @return {number} The index of the given item. -1 if the item is not in the list. + * @see Specified by {@link yfiles.objectcollections.IList#indexOfItem}. + */ + indexOfItem(item:Object):number; + /** + * Inserts the given item at the given index. + * @param {number} index The index at which the item should be inserted. + * @param {Object} item The item to insert. + * @see Specified by {@link yfiles.objectcollections.IList#insertAt}. + */ + insertAt(index:number,item:Object):void; + /** + * Removes the item at the given index from the list. + * @param {number} index The index of the item which should be removed. + * @see Specified by {@link yfiles.objectcollections.IList#removeAt}. + */ + removeAt(index:number):void; + /** + * Removes the given object from the list. + * @param {Object} value The object to remove. + * @see Specified by {@link yfiles.objectcollections.IList#removeValue}. + */ + removeValue(value:Object):void; + /** + * Whether this list contains the given object. + * @param {Object} value The object to search for. + * @return {boolean} true if the given object is contained in the list. + * @see Specified by {@link yfiles.objectcollections.IList#containsValue}. + */ + containsValue(value:Object):boolean; + /** + * Removes all elements from the list. + * @see Specified by {@link yfiles.objectcollections.IList#clear}. + */ + clear():void; + /** + * Adds the given object at the end of the list. + * @param {Object} value The object to add. + * @return {number} The index of the added object. + * @see Specified by {@link yfiles.objectcollections.IList#addWithValue}. + */ + addWithValue(value:Object):number; + /** + * Gets or sets the object at the given index. + * @param {number} index The index of the object to access. + * @return {Object} The object at the given index. + * @see Specified by {@link yfiles.objectcollections.IList#getObject}. + */ + getObject(index:number):Object; + /** + * Gets or sets the object at the given index. + * @param {number} index The index of the object to access. + * @return {Object} The object at the given index. + * @see Specified by {@link yfiles.objectcollections.IList#getObject}. + */ + setObject(index:number,value:Object):void; + /** + * Whether the collection is read-only. + * @see Specified by {@link yfiles.objectcollections.IList#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Whether the collection has a fixed size. + * @see Specified by {@link yfiles.objectcollections.IList#isFixedSize}. + */ + isFixedSize:boolean; + } + var IList:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An {@link yfiles.objectcollections.IEnumerator} which allows to iterate over an {@link yfiles.objectcollections.IDictionary}'s key/value pairs. + */ + export interface IDictionaryEnumerator extends Object,yfiles.objectcollections.IEnumerator{ + /** + * The key of the {@link yfiles.objectcollections.IEnumerator#currentObject current key/value pair}. + * @see Specified by {@link yfiles.objectcollections.IDictionaryEnumerator#key}. + */ + key:Object; + /** + * The value of the {@link yfiles.objectcollections.IEnumerator#currentObject current key/value pair}. + * @see Specified by {@link yfiles.objectcollections.IDictionaryEnumerator#value}. + */ + value:Object; + } + var IDictionaryEnumerator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Provides a method to compare two objects. + */ + export interface IComparer extends Object{ + /** + * Compares two objects. + * @param {Object} x The first object. + * @param {Object} y The second object. + * @return {number}
    + *
  • -1: x is less than y
  • + *
  • 0: x is equal to y
  • + *
  • 1: x is greater than y
  • + *
+ * @see Specified by {@link yfiles.objectcollections.IComparer#compare}. + */ + compare(x:Object,y:Object):number; + } + var IComparer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Defines methods to manipulate collections. + */ + export interface ICollection extends Object,yfiles.objectcollections.IEnumerable{ + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.objectcollections.ICollection#count}. + */ + count:number; + /** + * Copies the elements of this collection into the given array starting at the given arrayIndex. + * @param {Object} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.objectcollections.ICollection#copyTo}. + */ + copyTo(array:Object,arrayIndex:number):void; + /** + * @see Specified by {@link yfiles.objectcollections.ICollection#isSynchronized}. + */ + isSynchronized:boolean; + /** + * @see Specified by {@link yfiles.objectcollections.ICollection#syncRoot}. + */ + syncRoot:Object; + } + var ICollection:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A collection of value objects which are mapped to key objects and can be queried using their keys. + * The keys must have a well defined hashCode method that must not change between registering a value for the key + * and retrieving a value using the key. + * Thus it is advisable to use stable, i.e. immutable, objects as the key. + */ + export interface IDictionary extends Object,yfiles.objectcollections.ICollection{ + /** + * Adds the given key / value pair to this dictionary. + * @param {Object} key The key to which the given value should be mapped. + * @param {Object} value The value which should be mapped to the given key. + * @see Specified by {@link yfiles.objectcollections.IDictionary#addWithKeyAndValue}. + */ + addWithKeyAndValue(key:Object,value:Object):void; + /** + * Whether this dictionary's key collection contains the given value. + * @param {Object} value The value to search for. + * @return {boolean} true if this dictionary contains the given value. + * @see Specified by {@link yfiles.objectcollections.IDictionary#containsWithValue}. + */ + containsWithValue(value:Object):boolean; + /** + * Removes the key/value pair which is represented by the given key. + * @param {Object} key The key of the key/value pair to remove. + * @see Specified by {@link yfiles.objectcollections.IDictionary#removeWithKey}. + */ + removeWithKey(key:Object):void; + /** + * An {@link yfiles.objectcollections.ICollection} with the keys of the {@link yfiles.objectcollections.IDictionary}. + * @see Specified by {@link yfiles.objectcollections.IDictionary#objectKeys}. + */ + objectKeys:yfiles.objectcollections.ICollection; + /** + * Gets or sets the value of the key/value pair with the given key. + * Setter: if there is already a key/value pair with the given key in the dictionary its value will be overridden. If not + * a new key/value pair will be added. + * Getter: if there is no key/value pair with the given key in this dictionary an exception will be thrown. + * @param {Object} key + * @return {Object} + * @throws {yfiles.system.KeyNotFoundException} (Getter only): The given key cannot be found in this dictionary. + * @see Specified by {@link yfiles.objectcollections.IDictionary#getObject}. + */ + getObject(key:Object):Object; + /** + * Gets or sets the value of the key/value pair with the given key. + * Setter: if there is already a key/value pair with the given key in the dictionary its value will be overridden. If not + * a new key/value pair will be added. + * Getter: if there is no key/value pair with the given key in this dictionary an exception will be thrown. + * @param {Object} key + * @return {Object} + * @throws {yfiles.system.KeyNotFoundException} (Getter only): The given key cannot be found in this dictionary. + * @see Specified by {@link yfiles.objectcollections.IDictionary#getObject}. + */ + putObject(key:Object,value:Object):void; + /** + * An {@link yfiles.objectcollections.ICollection} with the values in the {@link yfiles.objectcollections.IDictionary}. + * @see Specified by {@link yfiles.objectcollections.IDictionary#objectValues}. + */ + objectValues:yfiles.objectcollections.ICollection; + /** + * Removes all key/value pairs from this dictionary. + * @see Specified by {@link yfiles.objectcollections.IDictionary#clear}. + */ + clear():void; + /** + * Whether this dictionary is read-only. + * @see Specified by {@link yfiles.objectcollections.IDictionary#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Whether this dictionary has a fixed size. + * @see Specified by {@link yfiles.objectcollections.IDictionary#isFixedSize}. + */ + isFixedSize:boolean; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which allows to iterate over this dictionary's key/value pairs. + * @return {yfiles.objectcollections.IDictionaryEnumerator} + * @see Specified by {@link yfiles.objectcollections.IDictionary#getDictionaryEnumerator}. + */ + getDictionaryEnumerator():yfiles.objectcollections.IDictionaryEnumerator; + } + var IDictionary:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + } + export module organic{ + /** + * This LayoutStage removes node overlaps considering the specified minimal node distance. + * Unlike the approach implemented in class {@link yfiles.organic.RemoveOverlapsLayoutStage}, this approach tries + * to keep the original layout structure, i.e., it tries to keep the geometric distance between the nodes. + * Therefore, it uses a similar strategy than organic layout algorithms. + * Thus, it is especially suited to remove node overlaps + * in undirected graph drawings with straight-line edge routes, e.g., layouts produced by the organic layouter. + */ + export interface OrganicRemoveOverlapsStage extends yfiles.layout.AbstractLayoutStage{ + /** + * The time limit (in milliseconds) set for the layout stage + * (not including the time required by the core layouter). + *

Note that restricting the maximum duration may result in a worse layout quality, + * i.e., there could be still some node overlaps. Furthermore, the actual + * runtime may exceed the maximum duration since the layout algorithm still has to find a valid solution.

+ */ + maximumDuration:number; + /** + * The current minimal node distance this layout stage should enforce. + *

The default value is 10.

+ */ + minimumNodeDistance:number; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var OrganicRemoveOverlapsStage:{ + $class:yfiles.lang.Class; + /** + * This key can be used to specify a boolean value that can be used to mark fixed nodes. + */ + FIXED_NODE_DP_KEY:Object; + /** + * Creates a new instance of OrganicRemoveOverlapsStage. + */ + WithCoreLayouter:{ + new (core:yfiles.layout.ILayouter):yfiles.organic.OrganicRemoveOverlapsStage; + }; + /** + * Creates a new instance of OrganicRemoveOverlapsStage. + */ + new ():yfiles.organic.OrganicRemoveOverlapsStage; + }; + /** + * Implementations of this class can be set via a setOutputRestriction(OutputRestriction) method, e.g. + * {@link yfiles.organic.SmartOrganicLayouter#outputRestriction} + * in SmartOrganicLayouter to restrict the output area and shape of the layout. + * Instances of this class can only be retrieved from the factory methods or from the static field. + * @see {@link yfiles.organic.OutputRestriction#NONE} + * @see {@link yfiles.organic.OutputRestriction#createAspectRatioRestriction} + * @see {@link yfiles.organic.OutputRestriction#createCircularCageRestriction} + * @see {@link yfiles.organic.OutputRestriction#createEllipticalCageRestriction} + * @see {@link yfiles.organic.OutputRestriction#createRectangularCageRestriction} + */ + export interface OutputRestriction extends Object{ + } + var OutputRestriction:{ + $class:yfiles.lang.Class; + /** + * This restriction actually does not restrict the output. + * It is a no-op. + * It can be used in for use in + * {@link yfiles.organic.SmartOrganicLayouter#outputRestriction} + */ + NONE:yfiles.organic.OutputRestriction; + /** + * This factory method creates a restriction object that can be used + * to restrict the result of a layout run of {@link yfiles.organic.SmartOrganicLayouter} so + * that the nodes lie within the given rectangle. + * @param {number} x x coordinate of the upper-left corner of the restriction rectangle + * @param {number} y y coordinate of the upper-left corner of the restriction rectangle + * @param {number} w width of the restriction rectangle + * @param {number} h height of the restriction rectangle + * @return {yfiles.organic.OutputRestriction} + * an instance for use in {@link yfiles.organic.SmartOrganicLayouter#outputRestriction} + */ + createRectangularCageRestriction(x:number,y:number,w:number,h:number):yfiles.organic.OutputRestriction; + /** + * This factory method creates a restriction object that can be used + * to restrict the result of a layout run of {@link yfiles.organic.SmartOrganicLayouter} so + * that the nodes lie within a circle. + * @param {number} x x coordinate of the center of the restriction circle + * @param {number} y y coordinate of the center of the restriction circle + * @param {number} radius the radius of the restriction circle + * @return {yfiles.organic.OutputRestriction} + * an instance for use in {@link yfiles.organic.SmartOrganicLayouter#outputRestriction} + */ + createCircularCageRestriction(x:number,y:number,radius:number):yfiles.organic.OutputRestriction; + /** + * This factory method creates a restriction object that can be used + * to restrict the result of a layout run of {@link yfiles.organic.SmartOrganicLayouter} so + * that the nodes lie within an ellipse whose main axes are parallel to the coordinate axes. + * @param {number} x x coordinate of the upper left corner + * @param {number} y y coordinate of the upper left corner + * @param {number} w width of the bounding box of the ellipse + * @param {number} h the height of the bounding box of the ellipse + * @return {yfiles.organic.OutputRestriction} + * an instance for use in {@link yfiles.organic.SmartOrganicLayouter#outputRestriction} + */ + createEllipticalCageRestriction(x:number,y:number,w:number,h:number):yfiles.organic.OutputRestriction; + /** + * This factory method creates a restriction object that can be used + * to restrict the result of a layout run of {@link yfiles.organic.SmartOrganicLayouter} so + * that the bounding box roughly has the given aspect ratio. + * @param {number} ratio the preferred aspect ratio (width/height) of the output + * @return {yfiles.organic.OutputRestriction} + * an instance for use in {@link yfiles.organic.SmartOrganicLayouter#outputRestriction} + */ + createAspectRatioRestriction(ratio:number):yfiles.organic.OutputRestriction; + }; + /** + * Layout stage that is used for handling a given partition grid structure that is + * attached to a graph with DataProvider {@link yfiles.layout.PartitionGrid#PARTITION_GRID_DP_KEY}. + * Note: the {@link yfiles.organic.SmartOrganicLayouter} automatically uses this stage if required. + * Note: if there is a partition grid structure, + * this layout stage throws an WrongGraphStructure if there are group nodes whose content + * span multiple grid cells or if the associated group node mode data + * (see {@link yfiles.organic.SmartOrganicLayouter#GROUP_NODE_MODE_DP_KEY}) + * is equals to {@link yfiles.organic.SmartOrganicLayouter#GROUP_NODE_MODE_FIX_BOUNDS} + * or {@link yfiles.organic.SmartOrganicLayouter#GROUP_NODE_MODE_FIX_CONTENTS}. + * @see {@link yfiles.layout.PartitionGrid} + */ + export interface OrganicPartitionGridLayoutStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var OrganicPartitionGridLayoutStage:{ + $class:yfiles.lang.Class; + new (core:yfiles.layout.ILayouter):yfiles.organic.OrganicPartitionGridLayoutStage; + }; + /** + * A graph layout algorithm that is based on a force directed model. + * Here is a sample output of the layouter: + *
+ */ + export interface OrganicLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * The current repulsion. + */ + repulsion:number; + /** + * The current attraction. + */ + attraction:number; + /** + * The GroupBoundsCalculator instance that is used for the + * calculation of the group nodes' bounds if a hierarchically grouped graph is + * being laid out. + * By default a {@link yfiles.layout.MinimumSizeGroupBoundsCalculator} instance + * is registered with this instance. + */ + groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; + /** + * The group node compactness factor. + * Values should be in the range [0..1], + * where 0 results in group nodes not affecting the overall layout too much, whereas + * a value of 1 forces nodes in the same group to be clustered tightly. + * @throws {yfiles.system.ArgumentException} if compactness value does not lie in [0..1] + */ + groupNodeCompactness:number; + /** + * The policy for group nodes. + * Getter:This policy controls the behavior + * of this layouter when acting on hierarchically grouped graphs. + * The default is {@link yfiles.organic.GroupsPolicy#LAYOUT}. + * Setter:This policy controls the behavior + * of this layouter when acting on hierarchically grouped graphs. + * This should be one of {@link yfiles.organic.GroupsPolicy#FIXED}, {@link yfiles.organic.GroupsPolicy#LAYOUT}, or + * {@link yfiles.organic.GroupsPolicy#IGNORE}. + */ + groupNodePolicy:yfiles.organic.GroupsPolicy; + /** + * The initial temperature. + * The temperature will be multiplied with the preferredEdgeLength + * and then assigned as the initial node heat. + *

+ * The default is 0.1d. + *

+ */ + initialTemperature:number; + /** + * The final temperature. + * This is an absolute temperature. If the average temperature falls + * under this value, the layout process comes to a halt. + * The default is 1.0d. + */ + finalTemperature:number; + /** + * Specifies whether or not this layouter is in deterministic mode. + * In a deterministic mode this layouter produces the + * same layouts for the same input graph and layout parameters. + *

+ * By default deterministic mode is inactive. + *

+ */ + activateDeterministicMode:boolean; + /** + * Specifies whether or not to activate the subtree beautifier. + * Activating this feature lays out subtrees within the + * given graph structure in an optimized way. + *

+ * By default this feature is inactive. + *

+ */ + activateTreeBeautifier:boolean; + /** + * The gravity factor. + * The magnitude of the gravity factor + * determines the strength of the force towards the barycenter of the graph. + * A high factor layout tends to cluster nodes + * around the barycenter of the graph. A low factor stretches the outskirts + * of the graph far away from the center. + *

+ * By default a value of 0.0 is assumed. + *

+ */ + gravityFactor:number; + /** + * The sphere of action for this layouter. + *

+ * The default value is {@link yfiles.organic.SphereOfAction#ALL}. + *

+ * @see {@link yfiles.organic.OrganicLayouter#SPHERE_OF_ACTION_NODES_DP_KEY} + */ + sphereOfAction:yfiles.organic.SphereOfAction; + /** + * The initial placement strategy. + *

+ * The default value is {@link yfiles.organic.InitialPlacement#AS_IS}. + *

+ */ + initialPlacement:yfiles.organic.InitialPlacement; + /** + * The maximum duration granted to this layouter. + */ + maximumDuration:number; + /** + * The iteration factor of this layouter. + * A higher iteration factor usually means better layout results and longer + * running times. + *

+ * By default an iteration factor of 3 is set. + *

+ */ + iterationFactor:number; + /** + * The general edge length that should be attained by this + * layouter. + *

+ * By default an edge length of 80 is set. + *

+ */ + preferredEdgeLength:number; + /** + * Specifies whether or not node sizes should be considered by this layouter. + * If you want to layout a diagram with big nodes in it you can reduce + * node overlaps by setting this feature to true. + *

+ * Defaults to true. + *

+ */ + obeyNodeSize:boolean; + /** + * Returns always true because this algorithms has no + * preconditions. + * @return {boolean} true. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Invokes the core layout algorithm. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * Frees resources. + */ + dispose():void; + } + var OrganicLayouter:{ + $class:yfiles.lang.Class; + /** + * DataProvider key used in conjunction with the sphere-of-action feature. + * If this + * data provider key is being used, then it + * must return for each node in the input graph a boolean value indicating whether + * or not it should be handled by this layouter. + * @see {@link yfiles.algorithms.Graph#addDataProvider} + * @see {@link yfiles.organic.OrganicLayouter#sphereOfAction} + */ + SPHERE_OF_ACTION_NODES_DP_KEY:Object; + /** + * DataProvider key used in conjunction with hierarchically grouped graphs. + * If this data provider key is registered with the LayoutGraph, then its associated + * data provider must return for each group node node in the input graph + * a boolean value indicating whether its contents/children should be treated + * as fixed or not. + * @see {@link yfiles.algorithms.Graph#addDataProvider} + * @see {@link yfiles.organic.OrganicLayouter#groupNodePolicy} + * @see {@link yfiles.organic.GroupsPolicy#FIXED} + */ + FIXED_GROUP_NODES_DP_KEY:Object; + /** + * Key used to associate a {@link yfiles.algorithms.IDataProvider} with a + * LayoutGraph. + * The associated DataProvider must return + * an int values for each edge of the LayoutGraph. + * The value returned for a specific edge will be interpreted as + * its preferred edge length. + * If a DataProvider is bound to this key, then the global + * preferredEdgeLength for all edges (see {@link yfiles.organic.OrganicLayouter#preferredEdgeLength}) + * will be ignored. + * Example: Assuming that the edge.tag property contains + * for each edge a double value between 0.0 and 1.0 that should + * be translated to edge length preferences between 0 and 200 for the OrganicLayouter. + *

+      * // register an adequate mapper
+      * graph.mapperRegistry.addMapperGetter(
+      *     yfiles.graph.IEdge.$class, yfiles.lang.Number.$class,
+      *     yfiles.organic.OrganicLayouter.PREFERRED_EDGE_LENGTH_DP_KEY,
+      *     function(edge) { 
+      *         return edge.tag * 200; 
+      *     });
+      * // launch the layouter
+      * graph.applyLayout(layouter);
+      * 
+ */ + PREFERRED_EDGE_LENGTH_DP_KEY:Object; + /** + * Returns a new organic Layouter. + */ + new ():yfiles.organic.OrganicLayouter; + }; + /** + * This LayoutStage removes node overlaps and guarantees a certain minimal + * node distance. + */ + export interface RemoveOverlapsLayoutStage extends Object,yfiles.layout.ILayoutStage{ + /** + * the graph. + */ + graph:yfiles.layout.LayoutGraph; + /** + * the source of randomness. + */ + random:yfiles.algorithms.YRandom; + /** + * x coordinates based on node-indices. + */ + x:number[]; + /** + * y coordinates based on node-indices. + */ + y:number[]; + /** + * widths based on node-indices. + */ + w:number[]; + /** + * heights based on node-indices. + */ + h:number[]; + /** + * the node array. + */ + nodes:yfiles.algorithms.Node[]; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Assigns a new graph layout to the given layout graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * updates arrays x and y according to the current centers of the nodes. + */ + updatePos():void; + /** + * The core layouter. + * @see Specified by {@link yfiles.layout.ILayoutStage#coreLayouter}. + */ + coreLayouter:yfiles.layout.ILayouter; + } + var RemoveOverlapsLayoutStage:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of RemoveOverlapsLayoutStage. + */ + new (minDist:number):yfiles.organic.RemoveOverlapsLayoutStage; + /** + * Creates a new instance of RemoveOverlapsLayoutStage. + */ + WithRandom:{ + new (random:yfiles.algorithms.YRandom,minDist:number):yfiles.organic.RemoveOverlapsLayoutStage; + }; + }; + /** + * This class can be used as a convenience class to gain access to a variety of + * organic layout algorithms. + * Its strength lies in being able to conveniently + * specify a ratio between quality and running time, as well as the ability to + * specify the degree of the compactness of the drawing and + * to guarantee non-overlapping nodes. + * Note: This class is able to consider a partition grid structure (see {@link yfiles.layout.PartitionGrid}). + * However, for common nodes (i.e., non-group nodes) it only considers single partition cells. + * Furthermore, the layout algorithm throws an {@link yfiles.algorithms.InvalidGraphStructureException} if there is a partition grid + * and the descendants of a group node are assigned to different partition grid cells or if there + * are group nodes that are associated with group node mode data + * (see {@link yfiles.organic.SmartOrganicLayouter#GROUP_NODE_MODE_DP_KEY}) + * that is not equal to {@link yfiles.organic.SmartOrganicLayouter#GROUP_NODE_MODE_NORMAL}. + */ + export interface SmartOrganicLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * The group node compactness factor. + * Values should be in the range [0..1], where 0 results in group nodes not + * affecting the overall layout too much, whereas a value of 1 forces nodes in the same group to be clustered + * tightly. + * Note: the specified value is only considered if option {@link yfiles.organic.SmartOrganicLayouter#automaticGroupNodeCompactionEnabled} + * is disabled and if there is no partition grid structure. + *

By default this value is 0.4.

+ * @see {@link yfiles.organic.SmartOrganicLayouter#automaticGroupNodeCompactionEnabled} + * @throws {yfiles.system.ArgumentException} if compactness value does not lie in [0..1] + * @see {@link yfiles.organic.SmartOrganicLayouter#automaticGroupNodeCompactionEnabled} + */ + groupNodeCompactness:number; + /** + * Specifies whether or not the automatic group node compaction is used. + * If this option is enabled the group node compactness + * is determined automatically, i.e., it only depends on the general compactness specified by option + * {@link yfiles.organic.SmartOrganicLayouter#compactness}). The value specified by option {@link yfiles.organic.SmartOrganicLayouter#groupNodeCompactness} is + * ignored. + *

+ * By default this option is enabled. + *

+ * @see {@link yfiles.organic.SmartOrganicLayouter#groupNodeCompactness} + * @see {@link yfiles.organic.SmartOrganicLayouter#compactness} + * @see {@link yfiles.organic.SmartOrganicLayouter#groupNodeCompactness} + * @see {@link yfiles.organic.SmartOrganicLayouter#compactness} + */ + automaticGroupNodeCompactionEnabled:boolean; + /** + * Specifies whether or not a clustering algorithm should be applied. + * If this option is enabled, the following steps are performed during the layout: + *
    + *
  • a clustering algorithm is applied to the input graph.
  • + *
  • all nodes of the same cluster are put into a new group node.
  • + *
  • the common layout is applied to the modified graph.
  • + *
  • group nodes denoting clusters (inserted during step 2) are removed.
  • + *
+ * The user can also specify customized clusters by defining appropriate groups. + *

+ * By default, automatic clustering is not enabled. + *

+ * Note: the runtime of the clustering algorithm does not depend on the specified maximal duration (see method {@link yfiles.organic.SmartOrganicLayouter#maximumDuration}). + *

+ */ + clusterNodes:boolean; + /** + * The quality ratio of the clustering algorithm. + * The higher d the higher the clustering quality. + * Default value is 1. + *

+ * Note: the expected runtime of the clustering algorithm increases with d. + * The runtime does not depend on the specified maximal duration (see method {@link yfiles.organic.SmartOrganicLayouter#maximumDuration}). + *

+ */ + clusteringQuality:number; + /** + * Specifies whether or not node labels are considered for the next layout run. + * Enabling this setting overrides the value of {@link yfiles.organic.SmartOrganicLayouter#nodeSizeAware}, i.e. + * node sizes are always considered. + *

+ * Default value is false. + *

+ */ + considerNodeLabels:boolean; + /** + * The{@link yfiles.layout.IGroupBoundsCalculator} instance used for calculating the size of group nodes. + * The default is {@link yfiles.layout.MinimumSizeGroupBoundsCalculator}. + * @throws {yfiles.system.ArgumentNullException} if the argument is null + */ + groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; + /** + * Determines whether this instance should configure the {@link yfiles.layout.CanonicMultiStageLayouter#componentLayouter ComponentLayouter} + * in such a way that it respects the {@link yfiles.organic.SmartOrganicLayouter#scope scope's} settings {@link yfiles.organic.Scope#SUBSET} and + * {@link yfiles.organic.Scope#MAINLY_SUBSET} by keeping other nodes pinned, even if they reside in different components. + *

+ * The default is false. + *

+ */ + smartComponentLayout:boolean; + /** + * Specifies whether or not the layouter tries to avoid node/edge overlaps. + * Note that the current implementation does not guarantee the non-existence + * of overlaps but tries to avoid them. Furthermore, the post-processing step that removes node overlaps + * ignores node/edge overlaps, i.e., the number of node/edge overlaps may increase if option + * {@link yfiles.organic.SmartOrganicLayouter#nodeOverlapsAllowed} is disabled. + *

+ * By default, this option is not enabled. + *

+ * @see {@link yfiles.organic.SmartOrganicLayouter#nodeOverlapsAllowed} + * @see {@link yfiles.organic.SmartOrganicLayouter#nodeOverlapsAllowed} + */ + nodeEdgeOverlapAvoided:boolean; + /** + * Configures the {@link yfiles.layout.CanonicMultiStageLayouter#componentLayouter ComponentLayouter} + * and graph instance to adhere to the {@link yfiles.organic.SmartOrganicLayouter#NODE_SUBSET_DP_KEY} in case + * {@link yfiles.organic.Scope#ALL} is not set, and to use {@link yfiles.organic.SmartOrganicLayouter#minimalNodeDistance} also for distances between components. + * This will result in the component layouter not rearranging components if they contain + * pinned-down nodes. + * @param {yfiles.layout.LayoutGraph} graph the graph that will be arranged + * @param {yfiles.layout.ComponentLayouter} layouter the layouter to reconfigure + * @see {@link yfiles.organic.SmartOrganicLayouter#unconfigureComponentLayouter} + * @see {@link yfiles.organic.SmartOrganicLayouter#smartComponentLayout} + */ + configureComponentLayouter(graph:yfiles.layout.LayoutGraph,layouter:yfiles.layout.ComponentLayouter):void; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(layoutGraph:yfiles.layout.LayoutGraph):void; + /** + * Resets the {@link yfiles.layout.CanonicMultiStageLayouter#componentLayouter ComponentLayouter} from the previous + * {@link yfiles.organic.SmartOrganicLayouter#configureComponentLayouter} + * call. + * @param {yfiles.layout.LayoutGraph} graph the graph that has been arranged + * @param {yfiles.layout.ComponentLayouter} layouter the layouter to reset. + * @see {@link yfiles.organic.SmartOrganicLayouter#configureComponentLayouter} + * @see {@link yfiles.organic.SmartOrganicLayouter#smartComponentLayout} + */ + unconfigureComponentLayouter(graph:yfiles.layout.LayoutGraph,layouter:yfiles.layout.ComponentLayouter):void; + /** + * Subclasses have to provide information whether or not they + * can layout the given graph. + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Subclasses have to provide core layout code in this method. + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * The quality to time ratio. + * Getter:This setting determines the ratio of layout quality versus time consumption. + * The higher the ratio, the better the quality of the resulting layout but + * the longer it may take to perform the layout. + *

+ * The default value is 0.6. + *

+ * Setter:This setting determines the ratio of layout quality versus time consumption. + *

+ * The default value is 0.6. + *

+ * @throws {yfiles.system.ArgumentException} + * if the specified ratio is less than + * 0 or greater than 1. + */ + qualityTimeRatio:number; + /** + * The maximum duration this algorithm is allowed to run. + * This is a soft limit + *

+ * By default, the maximum duration is set to 30 seconds. + *

+ * @throws {yfiles.system.ArgumentException} + * if the specified duration is less than + * 0. + */ + maximumDuration:number; + /** + * The scope of the layout. + * The scope determines which of the nodes + * should be affected and how they should be affected by the layout run. + *

+ * Defaults to {@link yfiles.organic.Scope#ALL}. + *

+ * Note: + * For all scopes but {@link yfiles.organic.Scope#ALL}, a data provider for key + * {@link yfiles.organic.SmartOrganicLayouter#NODE_SUBSET_DP_KEY} has to be registered. + *

+ * @see {@link yfiles.organic.SmartOrganicLayouter#NODE_SUBSET_DP_KEY} + */ + scope:yfiles.organic.Scope; + /** + * The property for the compactness of the resulting layout. + * Getter:Lower values result in less compact drawings. + *

+ * The default value is 0.5. + *

+ * Setter:Smaller values result in less compact drawings, greater values result in more compact drawings + * with 0.5d being a "normal" compactness. + *

+ * The default value is 0.5. + *

+ * @throws {yfiles.system.ArgumentException} + * if the specified value is less than + * 0 or greater than 1. + */ + compactness:number; + /** + * The currently set default preferred edge length. + * The algorithm will + * try to find a drawing where most of the edges have this length. This default + * is applied to all edges where there is no specific edge length given using the + * double DataProvider instance bound to the graph using the + * {@link yfiles.organic.SmartOrganicLayouter#PREFERRED_EDGE_LENGTH_DP_KEY} key. + */ + preferredEdgeLength:number; + /** + * The current preferred minimal node distance this algorithm should use for + * pairs of nodes that are not directly connected by adjacent edges. + */ + preferredMinimalNodeDistance:number; + /** + * Determines whether the algorithm should consider the size of the nodes for the layout. + * Getter:If set to true the algorithm will take the node size into account + * for given preferred edge lengths. + * Setter:These settings do not affect the hard minimal node distance property. + */ + nodeSizeAware:boolean; + /** + * Specifies whether the algorithm will behave deterministically in the next layout run. + * If set to true, the algorithm will yield + * the same results if given the exact same input and same settings. + */ + deterministic:boolean; + /** + * The current minimal node distance this algorithm should enforce if the + * node overlaps allowance property is set to true. + *

+ * The default value is 0. + *

+ * @see {@link yfiles.organic.SmartOrganicLayouter#nodeOverlapsAllowed} + */ + minimalNodeDistance:number; + /** + * Specifies whether node overlaps are allowed (but not encouraged) for the next run. + * The + * minimal distance between each pair of nodes is determined by the minimal + * node distance property. + *

+ * By default, node overlaps are not allowed. + *

+ *

+ * Note: if scope is set to SCOPE_SUBSET or SCOPE_MAINLY_SUBSET, there might be some overlapping nodes even if + * this option is set to false. + *

+ * @see {@link yfiles.organic.SmartOrganicLayouter#minimalNodeDistance} + * @see {@link yfiles.organic.SmartOrganicLayouter#scope} + */ + nodeOverlapsAllowed:boolean; + /** + * The current OutputRestriction instance set for this instance. + * The default is {@link yfiles.organic.OutputRestriction#NONE}. + * @see {@link yfiles.organic.OutputRestriction#NONE} + * @see {@link yfiles.organic.OutputRestriction} + */ + outputRestriction:yfiles.organic.OutputRestriction; + } + var SmartOrganicLayouter:{ + $class:yfiles.lang.Class; + /** + * The data provider key for specifying the node subset to be laid out. + * The algorithm expects for each node in the graph to find a + * {@link yfiles.algorithms.IDataProvider#getBool boolean} that indicates whether the node belongs + * to the "sphere of action". + * @see {@link yfiles.organic.SmartOrganicLayouter#scope} + */ + NODE_SUBSET_DP_KEY:Object; + /** + * The data provider key for specifying how to handle group nodes. + * The algorithm expects for each node to find one of the following constants or + * null: + *
    + *
  • {@link yfiles.organic.SmartOrganicLayouter#GROUP_NODE_MODE_NORMAL}
  • + *
  • {@link yfiles.organic.SmartOrganicLayouter#GROUP_NODE_MODE_FIX_BOUNDS}
  • + *
  • {@link yfiles.organic.SmartOrganicLayouter#GROUP_NODE_MODE_FIX_CONTENTS}
  • + *
+ * null will be treated like {@link yfiles.organic.SmartOrganicLayouter#GROUP_NODE_MODE_NORMAL}. + */ + GROUP_NODE_MODE_DP_KEY:Object; + /** + * Group node mode constant that can be used to tag a group node. + * Use the {@link yfiles.organic.SmartOrganicLayouter#GROUP_NODE_MODE_DP_KEY} DataProvider key to associate this constant + * with a group node to indicate that it should be treated like an ordinary group node. + */ + GROUP_NODE_MODE_NORMAL:Object; + /** + * Group node mode constant that can be used to tag a group node. + * Use the {@link yfiles.organic.SmartOrganicLayouter#GROUP_NODE_MODE_DP_KEY} DataProvider key to associate this constant + * with a group node to indicate that its bounds should be treated as fixed an + * its contents should never exceed those bounds. + */ + GROUP_NODE_MODE_FIX_BOUNDS:Object; + /** + * Group node mode constant that can be used to tag a group node. + * Use the {@link yfiles.organic.SmartOrganicLayouter#GROUP_NODE_MODE_DP_KEY} DataProvider key to associate this constant + * with a group node to indicate that it can be moved like an ordinary group node however its + * contents should remain fixed relative to the position of the group node. + * Note that this implicitly fixes all descendants of the group node. + */ + GROUP_NODE_MODE_FIX_CONTENTS:Object; + /** + * The data provider key for specifying the preferred edge lengths for each edge + * The algorithm expects to find {@link yfiles.algorithms.IDataProvider#getInt} integer values associated with + * each edge. + */ + PREFERRED_EDGE_LENGTH_DP_KEY:Object; + /** + * Creates a new SmartOrganicLayouter instance. + */ + new ():yfiles.organic.SmartOrganicLayouter; + }; + /** + * This layout stage replaces edges by a path of nodes before it calls + * a core layouter. + * After the core layouter is finished this stage transforms + * the substituted path of nodes back to the original edge. For each node in the path + * there will be a bend in the original edge. The coordinate of the bend will be the + * center coordinate of the corresponding path node. + */ + export interface SplitEdgeLayoutStage extends Object,yfiles.layout.ILayoutStage{ + /** + * The DataProvider key that determines which edges + * are to be split. + *

+ * By default, {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY} is used. + *

+ * @throws {yfiles.system.ArgumentException} if the specified key is null. + */ + splitEdgesDpKey:Object; + /** + * The DataProvider key to mark the nodes, that were + * created by splitting edges, for the core layouter. + *

+ * By default, {@link yfiles.layout.LayouterKeys#SELECTED_NODES_DP_KEY} is used. + *

+ * @throws {yfiles.system.ArgumentException} if the specified key is null. + */ + splitNodesDpKey:Object; + /** + * The split segment length. + * The split segment length determines + * the length of the path that will replace an original edge in the graph. + * The length of the original edge path divided by the given split segment length + * yields the number of nodes on the new node path. + */ + splitSegmentLength:number; + /** + * The size used as width/height for proxy nodes, i.e. + * nodes inserted by this layout stage. + */ + proxyNodeSize:number; + /** + * Returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Assigns a new graph layout to the given layout graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * The core layouter. + * @see Specified by {@link yfiles.layout.ILayoutStage#coreLayouter}. + */ + coreLayouter:yfiles.layout.ILayouter; + } + var SplitEdgeLayoutStage:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of SplitEdgeLayouter. + */ + new ():yfiles.organic.SplitEdgeLayoutStage; + }; + /** + * This class uses a customizable shuffle layout algorithm to recursively remove node + * overlaps from grouped graph structures. + * This class can be used as a LayoutStage in which case it will perform its work + * after the core layouter instance has performed its work. + */ + export interface GroupedShuffleLayouter extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * The currently installed GroupBoundsCalculator instance. + */ + groupBoundsCalculator:yfiles.layout.IGroupBoundsCalculator; + /** + * The layouter instance, that will be used for shuffling (removing node overlaps). + */ + shuffleLayouter:yfiles.layout.ILayouter; + } + var GroupedShuffleLayouter:{ + $class:yfiles.lang.Class; + new ():yfiles.organic.GroupedShuffleLayouter; + /** + * Creates a new instance of GroupedShuffleLayouter + * The given core layouter instance will get to perform its work before the + * actual shuffling takes place. + */ + WithCoreLayouter:{ + new (core:yfiles.layout.ILayouter):yfiles.organic.GroupedShuffleLayouter; + }; + }; + /** + * The InteractiveOrganicLayouter is a special organic layouter that offers functionality to change the + * laid out graph while the layouter is running. + * If a {@link yfiles.layout.CopiedLayoutGraph} is being laid out, structural changes (node and edge additions/removals) + * in the original graph are automatically scheduled and executed on the copy. + * The method {@link yfiles.organic.InteractiveOrganicLayouter#addStructureUpdate} may be used to schedule a Runnable that is executed in a + * synchronized context and may safely update the structure of the graph. + * The layouter can also run in a single-threaded mode that is provided by a + * {@link yfiles.organic.InteractiveOrganicLayouter single-threaded context}. The {@link yfiles.organic.InteractiveOrganicLayouter.ISingleThreadContext} provides methods to + * control layout calculation. + * @see {@link yfiles.organic.InteractiveOrganicLayouter#startLayout} + * @see {@link yfiles.organic.InteractiveOrganicLayouter#stop} + * @see {@link yfiles.organic.InteractiveOrganicLayouter#stopAndWait} + */ + export interface InteractiveOrganicLayouter extends Object,yfiles.layout.ILayouter{ + /** + * Makes sure that the core of this layouter will not use the usual {@link yfiles.layout.ILayoutStage}s, + * like {@link yfiles.layout.ComponentLayouter}, {@link yfiles.layout.ParallelEdgeLayouter}, etc. + * If you really need this feature, override this method and return silently. + */ + enableOnlyCore():void; + /** + * Determines whether this algorithm performs automatic structure updates. + * If set to true this algorithm will register a listener + * on the graph to be laid out to automatically update internal data structures + * as soon as the structure of the original graph changes. + *

+ * The default is false. + *

+ */ + automaticStructureUpdateEnabled:boolean; + /** + * Returns whether this layouter can layout the given graph. + * @return {boolean} true if the graph may be laid out, false otherwise. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Calculates the layout for the graph. + * The calculated layout is *NOT AUTOMATICALLY APPLIED*. + * The graph has to be updated with the actual calculated positions automatically. + * Attention: It is recommended to use a CopiedLayoutGraph to buffer the original graph. + * If {@link yfiles.organic.InteractiveOrganicLayouter#automaticStructureUpdateEnabled} is set to true, structural changes + * to the original graph are automatically transferred to the copy. + * If an instance of CopiedLayoutGraph is laid out, the setters and getters having a node or edge + * as parameter may be used with instances from the original graph *or* the copied graph. + * This call will not return until {@link yfiles.organic.InteractiveOrganicLayouter#stop} is called. + * @param {yfiles.layout.LayoutGraph} graph the graph that is laid out + * @see {@link yfiles.organic.InteractiveOrganicLayouter#startLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Prepares the graph for layout and creates a context object that provides methods for + * {@link yfiles.organic.InteractiveOrganicLayouter.ISingleThreadContext#continueLayout continuing} + * and + * {@link yfiles.organic.InteractiveOrganicLayouter.ISingleThreadContext#stopLayout stop} + * the layout calculation. + * Note that simply calling this method will not perform any layout. Repeated calls to {@link yfiles.organic.InteractiveOrganicLayouter.ISingleThreadContext} + * need to be made in order for the layout calculation to be performed. + * @param {yfiles.layout.LayoutGraph} graph the graph that gets layouted. + * @return {yfiles.organic.InteractiveOrganicLayouter.ISingleThreadContext} the context object to control layout calculation. + */ + startLayout(graph:yfiles.layout.LayoutGraph):yfiles.organic.InteractiveOrganicLayouter.ISingleThreadContext; + /** + * This method writes the calculated positions (represented by the internal data structure of this layouter) to + * the LayoutGraph. + * This method must only be called while the layouter is running {@link yfiles.organic.InteractiveOrganicLayouter#running}. + * There may occur synchronization issues, if {@link yfiles.organic.InteractiveOrganicLayouter#doLayout} is not called + * using a CopiedLayoutGraph. + */ + commitPositions():void; + /** + * This method transfers the calculated positions (represented by the internal data structure of this layouter) to + * the LayoutGraph. + * This method must only be called while the layouter is running {@link yfiles.organic.InteractiveOrganicLayouter#running}. + * The positions are not transferred directly. + * Instead the nodes are moved towards the calculated position in each step. + * "Good" values for this method may be about 50 for the maxMovement and about 0.15 as factor (when the + * positions are updates about 25 times a second). + * @param {number} maxMovement the maximal distance a node is moved + * @param {number} factor determines the node movement (movement = factor * distance between calculated and actual location) + * @return {number} + * the biggest movement. This value can be used to estimate the difference between calculated layout + * and actual positions. If the return value is "0" the calculated layout has been transferred completely. + */ + commitPositionsSmoothly(maxMovement:number,factor:number):number; + /** + * This method may be called if something has "changed" and the layouter shall restart/continue layout calculation. + * This is e.g. useful if the layouter is sleeping and some user interaction has occurred. + */ + wakeUp():void; + /** + * The time when the last wake-up has occurred. + */ + lastWakeupTime:number; + /** + * Adds a structural update to the queue. + * The given Runnable will be queued and executed at a specific time. Within this Runnable structural + * changes (like edge/node removals or adds) may be done. They are synchronized with the layouter. + * This method should only be used when changes to the structure of the graph are done. Every structural + * change involves a rebuild of the internal data structure. + * So "lightweight" changes like modifications of the positions of the nodes should be done using the corresponding + * methods {@link yfiles.organic.InteractiveOrganicLayouter#setCenter}. + * @param {function(Object, yfiles.system.EventArgs)} handler The handler delegate that will be invoked using null as the sender and args as the event arguments + * @param {yfiles.system.EventArgs} args The event argument that will be piped to the handler invocation. + */ + addStructureUpdate(handler:(sender:Object,e:yfiles.system.EventArgs)=> void,args:yfiles.system.EventArgs):void; + /** + * Stops the layouter. + * The layouter will stop after the actual round. This means that the layouter cannot be awakened again. + */ + stop():void; + /** + * Specifies whether the layouter has been stopped. + */ + stopped:boolean; + /** + * Specifies whether the layouter is sleeping. + * A sleeping layouter can be awakened using {@link yfiles.organic.InteractiveOrganicLayouter#wakeUp} and will continue its work. + */ + sleeping:boolean; + /** + * Specifies whether the layouter is running at the moment. + */ + running:boolean; + /** + * The actual working ratio. + * Getter:The working ratio is the planned ratio of working time to waiting time. + * Setter:The working ratio represents the amount of processor time the layouter tries to + * grab. + * If the working ratio is set to 1 the layouter will try to run as fast as possible. Lower values will lead + * to small breaks after each round. + */ + workingRatio:number; + /** + * The preferred edge length. + * The edges should not become smaller than this amount. + */ + preferredEdgeLength:number; + /** + * The preferred node distance. + */ + preferredNodeDistance:number; + /** + * Sets the preferred edge length for the given edge. + * @param {yfiles.algorithms.Edge} edge + * @param {number} newEdgeLength + */ + setPreferredEdgeLength(edge:yfiles.algorithms.Edge,newEdgeLength:number):void; + /** + * Set the inertia for the node. + * The inertia represents how "easy" a node will move. + * Inertia "1.0": The node will not move + * Inertia "0.5": The node will only move half as wide as it would with an inertia of "0.0" + * Inertia "0.0": The node will move as fast as possible + * @param {yfiles.algorithms.Node} node + * @param {number} inertia + */ + setInertia(node:yfiles.algorithms.Node,inertia:number):void; + /** + * Sets the center for the node. + * This method does not affect the graph itself. Instead the internal + * data structure of the layouter is changed. + * This method may be used to update node positions due to user interaction (e.g. dragging). + * @param {yfiles.algorithms.Node} node + * @param {number} x + * @param {number} y + */ + setCenter(node:yfiles.algorithms.Node,x:number,y:number):void; + /** + * Sets the radius for the given node. + * @param {yfiles.algorithms.Node} node + * @param {number} radius + */ + setRadius(node:yfiles.algorithms.Node,radius:number):void; + /** + * Sets the stress for the given node. + * The higher the stress of a node is, the farther this node will be moved. + * @param {yfiles.algorithms.Node} node + * @param {number} stress a value between 0 and 1 + */ + setStress(node:yfiles.algorithms.Node,stress:number):void; + /** + * Gets the stress for the given node. + * The higher the stress of a node is, the farther this node will be moved. + * @param {yfiles.algorithms.Node} node + */ + getStress(node:yfiles.algorithms.Node):number; + /** + * Sets the center of the node. + * @param {yfiles.algorithms.Node} node + * @param {number} x + */ + setCenterX(node:yfiles.algorithms.Node,x:number):void; + /** + * Sets the center of the node. + * @param {yfiles.algorithms.Node} node + * @param {number} y + */ + setCenterY(node:yfiles.algorithms.Node,y:number):void; + /** + * Return the actual center of the node. + * @param {yfiles.algorithms.Node} node + * @return {yfiles.algorithms.YPoint} the center of the node or null if the layouter does not know anything about the node. + */ + getCenter(node:yfiles.algorithms.Node):yfiles.algorithms.YPoint; + /** + * Return the actual center of the node. + * @param {yfiles.algorithms.Node} node + * @return {number} the center of the node. + */ + getCenterX(node:yfiles.algorithms.Node):number; + /** + * Return the actual center of the node. + * @param {yfiles.algorithms.Node} node + * @return {number} the center of the node. + */ + getCenterY(node:yfiles.algorithms.Node):number; + /** + * The maximal time the layouter will run (in milliseconds). + * After this time it will sleep - independent of the actual result. + */ + maxTime:number; + /** + * The quality time ratio set. + */ + quality:number; + /** + * This method synchronizes the CopiedLayoutGraph given as parameter to {@link yfiles.organic.InteractiveOrganicLayouter#doLayout} with + * the original graph. + */ + syncStructure():void; + /** + * The current OutputRestriction instance set for this instance. + * The default is {@link yfiles.organic.OutputRestriction#NONE}. + * @see {@link yfiles.organic.OutputRestriction#NONE} + * @see {@link yfiles.organic.OutputRestriction} + */ + outputRestriction:yfiles.organic.OutputRestriction; + /** + * Stops a previously + * {@link yfiles.organic.InteractiveOrganicLayouter#startLayout started} + * layout calculation. + */ + stopAndWait():void; + } + export module InteractiveOrganicLayouter{ + /** + * Context object that provides controls of layout calculation in case the layouter runs single-threaded. + */ + export interface ISingleThreadContext extends Object{ + /** + * Do layout calculation for the given amount of time where it has stopped before. + * @param {number} duration the duration of continuing layout calculation in milliseconds. + * @see Specified by {@link yfiles.organic.InteractiveOrganicLayouter.ISingleThreadContext#continueLayout}. + */ + continueLayout(duration:number):void; + /** + * Stops layout calculation. + * After this call, this context cannot continue layout calculation again. + * @see Specified by {@link yfiles.organic.InteractiveOrganicLayouter.ISingleThreadContext#stopLayout}. + */ + stopLayout():void; + } + } + var InteractiveOrganicLayouter:{ + $class:yfiles.lang.Class; + /** + * Create a new instance of the InteractiveOrganicLayouter. + */ + new ():yfiles.organic.InteractiveOrganicLayouter; + }; + /** + * This class implements a variant of the GRIP algorithm by + * P Gajer and SG Kobourov: "Graph Drawing with + * Intelligent Placement". + * It implements ideas of the GUIDE algorithm, + * and fixes some bugs from the original algorithm and implementation. + * Additionally several important parts of the algorithm have been drastically + * improved. + * This layout is especially suited for huge diagrams, that would normally + * be laid out using an Organic layout. It leads to perfect results for + * mesh-like graph structures. + */ + export interface GRIP extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * Subclasses have to provide information whether or not they + * can layout the given graph. + */ + canLayoutCore(g:yfiles.layout.LayoutGraph):boolean; + /** + * The number of the initial rounds. + */ + rounds:number; + /** + * The number of the final rounds. + */ + finalRounds:number; + /** + * The desired edge length. + */ + preferredEdgeLength:number; + /** + * The initial temperature. + * This value should lie somewhere in [10..80]. + */ + initialTemperature:number; + /** + * Subclasses have to provide core layout code in this method. + */ + doLayoutCore(g:yfiles.layout.LayoutGraph):void; + /** + * Specifies whether or not initial placements are determined in a smart way. + */ + smartInitialPlacement:boolean; + /** + * Specifies whether or not GRIP works in a deterministic manner. + */ + deterministic:boolean; + /** + * The current laxity value. + */ + laxity:number; + /** + * Specifies whether or not GRIP takes average node sizes into account. + */ + nodeSizeAware:boolean; + } + var GRIP:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of the GRIP layout algorithm. + */ + new ():yfiles.organic.GRIP; + }; + export enum GroupsPolicy{ + /** + * Node group policy specifier. This layouter will consider grouping + * information of an input graph. It will layout the contents of groups + * in a way that highlights their togetherness. + */ + LAYOUT, + /** + * Node group policy specifier. This layouter will keep the relative positions + * of nodes that belong to the same group. The layouter will take the + * fixed groups into account when placing the other nodes of the graph. + */ + FIXED, + /** + * Node group policy specifier. This layouter will ignore all grouping related + * information when laying out the graph. + */ + IGNORE + } + export enum InitialPlacement{ + /** + * Initial placement strategy. Start with randomly chosen positions. + */ + RANDOM, + /** + * Initial placement strategy. Start with all positions set to (0,0,0). + */ + ZERO, + /** + * Initial placement strategy. Start with given positions. + */ + AS_IS + } + export enum SphereOfAction{ + /** + * Sphere of action specifier. Displace all nodes. + */ + ALL, + /** + * Sphere of action specifier. Displace mainly selected nodes, but allow + * minor movement of unselected nodes as well. + * A node is considered to be selected if the LayoutGraph DataProvider + * registered with the key + * returns true for that node. + */ + MAINLY_SELECTION, + /** + * Sphere of action specifier. Displace only selected nodes + * A node is considered to be selected if the LayoutGraph DataProvider + * registered with the key + * returns true for that node. + */ + ONLY_SELECTION + } + /** + * This layout stage removes node overlaps in a layout graph by using a method + * which is based on a famous russian arcade game. + */ + export interface ShuffleLayouter extends Object,yfiles.layout.ILayoutStage{ + /** + * Performs the force transfer algorithm on the given graph + * after the core layouter has performed its job. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * The core layouter. + * @see Specified by {@link yfiles.layout.ILayoutStage#coreLayouter}. + */ + coreLayouter:yfiles.layout.ILayouter; + /** + * The horizontal overlap criterion. + * One of {@link yfiles.organic.HorizontalOverlapCriterion#INTERSECTION_BOX}, + * {@link yfiles.organic.HorizontalOverlapCriterion#LESS_MOVEMENT} and + * {@link yfiles.organic.HorizontalOverlapCriterion#NODE_CENTER} + */ + horizontalOverlapCriterium:yfiles.organic.HorizontalOverlapCriterion; + /** + * The minimal distance between nodes that has to be obeyed by this + * layouter. + */ + minimalNodeDistance:number; + /** + * Specifies whether or not simple mode is active. + * When in simple mode the algorithm is very fast + * but the quality of the resulting layout may be poor. + * When not active the resulting layout is better and + * the running time is higher. + * By default simple mode is not active. + */ + simpleModeActive:boolean; + /** + * true if this layouter uses a barycenter based + * node shuffling strategy and false otherwise. + */ + barycenterModeActive:boolean; + } + var ShuffleLayouter:{ + $class:yfiles.lang.Class; + /** + * This key can be used to specify a minimal distance for each single node in the graph + * using a data provider. + * Note that values must be strictly positive. + */ + MINIMAL_DISTANCE_DP_KEY:Object; + /** + * This key can be used to specify whether or not a node's position should + * remain fixed. + * The corresponding data provider's + * {@link yfiles.algorithms.IDataProvider#getBool} method is used to determine which + * nodes are fixed. + */ + FIXED_NODE_DP_KEY:Object; + /** + * Creates a new instance of ShuffleLayouter. + */ + new ():yfiles.organic.ShuffleLayouter; + }; + export enum Scope{ + /** + * Scope constant - used for laying out all nodes. + */ + ALL, + /** + * Scope constant - used for laying out the subset of nodes only. + * The above mentioned subset has to be specified by registering an + * appropriate {@link yfiles.algorithms.IDataProvider} for key . + */ + SUBSET, + /** + * Scope constant - used for laying out mainly the subset of the nodes. + * The above mentioned subset has to be specified by registering an + * appropriate {@link yfiles.algorithms.IDataProvider} for key . + */ + MAINLY_SUBSET + } + export enum HorizontalOverlapCriterion{ + /** + * Horizontal overlap criteria enumeration constant. + */ + INTERSECTION_BOX, + /** + * Horizontal overlap criteria enumeration constant. + */ + NODE_CENTER, + /** + * Horizontal overlap criteria enumeration constant. + */ + LESS_MOVEMENT + } + } + export module orthogonal{ + /** + * This class provides a layout algorithm which produces + * orthogonal drawings of hierarchically grouped graphs. + * Here is a sample output of the layouter. + *
+ */ + export interface OrthogonalGroupLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * Specifies whether the algorithm should try to align degree-one nodes that have the same neighbour. + * The default is false. + */ + alignDegreeOneNodes:boolean; + /** + * Determines if an additional postprocessing step is used that improves compactness and reduces the number of edge bends. + * The postprocessing is enabled by default. + */ + postprocessingEnabled:boolean; + /** + * Specifies whether the algorithm should perform a post processing algorithm + * to reduce perceived bends in the drawing. + * The default is false. + */ + optimizePerceivedBends:boolean; + /** + * Factory method that creates the default EdgeLayoutDescriptor. + * May not return null! + * @return {yfiles.orthogonal.EdgeLayoutDescriptor} a new EdgeLayoutDescriptor (new EdgeLayoutDescriptor()) + */ + createEdgeLayoutDescriptor():yfiles.orthogonal.EdgeLayoutDescriptor; + /** + * The EdgeLayoutDescriptor instance used for all those + * edges, that do not have a specific layout descriptor assigned. + * @see {@link yfiles.orthogonal.OrthogonalLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + * @see {@link yfiles.orthogonal.OrthogonalGroupLayouter#createEdgeLayoutDescriptor} + * @throws {yfiles.system.ArgumentNullException} if the argument is null + * @see {@link yfiles.orthogonal.OrthogonalLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + */ + edgeLayoutDescriptor:yfiles.orthogonal.EdgeLayoutDescriptor; + /** + * Specifies whether or not node labels are taken into account when calculating node positions (thereby preventing + * possible node/node label or node label/node label overlaps). + * Setter:This method is a convenience method that assures that the + * {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter label layouter} is of type {@link yfiles.layout.LabelLayoutTranslator} and {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} is set to + * true. + * Note that setting this option may overwrite the currently set label layouter. Hence, to combine this option with + * a generic edge labeling algorithm, the generic labeling has to be applied in an additional step after calculating the layout. + * Getter:This method is a convenience method checks whether the + * {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter label layouter} is of type {@link yfiles.layout.LabelLayoutTranslator} and {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} returns true. + * The default is false. + * @throws {yfiles.system.InvalidOperationException} + * if the current label layouter is not of type {@link yfiles.layout.LabelLayoutTranslator}. + */ + considerNodeLabels:boolean; + /** + * Specifies whether integrated edge labeling is enabled. + * This method is a convenience method that checks if the {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter label layouter} is of type {@link yfiles.layout.LabelLayoutTranslator} and + * {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} returns true. + * The default is + * false. + * @throws {yfiles.system.InvalidOperationException} + * if the current label layouter is not of type {@link yfiles.layout.LabelLayoutTranslator}. + */ + integratedEdgeLabeling:boolean; + /** + * The currently set layout quality. + * Higher quality means less connection + * crossings and smaller layout area, but also increased computation time. + * By default best layout quality (value 1) is set. + */ + layoutQuality:number; + /** + * The grid distance. + */ + grid:number; + /** + * Note that the component layouter set here should work in such a way that + * isolated components inside groups should be reported separately. + * E.g. instances of {@link yfiles.layout.IsolatedGroupComponentLayouter} can be set here. + * If the component layouter should be customized, the suggested way of doing this is to + * {@link yfiles.layout.CanonicMultiStageLayouter#componentLayouter} and cast it to {@link yfiles.layout.ComponentLayouter}. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#componentLayouter} + */ + componentLayouter:yfiles.layout.ILayoutStage; + /** + * Subclasses have to provide information whether or not they + * can layout the given graph. + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Subclasses have to provide core layout code in this method. + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var OrthogonalGroupLayouter:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key used to retrieve {@link yfiles.orthogonal.EdgeLayoutDescriptor} + * instances for each edge in the graph. + * Different settings will affect the routing of the edges during the layout. + */ + EDGE_LAYOUT_DESCRIPTOR_DP_KEY:Object; + /** + * Creates a new instance of OrthogonalGroupLayouter. + */ + new ():yfiles.orthogonal.OrthogonalGroupLayouter; + }; + /** + * This class provides a layout algorithm which produces + * orthogonal drawings. + * OrthogonalLayouter can consider edge label data when laying out a graph. + * That means that the the layout of edge labels will be part of the resulting + * layout and the layout of nodes and edges is chosen in such a way that the + * edge labels do not conflict with the rest of the layout. + * See classes {@link yfiles.layout.LabelLayoutData}, + * {@link yfiles.layout.LabelLayoutKeys} and {@link yfiles.layout.LabelLayoutTranslator} on how + * to setup the integrated edge label layout feature. + * Here is an sample output of the layouter using the layout style {@link yfiles.orthogonal.LayoutStyle#NORMAL}. + *
+ */ + export interface OrthogonalLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + nodeModel:number; + /** + * Factory method that creates the default EdgeLayoutDescriptor. + * May not return null! + * @return {yfiles.orthogonal.EdgeLayoutDescriptor} a new EdgeLayoutDescriptor (new EdgeLayoutDescriptor()) + */ + createEdgeLayoutDescriptor():yfiles.orthogonal.EdgeLayoutDescriptor; + /** + * The EdgeLayoutDescriptor instance used for all those + * edges, that do not have a specific layout descriptor assigned. + * @see {@link yfiles.orthogonal.OrthogonalLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + * @see {@link yfiles.orthogonal.OrthogonalLayouter#createEdgeLayoutDescriptor} + * @throws {yfiles.system.ArgumentNullException} if the argument is null + * @see {@link yfiles.orthogonal.OrthogonalLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + */ + edgeLayoutDescriptor:yfiles.orthogonal.EdgeLayoutDescriptor; + /** + * Specifies whether or not node labels are taken into account when calculating node positions (thereby preventing + * possible node/node label or node label/node label overlaps). + * Setter:This method is a convenience method that assures that the + * {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter} label layouter is of type {@link yfiles.layout.LabelLayoutTranslator} and {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} is set to + * true. + * Note that setting this option may overwrite the currently set label layouter. Hence, to combine this option with + * a generic edge labeling algorithm, the generic labeling has to be applied in an additional step after calculating the layout. + * Furthermore, node labels can only be considered if the layout style is set to {@link yfiles.orthogonal.LayoutStyle#NORMAL}. + * Getter:This method is a convenience method checks whether the + * {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter label layouter} is of type {@link yfiles.layout.LabelLayoutTranslator} and {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} returns true. + * The default is false. + * @throws {yfiles.system.InvalidOperationException} + * if the current label layouter is not of type {@link yfiles.layout.LabelLayoutTranslator}. + */ + considerNodeLabels:boolean; + /** + * Specifies whether integrated edge labeling is enabled. + * Setter:This method is a convenience method that assures that the + * {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter label layouter} is of type {@link yfiles.layout.LabelLayoutTranslator} and {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} is set to + * true + * Note: edge labels can only be considered if the layout style is set to {@link yfiles.orthogonal.LayoutStyle#NORMAL}. + * Getter:This method is a convenience method that checks if the {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter label layouter} is of type {@link yfiles.layout.LabelLayoutTranslator} and + * {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} returns true. + * The default is + * false. + * @throws {yfiles.system.InvalidOperationException} + * if the current label layouter is not of type {@link yfiles.layout.LabelLayoutTranslator}. + */ + integratedEdgeLabeling:boolean; + /** + * If a randomization strategy is used. + * The randomization usually improves the result but it may be disabled to + * get a deterministic behavior of the algorithm. + * Default is true. + */ + useRandomization:boolean; + /** + * Specifies whether the algorithm should try to align degree-one nodes that have the same neighbour. + * The default is false. + */ + alignDegreeOneNodes:boolean; + /** + * If the layouter should try to maximize one face of the embedding. + * Default is false. + */ + useFaceMaximization:boolean; + /** + * If post-processing is used to reduce the number of crossings. + * This post-processing may decrease the number of crossings significantly + * but it may slows down the algorithm, too. + * Default is true. + */ + useCrossingPostprocessing:boolean; + /** + * Specifies whether the algorithm should perform a post processing algorithm + * to reduce perceived bends in the drawing. + * The default is false. + */ + optimizePerceivedBends:boolean; + /** + * The size of the grid on which the nodes and edges are placed. + * Default is 20. + */ + grid:number; + /** + * The layout style of this layouter. + * By default the layout style {@link yfiles.orthogonal.LayoutStyle#NORMAL} is set. + */ + layoutStyle:yfiles.orthogonal.LayoutStyle; + /** + * If post-processing is used to reduce the space used by the drawing. + * This post-processing may decrease space significantly + * but it slows the algorithm down. + * Default is true. + */ + useSpacePostprocessing:boolean; + /** + * If the algorithm optimizes over the length of the edges. + * This may decrease the length of some edges significantly + * but it slows the algorithm down. + * Default is true. + */ + useLengthReduction:boolean; + /** + * If the existing drawing should be used as sketch. + */ + useSketchDrawing:boolean; + /** + * Returns always true. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Assigns an orthogonal graph layout to the given layout graph. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + } + var OrthogonalLayouter:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key used to retrieve {@link yfiles.orthogonal.EdgeLayoutDescriptor} + * instances for each edge in the graph. + * Different settings will affect the routing of the edges during the layout. + * Note: minimum edge length constraints are only considered for layout style {@link yfiles.orthogonal.LayoutStyle#NORMAL}, + * {@link yfiles.orthogonal.LayoutStyle#NORMAL_TREE} and {@link yfiles.orthogonal.LayoutStyle#UNIFORM} (see {@link yfiles.orthogonal.OrthogonalLayouter#layoutStyle}). + * @see {@link yfiles.orthogonal.OrthogonalLayouter#layoutStyle} + */ + EDGE_LAYOUT_DESCRIPTOR_DP_KEY:Object; + /** + * Returns a new instance. + */ + new ():yfiles.orthogonal.OrthogonalLayouter; + }; + /** + * This class is a variant of {@link yfiles.orthogonal.OrthogonalLayouter} that tries to arrange nodes in a more + * compact way, even allowing to specify a desired aspect ratio for the bounds of the + * calculated layout. + * This is especially important if you want to print the layout + * on a paper with predefined size. As a disadvantage, this algorithm will usually produce + * less elegant edge routes than {@link yfiles.orthogonal.OrthogonalLayouter} does. + *

+ * The algorithm is realized as a {@link yfiles.layout.PartitionLayouter}, that uses {@link yfiles.layout.PartitionLayouter.EdgeBetweennessPartitionFinder} + * to partition the graph, {@link yfiles.orthogonal.OrthogonalLayouter} to layout the graph partitions, {@link yfiles.layout.PartitionLayouter.ComponentPartitionPlacer} + * to place the partitions, and finally {@link yfiles.layout.PartitionLayouter.ChannelInterEdgeRouter} to route the edges between partitions. + * Each of these strategies can be individually configured and/or replaced. + *

+ *

+ * Here is a sample output of the layouter with aspect ratio of the resulting layout bounds set to 1. + *

+ *

+ *

+ *

+ */ + export interface CompactOrthogonalLayouter extends yfiles.layout.PartitionLayouter{ + /** + * The grid spacing used to place the nodes. + * By default, a value of 20 is set. + * Setting the grid spacing will only have an effect if the configurable stages + * have not been replaced by other implementations. + * Note: When setting configurable stages after specifying + * grid spacing, it is assumed that the aforementioned stages are already + * properly configured and the previously set grid spacing will not be passed + * to these stages. + */ + gridSpacing:number; + /** + * The desired aspect ratio of the resulting layout bounds. + * the quotient width/height) of the + * resulting layout bounds. By default a value of 1 is set. + * This setting will only have an effect if the set {@link yfiles.layout.PartitionLayouter.IPartitionPlacer} + * is of the pre-configured type {@link yfiles.layout.PartitionLayouter.ComponentPartitionPlacer}. + * Note: When setting configurable stages after specifying + * aspect ratio, it is assumed that the aforementioned stages are already + * properly configured and the previously set aspect ratio will not be passed + * to these stages. + */ + aspectRatio:number; + } + var CompactOrthogonalLayouter:{ + $class:yfiles.lang.Class; + /** + * Create a new instance of this class with a default aspect ratio of 1 and a + * default grid spacing of 20. + */ + new ():yfiles.orthogonal.CompactOrthogonalLayouter; + }; + export enum LayoutStyle{ + /** + * Layout style specifier. In this layout style the size of the nodes will not + * be changed by the algorithm. All edges will be routed orthogonally. + */ + NORMAL, + /** + * Layout style specifier. In this layout style a uniform size will be assigned to all + * nodes. All edges will be routed orthogonally. + */ + UNIFORM, + /** + * Layout style specifier. In this layout style the size of the original nodes will + * be enlarged in order to save some bends. + * All edges will be routed orthogonally. + */ + BOX, + /** + * Layout style specifier. In this layout style not all edges will be routed orthogonally. + * Edge segments that directly connect to a node may be routed non-vertically and + * non-horizontally. + * A small uniform size will be assigned to all nodes. + */ + MIXED, + /** + * Layout style specifier. Like {@link yfiles.orthogonal.LayoutStyle#NORMAL} but all directed subtree structures + * of the graph will be laid out in an optimized way. All edges will be routed orthogonally. + * The tree edges will be routed in a bus-like fashion. + */ + NORMAL_TREE, + /** + * Layout style specifier. In this layout style not all edges will be routed orthogonally. + * Edge segments that directly connect to a node may be routed non-vertically and + * non-horizontally. + * The size of nodes will not be altered. + */ + FIXED_MIXED, + /** + * Layout style specifier. Nodes will be placed + * at the same location as with {@link yfiles.orthogonal.LayoutStyle#FIXED_MIXED} + * but edges will be routed strictly orthogonally. + * The size of nodes will not be altered. + */ + FIXED_BOX + } + /** + * This class is used by {@link yfiles.orthogonal.OrthogonalLayouter}, {@link yfiles.orthogonal.DirectedOrthogonalLayouter} and + * {@link yfiles.orthogonal.OrthogonalGroupLayouter} to determine the routing details of the graph's edges. + * @see {@link yfiles.orthogonal.OrthogonalLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + * @see {@link yfiles.orthogonal.DirectedOrthogonalLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + * @see {@link yfiles.orthogonal.OrthogonalGroupLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + */ + export interface EdgeLayoutDescriptor extends Object{ + /** + * The minimum length of the first segment (at the source). + * Setter:Note: the resulting segment length also depends on the given grid size + * (see {@link yfiles.orthogonal.OrthogonalLayouter#grid}), + * i.e., segment length >= (int) Math.ceil(length / grid size). + * Getter:Default is 15.0d. + */ + minimumFirstSegmentLength:number; + /** + * The minimum length of the last segment (at the target). + * Setter:Note: the resulting segment length also depends on the given grid size + * (see {@link yfiles.orthogonal.OrthogonalLayouter#grid}), + * i.e., segment length >= (int) Math.ceil(length / grid size). + * Getter:Default is 15.0d. + */ + minimumLastSegmentLength:number; + /** + * The minimum segment length of the edge. + * Setter:Note: the resulting segment length also depends on the given grid size + * (see {@link yfiles.orthogonal.OrthogonalLayouter#grid}), + * i.e., segment length >= (int) Math.ceil(length / grid size). + * Getter:Default is 15.0d. + */ + minimumSegmentLength:number; + /** + * Creates a copy of this instance. + * @return {yfiles.orthogonal.EdgeLayoutDescriptor} the copy. + */ + createCopy():yfiles.orthogonal.EdgeLayoutDescriptor; + } + var EdgeLayoutDescriptor:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of an EdgeLayoutDescriptor using the + * default values. + */ + new ():yfiles.orthogonal.EdgeLayoutDescriptor; + }; + /** + * This class is a variant of {@link yfiles.orthogonal.OrthogonalLayouter} that can route edges in a way that + * they point to a main layout direction. + * Also, this class can route edges that connect to the same + * node in a shared bus-structure. A typical use case for this layout algorithm are UML class diagrams + * that contain some relationships like generalization or realization which are best expressed by + * upward-pointing edges. + * Directed edges are marked by a boolean data provider that is registered with the key + * {@link yfiles.orthogonal.DirectedOrthogonalLayouter#DIRECTED_EDGE_DP_KEY} to the input graph. Edge groups at a common node can be specified + * by registering data providers with the keys {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} + * and {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}. + * Like {@link yfiles.orthogonal.OrthogonalLayouter} this layout algorithm can consider edge label data when + * laying out a graph. That means that the layout of edge labels will be part of the resulting + * layout and the layout of nodes and edges is chosen in such a way that the + * edge labels do not conflict with the rest of the layout. + * See classes {@link yfiles.layout.LabelLayoutData}, + * {@link yfiles.layout.LabelLayoutKeys} and {@link yfiles.layout.LabelLayoutTranslator} on how + * to setup the integrated edge label layout feature. + * Here is an sample output of the layout algorithm. Note that all edges painted in blue + * are marked as directed edges. Also, the directed edges at each node have been put into the + * same edge group. + *
+ */ + export interface DirectedOrthogonalLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * Specifies whether the algorithm should try to align degree-one nodes that have the same neighbour. + * The default is false. + */ + alignDegreeOneNodes:boolean; + /** + * Factory method that creates the default EdgeLayoutDescriptor. + * May not return null! + * @return {yfiles.orthogonal.EdgeLayoutDescriptor} a new EdgeLayoutDescriptor (new EdgeLayoutDescriptor()) + */ + createEdgeLayoutDescriptor():yfiles.orthogonal.EdgeLayoutDescriptor; + /** + * The EdgeLayoutDescriptor instance used for all those + * edges, that do not have a specific layout descriptor assigned. + * @see {@link yfiles.orthogonal.OrthogonalLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + * @see {@link yfiles.orthogonal.DirectedOrthogonalLayouter#createEdgeLayoutDescriptor} + * @throws {yfiles.system.ArgumentNullException} if the argument is null + * @see {@link yfiles.orthogonal.OrthogonalLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + */ + edgeLayoutDescriptor:yfiles.orthogonal.EdgeLayoutDescriptor; + /** + * Specifies whether or not node labels are taken into account when calculating node positions (thereby preventing + * possible node/node label or node label/node label overlaps). + * Setter:This method is a convenience method that assures that the + * {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter label layouter} is of type {@link yfiles.layout.LabelLayoutTranslator} and {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} is set to + * true. + * Note that setting this option may overwrite the currently set label layouter. Hence, to combine this option with + * a generic edge labeling algorithm, the generic labeling has to be applied in an additional step after calculating the layout. + * Getter:This method is a convenience method checks whether the + * {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter label layouter} is of type {@link yfiles.layout.LabelLayoutTranslator} and {@link yfiles.layout.LabelLayoutTranslator#translateNodeLabels} returns true. + * The default is false. + * @throws {yfiles.system.InvalidOperationException} + * if the current label layouter is not of type {@link yfiles.layout.LabelLayoutTranslator}. + */ + considerNodeLabels:boolean; + /** + * Specifies whether the algorithm should perform a post processing algorithm + * to reduce perceived bends in the drawing. + * The default is false. + */ + optimizePerceivedBends:boolean; + /** + * Specifies whether integrated edge labeling is enabled. + * This method is a convenience method that checks if the {@link yfiles.layout.CanonicMultiStageLayouter#labelLayouter label layouter} is of type {@link yfiles.layout.LabelLayoutTranslator} and + * {@link yfiles.layout.LabelLayoutTranslator#translateEdgeLabels} returns true. + * The default is + * false. + * @throws {yfiles.system.InvalidOperationException} + * if the current label layouter is not of type {@link yfiles.layout.LabelLayoutTranslator}. + */ + integratedEdgeLabeling:boolean; + /** + * The currently set grid spacing. + * By default a value of 20 is set. + */ + grid:number; + /** + * If the existing drawing should be used as sketch. + */ + useSketchDrawing:boolean; + /** + * If an additional postprocessing step is used that improves compactness and reduces the number of edge bends. + * The postprocessing is enabled by default. + */ + usePostprocessing:boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Subclasses have to provide core layout code in this method. + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * Subclasses have to provide information whether or not they + * can layout the given graph. + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + } + var DirectedOrthogonalLayouter:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key used to retrieve {@link yfiles.orthogonal.EdgeLayoutDescriptor} + * instances for each edge in the graph. + * Different settings will affect the routing of the edges during the layout. + */ + EDGE_LAYOUT_DESCRIPTOR_DP_KEY:Object; + /** + * DataProvider key that is used to mark edges that should be routed in a way that + * point in the main layout direction. + * The main layout direction can be set + * by using method {@link yfiles.layout.CanonicMultiStageLayouter#layoutOrientation} . + */ + DIRECTED_EDGE_DP_KEY:Object; + /** + * Creates a new instance of this class. + */ + new ():yfiles.orthogonal.DirectedOrthogonalLayouter; + }; + } + export module partial{ + export enum ComponentAssignmentStrategy{ + /** + * Specifier for the strategy that is used to assign partial nodes to subgraph components. This value specifies that + * each partial node is assigned to a separate component. + * @see {@link yfiles.partial.PartialLayouter#componentAssignmentStrategy} + * @see {@link yfiles.partial.PartialLayouter#componentAssignmentStrategy} + */ + SINGLE, + /** + * Specifier for the strategy that is used to assign partial nodes to subgraph components. This value specifies that + * all partial nodes of a connected component are assigned to the same subgraph component. + * @see {@link yfiles.partial.PartialLayouter#componentAssignmentStrategy} + * @see {@link yfiles.partial.PartialLayouter#componentAssignmentStrategy} + */ + CONNECTED, + /** + * Specifier for the strategy that is used to assign partial nodes to subgraph components. This value specifies that + * the algorithm should use a natural clustering algorithm to determine the subgraph components (nodes of the same + * cluster are in the same subgraph component). + * @see {@link yfiles.partial.PartialLayouter#componentAssignmentStrategy} + * @see {@link yfiles.partial.PartialLayouter#componentAssignmentStrategy} + */ + CLUSTERING, + /** + * Specifier for the strategy that is used to assign partial nodes to subgraph components. This value allows to use a + * customized component assignment, see {@link yfiles.partial.PartialLayouter#COMPONENT_ASSIGNMENT_DP_KEY}. + * @see {@link yfiles.partial.PartialLayouter#componentAssignmentStrategy} + * @see {@link yfiles.partial.PartialLayouter#componentAssignmentStrategy} + */ + CUSTOMIZED + } + export enum SubgraphPositioningStrategy{ + /** + * Specifies the objective used for finding 'good' positions for subgraph components. This values specifies that each + * component should be placed close to the barycenter of its graph neighbors. + * @see {@link yfiles.partial.PartialLayouter#positioningStrategy} + * @see {@link yfiles.partial.PartialLayouter#positioningStrategy} + */ + BARYCENTER, + /** + * Specifies the objective used for finding 'good' positions for subgraph components. This values specifies that each + * component should be placed close to its original position. + * @see {@link yfiles.partial.PartialLayouter#positioningStrategy} + * @see {@link yfiles.partial.PartialLayouter#positioningStrategy} + */ + FROM_SKETCH + } + export enum EdgeRoutingStrategy{ + /** + * Specifier for the routing strategy of inter-edges (edges between fixed and partial nodes as well as edges between + * different subgraph components). The algorithm will use orthogonal routes for inter-edges, i.e., each edge only + * consists of vertical and horizontal segments. + * @see {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy} + * @see {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy} + */ + ORTHOGONAL, + /** + * Specifier for the routing strategy of inter-edges (edges between fixed and partial nodes as well as edges between + * different subgraph components). The algorithm will use straight-line routes for inter-edges. + * @see {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy} + * @see {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy} + */ + STRAIGHTLINE, + /** + * Specifier for the routing strategy of inter-edges (edges between fixed and partial nodes as well as edges between + * different subgraph components). The algorithm automatically chooses a suitable routing strategy. + * @see {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy} + * @see {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy} + */ + AUTOMATIC, + /** + * Specifier for the routing strategy of inter-edges (edges between fixed and partial nodes as well as edges between + * different subgraph components). The algorithm will use organic routes for inter-edges. + * @see {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy} + * @see {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy} + */ + ORGANIC, + /** + * Specifier for the routing strategy of inter-edges (edges between fixed and partial nodes as well as edges between + * different subgraph components). The algorithm will use octilinear routes for inter-edges (the slope of each segment + * is a multiple of 45 degree). + * @see {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy} + * @see {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy} + */ + OCTILINEAR + } + export enum LayoutOrientation{ + /** + * Specifies the orientation of the drawing. This value specifies that the algorithm should try to place partial nodes + * (subgraph components) such that each predecessor of a node v is placed above v and each successor below v. + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + */ + TOP_TO_BOTTOM, + /** + * Specifies the orientation of the drawing. This value specifies that the algorithm should try to place partial nodes + * (subgraph components) such that each predecessor of a node v is placed below v and each successor above v. + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + */ + BOTTOM_TO_TOP, + /** + * Specifies the orientation of the drawing. This value specifies that the algorithm should try to place partial nodes + * (subgraph components) such that each predecessor of a node v is placed to the left of v and each successor to the + * right of v. + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + */ + LEFT_TO_RIGHT, + /** + * Specifies the orientation of the drawing. This value specifies that the algorithm should try to place partial nodes + * (subgraph components) such that each predecessor of a node v is placed to the right of v and each successor to the + * left of v. + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + */ + RIGHT_TO_LEFT, + /** + * Specifies the orientation of the drawing. This value specifies that the layout algorithm should detect the + * orientation automatically. Therefore it analysis the current drawing. + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + */ + AUTO_DETECT, + /** + * Specifies the orientation of the drawing. + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + */ + NONE + } + /** + * This class represents a partial layouter. + * A partial layouter is a layout algorithm that changes the coordinates for a + * given set of graph elements (called partial elements). The location or size of the remaining elements (called fixed + * elements) is not allowed to be changed. The layout algorithm tries to place the partial elements such that the + * resulting drawing (including the fixed elements) has a good quality with respect to common graph drawing aesthetics. + *

This layouter can be applied to plain graphs as well as to grouped graphs. + * Note: when a partial node should be placed inside a fixed group node, + * it is important that there is enough free space inside the group. Otherwise, there may be overlapping node elements.

+ *

The layouter handles each selected graph element as partial element. Therefore it looks up the data provider keys + * {@link yfiles.partial.PartialLayouter#PARTIAL_NODES_DP_KEY} and {@link yfiles.partial.PartialLayouter#PARTIAL_EDGES_DP_KEY}. Partial node elements can be + * assigned to so called subgraph components. During the layout process each subgraph induced by the nodes of a + * component is first laid out using the specified core layouter {@link yfiles.partial.PartialLayouter#coreLayouter}. Then, the + * different components are placed one-by-one onto the drawing area such that the number of overlaps among graph + * elements is small. The user can specify different objectives for finding 'good' positions for subgraph components + * ({@link yfiles.partial.PartialLayouter#positioningStrategy}), e.g., {@link yfiles.partial.SubgraphPositioningStrategy#BARYCENTER} specifies that the + * component should be placed close to the barycenter of its graph neighbors and {@link yfiles.partial.SubgraphPositioningStrategy#FROM_SKETCH} specifies that the component should be placed close to its original + * position.

+ *

Method {@link yfiles.partial.PartialLayouter#componentAssignmentStrategy} allows to specify the strategy that is used + * to assign partial nodes to subgraph components. Possible values are {@link yfiles.partial.ComponentAssignmentStrategy#CLUSTERING}, + * {@link yfiles.partial.ComponentAssignmentStrategy#CONNECTED}, {@link yfiles.partial.ComponentAssignmentStrategy#SINGLE} and {@link yfiles.partial.ComponentAssignmentStrategy#CUSTOMIZED}. The last value allows to use a customized component assignment. Note: + * nodes of a component cannot be assigned to different group nodes.

+ *

Furthermore, the user can specify the edge + * routing strategy (method {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy}) that is used for routing partial edges and edges + * between different subgraph components (so-called inter-edges). Possible values are {@link yfiles.partial.EdgeRoutingStrategy#ORGANIC}, {@link yfiles.partial.EdgeRoutingStrategy#ORTHOGONAL}, {@link yfiles.partial.EdgeRoutingStrategy#STRAIGHTLINE}, {@link yfiles.partial.EdgeRoutingStrategy#OCTILINEAR} and {@link yfiles.partial.EdgeRoutingStrategy#AUTOMATIC}.

+ */ + export interface PartialLayouter extends yfiles.layout.AbstractLayoutStage{ + /** + * The core layouter, i.e., the layout algorithm that is applied to the subgraph components. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#coreLayouter} + * @see Specified by {@link yfiles.layout.ILayoutStage#coreLayouter}. + */ + coreLayouter:yfiles.layout.ILayouter; + /** + * The time limit (in milliseconds) set for the layout algorithm. + * Note that restricting the maximal duration + * may result in a worse layout quality. Furthermore, the real runtime may exceed the maximal duration since the + * layout algorithm still have to find a valid solution. + * By default the time limit is Integer.MAX_VALUE. + */ + maximalDuration:number; + /** + * Specifies whether or not edges between different subgraph components should be routed immediately. + * If this option is enabled, edges are routed during the placement of the subgraph components, i.e., immediately + * after a component is placed, its edges to other, already placed components are routed. + * Otherwise these edges are routed in a separate step after placing all subgraph components. + * By default this option is disabled. + * @see {@link yfiles.partial.PartialLayouter#routeInterEdges} + * @see {@link yfiles.partial.PartialLayouter#placeSubgraphs} + */ + routeInterEdgesImmediately:boolean; + /** + * If enabled, the bounding boxes of subgraph components may overlap (elements of different components will still not + * overlap). + * If set to true, the bounding boxes of subgraph + * components may overlap (elements of different components will still not overlap). + */ + packComponents:boolean; + /** + * Specifies whether or not fixed group nodes may be resized. + */ + fixedGroupResizingEnabled:boolean; + /** + * The objective used for finding 'good' positions for subgraph components. + */ + positioningStrategy:yfiles.partial.SubgraphPositioningStrategy; + /** + * The minimum distance between two adjacent nodes. + */ + minimalNodeDistance:number; + /** + * True, if node alignment is enabled, that is the algorithm tries to + * align partial nodes with other nodes. + * If set to true, the algorithm tries to align the center of + * partial nodes with other nodes. + */ + considerNodeAlignment:boolean; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * The strategy that is used to assign partial nodes to subgraph components. + */ + componentAssignmentStrategy:yfiles.partial.ComponentAssignmentStrategy; + /** + * Specifies whether or not a postprocessing step should be applied to reduce + * the number of edges that do not comply with the desired orientation. + *

+ * By default, this feature is disabled. + *

+ * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + * @see {@link yfiles.partial.PartialLayouter#layoutOrientation} + */ + optimizeLayoutOrientation:boolean; + /** + * The edge router used for routing partial edges as well as edges + * between different subgraph components (so-called inter-edges). + * The specified edge router is used for routing partial edges as well as + * edges between different subgraph components (so-called inter-edges). + * Edges that have to be routed with the specified router will be marked + * using this algorithm's {@link yfiles.partial.PartialLayouter#ROUTE_EDGE_DP_KEY} data provider key. + *

+ * Note: the customized edge router is disabled when method {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy} is called + * afterwards. + *

+ * @see {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy} + * @see {@link yfiles.partial.PartialLayouter#ROUTE_EDGE_DP_KEY} + * @see {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy} + */ + edgeRouter:yfiles.layout.ILayouter; + /** + * The specified edge routing strategy. + *

+ * Note: calling this method disables a previously set customized edge router (see method + * {@link yfiles.partial.PartialLayouter#edgeRouter}). + *

+ * @see {@link yfiles.partial.PartialLayouter#edgeRouter} + */ + edgeRoutingStrategy:yfiles.partial.EdgeRoutingStrategy; + /** + * The layout orientation. + * @see {@link yfiles.partial.LayoutOrientation#TOP_TO_BOTTOM} + * @see {@link yfiles.partial.LayoutOrientation#BOTTOM_TO_TOP} + * @see {@link yfiles.partial.LayoutOrientation#LEFT_TO_RIGHT} + * @see {@link yfiles.partial.LayoutOrientation#RIGHT_TO_LEFT} + * @see {@link yfiles.partial.LayoutOrientation#AUTO_DETECT} + * @see {@link yfiles.partial.LayoutOrientation#NONE} + * @see {@link yfiles.partial.LayoutOrientation#TOP_TO_BOTTOM} + * @see {@link yfiles.partial.LayoutOrientation#BOTTOM_TO_TOP} + * @see {@link yfiles.partial.LayoutOrientation#LEFT_TO_RIGHT} + * @see {@link yfiles.partial.LayoutOrientation#RIGHT_TO_LEFT} + * @see {@link yfiles.partial.LayoutOrientation#AUTO_DETECT} + * @see {@link yfiles.partial.LayoutOrientation#NONE} + */ + layoutOrientation:yfiles.partial.LayoutOrientation; + /** + * Specifies whether or not subgraph components may be mirrored to improve the layout quality, i.e., for each component + * the algorithm checks which of the four possible mirrorings minimizes the edge length. + */ + allowMirroring:boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * This method calculates the partial layout. + * Therefore, it calls the following methods: 1. {@link yfiles.partial.PartialLayouter#routeEdgesBetweenFixedElements} 2. {@link yfiles.partial.PartialLayouter#layoutSubgraph} for each subgraph component 3. {@link yfiles.partial.PartialLayouter#placeSubgraphs} 4. {@link yfiles.partial.PartialLayouter#routeInterEdges} + * Note: the method is called after applying the {@link yfiles.layout.OrientationLayouter}. Hence, the called methods + * always assume that the graph is drawn from top to bottom. + * @param {yfiles.layout.LayoutGraph} graph the input graph. + */ + doPartialLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Calculates the layout for the subgraph component. + * @param {yfiles.layout.LayoutGraph} subGraph the subgraph component + */ + layoutSubgraph(subGraph:yfiles.layout.LayoutGraph):void; + /** + * This method places the subgraph components one-by-one onto the drawing area. + * Therefore, it considers the specified + * objective for finding a 'good' position, see ({@link yfiles.partial.PartialLayouter#positioningStrategy}). + * @param {yfiles.layout.LayoutGraph} graph the input graph + * @param {yfiles.algorithms.NodeList[]} subgraphComponents each entry contains a NodeList that defines a subgraph component + */ + placeSubgraphs(graph:yfiles.layout.LayoutGraph,subgraphComponents:yfiles.algorithms.NodeList[]):void; + /** + * This method routes all inter-edges, that is edges between different + * subgraph components (including edges between fixed and partial elements). + * Therefore, it uses the edge router set with method + * {@link yfiles.partial.PartialLayouter#edgeRouter}. If no edge router was specified + * by the user, it uses an internal edge router with routing strategy + * {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy}. + * @param {yfiles.layout.LayoutGraph} graph the relevant graph. + * @param {yfiles.algorithms.EdgeList} interEdges the edges to route. + */ + routeInterEdges(graph:yfiles.layout.LayoutGraph,interEdges:yfiles.algorithms.EdgeList):void; + /** + * This method routes all partial edges that connect two fixed elements. + * Therefore, it uses the edge router set with + * method {@link yfiles.partial.PartialLayouter#edgeRouter}. If no edge router was specified by the user, it uses an internal + * edge router with routing strategy {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy}. + * @param {yfiles.layout.LayoutGraph} graph the subgraph of the original graph induced on the fixed nodes. + * @param {yfiles.algorithms.EdgeList} partialEdges the edges to route. + */ + routeEdgesBetweenFixedElements(graph:yfiles.layout.LayoutGraph,partialEdges:yfiles.algorithms.EdgeList):void; + /** + * This method is called each time edges are routed with an edge router instance. + * Hence, it offers a way to + * modify the used settings. + *

+ * The type of the given instance depends on the edge routing strategy, i.e., + * if the routing strategy is set to {@link yfiles.partial.EdgeRoutingStrategy#OCTILINEAR} or + * {@link yfiles.partial.EdgeRoutingStrategy#ORTHOGONAL} it's an instance of {@link yfiles.router.polyline.EdgeRouter}, if the routing strategy is set + * to {@link yfiles.partial.EdgeRoutingStrategy#ORGANIC} it's an instance of {@link yfiles.organic.SmartOrganicLayouter}, and, if the routing + * strategy is set to {@link yfiles.partial.EdgeRoutingStrategy#STRAIGHTLINE} it's an instance of {@link yfiles.partial.PartialLayouter.StraightLineEdgeRouter}. + * If the edge routing strategy is set to {@link yfiles.partial.EdgeRoutingStrategy#AUTOMATIC} one of the above strategies is used. + *

+ *

+ * Note: if a customized edge router is set (see {@link yfiles.partial.PartialLayouter#edgeRouter}), + * the edge router instance is of this type. + *

+ * @param {yfiles.layout.ILayouter} edgeRouter the instance used for routing the edges. + * @see {@link yfiles.partial.PartialLayouter#edgeRouter} + * @see {@link yfiles.partial.PartialLayouter#edgeRoutingStrategy} + */ + configureEdgeRouter(edgeRouter:yfiles.layout.ILayouter):void; + } + export module PartialLayouter{ + /** + * Simple Edge Router that draws edges straight-line. + */ + export interface StraightLineEdgeRouter extends yfiles.router.StraightLineEdgeRouter{ + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + } + var PartialLayouter:{ + $class:yfiles.lang.Class; + /** + * The data provider key used to look up the partial nodes of the graph. + * The looked up data provider should provide boolean values + * for the nodes of that graph. The boolean value should signal + * whether a node is to be considered as partial or not. + */ + PARTIAL_NODES_DP_KEY:Object; + /** + * If a layout orientation (see {@link yfiles.partial.PartialLayouter#layoutOrientation}) is specified + * (i.e., {@link yfiles.partial.PartialLayouter#layoutOrientation} != {@link yfiles.partial.LayoutOrientation#NONE}), + * this data provider key can be used to distinguish between directed and undirected edges. + * The layout orientation is only considered for directed edges. + * The registered data provider's {@link yfiles.algorithms.IDataProvider#getBool getBool} method should return true for directed edges and false for undirected edges. + * Note: if this data provider is not registered, all edges are considered to be directed. + */ + DIRECTED_EDGES_DP_KEY:Object; + /** + * The data provider key used to look up the partial edges of the graph. + * The looked up data provider should provide + * boolean values for the edges of that graph. The boolean value should signal whether an edge is to be considered as + * partial or not. + */ + PARTIAL_EDGES_DP_KEY:Object; + /** + * This key is used by this algorithm to temporarily add a DataProvider that marks edges that should be routed + * by the edge router. + *

+ * Note that this DataProvider must not be set by the user! It is automatically set during the layout + * and should only be used by the specified edge router (see {@link yfiles.partial.PartialLayouter#edgeRouter}). + *

+ * The added data provider's {@link yfiles.algorithms.IDataProvider#getBool} + * method will return true for edges that have to be + * routed and false for all other edges. + * @see {@link yfiles.partial.PartialLayouter#edgeRouter} + */ + ROUTE_EDGE_DP_KEY:string; + /** + * {@link yfiles.algorithms.IDataProvider} key used to store an object for each partial node of the graph. + * All partial nodes + * associated with the same object are assigned to the same subgraph component. Note: nodes of a component cannot be + * assigned to different group nodes as well as different partition cells. + * @see {@link yfiles.partial.ComponentAssignmentStrategy#CUSTOMIZED} + * @see {@link yfiles.partial.PartialLayouter#componentAssignmentStrategy} + * @see {@link yfiles.partial.PartialLayouter#componentAssignmentStrategy} + */ + COMPONENT_ASSIGNMENT_DP_KEY:Object; + /** + * Creates a new instance of the PartialLayouter. + */ + new ():yfiles.partial.PartialLayouter; + /** + * Creates a new instance of the PartialLayouter. + * The parameter specifies the layout algorithm that is used for the + * subgraph components. + * @param {yfiles.layout.ILayouter} subgraphLayouter the layout algorithm that is applied to the subgraph components. + */ + WithCoreLayouter:{ + new (subgraphLayouter:yfiles.layout.ILayouter):yfiles.partial.PartialLayouter; + }; + StraightLineEdgeRouter:{ + $class:yfiles.lang.Class; + /** + * Creates a new StraightLineEdgeRouter. + */ + new ():yfiles.partial.PartialLayouter; + }; + }; + } + export module planar{ + } + export module radial{ + /** + * Radial style layouter. + * This layouter places all nodes on circles around a common center. + *

+ *

+ *

+ *

+ * A virtual tree structure is created for the graph whose root node is placed on the center of the circles. All + * children of a tree node are on a higher layer (i.e. larger circles) than their parent. A sector is calculated for + * each node so the sector of each child in the virtual tree is a sub-sector of its parent's sector. The radii of the + * circles are calculated taking the sector size needed by the whole subtree into account. + *

+ *

+ * There are different {@link yfiles.radial.RadialLayouter#centerNodesPolicy center nodes policies} that can be used to determine which + * nodes shall be placed on the center (single center node) or on the innermost circle (several center nodes). How the + * nodes are distributed over the circles can be specified by a {@link yfiles.radial.RadialLayouter#layeringStrategy layering strategy}. + *

+ *

+ * The way in which edges are routed in this layout is specified by an + * {@link yfiles.radial.RadialLayouter#edgeRoutingStrategy edge routing strategy}. + * Note that the edge routing cannot always prevent node-edge overlaps. + *

+ */ + export interface RadialLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * The minimum distance between two neighboring nodes on a circle. + * The default is 10.0d. + * @throws {yfiles.system.ArgumentException} when setting a negative distance. + */ + minimalNodeToNodeDistance:number; + /** + * The spacing value for the circles. + * The radius of each circle will be a multiple of this value. + *

+ * If the spacing value is set 0, no spacing will be considered. + *

+ * Default value is 25.0d + * @throws {yfiles.system.ArgumentException} when setting a negative spacing value. + */ + layerSpacing:number; + /** + * The minimal distance between two circles. + * Default value is 100.0d. + * @throws {yfiles.system.ArgumentException} when setting a negative distance. + */ + minimalLayerDistance:number; + /** + * The maximal sector angle in degrees around a node where the children of the node may be placed. + *

+ * The child sector of a node has the node's center as center. The sector points away from the center of the + * circle the node is placed on. + *

+ * Valid values range from 0 to 360. + * @throws {yfiles.system.ArgumentException} when setting a negative angle or an angle greater than 360 degrees. + */ + maximalChildSectorAngle:number; + /** + * The minimal kink angle in degrees between two adjacent edge segments. + * Getter:

+ * Increasing this value reduces the number of bends so the edge path gets less smooth. + *

+ * Valid values are between 0.0d and 90.0d. + * Setter:

+ * Increasing this value reduces the number of bends so the edge path gets less smooth. + *

+ * Default value is 5.0d. Valid angles range from 0 to 90 degrees. + * @throws {yfiles.system.ArgumentException} when setting a negative angle or an angle greater than 90 degrees. + */ + minimalBendAngle:number; + /** + * The center node policy that determines which node is chosen as (virtual) tree root for the layout process + * and is set in the center of the circles. + * By default {@link yfiles.radial.CenterNodesPolicy#WEIGHTED_CENTRALITY} is set. + * @throws {yfiles.system.ArgumentException} when setting an invalid center node policy. + */ + centerNodesPolicy:yfiles.radial.CenterNodesPolicy; + /** + * The data provider key used to look up the selected nodes that shall be placed in the center with + * {@link yfiles.radial.RadialLayouter#centerNodesPolicy center node policy} set to {@link yfiles.radial.CenterNodesPolicy#SELECTION}. + * By default, {@link yfiles.layout.LayouterKeys#SELECTED_NODES_DP_KEY} is used. + * @throws {yfiles.system.ArgumentException} when the new key is null + */ + centerNodesDpKey:Object; + /** + * The layering strategy that determines how nodes are distributed to different layers. + * Getter:All nodes of one layer will be placed on the same circle later. + * By default, {@link yfiles.radial.LayeringStrategy#BFS} is set. + * Setter:All nodes of one layer will be placed on the same circle later. + *

+ * Must be either {@link yfiles.radial.LayeringStrategy#BFS} or {@link yfiles.radial.LayeringStrategy#HIERARCHICAL}. + * By default, {@link yfiles.radial.LayeringStrategy#BFS} is set. + *

+ * @throws {yfiles.system.ArgumentException} when setting an invalid layering strategy. + */ + layeringStrategy:yfiles.radial.LayeringStrategy; + /** + * The edge routing strategy. + *

+ * Must be one of {@link yfiles.radial.EdgeRoutingStrategy#POLYLINE} or {@link yfiles.radial.EdgeRoutingStrategy#ARC}. + * By default {@link yfiles.radial.EdgeRoutingStrategy#ARC} is used. + *

+ *

+ * Note that the edge routing cannot always prevent node-edge overlaps. + *

+ * @throws {yfiles.system.ArgumentException} when setting an invalid edge routing strategy. + */ + edgeRoutingStrategy:yfiles.radial.EdgeRoutingStrategy; + /** + * Specifies whether or not node labels are taken into account when calculating + * node positions. + * Thereby preventing possible node/node label or + * node label/node label overlaps. + *

+ * Default value is false. + *

+ */ + considerNodeLabels:boolean; + /** + * Specifies whether or not ComponentLayouter is enabled. + * By default it is disabled. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#componentLayouterEnabled} + */ + componentLayouterEnabled:boolean; + /** + * Subclasses have to provide information whether or not they + * can layout the given graph. + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Subclasses have to provide core layout code in this method. + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * Determines the center nodes of the graph according to the chosen center node policy. + *

+ * This method may be overwritten to introduce a custom policy to choose center nodes. + *

+ * @param {yfiles.layout.LayoutGraph} graph The graph to return the central node for. + * @return {yfiles.algorithms.NodeList} A list of center nodes of the given graph. + * @see {@link yfiles.radial.RadialLayouter#centerNodesPolicy} + * @see {@link yfiles.radial.RadialLayouter#centerNodesPolicy} + */ + determineCenter(graph:yfiles.layout.LayoutGraph):yfiles.algorithms.NodeList; + /** + * Returns the diameter of the circular space around the given node's center that shall be reserved for the node. + *

+ * By default the actual diameter of the given node extended by + * {@link yfiles.radial.RadialLayouter#minimalNodeToNodeDistance minimalNodeToNodeDistance} is used as diameter of the space to reserve. + * That way the nodes keep enough distance to the nodes around. + *

+ *

+ * This method may be overwritten to keep more or different amounts of space around each node in the graph. + *

+ * @param {yfiles.layout.LayoutGraph} graph The graph to which the node belongs. + * @param {yfiles.algorithms.Node} node The node to return the diameter for. + * @return {number} The diameter of the circle around the given node's center that shall be reserved for the node. + */ + getNodeDiameter(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):number; + } + export module RadialLayouter{ + /** + * Info object describing on which circle and in which sector the node is placed. + * This object can be registered for every node using the data provider key {@link yfiles.radial.RadialLayouter#NODE_INFO_DP_KEY}. The layouter + * will update its fields when the layout is calculated. + *

+ * Note that this info object only delivers additional data which was calculated during the layout run and has no + * influence on layout calculation. + *

+ */ + export interface NodeInfo extends Object{ + /** + * The index of the circle the node is placed on. + * The circles used by the RadialLayouter are indexed from the innermost to the outermost circle. Index 0 + * represents the center, i.e. the circle with radius 0. + */ + circleIndex:number; + /** + * The radius of the circle the node is placed on. + */ + radius:number; + /** + * The offset from the center of the circle, the node is placed on, to the center of the node. + */ + centerOffset:yfiles.algorithms.YPoint; + /** + * The start angle in degrees of the sector the node is placed in. + * The angle refers to a counter-clockwise rotation starting at the 3 o'clock position. + * @see {@link yfiles.radial.RadialLayouter.NodeInfo#sectorSize} + */ + sectorStart:number; + /** + * The size in degrees of the sector the node is placed in. + * @see {@link yfiles.radial.RadialLayouter.NodeInfo#sectorStart} + */ + sectorSize:number; + } + } + var RadialLayouter:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key used to provide additional data for nodes about the circle they are placed on as + * well as the sector they are placed in. + *

+ * Only if a data provider with this key is registered at the graph and returns a {@link yfiles.radial.RadialLayouter.NodeInfo} object for each node, + * the properties of these {@link yfiles.radial.RadialLayouter.NodeInfo} objects will be updated during the layout. + *

+ */ + NODE_INFO_DP_KEY:Object; + /** + * Creates a new instance. + */ + new ():yfiles.radial.RadialLayouter; + }; + export enum CenterNodesPolicy{ + /** + * Specifier for a center nodes policy which chooses all nodes with indegree 0 as center nodes. + * If no node with that property is present, an arbitrary node is chosen. + * @see {@link yfiles.radial.RadialLayouter#centerNodesPolicy } + */ + DIRECTED, + /** + * Specifier for a center nodes policy which chooses the node with the highest centrality as center node. + * @see {@link yfiles.radial.RadialLayouter#centerNodesPolicy } + * @see {@link yfiles.algorithms.Trees#getCenterRoot} + */ + CENTRALITY, + /** + * Specifier for a center nodes policy which chooses the node with the highest weighted centrality as center node. + * @see {@link yfiles.radial.RadialLayouter#centerNodesPolicy } + * @see {@link yfiles.algorithms.Trees#getWeightedCenterNode } + */ + WEIGHTED_CENTRALITY, + /** + * Specifier for a center nodes policy which uses user specified center nodes. The center nodes have to be specified + * using a data provider registered with the + * {@link yfiles.radial.RadialLayouter#centerNodesDpKey} key that returns true for these nodes. + *

+ * If there are several center nodes, they are placed on the first circle while the center position stays empty. + *

+ * @see {@link yfiles.radial.RadialLayouter#centerNodesPolicy} + * @see {@link yfiles.radial.RadialLayouter#centerNodesDpKey} + */ + SELECTION + } + export enum LayeringStrategy{ + /** + * Specifier for a layering strategy that uses breadth first search (bfs) to determine a layering for the graph. + * All edges will span at most one layer in + * the resulting drawing. Edges between nodes that belong to the same layer are possible. + * @see {@link yfiles.radial.RadialLayouter#layeringStrategy} + */ + BFS, + /** + * Specifier for a layering strategy that uses an optimal hierarchical layering strategy. + * The layer distance of an edge is the absolute difference between the layer numbers + * of its source and target node. + * Layer assignment will be done in such a way that the overall sum of the layer distances + * of all edges in the layout is minimal. + * @see {@link yfiles.radial.RadialLayouter#layeringStrategy} + */ + HIERARCHICAL + } + export enum EdgeRoutingStrategy{ + /** + * Specifier for an edge routing strategy that will route edges as a polyline from source to target with one bend on + * each spanned circle. + * @see {@link yfiles.radial.RadialLayouter#edgeRoutingStrategy} + */ + POLYLINE, + /** + * Specifier for an edge routing strategy that will route edges as an arc. + * The source and target of an edge as well as one bend on each spanned circle are used as main control points. + * An easing function is used to calculate additional control points between the polar + * coordinates of the main control points. + * @see {@link yfiles.radial.RadialLayouter#edgeRoutingStrategy} + */ + ARC + } + } + export module random{ + /** + * This class generates a layout, where the nodes are placed + * randomly. + * Edges have no bends and ports. + * The layout is placed inside a box. + */ + export interface RandomLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * Specifies whether or not ComponentLayouter is enabled. + * By default it is disabled. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#componentLayouterEnabled} + */ + componentLayouterEnabled:boolean; + /** + * The rectangle, inside which the layout should be placed. + */ + layoutBounds:yfiles.algorithms.Rectangle; + /** + * Returns always true, because every graph can be drawn. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Perform the layout. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * The randomization seed, with which the layout will be generated. + */ + seed:number; + } + var RandomLayouter:{ + $class:yfiles.lang.Class; + new ():yfiles.random.RandomLayouter; + }; + } + export module router{ + /** + * This class provides helpers to convert between buses given by complete subgraphs and buses represented by specific + * hub nodes. + *

In a representation by means of hubs, each connected subgraph induced by hubs establishes a + * bus. All regular nodes (non-hubs) which are connected to hubs of the same component are end-nodes of the same bus. In + * other words, nodes which are reachable on paths consisting of only hubs belong to the same bus. Of course, a node can + * be an end-node of more than one bus.

Since a bus models a group of nodes in which every node is connected to + * every other node, it can be represented as a complete subgraph of these nodes. To distinguish buses in this + * representation, each edge must be associated with a unique ID which identifies the bus it is associated to. This is + * the representation expected by {@link yfiles.router.BusRouter}.

+ */ + export interface BusRepresentations extends Object{ + } + var BusRepresentations:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key used to transfer a user-defined object from each original edge to the respective + * newly created edge. + * Algorithms which respect this key expect the associated data provider to be also an instance of + * {@link yfiles.algorithms.IDataAcceptor} to enable the storage of the data object for the new edge. Since there is no one-to-one + * mapping between original and new edges, the data provider of this key is responsible for the edges whose source end + * is a regular node. + */ + SOURCE_ID_DP_KEY:Object; + /** + * {@link yfiles.algorithms.IDataProvider} key used to transfer a user-defined object from each original edge to the respective + * newly created edge. + * Algorithms which respect this key expect the associated data provider to be also an instance of + * {@link yfiles.algorithms.IDataAcceptor} to enable the storage of the data object for the new edge. Since there is no one-to-one + * mapping between original and new edges, the data provider of this key is responsible for the edges whose target end + * is a regular node. + */ + TARGET_ID_DP_KEY:Object; + /** + * Calculates for every bus represented by hubs a list of all of its edges. + * Note that this method cannot return + * isolated hubs and that each edge between two regular nodes establishes a separate bus. + * @param {yfiles.algorithms.Graph} graph the graph + * @param {yfiles.algorithms.IDataProvider} hubMarker a DataProvider which returns true if and only if a node is a hub + * @return {yfiles.algorithms.EdgeList[]} an array of EdgeLists. Each list contains all edges of a bus. + */ + toEdgeLists(graph:yfiles.algorithms.Graph,hubMarker:yfiles.algorithms.IDataProvider):yfiles.algorithms.EdgeList[]; + /** + * Changes the representation of buses from hubs to complete subgraphs. + * This method calls + * ReplaceHubsBySubgraph(graph, calculateBusEdgeLists(graph, hubMarker), hubMarker, false, + * busDescriptors). + * @see {@link yfiles.router.BusRepresentations#replaceHubsBySubgraphWithEdgeList} + * @see {@link yfiles.router.BusRepresentations#toEdgeLists} + */ + replaceHubsBySubgraph(graph:yfiles.layout.LayoutGraph,hubMarker:yfiles.algorithms.IDataProvider,descriptorAcceptor:yfiles.algorithms.IDataAcceptor):yfiles.algorithms.EdgeList; + /** + * Changes the representation of buses from hubs to complete subgraphs by creating new edges between regular nodes and + * removing the hubs. + * This method respects multiple connections of nodes and creates appropriate {@link yfiles.router.BusDescriptor}s consisting of the bus ID and source and target group IDs. + * The path of each new edge follows the route defined by the component of the hubs. If the subgraph of hubs is not a + * tree, these paths are ambiguous. In this case, an arbitrary tree is computed from the hub's subgraph which defines + * all the paths. + * @param {yfiles.layout.LayoutGraph} graph the graph of the bus + * @param {yfiles.algorithms.EdgeList[]} hubEdgesLists an EdgeList for each bus + * @param {yfiles.algorithms.IDataProvider} hubMarker + * a DataProvider that returns true if and only if a node is a + * hub + * @param {yfiles.algorithms.IDataProvider} fixedMarker + * a DataProvider that returns true if and only if an edge is + * fixed + * @param {yfiles.algorithms.IDataAcceptor} descriptorAcceptor a DataAcceptor to which the created bus descriptors are set + * @return {yfiles.algorithms.EdgeList} a list of the created edges + */ + replaceHubsBySubgraphWithEdgeList(graph:yfiles.layout.LayoutGraph,hubEdgesLists:yfiles.algorithms.EdgeList[],hubMarker:yfiles.algorithms.IDataProvider,fixedMarker:yfiles.algorithms.IDataProvider,descriptorAcceptor:yfiles.algorithms.IDataAcceptor):yfiles.algorithms.EdgeList; + /** + * Changes the representation of buses from complete subgraphs to hubs by replacing intersection points by hubs. + * The + * edges must form an orthogonal, cycle-free bus, otherwise an {@link yfiles.system.InvalidOperationException} is thrown. + * @param {yfiles.layout.LayoutGraph} graph the graph of the bus + * @param {yfiles.algorithms.IEdgeCursor} edgeCursor an EdgeCursor of the regular edges + * @param {yfiles.algorithms.IDataProvider} descriptorProvider + * a DataProvider that provides a {@link yfiles.router.BusDescriptor} for each edge + * @param {yfiles.algorithms.IDataAcceptor} busIDAcceptor + * an optional DataAcceptor. If specified, the bus ID for each new edge is set + * to this data acceptor + * @throws {yfiles.system.InvalidOperationException} if the path of an edge is not orthogonal or if some paths form a cycle + */ + replaceSubgraphByHubs(graph:yfiles.layout.LayoutGraph,edgeCursor:yfiles.algorithms.IEdgeCursor,descriptorProvider:yfiles.algorithms.IDataProvider,busIDAcceptor:yfiles.algorithms.IDataAcceptor):void; + }; + /** + * An orthogonal bus-style edge routing algorithm which combines the large number of edges of complete subgraphs in a + * concise, tree-like structure that consists of vertical and horizontal line segments. + * A complete (sub)graph is a set + * of nodes, in which each node is connected to every other node. The positions of the nodes in a graph are not + * altered by this algorithm. + *

+ *

+ *

+ *

+ * In a drawing of this algorithm, each edge path is orthogonal and there are no cycles induced by any two edge paths of + * the same bus, that is, the combination of all edge routes looks like an orthogonal tree. Besides these strict + * requirements, the algorithm aims to find routes where shared paths of edges with different end-nodes are drawn on top + * of each other and form long straight lines, so-called backbone segments. From these + * backbone segments, short connections of grouped edges branch off to each node (bus + * connections). + *

+ * This routing algorithm uses a two-phase process. First, in backbone selection, a set + * of good initial backbone segments is determined. In routing and recombination, each + * initial backbone segment is connected to all others and also to each node by using orthogonal edge paths. Then, the + * set of resulting structures is reduced to the most optimal structure where backbone segments are long and connections + * to the nodes are short. Note that the calculated paths can join before reaching an initial backbone segment and, + * thus, establish additional backbone segments. Contrariwise, initial backbone segments of low overall profit are + * discarded and connections to them are rerouted to other backbone segments. + *

+ * To determine which edges belong to a common bus, a mapping that assigns a bus ID to each edge must be specified using + * {@link yfiles.router.BusDescriptor}s. A data provider holding bus descriptor objects is expected to be registered + * with the graph using the {@link yfiles.router.BusRouter#EDGE_DESCRIPTOR_DP_KEY} look-up key. In the absence of an individual bus ID for an + * edge, a bus consisting only of the single edge is created. Additionally, a bus descriptors allows to mark its + * associated edge as fixed or movable, which is required for incremental routing, and to specify an optional group ID + * for an edge's source end and target end, respectively. + *

+ * Incremental routing means extending or updating an already existing bus-style representation. This can be used to + * rearrange existing edges or to include additional edges in an existing bus. The paths of edges not marked as fixed by + * their associated {@link yfiles.router.BusDescriptor#fixed BusDescriptor} are calculated anew. The structure induced by the + * fixed edges must be orthogonal and cycle-free. + *

+ */ + export interface BusRouter extends yfiles.layout.AbstractLayoutStage{ + /** + * Factory method that creates an appropriate OrthogonalEdgeRouter implementation. + * @return {yfiles.router.OrthogonalEdgeRouter} an appropriate OrthogonalEdgeRouter + */ + createOrthogonalEdgeRouter():yfiles.router.OrthogonalEdgeRouter; + /** + * Returns true if the specified graph can be routed by this algorithm. + * Calling {@link yfiles.router.BusRouter#doLayout} with + * the specified graph as its argument will only succeed if this method returns true. + * If there is no fixed edge in the graph, routing is always possible. Otherwise, the route of each fixed edge must be + * orthogonal. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#canLayout} + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Calculates a new bus layout for the specified graph. + * @param {yfiles.layout.LayoutGraph} graph the graph to lay out + * PointlessBooleanExpression, ConstantConditions@see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * The grid spacing that is used when grid routing is enabled. + * By default, a spacing of 10 is set. + * @see {@link yfiles.router.BusRouter#gridRouting} + * @see {@link yfiles.router.OrthogonalEdgeRouter#gridSpacing} + * @see {@link yfiles.router.OrthogonalEdgeRouter#gridSpacing} + */ + gridSpacing:number; + /** + * Specifies whether or not to route edge segments on grid lines. + * By default, this feature is disabled. + * @see {@link yfiles.router.OrthogonalEdgeRouter#gridRouting} + * @see {@link yfiles.router.OrthogonalEdgeRouter#gridRouting} + */ + gridRouting:boolean; + /** + * The minimum distance between edge segments and nodes. + * By default, a distance of 10 is set. + * @see {@link yfiles.router.OrthogonalEdgeRouter#minimumDistanceToNode} + * @see {@link yfiles.router.OrthogonalEdgeRouter#minimumDistanceToNode} + */ + minimumDistanceToNode:number; + /** + * The minimum distance between edge segments. + * By default, a distance of 5 is set. + * @see {@link yfiles.router.OrthogonalEdgeRouter#minimumDistance} + * @see {@link yfiles.router.OrthogonalEdgeRouter#minimumDistance} + */ + minimumDistanceToEdge:number; + /** + * The cost for each edge crossing of a routed path. + * A cost of n means that a path rather changes + * direction n times than crossing the path of an edge. If the cost is set to 0.0, no global + * crossing optimization is performed. Setting a higher value will activate global crossing minimization. A good + * trade-off between the number of direction changes and few crossings of a path is achieved by values between + * 1.0 and 3.0. By default, a cost of 1.0 is set. + * This setting is taken into account only in the routing and recombination phase and does not affect the selection of + * the initial backbone segments. + */ + crossingCost:number; + /** + * Specifies whether rerouting of edges with many crossings is enabled. + * By default, this feature is disabled. Activating this feature only makes sense if the global crossing + * cost is set to a value greater than 0.0. + * This setting is taken into account only in the routing and recombination phase and does not affect the selection of + * the initial backbone segments. + * @see {@link yfiles.router.BusRouter#crossingCost} + * @see {@link yfiles.router.OrthogonalEdgeRouter#rerouting} + * @see {@link yfiles.router.BusRouter#crossingCost} + * @see {@link yfiles.router.OrthogonalEdgeRouter#rerouting} + */ + rerouting:boolean; + /** + * The preferred number of backbone segments with the same orientation. + * The more initial backbone + * segments, the longer the running time. By default, a count of 2 is set. + * This count defines the number of backbone segments of the same orientation which are computed by the backbone + * selection phase. The final number of backbone segments may be different due to changes in the routing and + * recombination phase. + */ + preferredBackboneSegmentCount:number; + /** + * The preferred minimum length of a backbone segment. + * This should be at least as large as the typical distance + * between nodes to avoid small backbone segments. It is reasonable to set this according to the dimension of the + * graph's bounding box. By default, a minimum length of 100.0 is set. + * This number defines the minimum length of backbone segments which are computed by the backbone selection phase. + * Some of the final backbone segments may be shorter due to changes in the routing and recombination phase. + */ + minimumBackboneSegmentLength:number; + /** + * The minimum number of bus connections each backbone segment must have. + * If a backbone segment has less + * connections, it is removed and the affected nodes connect to another backbone segment. Three or four is a good + * choice for small graphs, for larger graphs a much larger count can be reasonable. By default, a minimum count of + * 3 is set. + * This setting is taken into account only in the routing and recombination phase and does not affect the selection of + * the initial backbone segments. + */ + minimumBusConnectionsCount:number; + /** + * Specifies whether or not collinear bends are removed from the layout. + * If an edge has a collinear bend, there is + * another edge which has a real bend at this point, i.e. the bend location is an intersection of the bus. Therefore, + * it is advantageous for some applications to keep such bends. By default, this feature is enabled. + */ + removeCollinearBends:boolean; + /** + * The DataProvider key to mark edges as selected. + *

By default, {@link yfiles.router.BusRouter#EDGE_SUBSET_DP_KEY} is used.

+ * @throws {yfiles.system.ArgumentException} if the specified key is null. + */ + selectedEdgesDpKey:Object; + /** + * The scope set for this router. + * The scope determines which edges are routed. Defaults to {@link yfiles.router.Scope#ALL}. + */ + scope:yfiles.router.Scope; + /** + * Provides access to implementation specific properties of the algorithms used internally. + * Used for internal + * purposes. + * @param {string} key the key to a property + * @param {Object} value the value to associate with the key + */ + setProperty(key:string,value:Object):boolean; + } + var BusRouter:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key used to store the {@link yfiles.router.BusDescriptor} of every edge. + * A bus descriptor provides the + * edge's bus ID, its optional group IDs and whether or not the edge is fixed. + */ + EDGE_DESCRIPTOR_DP_KEY:Object; + /** + * {@link yfiles.algorithms.IDataProvider} key used for specifying the edge subset to be laid out. + * This key is used if no custom key is + * set. The algorithm expects for each edge in the graph to find a {@link yfiles.algorithms.IDataProvider#getBool boolean} that + * indicates whether the node belongs to the scope. + * @see {@link yfiles.router.BusRouter#scope} + * @see {@link yfiles.router.BusRouter#selectedEdgesDpKey} + */ + EDGE_SUBSET_DP_KEY:Object; + /** + * Creates a new instance of BusRouter. + * ThisEscapedInObjectConstruction + */ + new ():yfiles.router.BusRouter; + }; + /** + * A descriptor for bus-related information to be associated with an edge. + * It consists of a bus ID defining the bus + * of the associated edge, two optional edge group IDs for specifying the edge grouping at the source and target side, + * respectively, and an optional boolean flag to mark the edge as fixed. + * Every object except null can be used as valid bus ID. Every edge of ID null forms a group + * of its own. Also, every object except null can be used as valid edge group ID. If there is no group ID + * defined for an edge or if null is set, a default group ID is used. Therefore, all such edges ending at + * the same node belong to the same group. + */ + export interface BusDescriptor extends Object{ + /** + * Indicates whether some other object is "equal to" this one. + * @param {Object} obj the reference object with which to compare. + * @return {boolean} true if all corresponding parameters are equal; false otherwise. + */ + equals(obj:Object):boolean; + hashCode():number; + /** + * The bus ID. + */ + busId:Object; + /** + * The group ID for the source side of the edge. + */ + sourceGroupId:Object; + /** + * The group ID for the target side of the edge. + */ + targetGroupId:Object; + /** + * Specifies whether the associated edge is fixed or not. + */ + fixed:boolean; + /** + * Returns a string consisting of the bus ID, the fixed flag, and both group IDs. + * @return {string} a string consisting of the bus ID, the fixed flag, and both group IDs + */ + toString():string; + } + var BusDescriptor:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of BusDescriptor for the specified bus ID which is marked as not fixed and uses + * the default edge group IDs. + * @param {Object} busID the ID of the bus the associated edge belongs to + */ + WithId:{ + new (busID:Object):yfiles.router.BusDescriptor; + }; + /** + * Creates a new instance of BusDescriptor for the specified parameters and marks it as not fixed. + * @param {Object} busID the ID of the bus the associated edge belongs to + * @param {Object} sourceGroupID the group ID of the source side + * @param {Object} targetGroupID the group ID of the target side + */ + ForSourceAndTarget:{ + new (busID:Object,sourceGroupID:Object,targetGroupID:Object):yfiles.router.BusDescriptor; + }; + /** + * Creates a new instance of BusDescriptor for the specified parameters and default group IDs. + * @param {Object} busID the ID of the bus the associated edge belongs to + * @param {boolean} fixed whether the associated edge is fixed or not + */ + WithFixed:{ + new (busID:Object,fixed:boolean):yfiles.router.BusDescriptor; + }; + /** + * Creates a new instance of BusDescriptor for the specified parameters. + * @param {Object} busID the ID of the bus the associated edge belongs to + * @param {boolean} fixed whether the associated edge is fixed or not + * @param {Object} sourceGroupID the group ID of the source side + * @param {Object} targetGroupID the group ID of the target side + */ + ForSourceAndTargetWithFixed:{ + new (busID:Object,fixed:boolean,sourceGroupID:Object,targetGroupID:Object):yfiles.router.BusDescriptor; + }; + }; + /** + * Simple edge router implementation that draws edges straight-line considering the specified port constraints. + */ + export interface StraightLineEdgeRouter extends yfiles.layout.AbstractLayoutStage{ + /** + * The edge (sub-)set to be routed. + * Defaults to {@link yfiles.router.SphereOfAction#ROUTE_ALL_EDGES}. + * @throws {yfiles.system.ArgumentException} + * if the given argument is not one of the + * above constants. + * @see {@link yfiles.router.StraightLineEdgeRouter#selectedEdgesDpKey} + */ + sphereOfAction:yfiles.router.SphereOfAction; + /** + * The data provider key used to look up the selected state of the + * nodes of the graph to be laid out. + * By default, {@link yfiles.layout.LayouterKeys#SELECTED_NODES_DP_KEY} is + * used. + *

+ * If the sphere of action is set to {@link yfiles.router.SphereOfAction#ROUTE_EDGES_AT_SELECTED_NODES}, + * only edges of selected nodes are routed while all other edges are + * considered to have fixed routes. + *

+ * @see {@link yfiles.router.StraightLineEdgeRouter#sphereOfAction} + * @throws {yfiles.system.ArgumentException} if the specified key is null. + * @see {@link yfiles.router.StraightLineEdgeRouter#sphereOfAction} + */ + selectedNodesDpKey:Object; + /** + * The data provider key used to look up the selected state of the + * edges of the graph to be laid out. + * By default, {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY} is + * used. + *

+ * If the sphere of action is set to {@link yfiles.router.SphereOfAction#ROUTE_SELECTED_EDGES}, only the + * selected keys are routed while all other edges are considered to have + * fixed routes. + *

+ * @see {@link yfiles.router.StraightLineEdgeRouter#sphereOfAction} + * @throws {yfiles.system.ArgumentException} if the specified key is null. + * @see {@link yfiles.router.StraightLineEdgeRouter#sphereOfAction} + */ + selectedEdgesDpKey:Object; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var StraightLineEdgeRouter:{ + $class:yfiles.lang.Class; + /** + * Creates a new StraightLineEdgeRouter that uses the given layouter instance as core layouter. + * @param {yfiles.layout.ILayouter} core a layouter instance that is used as core layouter. + */ + WithCoreLayouter:{ + new (core:yfiles.layout.ILayouter):yfiles.router.StraightLineEdgeRouter; + }; + /** + * Creates a new StraightLineEdgeRouter. + */ + new ():yfiles.router.StraightLineEdgeRouter; + }; + /** + * This LayoutStage will move edge ports, that are outside the corresponding nodes border, to the border. + * Thus guarantees ports are not outside of nodes. + */ + export interface SnapOuterPortsToNodeBorderStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var SnapOuterPortsToNodeBorderStage:{ + $class:yfiles.lang.Class; + new ():yfiles.router.SnapOuterPortsToNodeBorderStage; + }; + /** + * This class represents an orthogonal edge router. + * An orthogonal edge router is a layout algorithm that changes the + * coordinates of the edge paths in a way that the resulting layout of the edges is made up of vertical and horizontal + * segments only. The router does not change the location or the size of the nodes in a diagram in any way. + *

+ * The edge router will not try to find a perfect route from source to edge like OrthogonalEdgeRouter does, but chooses + * the best path out of several fixed paths it can choose from. The best path out of these possible paths is determined + * by its cost. One can take influence on the costs by setting several cost factors. The distance, an edge will have + * from its source and target node is determined by setMinimumDistance(double). + *

+ *

+ * The edges whose paths are to be routed can be defined using method setSphereOfAction(byte) + * or binding a data provider to the input graph with key {@link yfiles.router.ChannelEdgeRouter#AFFECTED_EDGES_DP_KEY}. + * Note: If the DataProvider is registered on the graph, it will determine all affected edges, regardless of the set + * sphere of action. So setting a sphere of action has lower priority than adding the specific DataProvider directly. + *

+ *

+ * By default all edges are routed according to their best paths and afterwards overlapping edges will be redistributed. + * This can be prevented by calling method setDistributeEdgesEnabled(boolean). + *

+ *

+ * ChannelEdgeRouter does also support grid routing setGridRoutingEnabled(boolean).Therefore + * the user can define the grid origin setGridOrigin(y.geom.YPoint) and the + * grid width setGridWidth(double). + *

+ *

+ * This edge router will obey strong and weak port constraints. It expects the port constraints to be bound to the input + * graph by the data provider keys {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} and {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY}. Furthermore, this class supports the more advanced port constraint + * concept of {@link yfiles.layout.PortCandidate}s. It expects collections of port candidates to be bound to the input graph by the + * data provider keys {@link yfiles.layout.PortCandidate#SOURCE_PC_LIST_DP_KEY} and {@link yfiles.layout.PortCandidate#TARGET_PC_LIST_DP_KEY}. + *

+ */ + export interface OrthogonalPatternEdgeRouter extends yfiles.layout.AbstractLayoutStage{ + /** + * The specified kind of monotonic path restrictions. + * Possible values are {@link yfiles.router.MonotonicPathRestriction#NONE}, {@link yfiles.router.MonotonicPathRestriction#VERTICAL}, {@link yfiles.router.MonotonicPathRestriction#HORIZONTAL} + * and {@link yfiles.router.MonotonicPathRestriction#BOTH}. + */ + monotonicPathRestriction:yfiles.router.MonotonicPathRestriction; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * This method throws an {@link yfiles.system.ArgumentException} if the width/height of the given node object is zero. + * It is called by the {@link yfiles.router.OrthogonalPatternEdgeRouter#doLayout} method for each node object in the input graph. + * @see {@link yfiles.router.OrthogonalPatternEdgeRouter#checkGroupNodeSize} + * @param {yfiles.layout.IGraphLayout} layout a graph layout object. + * @param {Object} node the node object to test. + * @throws {yfiles.system.ArgumentException} thrown if the width/height of the node object is zero. + */ + checkNodeSize(layout:yfiles.layout.IGraphLayout,node:Object):void; + /** + * This method throws an {@link yfiles.system.ArgumentException} if the width/height of the given group node object is zero. + * It is called by the {@link yfiles.router.OrthogonalPatternEdgeRouter#doLayout} method for each group node object in the input graph. + * @see {@link yfiles.router.OrthogonalPatternEdgeRouter#checkNodeSize} + * @param {yfiles.layout.IGraphLayout} layout a graph layout object. + * @param {Object} node the group node object to test. + * @throws {yfiles.system.ArgumentException} thrown if the width/height of the group node object is zero. + */ + checkGroupNodeSize(layout:yfiles.layout.IGraphLayout,node:Object):void; + /** + * Calculates the edge cost of a possible edge path, to determine which path is the best (cheapest). + * @param {yfiles.algorithms.Edge} edge the edge whose cost to calculate. + * @param {yfiles.algorithms.YList} path the edge's path. + * @param {yfiles.layout.PortCandidate} spc the source port candidate chosen for this path. + * @param {yfiles.layout.PortCandidate} tpc the target port candidate chosen for this path. + * @return {number} the sum of all costs for this edge's path + */ + calculateCost(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; + /** + * Calculates the costs for the chosen ports. + * By default these costs are determined from set port + * candidates. If no PortCandidates have been set on the given edge, the cost is 0. If PortConstraints have been set + * for this edge, the cost is also 0. + * @param {yfiles.algorithms.Edge} edge the edge the penalty is calculated for. + * @param {yfiles.algorithms.YList} path the path this penalty is calculated for. + * @param {yfiles.layout.PortCandidate} spc the used source PortCandidate for this path. + * @param {yfiles.layout.PortCandidate} tpc the used target PortCandidate for this path. + * @return {number} the costs for all bends of this path + */ + calculatePortCandidateCost(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; + /** + * Calculates the costs for all bends of the given path by simple multiplying + * all bends with the {@link yfiles.router.OrthogonalPatternEdgeRouter#bendCost bend costs}. + *

+ * Note: Only bends are taken into account, not the source and target + * ports, that are also part of the given path. + *

+ * @param {yfiles.algorithms.Edge} edge the edge the penalty is calculated for. + * @param {yfiles.algorithms.YList} path the path this penalty is calculated for. + * @param {yfiles.layout.PortCandidate} spc the used source PortCandidate for this path. + * @param {yfiles.layout.PortCandidate} tpc the used target PortCandidate for this path. + * @return {number} the costs for all bends of this path + */ + calculateBendCost(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; + /** + * Calculates the extra penalty that is added to the paths cost if the edge is a selfloop and source and target + * ports have the same direction. + * By default this penalty is a bit more than adding another bend to the path so that patterns with different + * source and target directions are cheaper and thus preferred. + * @param {yfiles.algorithms.Edge} edge the edge the penalty is calculated for. + * @param {yfiles.algorithms.YList} path the path this penalty is calculated for. + * @param {yfiles.layout.PortCandidate} spc the used source PortCandidate for this path. + * @param {yfiles.layout.PortCandidate} tpc the used target PortCandidate for this path. + * @return {number} an extra penalty for paths + */ + calculateSelfLoopSelfSidePenaltyCost(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; + /** + * Calculates the costs for the length of the given path. + * By default this cost is between 0 (short path) and 1 (long path) so this has very little impact on the + * overall costs. + * @param {yfiles.algorithms.Edge} edge the edge the penalty is calculated for. + * @param {yfiles.algorithms.YList} path the path this penalty is calculated for. + * @param {yfiles.layout.PortCandidate} spc the used source PortCandidate for this path. + * @param {yfiles.layout.PortCandidate} tpc the used target PortCandidate for this path. + * @return {number} the length costs of the given path between 0 and 1 + */ + calculateEdgeLength(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; + /** + * Calculates the overall crossing costs of the given path including edge crossings, edge overlaps and node crossings. + * @param {yfiles.algorithms.Edge} edge the edge the penalty is calculated for. + * @param {yfiles.algorithms.YList} path the path this penalty is calculated for. + * @param {yfiles.layout.PortCandidate} spc the used source PortCandidate for this path. + * @param {yfiles.layout.PortCandidate} tpc the used target PortCandidate for this path. + * @return {number} the overall crossing costs of the given path including edge crossings, edge overlaps and node crossings. + */ + calculateCrossingCosts(edge:yfiles.algorithms.Edge,path:yfiles.algorithms.YList,spc:yfiles.layout.PortCandidate,tpc:yfiles.layout.PortCandidate):number; + /** + * The DataProvider key, which determines the edges, that shall be routed by the algorithm. + *

+ * By default, {@link yfiles.router.OrthogonalPatternEdgeRouter#DEFAULT_AFFECTED_EDGES_DP_KEY} is used. + *

+ */ + affectedEdgesDpKey:Object; + /** + * The minimum distance an edge will have to its source and target node. + * Default value is 10.0. + */ + minimumDistance:number; + /** + * The grid width, that defines the space between two grid lines. + * Setter:Only takes effect if + * {@link yfiles.router.OrthogonalPatternEdgeRouter#gridRoutingEnabled grid routing is enabled}. + *

Default value is 10.0.

+ * Getter:

Default value is 10.0

. + * @throws {yfiles.system.ArgumentException} + * if the specified grid width is less than + * 2. + */ + gridWidth:number; + /** + * The origin of the grid, which is used for grid routing if enabled. + * Setter:Takes effect if grid routing is enabled {@link yfiles.router.OrthogonalPatternEdgeRouter#gridRoutingEnabled}. + * Note that grid routing has lower priority than the minimum Distance setting {@link yfiles.router.OrthogonalPatternEdgeRouter#minimumDistance}. + * Thus it is possible that edges are not routed on the grid if there is not enough space between two borders. Default + * origin is at x = 0, y = 0 + * Getter:{@link yfiles.router.OrthogonalPatternEdgeRouter#gridRoutingEnabled}. Default origin is at x = 0, y = 0 + */ + gridOrigin:yfiles.algorithms.YPoint; + /** + * Specifies whether or not grid routing is enabled. + * Grid routing means edges are routed on a grid's lines only. The grid can be defined + * using method {@link yfiles.router.OrthogonalPatternEdgeRouter#gridOrigin} and {@link yfiles.router.OrthogonalPatternEdgeRouter#gridWidth}. Note that grid routing has + * lower priority than the minimum Distance setting {@link yfiles.router.OrthogonalPatternEdgeRouter#minimumDistance}. Thus it is possible that + * edges are not routed on the grid if there is not enough space between two borders. + *

+ * Also, the edges source and target ports are not reassigned if they have fixed coordinates. Therefore, the first and + * last segments of an edge might not be routed on the grid. Use weak ports or assign coordinates that already lie on + * the grid for these ports, if grid routing is wanted. + *

+ * By default grid routing is not enabled. + */ + gridRoutingEnabled:boolean; + /** + * The edge cost an edge crossing will cause. + * Used to find the best path out of the predefined paths the + * router can choose from. Default value is 5. + */ + edgeCrossingCost:number; + /** + * The node cost an edge node overlap will cause. + * Used to find the best path out of the predefined paths the + * router can choose from. Default value is 50. + */ + nodeCrossingCost:number; + /** + * The edge cost a bend inside an edge's path will cause. + * Used to find the best path out of the predefined paths + * the router can choose from. Default value is 1. + */ + bendCost:number; + /** + * The cost an edge overlap will cause. + * By default this edge router is used in conjunction with a segment + * distribution stage like {@link yfiles.router.OrthogonalSegmentDistributionStage}, so edge overlaps are wanted and + * thus should not cause any costs. Default value is therefore 0. + * If this edge router is used stand-alone, one can determine a higher cost to prevent edge overlaps. + */ + edgeOverlapCost:number; + } + var OrthogonalPatternEdgeRouter:{ + $class:yfiles.lang.Class; + /** + * DataProvider key that can be used to determine which edges the edge router will route. + */ + DEFAULT_AFFECTED_EDGES_DP_KEY:Object; + new ():yfiles.router.OrthogonalPatternEdgeRouter; + }; + /** + * This class can be used to distribute overlapping edge segments of orthogonally routed edges. + * The edge segments will + * then be distributed in their so called channel according to the given settings. The channel in which the segments can + * be distributed is defined by the surrounding graph elements, which will form borderlines for the channel. + * The distance between the distributed edge segments can be determined by method {@link yfiles.router.OrthogonalSegmentDistributionStage#preferredDistance}. + * The edge segments can also be forced to be distributed on a given grid ({@link yfiles.router.OrthogonalSegmentDistributionStage#gridEnabled} ) whose + * origin ( {@link yfiles.router.OrthogonalSegmentDistributionStage#setGridOffset} ) and grid width ( {@link yfiles.router.OrthogonalSegmentDistributionStage#gridWidth} ) can be set. + * Note: this LayoutStage is not capable of moving nodes. If the set conditions like preferred distance or the grid width + * can not be satisfied, for example, because there is not enough space inside the channel, the set values will by + * default be adjusted (reduced). Concerning the grid, it will be divided by 2 until all segments will fit. The + * preferred distance will be adjusted so that the maximum possible distance near the given value will be taken. Also, + * segments that are directly at a node (source or target) will be distributed, so that they are placed equidistant + * all along the node's side. + * Settings {@link yfiles.router.OrthogonalSegmentDistributionStage#gridWidthAdjustable} and {@link yfiles.router.OrthogonalSegmentDistributionStage#preferredDistanceAdjustable} can be used to + * force the algorithm to distribute the edges with the exact given distances. If the segments will not fit into the + * given channel, they then will not be distributed at all. So there is a guarantee that they will match the settings if + * they are routed. + * {@link yfiles.router.OrthogonalSegmentDistributionStage#lockFirstAndLastSegment} can be used to guarantee that the first and last segment of an edge + * (connected to source or target), won't be distributed. So ports can easily be kept without setting explicit strong + * port constraints or fixed PortCandidates. + * The algorithm will not distribute the segments, whose end connect to a node at a strong port constraint or fixed + * port candidate. + */ + export interface OrthogonalSegmentDistributionStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * The DataProvider key, which determines the edges, that shall be distributed by the algorithm. + *

+ * By default, {@link yfiles.router.OrthogonalSegmentDistributionStage#DEFAULT_AFFECTED_EDGES_DP_KEY} is used. + *

+ */ + affectedEdgesDpKey:Object; + /** + * What happens if the preferred distance can not be kept, because there is not enough space for the segments + * to be distributed in that distance. + * If set to true the algorithm is allowed to reduce the + * distance to the next best value, that is possible. If set to false the algorithm will not at all + * distribute those segments. By default the setting is true and therefore segments will be distributed. + * Note: Preferred distances will not be kept for segments connecting to nodes (first and last segment of an edge). + * The segments are distributed equidistant all along the node side, thus may lead to bigger distances between + * segments. + */ + preferredDistanceAdjustable:boolean; + /** + * Specifies whether or not the algorithm is allowed to reduce the grid width, + * if segments cannot be distributed using the previously given grid width. + * The algorithm will divide the given grid width by 2 as long as the segments + * will not fit and thus will lead to nicer results than taking some other value. + * Note: The grid width will only be adjusted for segments that cannot keep + * the originally set grid width. + *

+ * By default, the algorithm is allowed to reduce the grid width. + *

+ */ + gridWidthAdjustable:boolean; + /** + * Specifies whether grid distribution is enabled or not. + * If so, all segments will be distributed onto the grid. By + * default grid distribution is not enabled. + */ + gridEnabled:boolean; + /** + * The grid width that shall be used if grid distribution is enabled. + * By default the grid width is 10.0. + */ + gridWidth:number; + /** + * Can be used to set the grid origin. + * By default the offset is (0, 0), so there is no offset. + * @param {number} offsetX the offset in x direction. + * @param {number} offsetY the offset in y direction + */ + setGridOffset(offsetX:number,offsetY:number):void; + /** + * The grid offset in x direction. + * by default this will be 0. + */ + gridOffsetX:number; + /** + * The grid offset in y direction. + * by default this will be 0. + */ + gridOffsetY:number; + /** + * Specifies whether the first and last segment of an edge (connected to source or target), will be distributed. + * So + * ports can easily be kept without setting explicit strong port constraints or fixed PortCandidates. + * Defaults to false, i.e. first and last segments are not locked. + */ + lockFirstAndLastSegment:boolean; + /** + * The preferred distance, segments shall have to each other and to the channel's border. + *

+ * Default value is 10.0. + *

+ * Note: if {@link yfiles.router.OrthogonalSegmentDistributionStage#preferredDistanceAdjustable} is set to true (which is the default), the + * preferred distance might be adjusted so that the maximum possible distance near the given value will be taken. This + * happens if the channel is not big enough to fit in all segments with the desired preferred distance. + *

+ */ + preferredDistance:number; + } + var OrthogonalSegmentDistributionStage:{ + $class:yfiles.lang.Class; + /** + * DataProvider key that can be used to determine which edges the distribution stage will route. + */ + DEFAULT_AFFECTED_EDGES_DP_KEY:Object; + new ():yfiles.router.OrthogonalSegmentDistributionStage; + }; + /** + * This algorithm routes edges using an organic-like layout approach and style. + * It is implemented as a LayoutStage so that it can easily be appended to + * another stage, by setting the other stage as the core of this one. + * Note that this algorithm only works correctly if it is guaranteed that nodes are at + * least approximately twice as far away from each other as the minimal edge + * distance, which has been set for this algorithm. This can be achieved by using + * the {@link yfiles.router.OrganicEdgeRouter#createNodeEnlargementStage} layout stage in combination with a stage + * that removes node overlaps as the core of this layouter. + * Here is a sample output of the router using as input a straight-line drawing + * created by : + *

+ *

+ */ + export interface OrganicEdgeRouter extends Object,yfiles.layout.ILayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Specifies whether or not edge-node overlaps are allowed. + * Getter:Enabling this option often leads to better results if the {@link yfiles.router.OrganicEdgeRouter#createNodeEnlargementStage} LayoutStage is not used + * (e.g. because the nodes are not allowed to move) and the distances between some nodes are small. + * However enabling this option may produce edge-node overlaps. Furthermore, the minimal distance (set with + * {@link yfiles.router.OrganicEdgeRouter#minimalDistance} cannot always be maintained in that case. + * Setter:because the nodes are not allowed to move) and the distances between some nodes are small. + * However enabling this option may produce edge-node overlaps. Furthermore, the minimal distance (set with + * {@link yfiles.router.OrganicEdgeRouter#minimalDistance}) cannot always be maintained in that case. + * @see {@link yfiles.router.OrganicEdgeRouter#createNodeEnlargementStage} + * @see {@link yfiles.router.OrganicEdgeRouter#minimalDistance} + * @see {@link yfiles.router.OrganicEdgeRouter#createNodeEnlargementStage} + * @see {@link yfiles.router.OrganicEdgeRouter#minimalDistance} + */ + edgeNodeOverlapAllowed:boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * This method throws an {@link yfiles.system.ArgumentException} if the width/height of the given node object is zero. + * It is called by the {@link yfiles.router.OrganicEdgeRouter#doLayout} method for each node object in the input graph. + * @see {@link yfiles.router.OrganicEdgeRouter#checkGroupNodeSize} + * @param {yfiles.layout.IGraphLayout} layout a graph layout object. + * @param {Object} node the node object to test. + * @throws {yfiles.system.ArgumentException} thrown if the width/height of the node object is zero. + */ + checkNodeSize(layout:yfiles.layout.IGraphLayout,node:Object):void; + /** + * This method throws an {@link yfiles.system.ArgumentException} if the width/height of the given group node object is zero. + * It is called by the {@link yfiles.router.OrganicEdgeRouter#doLayout} method for each group node object in the input graph. + * @see {@link yfiles.router.OrganicEdgeRouter#checkNodeSize} + * @param {yfiles.layout.IGraphLayout} layout a graph layout object. + * @param {Object} node the group node object to test. + * @throws {yfiles.system.ArgumentException} thrown if the width/height of the group node object is zero. + */ + checkGroupNodeSize(layout:yfiles.layout.IGraphLayout,node:Object):void; + /** + * The core layouter. + * @see Specified by {@link yfiles.layout.ILayoutStage#coreLayouter}. + */ + coreLayouter:yfiles.layout.ILayouter; + /** + * The minimal distance between nodes and non-incident edges. + * Values should be larger than 10. + */ + minimalDistance:number; + /** + * Specifies whether given bend coordinates are taken into account when + * determining initial bend positions. + */ + usingBends:boolean; + /** + * Specifies whether edges should be rerouted even if they do not obey all + * constraints initially. + * This flag is initially set to false + * so that if edges that do not intersect with other nodes will not be rerouted + * by this algorithm. + */ + routingAll:boolean; + /** + * Returns a layout stage which can be used to ensure that the nodes do not overlap. + * Note that overlapping nodes may lead to bad routing results. + */ + createNodeEnlargementStage():yfiles.layout.ILayoutStage; + } + var OrganicEdgeRouter:{ + $class:yfiles.lang.Class; + /** + * Use this key to provide the algorithm with boolean values for each edge, + * specifying the ones which should be rerouted. + */ + ROUTE_EDGE_DP_KEY:Object; + /** + * Creates a new instance of OrganicEdgeRouter with an + * initial minimal distance of 10. + */ + new ():yfiles.router.OrganicEdgeRouter; + /** + * Creates a new instance of OrganicEdgeRouter using the given + * initial minimal distance. + */ + WithMinDistance:{ + new (minNodeDistance:number):yfiles.router.OrganicEdgeRouter; + }; + }; + /** + * This class represents an orthogonal edge router. + * An orthogonal edge router is a layout algorithm that changes the + * coordinates of the edge paths in a way that the resulting layout of the edges is made up of vertical and horizontal + * segments only. The router does not change the location or the size of the nodes in a diagram in any way. + *

+ * Several LayoutStages can be used to enhance performance and/or functionality of this class, e.g. {@link yfiles.router.EdgeGroupRouterStage}, {@link yfiles.router.GroupNodeRouterStage}, {@link yfiles.router.ReducedSphereOfActionStage} or {@link yfiles.router.PatchRouterStage}. + *

+ *

+ * This edge router will obey strong and weak port constraints. It expects the port constraints to be bound to the input + * graph by the data provider keys {@link yfiles.layout.PortConstraintKeys#SOURCE_PORT_CONSTRAINT_DP_KEY} and {@link yfiles.layout.PortConstraintKeys#TARGET_PORT_CONSTRAINT_DP_KEY}. Furthermore, this class supports the more advanced port constraint + * concept of {@link yfiles.layout.PortCandidate}s. It expects collections of port candidates to be bound to the input graph by the + * data provider keys {@link yfiles.layout.PortCandidate#SOURCE_PC_LIST_DP_KEY} and {@link yfiles.layout.PortCandidate#TARGET_PC_LIST_DP_KEY}. + *

+ *

+ * The router often finds ideal routes in difficult situations like the one depicted below.

+ *

+ *

+ */ + export interface OrthogonalEdgeRouter extends yfiles.layout.AbstractLayoutStage{ + /** + * The DataProvider key to mark nodes as + * selected. + *

+ * By default, {@link yfiles.layout.LayouterKeys#SELECTED_NODES_DP_KEY} is used. + *

+ * @throws {yfiles.system.ArgumentException} if the specified key is null. + */ + selectedNodesDpKey:Object; + /** + * The DataProvider key to mark edges as + * selected. + *

+ * By default, {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY} is used. + *

+ * @throws {yfiles.system.ArgumentException} if the specified key is null. + */ + selectedEdgesDpKey:Object; + /** + * Specifies whether or not node labels are taken into account when calculating edge paths (thereby preventing + * possible edge/node label overlaps). + * The default is false. + */ + considerNodeLabels:boolean; + /** + * The specified kind of monotonic path restrictions. + * Possible values are {@link yfiles.router.MonotonicPathRestriction#NONE}, {@link yfiles.router.MonotonicPathRestriction#VERTICAL}, {@link yfiles.router.MonotonicPathRestriction#HORIZONTAL} + * and {@link yfiles.router.MonotonicPathRestriction#BOTH}. + */ + monotonicPathRestriction:yfiles.router.MonotonicPathRestriction; + /** + * Specifies whether monotonic path restrictions (set with{@link yfiles.router.OrthogonalEdgeRouter#monotonicPathRestriction}) should be enforced. + * Enabling this option guarantees monotonic edge paths even if this results in additional overlaps between edges and nodes. + */ + enforceMonotonicPathRestrictions:boolean; + /** + * Returns true if the specified core layouter does, and also when there is no core layouter. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#canLayout} + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main entrance to orthogonal edge routing. + * Routes the edges of the given graph. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * This method throws an {@link yfiles.system.ArgumentException} if the width/height of the given node object is zero. + * It is called by the {@link yfiles.router.OrthogonalEdgeRouter#doLayout} method for each node object in the input graph. + * @see {@link yfiles.router.OrthogonalEdgeRouter#checkGroupNodeSize} + * @param {yfiles.layout.IGraphLayout} layout a graph layout object. + * @param {Object} node the node object to test. + * @throws {yfiles.system.ArgumentException} thrown if the width/height of the node object is zero. + */ + checkNodeSize(layout:yfiles.layout.IGraphLayout,node:Object):void; + /** + * This method throws an {@link yfiles.system.ArgumentException} if the width/height of the given group node object is zero. + * It is called by the {@link yfiles.router.OrthogonalEdgeRouter#doLayout} method for each group node object in the input graph. + * @see {@link yfiles.router.OrthogonalEdgeRouter#checkNodeSize} + * @param {yfiles.layout.IGraphLayout} layout a graph layout object. + * @param {Object} node the group node object to test. + * @throws {yfiles.system.ArgumentException} thrown if the width/height of the group node object is zero. + */ + checkGroupNodeSize(layout:yfiles.layout.IGraphLayout,node:Object):void; + /** + * For internal use only. + * @deprecated For internal use only. Might be changed or removed in the future. + */ + setProperty(key:string,value:Object):boolean; + /** + * The cost for each edge crossing of a routed path. + * A cost of n means that a path rather changes + * direction n times than crossing the path of an edge. By default the cost is set to 0 and + * therefore no global crossing optimization is performed. Setting a higher value will activate global crossing + * minimization. A good trade-off between the number of direction changes and few crossings of a path is achieved by + * values between 1 and 3. + */ + crossingCost:number; + /** + * Specifies whether rerouting bad edges is enabled. + * By default this feature is not enabled. + * Activating this feature only makes sense if the global crossing cost + * is set to a value greater an 0. + * @see {@link yfiles.router.OrthogonalEdgeRouter#crossingCost} + */ + rerouting:boolean; + /** + * The currently set sphere of action specifier. + * Default setting is {@link yfiles.router.SphereOfAction#ROUTE_ALL_EDGES}. + * @see {@link yfiles.router.OrthogonalEdgeRouter#selectedEdgesDpKey} + * @see {@link yfiles.router.OrthogonalEdgeRouter#selectedNodesDpKey} + */ + sphereOfAction:yfiles.router.SphereOfAction; + /** + * Specifies whether or not to route edge segments on grid lines. + * By default this feature is disabled, i.e., "free" routing is enabled. + * @see {@link yfiles.router.OrthogonalEdgeRouter#setGridOrigin} + * @see {@link yfiles.router.OrthogonalEdgeRouter#gridSpacing} + */ + gridRouting:boolean; + /** + * Sets a grid point coordinate used when grid routing is enabled. + * By default (0, 0) is set. + * @see {@link yfiles.router.OrthogonalEdgeRouter#gridRouting} + */ + setGridOrigin(x:number,y:number):void; + /** + * A grid point coordinate used when grid routing is enabled. + * @see {@link yfiles.router.OrthogonalEdgeRouter#setGridOrigin} + */ + gridOrigin:yfiles.algorithms.YPoint; + /** + * The grid spacing that is used when grid routing is enabled. + * By default a spacing of 2 is set, + * which is also the minimum allowed spacing. + * @see {@link yfiles.router.OrthogonalEdgeRouter#gridRouting} + */ + gridSpacing:number; + /** + * The minimum distance between edge segments. + * By default a distance of 4 is set, which is also the + * minimum allowed distance. + * @see {@link yfiles.router.OrthogonalEdgeRouter#coupledDistances} + * @see {@link yfiles.router.OrthogonalEdgeRouter#minimumDistanceToNode} + */ + minimumDistance:number; + /** + * Specifies whether the minimum distances are coupled. + * I.e., whether half the value set for the minimum distance between edge + * segments should automatically be used as the minimum distance between edge + * segments and nodes, or a custom value should be used instead. + *

+ * By default the minimum distances are coupled. + *

+ * @see {@link yfiles.router.OrthogonalEdgeRouter#minimumDistance} + * @see {@link yfiles.router.OrthogonalEdgeRouter#minimumDistanceToNode} + */ + coupledDistances:boolean; + /** + * The minimum distance between edge segments and nodes. + * @see {@link yfiles.router.OrthogonalEdgeRouter#coupledDistances} + * @see {@link yfiles.router.OrthogonalEdgeRouter#minimumDistance} + */ + minimumDistanceToNode:number; + /** + * Specifies whether the local crossing minimization strategy is enabled. + * By default this feature is enabled. + */ + localCrossingMinimization:boolean; + /** + * The currently set ratio between the two complementary weighting strategies center driven and space driven. + *
  • Center driven means that those edge paths should be preferred + * that are closer to the edge's center. (Where the edge's center is an equidistant point between source node and + * target node.)
  • Space driven means that those edge paths should be preferred that are evenly distributed + * over the available space.
+ */ + centerToSpaceRatio:number; + /** + * The currently set routing style. + * The default setting is {@link yfiles.router.RoutingStyle#BALANCED}. + */ + routingStyle:yfiles.router.RoutingStyle; + /** + * Specifies whether bad edges should be drawn in an orthogonal fashion. + * If set, edge paths are drawn in an orthogonal + * fashion. Otherwise the edge path is drawn as a straight line. + *

+ * Default setting is true.

+ */ + badOrthogonal:boolean; + /** + * Specifies whether a custom value for the capacity of the routing border is used. + *

+ * Default setting is false.

+ * @see {@link yfiles.router.OrthogonalEdgeRouter#customBorderCapacity} + * @see {@link yfiles.router.OrthogonalEdgeRouter#customBorderCapacity} + */ + useCustomBorderCapacity:boolean; + /** + * The currently set custom value for the capacity of the routing border around the graph's bounding box. + * The routing + * border means the space left of the leftmost node, right of the rightmost node, above the topmost node, and below + * the bottommost node. By default this value is set to 5, i.e., the routing border accommodates up to 5 parallel edge + * paths left of the leftmost node, right of the rightmost node, etc. + */ + customBorderCapacity:number; + /** + * Specifies whether edge ports (that do not have a strong port constraint set) should lie inside the node's bounding + * box or on the node's border. + * More specifically, "inside" means on the node's meridian for edges + * connecting to the left and right, and on the node's equator for edges + * connecting to the upper and lower side. + *

+ * Default setting is false. + *

+ */ + innerPorts:boolean; + } + var OrthogonalEdgeRouter:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of the Orthogonal Edge Router. + * The initial settings (the default values) make up an instance + * that:
  • processes all edges,
  • applies "free" routing with a minimum distance between edge segments + * of 4 [pixel],
  • uses an automatically derived minimum distance between edge segments and nodes of 2 + * [pixel],
  • obeys port constraints (if previously set),
  • uses an edge routing style, where edge + * segments are drawn with the most distance to already known obstacles (i.e., nodes and other edge segments),
  • + *
  • draws edges, which cannot be routed, in an orthogonal fashion, and
  • places edge ports along the node's + * bounding box.
+ * @see {@link yfiles.router.OrthogonalEdgeRouter#sphereOfAction} + * @see {@link yfiles.router.OrthogonalEdgeRouter#gridRouting} + * @see {@link yfiles.router.OrthogonalEdgeRouter#routingStyle} + * @see {@link yfiles.router.OrthogonalEdgeRouter#badOrthogonal} + */ + new ():yfiles.router.OrthogonalEdgeRouter; + /** + * Convenience constructor to simultaneously set a core layout algorithm which will run before the orthogonal edge + * router. + */ + WithCoreLayouter:{ + new (core:yfiles.layout.ILayouter):yfiles.router.OrthogonalEdgeRouter; + }; + }; + /** + * Performance optimization stage for + * {@link yfiles.router.OrthogonalEdgeRouter}. + * This layout stage is applicable when only a subset of the edges + * in the input graph should be + * routed orthogonally. + */ + export interface ReducedSphereOfActionStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Assigns orthogonal edge paths to the selected edges of a graph, efficiently. + * Note that this + * stage will only have an optimizing effect if not all edges of the graph + * should be routed. + * Precondition: a LayoutStage of getCoreLayouter() must be an instance of OrthogonalEdgeRouter. + * @see {@link yfiles.router.OrthogonalEdgeRouter#sphereOfAction} + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * The activation threshold for this class. + * This stage will perform its optimization + * step only if the sum of the edges and nodes of the input graph is bigger than the activation threshold. + * By default the threshold value is set to 200. + */ + activationThreshold:number; + } + var ReducedSphereOfActionStage:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of ReducedSphereOfActionStage. + * @param {yfiles.layout.ILayouter} coreLayouter + * the core layouter invoked by this stage. The coreLayouter must + * contain an instance of {@link yfiles.router.OrthogonalEdgeRouter} its layout pipeline. + */ + new (coreLayouter:yfiles.layout.ILayouter):yfiles.router.ReducedSphereOfActionStage; + }; + /** + * Layout stage for {@link yfiles.router.OrthogonalEdgeRouter} that should be + * applied when routing edges in a partition grid. + * Note: This stage can only be applied if all nodes are contained within a single partition grid, i.e., edges can + * never cross the border of the partition grid. + * @see {@link yfiles.layout.PartitionGrid} + */ + export interface PartitionGridRouterStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine. + * Precondition: + * the coreLayouter must contain an instance of + * {@link yfiles.router.OrthogonalEdgeRouter} in its layout pipeline. + * Furthermore all elements have to lie inside the partition grid. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var PartitionGridRouterStage:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this class. + */ + new ():yfiles.router.PartitionGridRouterStage; + /** + * Creates a new instance of this class. + * @param {yfiles.layout.ILayouter} coreLayouter + * the core layouter invoked by this stage. + * The coreLayouter must contain an instance of + * {@link yfiles.router.OrthogonalEdgeRouter} in its layout pipeline. + */ + WithCoreLayouter:{ + new (coreLayouter:yfiles.layout.ILayouter):yfiles.router.PartitionGridRouterStage; + }; + }; + /** + * Performance optimization stage for + * {@link yfiles.router.OrthogonalEdgeRouter}. + * This layout stage decomposes + * the input graph for the orthogonal edge router into several smaller graphs + * on each of which the edge router will perform its action separately, hence + * speeding up execution time and reducing peak memory consumption. + */ + export interface PatchRouterStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * The activation threshold for this class. + * The patch router will perform its optimization + * step only if the sum of the edges and nodes of the input graph is bigger than the activation threshold. + * By default the threshold value is set to 1000. + */ + activationThreshold:number; + /** + * Assigns orthogonal edge paths to the edges of a big graph, efficiently. + * Note that this + * stage will only have an optimizing effect if the graph is bigger than the + * activation threshold and the sphere of action of the core router includes all edges. + * Precondition: a LayoutStage of getCoreLayouter() must be an instance of OrthogonalEdgeRouter. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var PatchRouterStage:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of PatchRouterStage. + * @param {yfiles.layout.ILayouter} coreLayouter + * the core layouter invoked by this stage. The coreLayouter must + * contain an instance of {@link yfiles.router.OrthogonalEdgeRouter} its layout pipeline. + */ + new (coreLayouter:yfiles.layout.ILayouter):yfiles.router.PatchRouterStage; + }; + /** + * Layout stage for {@link yfiles.router.OrthogonalEdgeRouter} that adds support for a bus-like routing style. + * Edges that connect to a + * common node can be marked as grouped by using the data provider keys {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} or + * {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY}. This stage tries to route grouped edges on a vertical or horizontal + * bus. The edges will connect to their common node at the same port coordinate. There are some limitations to this + * stage:
  • If at least one edge of a specific edge group is part of the sphere of action of + * OrthogonalEdgeRouter, then all of the edges belonging to that group will be part of the sphere of action of the + * router.
  • Edges can either be source or target grouped but not both at the same time.
  • Not all + * edges belonging to a group will be placed on a common bus. Only edges that connect to nodes which lie in the same + * direction relative to their common node will be routed on a bus.
+ */ + export interface EdgeGroupRouterStage extends yfiles.layout.AbstractLayoutStage{ + /** + * The minimal distance between a bus formed by an edge group and the nodes the grouped edges connect to. + * By + * default this value is set to 15.0. + */ + minimalBusDistance:number; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var EdgeGroupRouterStage:{ + $class:yfiles.lang.Class; + new (coreLayouter:yfiles.layout.ILayouter):yfiles.router.EdgeGroupRouterStage; + }; + /** + * This class represents an edge router. + * It combines two strategic steps of edge routing and executes them after each + * other. The first strategy is called path finder strategy and will route the edges, potentially with edge overlaps. + * The second strategy will then split overlapping edge segments inside their channels and distribute them according to + * the specific distribution strategy. + * For path finding strategies you can for example use {@link yfiles.router.ChannelEdgeRouter.OrthogonalShortestPathPathFinder} or + * {@link yfiles.router.OrthogonalPatternEdgeRouter}. By default the latter will be used. + * One possible implementation of an edge distribution strategy is + * {@link yfiles.router.OrthogonalSegmentDistributionStage}, which is also used by default. + * Note: when exchanging only one of the strategies, make sure, that their algorithms will use the same (sub)set + * of graph objects. The strategies bound to this router by default will use key {@link yfiles.router.ChannelEdgeRouter#AFFECTED_EDGES_DP_KEY} to determine + * the affected edges. + */ + export interface ChannelEdgeRouter extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * This method throws an {@link yfiles.system.ArgumentException} if the width/height of the given node object is zero. + * It is called by the {@link yfiles.router.ChannelEdgeRouter#doLayout} method for each node object in the input graph. + * @see {@link yfiles.router.ChannelEdgeRouter#checkGroupNodeSize} + * @param {yfiles.layout.IGraphLayout} layout a graph layout object. + * @param {Object} node the node object to test. + * @throws {yfiles.system.ArgumentException} thrown if the width/height of the node object is zero. + */ + checkNodeSize(layout:yfiles.layout.IGraphLayout,node:Object):void; + /** + * This method throws an {@link yfiles.system.ArgumentException} if the width/height of the given group node object is zero. + * It is called by the {@link yfiles.router.ChannelEdgeRouter#doLayout} method for each group node object in the input graph. + * @see {@link yfiles.router.ChannelEdgeRouter#checkNodeSize} + * @param {yfiles.layout.IGraphLayout} layout a graph layout object. + * @param {Object} node the group node object to test. + * @throws {yfiles.system.ArgumentException} thrown if the width/height of the group node object is zero. + */ + checkGroupNodeSize(layout:yfiles.layout.IGraphLayout,node:Object):void; + /** + * The currently used path finder strategy of this router. + * Path finding means routing the edges in a first approach. + * Note: when exchanging only one of the strategies, make sure, that their algorithms will use the same (sub)set + * of graph objects. The strategies bound to this router by default will us key {@link yfiles.router.ChannelEdgeRouter#AFFECTED_EDGES_DP_KEY} to determine the + * affected edges. + */ + pathFinderStrategy:yfiles.layout.ILayouter; + /** + * The currently used edge distribution strategy of this router. + * Note: when exchanging only one of the strategies, make sure, that their algorithms will use the same (sub)set + * of graph objects. The strategies bound to this router by default will us key {@link yfiles.router.ChannelEdgeRouter#AFFECTED_EDGES_DP_KEY} to determine the + * affected edges. + */ + edgeDistributionStrategy:yfiles.layout.ILayouter; + } + export module ChannelEdgeRouter{ + /** + * This layouter is a s special version of {@link yfiles.router.OrthogonalEdgeRouter} that can be used as a path + * finding strategy in {@link yfiles.router.ChannelEdgeRouter}. + * It takes a bit longer than using the default path finding strategy + * {@link yfiles.router.OrthogonalPatternEdgeRouter} but therefore will create no node crossings. It can be + * configured like OrthogonalEdgeRouter. + */ + export interface OrthogonalShortestPathPathFinder extends yfiles.router.OrthogonalEdgeRouter{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * The key of a DataProvider that defines the edges, that shall be affected. + */ + affectedEdgesDpKey:Object; + } + } + var ChannelEdgeRouter:{ + $class:yfiles.lang.Class; + /** + * This field is used as the key to add a DataProvider to the graph, which specifies the edges, that are affected by + * the edge routing. + */ + AFFECTED_EDGES_DP_KEY:Object; + new ():yfiles.router.ChannelEdgeRouter; + OrthogonalShortestPathPathFinder:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the OrthogonalShortestPathPathFinder class. + */ + new ():yfiles.router.ChannelEdgeRouter; + }; + }; + /** + * Temporarily hides collinear bends on edge paths. + */ + export interface CollinearBendHider extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var CollinearBendHider:{ + $class:yfiles.lang.Class; + /** + * DataProvider key for boolean edge data. + * Only selected edges + * will be considered by this stage. If this key is not bound + * to the graph, then all edges will be considered. + */ + SELECTED_EDGES_DP_KEY:Object; + new (coreLayouter:yfiles.layout.ILayouter):yfiles.router.CollinearBendHider; + }; + /** + * Layout stage for {@link yfiles.router.OrthogonalEdgeRouter} that should be + * applied when routing edges in hierarchically grouped graphs. + * {@link yfiles.router.OrthogonalEdgeRouter} itself is not well suited + * to route edges that connect to grouped nodes, since it considers + * all nodes (also group nodes!) as obstacles that should be avoided + * when determining the route of an edge. + */ + export interface GroupNodeRouterStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine. + * Precondition: + * the coreLayouter must contain an instance of + * {@link yfiles.router.OrthogonalEdgeRouter} in its layout pipeline. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#doLayout} + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var GroupNodeRouterStage:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this class. + */ + new ():yfiles.router.GroupNodeRouterStage; + /** + * Creates a new instance of this class. + * @param {yfiles.layout.ILayouter} coreLayouter + * the core layouter invoked by this stage. + * The coreLayouter must contain an instance of + * {@link yfiles.router.OrthogonalEdgeRouter} in its layout pipeline. + */ + WithCoreLayouter:{ + new (coreLayouter:yfiles.layout.ILayouter):yfiles.router.GroupNodeRouterStage; + }; + }; + export enum MonotonicPathRestriction{ + /** + * Constant that specifies monotonic path restrictions for edges. + * This constant specifies that there are no restrictions. + */ + NONE, + /** + * Constant that specifies monotonic path restrictions for edges. + * This constant specifies restrictions for the vertical direction, i.e., + * each vertical edge segment is directed from the source to the target. + */ + VERTICAL, + /** + * Constant that specifies monotonic path restrictions for edges. + * This constant specifies restrictions for the horizontal direction, i.e., + * each horizontal edge segment is directed from the source to the target. + */ + HORIZONTAL, + /** + * Constant that specifies monotonic path restrictions for edges. This constant specifies restrictions for the + * horizontal and vertical direction, i.e., each horizontal as well as each vertical edge segment is directed from the + * source to the target. + */ + BOTH + } + export enum SphereOfAction{ + /** + * Sphere of action specifier. Route all edges of the input graph. + */ + ROUTE_ALL_EDGES, + /** + * Sphere of action specifier. Route only selected edges of the input graph. + * The selection state of an edge is determined by a boolean value returned + * by the data provider associated with the data provider key. + * @see {@link yfiles.algorithms.Graph#addDataProvider} + */ + ROUTE_SELECTED_EDGES, + /** + * Sphere of action specifier. Route only edges connected to selected nodes. + * The selection state of a node is determined by a boolean value returned + * by the data provider associated with the data provider key. + * @see {@link yfiles.algorithms.Graph#addDataProvider} + */ + ROUTE_EDGES_AT_SELECTED_NODES + } + export enum Scope{ + /** + * Scope constant - used for routing all edges in the graph. + */ + ALL, + /** + * Scope constant - used for routing only a subset of edges. This subset has to be specified by registering an + * appropriate {@link yfiles.algorithms.IDataProvider}. + */ + SUBSET + } + export enum RoutingStyle{ + /** + * Routing style specifier. Edge segments are drawn ad hoc, i.e., rather crude. + */ + ADHOC, + /** + * Routing style specifier. Edge segments are drawn the short way, i.e., with the global way of the edge in mind. + */ + SHORTPATH, + /** + * Routing style specifier. Edge segments are drawn with the most distance to already known obstacles such as nodes or + * other edge segments. + */ + PREFERMIDDLE, + /** + * Routing style specifier. Similar to {@link yfiles.router.RoutingStyle#PREFERMIDDLE} for the two end segments and segments between bends + * of different directions. Segments between bends of the same direction (u-shaped turns) are drawn the short way. + * This style achieves a well-balanced routing and is used by default. + */ + BALANCED + } + export enum ChannelOrientation{ + /** + * Channel orientation specifier. Used to route edges in a vertical channel. + */ + VERTICAL, + /** + * Channel orientation specifier. Used to route edges in a horizontal channel. + */ + HORIZONTAL + } + /** + * Class that routes edges within a vertical or horizontal channel + * All edges will then be routed in an orthogonal fashion. + * This class basically assigns subchannels to each each key (normally edges) + * so that the + * overall number of subchannels is small. + */ + export interface ChannelRouter extends Object{ + /** + * Sets the channel bounds and direction. + * A call to this method + * implies that all previously added segments will be removed. + * @param {number} min the smallest assignable coordinate within the channel + * @param {number} max the largest assignable coordinate within the channel + * @param {yfiles.router.ChannelOrientation} orientation + * the orientation of the channel. One of + * {@link yfiles.router.ChannelOrientation#VERTICAL} and {@link yfiles.router.ChannelOrientation#HORIZONTAL} + */ + setChannel(min:number,max:number,orientation:yfiles.router.ChannelOrientation):void; + /** + * Adds an edge object with source and target coordinates + * to the set of edges that have to be routed within the channel. + */ + addSegment(key:Object,p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):void; + /** + * Adds an edge object that belongs to a group of edges + * with source and target coordinates + * to the set of edges that have to be routed within the channel + * Edges sharing the same groupId will be placed on the same channel. + */ + addGroupSegment(key:Object,groupId:Object,p1:yfiles.algorithms.YPoint,p2:yfiles.algorithms.YPoint):void; + /** + * Returns an iterator over all added segment keys. + * For grouped edges, a {@link yfiles.algorithms.YList} instance will be returned. + */ + segmentKeys():yfiles.algorithms.IIterator; + /** + * Determines if the given key has been registered already with this instance. + * @param {Object} key + * the key which is used in {@link yfiles.router.ChannelRouter#addSegment} + */ + containsKey(key:Object):boolean; + /** + * Determines if the given key has been registered as a grouping key with this instance. + * @param {Object} groupKey + * the key which is used in {@link yfiles.router.ChannelRouter#addGroupSegment} + */ + containsGroupKey(groupKey:Object):boolean; + /** + * Routes all added edges within the specified channel. + * The resulting subchannels can then be queried using the {@link yfiles.router.ChannelRouter#getSubChannelRank} + * method. + */ + route():void; + /** + * Returns the calculated channel coordinate for an added edge object. + * If for example the router was instantiated with the arguments + * ChannelRouter(100,200,ChannelRouter.ROUTE_HORIZONTAL) + * then the returned coordinate is an x-coordinate between 100 and + * 200. This coordinate represents the x-coordinate of two additional + * bends that are needed to route the edge orthogonally from + * p1 to p2 (as specified in addSegment). + * @param {Object} key + * an edge object added with {@link yfiles.router.ChannelRouter#addSegment} + */ + getCoord(key:Object):number; + /** + * The number of subchannels within this channel. + * The return value 0 indicates that there are no subchannels + * present. + */ + subChannelCount:number; + /** + * Returns the subchannel rank of this segment within the channel. + * @param {Object} key + * an edge object added with {@link yfiles.router.ChannelRouter#addSegment} + */ + getSubChannelRank(key:Object):number; + /** + * Returns the subchannel rank for the group indicated by the groupKey. + * @see {@link yfiles.router.ChannelRouter#addGroupSegment} + */ + getGroupSubChannelRank(groupKey:Object):number; + /** + * Specifies whether subchannels shorter than epsilon are ignored + * by this instance. + * Default is true with an epsilon value of 0.5d. + * @see {@link yfiles.router.ChannelRouter#epsilon} + */ + epsilonChannelIgnored:boolean; + /** + * The current epsilon value. + * Subchannel lengths smaller than this + * value will be ignored by this instance if the the epsilonChannelIgnored + * property is set to true + * @see {@link yfiles.router.ChannelRouter#epsilonChannelIgnored} + */ + epsilon:number; + } + var ChannelRouter:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of ChannelRouter. + * @param {number} min the smallest assignable coordinate within the channel + * @param {number} max the largest assignable coordinate within the channel + * @param {yfiles.router.ChannelOrientation} orientation + * the direction of the channel. One of + * {@link yfiles.router.ChannelOrientation#VERTICAL} and {@link yfiles.router.ChannelOrientation#HORIZONTAL} + */ + WithOrientation:{ + new (min:number,max:number,orientation:yfiles.router.ChannelOrientation):yfiles.router.ChannelRouter; + }; + /** + * Creates a new instance of ChannelRouter for a horizontal channel. + * @param {number} min the smallest assignable coordinate within the channel + * @param {number} max the largest assignable coordinate within the channel + */ + new (min:number,max:number):yfiles.router.ChannelRouter; + }; + export module polyline{ + /** + * Partitions the bounding box of a graph in rectangles using graph elements as obstacles. + *

+ * All {@link yfiles.router.polyline.Obstacle}s used during the partitioning are {@link yfiles.router.polyline.GraphPartition#createObstacle created} + * by {@link yfiles.router.polyline.IGraphPartitionExtension}s, that have been + * {@link yfiles.router.polyline.GraphPartition#addDynamicDecompositionListener registered} before, + * in their {@link yfiles.router.polyline.IGraphPartitionExtension#preparePartition prepare} method + * which is called during the GraphPartitions {@link yfiles.router.polyline.GraphPartition#init initialization}. + *

+ *

+ * The core partitioning is delegated to an {@link yfiles.router.polyline.IObstaclePartition} that is + * {@link yfiles.router.polyline.IObstaclePartition#init initialized} with these Obstacles. + *

+ *

+ * If the {@link yfiles.router.polyline.IObstaclePartition} implements {@link yfiles.router.polyline.IDynamicDecomposition}, GraphPartition redispatches + * the decomposition notifications to its extensions. + *

+ * @see {@link yfiles.router.polyline.IGraphPartitionExtension} + */ + export interface GraphPartition extends Object,yfiles.router.polyline.IPartition,yfiles.router.polyline.IDynamicDecomposition,yfiles.router.polyline.DynamicDecompositionCompanion.IListener{ + /** + * The inner obstacle partition. + */ + partition:yfiles.router.polyline.IObstaclePartition; + /** + * Adds the given listener to the {@link yfiles.router.polyline.IPartition}. + * @param {yfiles.router.polyline.DynamicDecompositionCompanion.IListener} listener + * The listener that shall be notified upon dynamic decomposition events. If it is a + * {@link yfiles.router.polyline.IGraphPartitionExtension}, its + * {@link yfiles.router.polyline.IGraphPartitionExtension#preparePartition preparePartition} + * method is called during {@link yfiles.router.polyline.GraphPartition#init initialization}. + * @see Specified by {@link yfiles.router.polyline.IDynamicDecomposition#addDynamicDecompositionListener}. + */ + addDynamicDecompositionListener(listener:yfiles.router.polyline.DynamicDecompositionCompanion.IListener):void; + /** + * Removes the given listener from the {@link yfiles.router.polyline.IPartition}. + * @param {yfiles.router.polyline.DynamicDecompositionCompanion.IListener} listener The listener that shall not be notified anymore upon dynamic decomposition events. + * @see Specified by {@link yfiles.router.polyline.IDynamicDecomposition#removeDynamicDecompositionListener}. + */ + removeDynamicDecompositionListener(listener:yfiles.router.polyline.DynamicDecompositionCompanion.IListener):void; + /** + * Initializes the partition with the given graph instance. + *

+ * After {@link yfiles.router.polyline.GraphPartition#clear clearing} any old partitioning information, the {@link yfiles.router.polyline.IGraphPartitionExtension#preparePartition} + * method of all registered extensions is called. Finally the inner {@link yfiles.router.polyline.IObstaclePartition} is initialized passing + * all {@link yfiles.router.polyline.GraphPartition#createObstacle added} obstacles as well as the given graph's bounds + * extended by a small padding. + *

+ * @param {yfiles.router.polyline.PathSearchConfiguration} configuration + */ + init(configuration:yfiles.router.polyline.PathSearchConfiguration):void; + /** + * Returns a list of all {@link yfiles.router.polyline.PartitionCell}s that are neighbors of the given cell, this means those cells have a + * common border segment with the given cell. + * @param {yfiles.router.polyline.PartitionCell} cell The cell to get the neighbors for. + * @return {yfiles.algorithms.IList} + * A list of {@link yfiles.router.polyline.PartitionCell}s that are neighbors of the given cell. + * @see Specified by {@link yfiles.router.polyline.IPartition#getNeighbors}. + */ + getNeighbors(cell:yfiles.router.polyline.PartitionCell):yfiles.algorithms.IList; + /** + * Returns a list of all {@link yfiles.algorithms.Node}s whose bounds intersect or cover the bounds of the given cell. + * @param {yfiles.router.polyline.PartitionCell} cell The cell to get the nodes for. + * @return {yfiles.algorithms.IList} + * A list of {@link yfiles.algorithms.Node}s that are intersected by the given cell. + */ + getNodes(cell:yfiles.router.polyline.PartitionCell):yfiles.algorithms.IList; + /** + * Returns all obstacles covering the given {@link yfiles.router.polyline.PartitionCell} by delegating to the inner partition's + * {@link yfiles.router.polyline.IObstaclePartition#getObstacles} method. + * @param {yfiles.router.polyline.PartitionCell} cell The cell to get the obstacles for. + * @return {yfiles.algorithms.IList} + * A list of {@link yfiles.router.polyline.Obstacle}s that cover the given cell. + */ + getObstacles(cell:yfiles.router.polyline.PartitionCell):yfiles.algorithms.IList; + /** + * Returns all cells that are completely covered by the bounds of the given + * node. + * @param {yfiles.algorithms.Node} node The node to get the covered cells for. + * @return {yfiles.algorithms.IList} + * An unmodifiable list of {@link yfiles.router.polyline.PartitionCell} instances that are + * completely covered by the bounds of the given node. + */ + getCellsWithNode(node:yfiles.algorithms.Node):yfiles.algorithms.IList; + /** + * + * Note: this call is delegated to {@link yfiles.router.polyline.IPartition#getCells}. + * @see Specified by {@link yfiles.router.polyline.IPartition#getCells}. + */ + getCells(rect:yfiles.algorithms.YRectangle):yfiles.algorithms.IList; + /** + * The rectangular area that is partitioned. + * @see Specified by {@link yfiles.router.polyline.IPartition#bounds}. + */ + bounds:yfiles.algorithms.YRectangle; + /** + * Clears the partition data so the GraphPartition can be reused and + * {@link yfiles.router.polyline.GraphPartition#init initialized} with a new configuration. + */ + clear():void; + /** + * Callback after a {@link yfiles.router.polyline.PartitionCell} has been subdivided into several sub cells. + *

+ * This class redispatches this event to all registered + * {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener}s. + *

+ * @param {yfiles.router.polyline.PartitionCell} cell The cell that has been subdivided. + * @param {yfiles.algorithms.IList} subCells The new sub cells of the divided cell. + * @see Specified by {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener#onCellSubdivided}. + */ + onCellSubdivided(cell:yfiles.router.polyline.PartitionCell,subCells:yfiles.algorithms.IList):void; + /** + * Callback after a {@link yfiles.router.polyline.PartitionCell} has been decided to be final and won't be subdivided further. + *

+ * This class redispatches this event to all registered + * {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener}s. + *

+ * @param {yfiles.router.polyline.PartitionCell} finalizedCell The cell that has been finalized. + * @see Specified by {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener#onCellFinalized}. + */ + onCellFinalized(finalizedCell:yfiles.router.polyline.PartitionCell):void; + /** + * Callback after a new {@link yfiles.router.polyline.PartitionCell} has been created. + *

+ * This class redispatches this event to all registered + * {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener}s. + *

+ * @param {yfiles.router.polyline.PartitionCell} createdCell The newly created cell. + * @see Specified by {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener#onCellCreated}. + */ + onCellCreated(createdCell:yfiles.router.polyline.PartitionCell):void; + /** + * Creates and returns a new {@link yfiles.router.polyline.Obstacle} using the given bounds and data. + * All obstacles created via this + * method are given to the inner {@link yfiles.router.polyline.IObstaclePartition} upon initialization. + * @param {yfiles.algorithms.YRectangle} bounds The bounds of the obstacle. + * @param {Object} data The additional data that shall be associated with the obstacle. + * @return {yfiles.router.polyline.Obstacle} + * A new {@link yfiles.router.polyline.Obstacle} using the given bounds and data. + */ + createObstacle(bounds:yfiles.algorithms.YRectangle,data:Object):yfiles.router.polyline.Obstacle; + /** + * Returns the obstacle that has earlier been created for the given data object. + * @param {Object} data The data to get the obstacle for. + * @return {yfiles.router.polyline.Obstacle} The obstacle that has been created for the given data object. + */ + getObstacle(data:Object):yfiles.router.polyline.Obstacle; + } + var GraphPartition:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + * @param {yfiles.router.polyline.IObstaclePartition} partition The inner obstacle partition used by this graph partition to delegate the partitioning to. + */ + new (partition:yfiles.router.polyline.IObstaclePartition):yfiles.router.polyline.GraphPartition; + }; + export enum RoutingType{ + /** + * Routing type information representing a straight crossing of the cell, i.e. a single orthogonal segment of + * edge enters and exits the cell. + * @see {@link yfiles.router.polyline.EdgeCellInfo#type} + */ + STRAIGHT, + /** + * Routing type information representing a crossing of the cell with three segments, i.e. the edge enters and exits + * the cell using the same direction but has an orthogonal middle segment between the entering and exiting segment. + * @see {@link yfiles.router.polyline.EdgeCellInfo#type} + */ + STRAIGHT_BENDING, + /** + * Routing type information representing a crossing of the cell with a single bend, i.e. the edge enters the cell + * in one direction, makes a bend and exits the cell in an orthogonal direction. + * @see {@link yfiles.router.polyline.EdgeCellInfo#type} + */ + BENDING, + /** + * Routing type information representing a crossing of the cell by making a u-turn, i.e. the edge enters and exits + * the cell on the same side using two turns and an orthogonal middle segment. + * @see {@link yfiles.router.polyline.EdgeCellInfo#type} + */ + U_TURN, + /** + * Routing type information representing the source or target end of an edge being in the cell, i.e. the enter and/or + * exit interval is null. + * @see {@link yfiles.router.polyline.EdgeCellInfo#type} + */ + END + } + export enum Alignment{ + /** + * Specifies that the segment prefers to be placed close to the lower bound of its location range. + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#preferredAlignment} + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#preferredAlignment} + */ + MIN, + /** + * Specifies that the segment prefers to be placed close to the upper bound of its location range. + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#preferredAlignment} + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#preferredAlignment} + */ + MAX, + /** + * Specifies that the segment can be placed somewhere in its location range. + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#preferredAlignment} + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#preferredAlignment} + */ + ANY + } + /** + * This class represents a polyline edge router which calculates an edge layout containing only straight segments. + * The router does not change the location or the size of the nodes in a diagram in any way. + *

+ *

Features

+ * Edges can be routed orthogonally, i.e. only horizontal and vertical segments, or with additional segments with + * other slopes. + *
+ * + *
+ * Fig. 1: The same graph with orthogonal (left) and polylinear (right) edge routing. + *
+ * Polyline routing can be activated using {@link yfiles.router.polyline.EdgeRouter#polylineRouting}. + *

+ *

+ * In both routing styles, edges can be grouped so they share common segments in the beginning or end of their routes. + *

+ *
+ * Fig. 2: Same graph as in Fig. 1 with grouped edges. + *
+ * Edges are marked as grouped by using the data provider keys + * {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} (for source grouped edges) or {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} (for target grouped edges). + *

+ *

+ * Many settings of the edge layout can be controlled individually for every edge using {@link yfiles.router.polyline.EdgeLayoutDescriptor} + * instances. So, if at the time of the invocation a {@link yfiles.algorithms.IDataProvider} instance is bound to the graph using the + * {@link yfiles.router.polyline.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} key, the EdgeLayoutDescriptors provided for the individual edges + * are used. Whenever no descriptor is provided for an edge, a default edge layout descriptor is used as fall-back + * value. This edge layout descriptor can be obtained with {@link yfiles.router.polyline.EdgeRouter#defaultEdgeLayoutDescriptor}. + *

+ *

+ * EdgeRouter supports two approaches to connect edges on a specific side or even an exact location to a node. + * {@link yfiles.layout.PortConstraint}s define a single constraint for the ports of an edge. To realize more complex port + * restrictions, several {@link yfiles.layout.PortCandidate}s or {@link yfiles.layout.PortCandidateSet}s can be assigned to edges + * or nodes. + * If an edge with registered PortCandidates connects to nodes with PortCandidateSets, + * the layouter + * will try to match both collections to find an appropriate port. In case there is no matching port candidate, a + * PortCandidate specified for the edge is preferred. + * Since their simultaneous existence at the same node may be ambiguous, it is not recommended to use a combination of + * PortConstraints and PortCandidates in the same layout. + *

+ *

+ *

Concept

+ * {@link yfiles.router.polyline.EdgeRouter} coordinates all settings and steps that are needed to achieve a + * polylinear or orthogonal edge routing. + * There are three steps that are executed in the following order: + *
    + *
  • Dividing the graph's area into several rectangular cells (see: {@link yfiles.router.polyline.IPartition}, + * {@link yfiles.router.polyline.GraphPartition}, {@link yfiles.router.polyline.PartitionCell}). + *
  • + *
  • Finding the shortest/cheapest paths for all edges through the Partition (see: {@link yfiles.router.polyline.PathSearch}, {@link yfiles.router.polyline.Path}). + *
  • + *
  • Assigning coordinates to the edges' segments based on the paths that were calculated before (see: {@link yfiles.router.polyline.ChannelBasedPathRouting}). + *
  • + *
+ * It is possible to customize the first two steps by adding extensions {@link yfiles.router.polyline.EdgeRouter#registeredPartitionExtensions + * for + * Partition + * } or {@link yfiles.router.polyline.EdgeRouter#registeredPathSearchExtensions for PathSearch}, respectively. + * {@link yfiles.router.polyline.IGraphPartitionExtension}s add obstacles which the PathSearch will + * consider. They also can add some information to PartitionCells that, for example, specifies whether or + * not the PartitionCell belongs to a node. + * {@link yfiles.router.polyline.PathSearchExtension PathSearchExtension}s influence the + * PathSearch by adding costs for traversing specified PartitionCells or narrowing their + * intervals to allow a less expensive traversal of a PartitionCell. For example, the + * PathSearch adds costs to a PartitionCell that was marked as an obstacle that belongs to a + * node, so the edge will avoid the node. + *

+ */ + export interface EdgeRouter extends yfiles.layout.AbstractLayoutStage{ + /** + * The time limit (in milliseconds) set for the layout algorithm. + *

+ * Note that restricting the maximum duration + * may result in a worse layout quality. Furthermore, the actual runtime may exceed the maximum duration since the + * layout algorithm still has to find a valid solution. + *

+ *

+ * By default no time limit is set. + *

+ */ + maximumDuration:number; + /** + * The{@link yfiles.router.polyline.EdgeLayoutDescriptor} instance used for all those edges, that do not have a specific + * layout descriptor assigned. + * @see {@link yfiles.router.polyline.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + */ + defaultEdgeLayoutDescriptor:yfiles.router.polyline.EdgeLayoutDescriptor; + /** + * Returns the {@link yfiles.router.polyline.EdgeLayoutDescriptor} provided by the {@link yfiles.algorithms.IDataProvider} with the key + * {@link yfiles.router.polyline.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} for the given edge. + *

+ * For all those edges, that do not have a specific layout descriptor assigned, the default descriptor is returned. + *

+ * @param {yfiles.algorithms.Edge} edge The edge to return the layout descriptor for. + * @return {yfiles.router.polyline.EdgeLayoutDescriptor} The layout descriptor used for the given edge. + * @see {@link yfiles.router.polyline.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + * @see {@link yfiles.router.polyline.EdgeRouter#defaultEdgeLayoutDescriptor} + */ + getEdgeLayoutDescriptor(edge:yfiles.algorithms.Edge):yfiles.router.polyline.EdgeLayoutDescriptor; + /** + * Determines whether or not this edge router creates (non-orthogonal) polyline segments. + *

+ * By default polyline edge routing is disabled. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#preferredPolylineSegmentLength} + * @see {@link yfiles.router.polyline.EdgeRouter#maximumPolylineSegmentRatio} + * @see {@link yfiles.router.polyline.EdgeRouter#preferredPolylineSegmentLength} + * @see {@link yfiles.router.polyline.EdgeRouter#maximumPolylineSegmentRatio} + */ + polylineRouting:boolean; + /** + * The preferred length of (non-orthogonal) polyline segments. + *

+ * Note that this restriction isn't used for orthogonal segments. + *

+ *

+ * By default the preferred polyline segment length is 30. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#polylineRouting} + * @see {@link yfiles.router.polyline.EdgeRouter#maximumPolylineSegmentRatio} + * @see {@link yfiles.router.polyline.EdgeRouter#polylineRouting} + * @see {@link yfiles.router.polyline.EdgeRouter#maximumPolylineSegmentRatio} + */ + preferredPolylineSegmentLength:number; + /** + * The maximum segment length ratio at each end of an orthogonal segment that may get converted into a + * (non-orthogonal) polyline segment. + *

+ * By default the maximum ratio for polyline segments is 0.3. + *

+ */ + maximumPolylineSegmentRatio:number; + /** + * Determines whether or not the edge router uses an additional step to reroute those edges that are considered to + * have the worst paths. + *

+ * Rerouting is only used, if the {@link yfiles.router.polyline.EdgeRouter#maximumDuration} isn't exceeded, yet. + *

+ *

+ * By default rerouting is disabled. + *

+ */ + rerouting:boolean; + /** + * The currently set sphere of action specifier. + * Default setting is {@link yfiles.router.SphereOfAction#ROUTE_ALL_EDGES}. + * @see {@link yfiles.router.polyline.EdgeRouter#selectedEdgesDpKey} + * @throws {yfiles.system.ArgumentException} if the given argument is not one of the above constants. + * @see {@link yfiles.router.SphereOfAction#ROUTE_ALL_EDGES} + * @see {@link yfiles.router.SphereOfAction#ROUTE_SELECTED_EDGES} + * @see {@link yfiles.router.SphereOfAction#ROUTE_EDGES_AT_SELECTED_NODES} + */ + sphereOfAction:yfiles.router.SphereOfAction; + /** + * The data provider key used to look up the selected state of the nodes of the graph to be laid out. + * By default, {@link yfiles.layout.LayouterKeys#SELECTED_NODES_DP_KEY} is used. + *

+ * If the sphere of action is set to {@link yfiles.router.SphereOfAction#ROUTE_EDGES_AT_SELECTED_NODES}, only edges of selected nodes are routed while all + * other edges are considered to have fixed routes. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#sphereOfAction} + * @throws {yfiles.system.ArgumentException} if the specified key is null. + * @see {@link yfiles.router.polyline.EdgeRouter#sphereOfAction} + */ + selectedNodesDpKey:Object; + /** + * The data provider key used to look up the selected state of the edges of the graph to be laid out. + * By default, {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY} is used. + *

+ * If the sphere of action is set to {@link yfiles.router.SphereOfAction#ROUTE_SELECTED_EDGES}, only the selected keys are routed while all + * other edges are considered to have fixed routes. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#sphereOfAction} + * @throws {yfiles.system.ArgumentException} if the specified key is null. + * @see {@link yfiles.router.polyline.EdgeRouter#sphereOfAction} + */ + selectedEdgesDpKey:Object; + /** + * A custom{@link yfiles.objectcollections.IComparer} used to sort the edges of the graph to determine the processing order + * of the edges. + *

+ * The processing order may influence the quality of the individual edge paths. When routing an edge, only the paths + * of already routed edges and fixed edges (that are not routed at all) can be considered. Therefore earlier edges + * have to consider less other edge paths then later edges which might have to use less optimal alternative paths. + *

+ *

+ * The default is null and the comparator returned by {@link yfiles.router.polyline.EdgeRouter#createDefaultEdgeOrderComparator} + * is used. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#createDefaultEdgeOrderComparator} + * @see {@link yfiles.router.polyline.EdgeRouter#createDefaultEdgeOrderComparator} + */ + edgeOrderComparator:yfiles.objectcollections.IComparer; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Utility method that returns the selection state of the given edge. + *

+ * If the sphere of action is {@link yfiles.router.SphereOfAction#ROUTE_ALL_EDGES}, true is returned for all edges. + *

+ */ + isSelected(e:yfiles.algorithms.Edge,graph:yfiles.algorithms.Graph):boolean; + /** + * Determines whether or not this edge router considers node labels as obstacles for edge routes. + *

+ * By default node labels are not considered. + *

+ * @see {@link yfiles.router.polyline.PenaltySettings#nodeLabelCrossingPenalty} + * @see {@link yfiles.router.polyline.PenaltySettings#nodeLabelCrossingPenalty} + */ + considerNodeLabels:boolean; + /** + * Determines whether or not this edge router ignores node labels that are inside the bounds of their owner + * as obstacles for edge routes. + *

+ * This setting has only an effect if node labels shall be {@link yfiles.router.polyline.EdgeRouter#considerNodeLabels considered} at all + * and is especially useful to ignore inner node labels of group nodes. + *

+ *

+ * Per default, this option is disabled. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#considerNodeLabels} + * @see {@link yfiles.router.polyline.PenaltySettings#nodeLabelCrossingPenalty} + * @see {@link yfiles.router.polyline.EdgeRouter#LABEL_CROSSING_COST_FACTOR_DP_KEY} + * @see {@link yfiles.router.polyline.EdgeRouter#considerNodeLabels} + * @see {@link yfiles.router.polyline.PenaltySettings#nodeLabelCrossingPenalty} + * @see {@link yfiles.router.polyline.EdgeRouter#LABEL_CROSSING_COST_FACTOR_DP_KEY} + */ + ignoreInnerNodeLabels:boolean; + /** + * Determines whether or not this edge router considers labels of edges that are not in the edge (sub-)set to + * be routed (see {@link yfiles.router.polyline.EdgeRouter#sphereOfAction}. + *

+ * By default edge labels are not considered. + *

+ * @see {@link yfiles.router.polyline.PenaltySettings#nodeLabelCrossingPenalty} + * @see {@link yfiles.router.polyline.EdgeRouter#sphereOfAction} + * @see {@link yfiles.router.polyline.EdgeRouter#selectedEdgesDpKey} + * @see {@link yfiles.router.polyline.PenaltySettings#nodeLabelCrossingPenalty} + * @see {@link yfiles.router.polyline.EdgeRouter#sphereOfAction} + * @see {@link yfiles.router.polyline.EdgeRouter#selectedEdgesDpKey} + */ + considerEdgeLabels:boolean; + /** + * The{@link yfiles.router.polyline.Grid} the edge router tries to place the orthogonal segments on. + *

+ * By default no grid is specified, so null will be returned. + *

+ */ + grid:yfiles.router.polyline.Grid; + /** + * Determines the minimal distance between edges and node bounds. + *

+ * By default the minimal node to edge distance is 10. + *

+ * @see {@link yfiles.router.polyline.PenaltySettings#minimalNodeToEdgeDistancePenalty} + * @see {@link yfiles.router.polyline.PenaltySettings#minimalNodeToEdgeDistancePenalty} + */ + minimalNodeToEdgeDistance:number; + /** + * Creates a {@link yfiles.router.polyline.GraphPartition} that divides the area of the graph into several rectangles. + *

+ * This implementation creates a GraphPartition using the current {@link yfiles.router.polyline.IObstaclePartition}. It may be + * overridden to customize the partition used in EdgeRouter. + *

+ * @return {yfiles.router.polyline.GraphPartition} a new GraphPartition + * @see {@link yfiles.router.polyline.EdgeRouter#configureGraphPartition} + * @see {@link yfiles.router.polyline.EdgeRouter#registeredPartitionExtensions} + */ + createGraphPartition(decomposition:yfiles.router.polyline.IObstaclePartition):yfiles.router.polyline.GraphPartition; + /** + * Configures the given {@link yfiles.router.polyline.GraphPartition}. + *

+ * This implementation gets all registered {@link yfiles.router.polyline.IGraphPartitionExtension}s and adds them to the given + * GraphPartition. It may be overridden to adjust the configuration of the GraphPartition. + *

+ * @param {yfiles.router.polyline.GraphPartition} partition the partition that shall be configured + * @see {@link yfiles.router.polyline.EdgeRouter#configureGraphPartition} + * @see {@link yfiles.router.polyline.EdgeRouter#registeredPartitionExtensions} + */ + configureGraphPartition(partition:yfiles.router.polyline.GraphPartition):void; + /** + * Cleans up the given {@link yfiles.router.polyline.GraphPartition}. + *

+ * This implementation gets all registered {@link yfiles.router.polyline.IGraphPartitionExtension}s and removes them from the given + * GraphPartition. It may be overridden to adjust the configuration of the GraphPartition. + *

+ * @param {yfiles.router.polyline.GraphPartition} partition the partition that shall be configured + * @see {@link yfiles.router.polyline.EdgeRouter#configureGraphPartition} + * @see {@link yfiles.router.polyline.EdgeRouter#registeredPartitionExtensions} + */ + cleanupGraphPartition(partition:yfiles.router.polyline.GraphPartition):void; + /** + * A list containing all registered{@link yfiles.router.polyline.IGraphPartitionExtension}s. + *

+ * GraphPartitionExtensions can be added and removed to change the composition of extensions used by the + * {@link yfiles.router.polyline.GraphPartition}. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#createGraphPartition} + * @see {@link yfiles.router.polyline.EdgeRouter#configureGraphPartition} + */ + registeredPartitionExtensions:yfiles.algorithms.IList; + /** + * Creates a {@link yfiles.router.polyline.PathSearch} that finds the edges' paths through the {@link yfiles.router.polyline.GraphPartition}. + *

+ * This implementation creates a new PathSearch. May be overridden to customize the path + * search. + *

+ * @return {yfiles.router.polyline.PathSearch} a new PathSearch + * @see {@link yfiles.router.polyline.EdgeRouter#configurePathSearch} + * @see {@link yfiles.router.polyline.EdgeRouter#registeredPathSearchExtensions} + */ + createPathSearch():yfiles.router.polyline.PathSearch; + /** + * Configures the given {@link yfiles.router.polyline.PathSearch}. + *

+ * This implementation gets all registered {@link yfiles.router.polyline.PathSearchExtension}s and adds them to + * the given PathSearch. It may be overridden to adjust the configuration of the + * PathSearch. + *

+ * @param {yfiles.router.polyline.PathSearch} pathSearch the path search that shall be configured + * @see {@link yfiles.router.polyline.EdgeRouter#createPathSearch} + * @see {@link yfiles.router.polyline.EdgeRouter#registeredPathSearchExtensions} + */ + configurePathSearch(pathSearch:yfiles.router.polyline.PathSearch):void; + /** + * A list containing all registered{@link yfiles.router.polyline.PathSearchExtension}s. + *

+ * {@link yfiles.router.polyline.PathSearchExtension} can be added and removed to change the composition of extensions used by the + * {@link yfiles.router.polyline.PathSearch}. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#createPathSearch} + * @see {@link yfiles.router.polyline.EdgeRouter#configurePathSearch} + */ + registeredPathSearchExtensions:yfiles.algorithms.IList; + /** + * Creates a {@link yfiles.router.polyline.ChannelBasedPathRouting} that routes the edges using pre-calculated {@link yfiles.router.polyline.Path} objects. + *

+ * This implementation creates a new ChannelBasedPathRouting. May be overridden to customize + * the path routing. + *

+ * @return {yfiles.router.polyline.ChannelBasedPathRouting} A new ChannelBasedPathRouting + */ + createPathRouting():yfiles.router.polyline.ChannelBasedPathRouting; + /** + * Creates a {@link yfiles.router.polyline.DynamicObstacleDecomposition} that is used by the {@link yfiles.router.polyline.GraphPartition} to divide the graph + * area in rectangles. + *

+ * This implementation creates a new DynamicObstacleDecomposition. May be overridden to + * customize the area decomposition. + *

+ * @return {yfiles.router.polyline.DynamicObstacleDecomposition} A new DynamicObstacleDecomposition + * @see {@link yfiles.router.polyline.EdgeRouter#createGraphPartition} + */ + createObstacleDecomposition():yfiles.router.polyline.DynamicObstacleDecomposition; + /** + * Creates a {@link yfiles.router.polyline.PathSearchContext} that provides context information for the path search algorithm. + *

+ * This implementation creates a new PathSearchContext. May be overridden to customize the context + * information providing. + *

+ * @param {yfiles.router.polyline.PathSearch} pathSearch The path search that uses the context to be created. + * @param {yfiles.router.polyline.PathSearchConfiguration} configuration The configuration used for the path search. + * @return {yfiles.router.polyline.PathSearchContext} A new PathSearchContext + */ + createPathSearchContext(pathSearch:yfiles.router.polyline.PathSearch,configuration:yfiles.router.polyline.PathSearchConfiguration):yfiles.router.polyline.PathSearchContext; + /** + * Creates the {@link yfiles.router.polyline.PathSearchConfiguration} that is used during the path search. + *

+ * This implementation creates a new PathSearchConfiguration. May be overridden to use + * a subclassed configuration. + *

+ * @return {yfiles.router.polyline.PathSearchConfiguration} A new PathSearchConfiguration. + */ + createConfiguration(graph:yfiles.layout.LayoutGraph,grouping:yfiles.layout.GraphGrouping):yfiles.router.polyline.PathSearchConfiguration; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Creates and returns the default {@link yfiles.objectcollections.IComparer} used to determine the order the edges of the graph + * are laid out with. + * @param {yfiles.layout.LayoutGraph} graph The graph that contains the edges to compare. + * @param {yfiles.router.polyline.PathSearchConfiguration} configuration The configuration to use for the following path searches. + * @return {yfiles.objectcollections.IComparer} A comparator ordering edges to determine the order the edges of the graph are laid out with. + */ + createDefaultEdgeOrderComparator(graph:yfiles.layout.LayoutGraph,configuration:yfiles.router.polyline.PathSearchConfiguration):yfiles.objectcollections.IComparer; + /** + * This method throws an {@link yfiles.system.ArgumentException} if the width/height of the given node object is zero. + * It is called by the {@link yfiles.router.polyline.EdgeRouter#doLayout} method for each node object in the input graph. + * @see {@link yfiles.router.polyline.EdgeRouter#checkGroupNodeSize} + * @param {yfiles.layout.IGraphLayout} layout a graph layout object. + * @param {Object} node the node object to test. + * @throws {yfiles.system.ArgumentException} thrown if the width/height of the node object is zero. + */ + checkNodeSize(layout:yfiles.layout.IGraphLayout,node:Object):void; + /** + * This method throws an {@link yfiles.system.ArgumentException} if the width/height of the given group node object is zero. + * It is called by the {@link yfiles.router.polyline.EdgeRouter#doLayout} method for each group node object in the input graph. + * @see {@link yfiles.router.polyline.EdgeRouter#checkNodeSize} + * @param {yfiles.layout.IGraphLayout} layout a graph layout object. + * @param {Object} node the group node object to test. + * @throws {yfiles.system.ArgumentException} thrown if the width/height of the group node object is zero. + */ + checkGroupNodeSize(layout:yfiles.layout.IGraphLayout,node:Object):void; + /** + * The{@link yfiles.router.polyline.GraphPartition} used during the layout. + */ + partition:yfiles.router.polyline.GraphPartition; + } + var EdgeRouter:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key used to store the {@link yfiles.router.polyline.EdgeLayoutDescriptor} for each edge. + * If there is no descriptor mapped for an edge, the default descriptor is used. + * @see {@link yfiles.router.polyline.EdgeRouter#defaultEdgeLayoutDescriptor} + */ + EDGE_LAYOUT_DESCRIPTOR_DP_KEY:string; + /** + * {@link yfiles.algorithms.IDataProvider} key used to store a cost factor for each label. + *

+ * This factor is multiplied with the basic penalty for an edge crossing a + * {@link yfiles.router.polyline.PenaltySettings#nodeLabelCrossingPenalty node label} or + * {@link yfiles.router.polyline.PenaltySettings#edgeLabelCrossingPenalty edge label} to determine the + * final costs to cross this label. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#defaultEdgeLayoutDescriptor} + * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#penaltySettings} + */ + LABEL_CROSSING_COST_FACTOR_DP_KEY:string; + /** + * Creates a new EdgeRouter instance with the given core Layouter. + */ + WithCoreLayouter:{ + new (core:yfiles.layout.ILayouter):yfiles.router.polyline.EdgeRouter; + }; + /** + * Creates a new EdgeRouter instance. + */ + new ():yfiles.router.polyline.EdgeRouter; + }; + /** + * This class is used by {@link yfiles.router.polyline.EdgeRouter} to determine the routing details of the graph's edges. + * @see {@link yfiles.router.polyline.EdgeRouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + */ + export interface EdgeLayoutDescriptor extends Object{ + /** + * The minimal length of the first segment (at the source). + * Setter:By default this value is set to 5.0. The + * value must be >= 0, otherwise the default value will be assigned. + *

+ * Note: the resulting segment length also depends on the given {@link yfiles.router.polyline.Grid#spacing + * grid + * spacing + * }, i.e., segment length >= (int) Math.ceil(length / grid spacing). + *

+ *

+ * Note: the first segment length starts, if present, at the halo of the source. + *

+ * Getter:Default is 5.0. + *

+ * Note: the first segment length starts, if present, at the halo of the source. + *

+ * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalLastSegmentLength} + * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalLastSegmentLength} + */ + minimalFirstSegmentLength:number; + /** + * The minimal length of the last segment (at the target). + * Setter:By default this value is set to 10.0. The + * value must be >= 0, otherwise the default value will be assigned. + *

+ * Note: the resulting segment length also depends on the given {@link yfiles.router.polyline.Grid#spacing + * grid + * spacing + * }, i.e., segment length >= (int) Math.ceil(length / grid spacing). + *

+ *

+ * Note: the last segment length ends, if present, at the halo of the target. + *

+ * Getter:Default is 10.0. + *

+ * Note: the last segment length ends, if present, at the halo of the target. + *

+ * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalFirstSegmentLength} + * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalFirstSegmentLength} + */ + minimalLastSegmentLength:number; + /** + * The minimal distance between a pair of edges. + * Getter:Default is 3.0. + * Setter:By default this value is set to 3.0.The value must + * be >= 0, otherwise the default value will be assigned. + */ + minimalEdgeToEdgeDistance:number; + /** + * The minimal distance the edge shall keep from node corners when entering or leaving the node. + * Getter:Default is + * 3.0. + * Setter:By default this + * value is set to 3.0. The value must be >= 0, otherwise the default value will be + * assigned. + */ + minimalNodeCornerDistance:number; + /** + * The monotonic path restrictions for this edge. + * The edge can be used with one of the following values: + * {@link yfiles.router.MonotonicPathRestriction#HORIZONTAL}, {@link yfiles.router.MonotonicPathRestriction#VERTICAL}, {@link yfiles.router.MonotonicPathRestriction#BOTH}, or {@link yfiles.router.MonotonicPathRestriction#NONE}. + * Default is {@link yfiles.router.MonotonicPathRestriction#NONE}. + */ + monotonicPathRestriction:yfiles.router.MonotonicPathRestriction; + /** + * The penalty settings that should be used for this edge. + * Besides specifying a completely customized setting, the user can choose + * between four predefined optimization strategies: {@link yfiles.router.polyline.PenaltySettings#OPTIMIZATION_BALANCED}, + * {@link yfiles.router.polyline.PenaltySettings#OPTIMIZATION_EDGE_BENDS}, {@link yfiles.router.polyline.PenaltySettings#OPTIMIZATION_EDGE_CROSSINGS} + * and {@link yfiles.router.polyline.PenaltySettings#OPTIMIZATION_EDGE_LENGTHS}. + * @see {@link yfiles.router.polyline.PenaltySettings#OPTIMIZATION_BALANCED} + * @see {@link yfiles.router.polyline.PenaltySettings#OPTIMIZATION_EDGE_BENDS} + * @see {@link yfiles.router.polyline.PenaltySettings#OPTIMIZATION_EDGE_CROSSINGS} + * @see {@link yfiles.router.polyline.PenaltySettings#OPTIMIZATION_EDGE_LENGTHS} + */ + penaltySettings:yfiles.router.polyline.PenaltySettings; + /** + * Creates a copy of this instance. + * @return {yfiles.router.polyline.EdgeLayoutDescriptor} the copy. + */ + createCopy():yfiles.router.polyline.EdgeLayoutDescriptor; + } + var EdgeLayoutDescriptor:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of an EdgeLayoutDescriptor using the + * default values. + */ + new ():yfiles.router.polyline.EdgeLayoutDescriptor; + }; + /** + * Interface providing additional intervals to traverse from one {@link yfiles.router.polyline.PartitionCell} into an adjacent one. + *

+ * To find a {@link yfiles.router.polyline.Path} for an edge, the {@link yfiles.router.polyline.PathSearch} algorithm traverses from the current partition cell to + * an adjacent partition cell. By default, the orthogonal interval shared by these two cells is used. Implementations + * of this interface may be added to the PathSearch to calculate additional enter intervals that might + * accumulate lower costs for entering the adjacent cell. + *

+ * @see {@link yfiles.router.polyline.PartitionCell} + * @see {@link yfiles.router.polyline.PathSearch#addAdditionalEnterIntervalCalculator} + */ + export interface IEnterIntervalCalculator extends Object{ + /** + * Appends additional enter intervals for traversing from partition cell of currentEntrance to + * enteredCell to the given list enteredCell. + * @param {yfiles.router.polyline.CellEntrance} currentEntrance The current CellEntrance that is left. + * @param {yfiles.router.polyline.PartitionCell} enteredCell The neighbor cell that shall be entered. + * @param {yfiles.router.polyline.OrthogonalInterval} commonInterval The common interval of the left and entered partition cells. + * @param {yfiles.algorithms.IList} allEnterIntervals The list to which additional enter intervals have to be appended. + * @param {yfiles.router.polyline.PathSearchContext} context The context of the path search. + * @see Specified by {@link yfiles.router.polyline.IEnterIntervalCalculator#appendEnterIntervals}. + */ + appendEnterIntervals(currentEntrance:yfiles.router.polyline.CellEntrance,enteredCell:yfiles.router.polyline.PartitionCell,commonInterval:yfiles.router.polyline.OrthogonalInterval,allEnterIntervals:yfiles.algorithms.IList,context:yfiles.router.polyline.PathSearchContext):void; + } + var IEnterIntervalCalculator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Implementations are extending the functionality of a {@link yfiles.router.polyline.GraphPartition}. + *

+ * A GraphPartitionExtension can be used to {@link yfiles.router.polyline.GraphPartition#createObstacle create} + * new {@link yfiles.router.polyline.Obstacle}s that will be given to the initializer + * of the {@link yfiles.router.polyline.IObstaclePartition} and react to its decomposition events if the {@link yfiles.router.polyline.IObstaclePartition} is + * a {@link yfiles.router.polyline.IDynamicDecomposition}. + *

+ *

+ * A GraphPartitionExtension has to be + * {@link yfiles.router.polyline.GraphPartition#addDynamicDecompositionListener added} + * to the {@link yfiles.router.polyline.GraphPartition} which will call its {@link yfiles.router.polyline.IGraphPartitionExtension#preparePartition preparePartition} + * method before the ObstaclePartition is initialized. + *

+ */ + export interface IGraphPartitionExtension extends Object,yfiles.router.polyline.DynamicDecompositionCompanion.IListener{ + /** + * This method is called by the given {@link yfiles.router.polyline.GraphPartition} upon initialization before its + * {@link yfiles.router.polyline.IObstaclePartition} gets initialized. + *

+ * Implementations may use the given graph the {@link yfiles.router.polyline.GraphPartition} is based upon to initialize themselves + * and/or {@link yfiles.router.polyline.GraphPartition#createObstacle add obstacles} to the list + * that {@link yfiles.router.polyline.IObstaclePartition} is initialized with. + *

+ * @param {yfiles.router.polyline.PathSearchConfiguration} configuration The configuration used for the path search. + * @param {yfiles.router.polyline.GraphPartition} graphPartition The graph partition using this extension. + * @see Specified by {@link yfiles.router.polyline.IGraphPartitionExtension#preparePartition}. + */ + preparePartition(configuration:yfiles.router.polyline.PathSearchConfiguration,graphPartition:yfiles.router.polyline.GraphPartition):void; + /** + * Cleans the extension up from the last partitioning with the current configuration and graphPartition. + * @see Specified by {@link yfiles.router.polyline.IGraphPartitionExtension#cleanup}. + */ + cleanup():void; + } + var IGraphPartitionExtension:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export interface DynamicDecompositionCompanion extends Object{ + } + export module DynamicDecompositionCompanion{ + /** + * Interface for classes that want to be notified about changes in partitions. + * Implementations are notified when + * {@link yfiles.router.polyline.PartitionCell}s are created, divided, and/or finalized. + */ + export interface IListener extends Object{ + /** + * Callback after a new {@link yfiles.router.polyline.PartitionCell} has been created. + * @param {yfiles.router.polyline.PartitionCell} createdCell The newly created cell. + * @see Specified by {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener#onCellCreated}. + */ + onCellCreated(createdCell:yfiles.router.polyline.PartitionCell):void; + /** + * Callback after a {@link yfiles.router.polyline.PartitionCell} has been subdivided into several sub cells. + *

+ * Listener may not modify the list of sub cells. + *

+ * @param {yfiles.router.polyline.PartitionCell} cell The cell that has been subdivided. + * @param {yfiles.algorithms.IList} subCells The new sub cells of the divided cell. + * @see Specified by {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener#onCellSubdivided}. + */ + onCellSubdivided(cell:yfiles.router.polyline.PartitionCell,subCells:yfiles.algorithms.IList):void; + /** + * Callback after a {@link yfiles.router.polyline.PartitionCell} has been decided to be final and won't be subdivided further. + * @param {yfiles.router.polyline.PartitionCell} finalizedCell The cell that has been finalized. + * @see Specified by {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener#onCellFinalized}. + */ + onCellFinalized(finalizedCell:yfiles.router.polyline.PartitionCell):void; + } + } + var DynamicDecompositionCompanion:{ + $class:yfiles.lang.Class; + }; + /** + * Provides support for routing edges on equidistant grid lines. + *

+ * The grid is defined by its origin and the spacing between the equidistant grid lines. + *

+ */ + export interface Grid extends Object{ + /** + * The horizontal coordinate of the origin. + */ + originX:number; + /** + * The vertical coordinate of the origin. + */ + originY:number; + /** + * The spacing between the horizontal and vertical grid lines. + */ + spacing:number; + /** + * Returns a String representation of Grid. + * @return {string} A String representation of Grid. + */ + toString():string; + } + var Grid:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + * The spacing between the grid lines must be at least 1. If spacing is smaller, + * 1 is assumed. + * @param {number} originX The horizontal coordinate of the origin. + * @param {number} originY The vertical coordinate of the origin. + * @param {number} spacing The spacing between the grid lines. Must be at least 1. + */ + new (originX:number,originY:number,spacing:number):yfiles.router.polyline.Grid; + }; + /** + * This abstract adapter provides an empty implementation of {@link yfiles.router.polyline.IGraphPartitionExtension}. + *

+ * The only real functionality is contained in the + * {@link yfiles.router.polyline.IGraphPartitionExtension#preparePartition prepare} method which stores the + * given {@link yfiles.router.polyline.PathSearchConfiguration} and {@link yfiles.router.polyline.GraphPartition} in properties.. + *

+ * @see {@link yfiles.router.polyline.GraphPartitionExtensionAdapter#configuration} + * @see {@link yfiles.router.polyline.GraphPartitionExtensionAdapter#graphPartition} + */ + export interface GraphPartitionExtensionAdapter extends Object,yfiles.router.polyline.IGraphPartitionExtension{ + /** + * The bridge passed in{@link yfiles.router.polyline.IGraphPartitionExtension#preparePartition}. + */ + graphPartition:yfiles.router.polyline.GraphPartition; + /** + * The configuration of the{@link yfiles.router.polyline.PathSearch} passed in + * {@link yfiles.router.polyline.IGraphPartitionExtension#preparePartition}. + */ + configuration:yfiles.router.polyline.PathSearchConfiguration; + /** + * Callback after a new {@link yfiles.router.polyline.PartitionCell} has been created. + * @param {yfiles.router.polyline.PartitionCell} createdCell The newly created cell. + * @see Specified by {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener#onCellCreated}. + */ + onCellCreated(createdCell:yfiles.router.polyline.PartitionCell):void; + /** + * Callback after a {@link yfiles.router.polyline.PartitionCell} has been subdivided into several sub cells. + *

+ * Listener may not modify the list of sub cells. + *

+ * @param {yfiles.router.polyline.PartitionCell} cell The cell that has been subdivided. + * @param {yfiles.algorithms.IList} subCells The new sub cells of the divided cell. + * @see Specified by {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener#onCellSubdivided}. + */ + onCellSubdivided(cell:yfiles.router.polyline.PartitionCell,subCells:yfiles.algorithms.IList):void; + /** + * Callback after a {@link yfiles.router.polyline.PartitionCell} has been decided to be final and won't be subdivided further. + * @param {yfiles.router.polyline.PartitionCell} finalizedCell The cell that has been finalized. + * @see Specified by {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener#onCellFinalized}. + */ + onCellFinalized(finalizedCell:yfiles.router.polyline.PartitionCell):void; + /** + * This method is called by the given {@link yfiles.router.polyline.GraphPartition} upon initialization before its + * {@link yfiles.router.polyline.IObstaclePartition} gets initialized. + *

+ * Implementations may use the given graph the {@link yfiles.router.polyline.GraphPartition} is based upon to initialize themselves + * and/or {@link yfiles.router.polyline.GraphPartition#createObstacle add obstacles} to the list + * that {@link yfiles.router.polyline.IObstaclePartition} is initialized with. + *

+ * @param {yfiles.router.polyline.PathSearchConfiguration} configuration The configuration used for the path search. + * @param {yfiles.router.polyline.GraphPartition} graphPartition The graph partition using this extension. + * @see Specified by {@link yfiles.router.polyline.IGraphPartitionExtension#preparePartition}. + */ + preparePartition(configuration:yfiles.router.polyline.PathSearchConfiguration,graphPartition:yfiles.router.polyline.GraphPartition):void; + /** + * Cleans the extension up from the last partitioning with the current configuration and graphPartition. + * @see Specified by {@link yfiles.router.polyline.IGraphPartitionExtension#cleanup}. + */ + cleanup():void; + } + var GraphPartitionExtensionAdapter:{ + $class:yfiles.lang.Class; + }; + /** + * This interface should be implemented by classes that dispatch notifications about changes in partitions. + * Interested + * parties are notified when {@link yfiles.router.polyline.PartitionCell}s are created, divided, and/or finalized. + * @see {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener} + */ + export interface IDynamicDecomposition extends Object{ + /** + * Adds the given listener to the {@link yfiles.router.polyline.IPartition}. + * @param {yfiles.router.polyline.DynamicDecompositionCompanion.IListener} listener The listener that shall be notified upon dynamic decomposition events. + * @see Specified by {@link yfiles.router.polyline.IDynamicDecomposition#addDynamicDecompositionListener}. + */ + addDynamicDecompositionListener(listener:yfiles.router.polyline.DynamicDecompositionCompanion.IListener):void; + /** + * Removes the given listener from the {@link yfiles.router.polyline.IPartition}. + * @param {yfiles.router.polyline.DynamicDecompositionCompanion.IListener} listener The listener that shall not be notified anymore upon dynamic decomposition events. + * @see Specified by {@link yfiles.router.polyline.IDynamicDecomposition#removeDynamicDecompositionListener}. + */ + removeDynamicDecompositionListener(listener:yfiles.router.polyline.DynamicDecompositionCompanion.IListener):void; + } + var IDynamicDecomposition:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Stores information about the part of an edge segment that lies inside a specified {@link yfiles.router.polyline.PartitionCell}. + */ + export interface CellSegmentInfo extends yfiles.router.polyline.AbstractSegmentInfo{ + /** + * The direction this segment part points to. + * @see Overrides {@link yfiles.router.polyline.AbstractSegmentInfo#direction} + */ + direction:yfiles.layout.Direction; + /** + * The partition cell this part of the edge segment lies in. + */ + cell:yfiles.router.polyline.PartitionCell; + } + var CellSegmentInfo:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + * @param {yfiles.algorithms.Edge} edge The edge the segment of this info belongs to. + * @param {number} segmentIndex The index of the segment this info belongs to. + * @param {yfiles.layout.Direction} direction The direction the segment points to. + * @param {yfiles.router.polyline.Interval} locationRange The range the common location of this segment has to be inside. + * @param {yfiles.router.polyline.Interval} minExtension The minimal interval in extension direction this segment part is known to intersect. + * @param {yfiles.router.polyline.Interval} maxExtension The maximum interval in extension direction this segment part will span. + * @param {yfiles.router.polyline.PartitionCell} cell The partition cell this part of the edge segment lies inside. + */ + new (edge:yfiles.algorithms.Edge,segmentIndex:number,direction:yfiles.layout.Direction,locationRange:yfiles.router.polyline.Interval,minExtension:yfiles.router.polyline.Interval,maxExtension:yfiles.router.polyline.Interval,cell:yfiles.router.polyline.PartitionCell):yfiles.router.polyline.CellSegmentInfo; + }; + /** + * Describes where and from which direction a {@link yfiles.router.polyline.PartitionCell} has been entered during a path search. + * The path to reach the cell can be reconstructed by traversing the {@link yfiles.router.polyline.CellEntrance#previousEntrance previous entrances}. + * The {@link yfiles.router.polyline.CellEntrance#enterInterval enter interval} and {@link yfiles.router.polyline.CellEntrance#enterDirection enter direction} determine how the + * cell was entered. + */ + export interface CellEntrance extends Object{ + toString():string; + /** + * This entrance's partition cell. + */ + cell:yfiles.router.polyline.PartitionCell; + /** + * The previous{@link yfiles.router.polyline.CellEntrance} in the path that reached this cell. + */ + previousEntrance:yfiles.router.polyline.CellEntrance; + /** + * The{@link yfiles.router.polyline.OrthogonalInterval} that was used to enter this cell. + */ + enterInterval:yfiles.router.polyline.OrthogonalInterval; + /** + * The direction from which this cell was entered. + */ + enterDirection:yfiles.layout.Direction; + /** + * The costs for the implicit path given by the{@link yfiles.router.polyline.CellEntrance#previousEntrance previous entrances}. + */ + costs:number; + heuristicCosts:number; + /** + * The{@link yfiles.router.polyline.EdgeCellInfo} describing how the previous cell was crossed. + */ + previousEdgeCellInfo:yfiles.router.polyline.EdgeCellInfo; + } + var CellEntrance:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + * @param {yfiles.router.polyline.PartitionCell} cell The entered partition cell. + */ + new (cell:yfiles.router.polyline.PartitionCell):yfiles.router.polyline.CellEntrance; + /** + * Creates a copy of the given CellEntrance. + * @param {yfiles.router.polyline.CellEntrance} other the CellEntrance, of which a copy is to be made + */ + FromCellEntrance:{ + new (other:yfiles.router.polyline.CellEntrance):yfiles.router.polyline.CellEntrance; + }; + }; + /** + * Stores location information for orthogonal edge segments. + *

+ * Most notably, AbstractSegmentInfo stores direction, segment points and intervals describing possible location and extension of a segment. + *

+ */ + export interface AbstractSegmentInfo extends Object{ + toString():string; + /** + * The minimal known extension of the segment, that is the minimal interval this segment will cover in any case. + *

+ * For horizontal intervals, this is the minimal horizontal extension; for vertical intervals, this is the minimal + * vertical extension. + *

+ */ + minExtension:yfiles.router.polyline.Interval; + /** + * The maximum extension this segment will stretch. + *

+ * For horizontal intervals, this is the maximum horizontal extension; for vertical intervals, this is the maximum + * vertical extension. + *

+ */ + maxExtension:yfiles.router.polyline.Interval; + /** + * The range, the location of the segment shall be placed in. + *

+ * For horizontal segments, this is the range containing the vertical location; for vertical segment this is the + * range containing the horizontal location. + *

+ */ + locationRange:yfiles.router.polyline.Interval; + /** + * Specifies whether this segment prefers to be placed close to the{@link yfiles.router.polyline.Alignment#MIN lower bound}, {@link yfiles.router.polyline.Alignment#MAX upper bound} or {@link yfiles.router.polyline.Alignment#ANY somewhere} of its location range. + * @see {@link yfiles.router.polyline.Alignment#MIN} + * @see {@link yfiles.router.polyline.Alignment#MAX} + * @see {@link yfiles.router.polyline.Alignment#ANY} + * @see {@link yfiles.router.polyline.Alignment#MIN} + * @see {@link yfiles.router.polyline.Alignment#MAX} + * @see {@link yfiles.router.polyline.Alignment#ANY} + */ + preferredAlignment:yfiles.router.polyline.Alignment; + /** + * The fixed location inside the{@link yfiles.router.polyline.AbstractSegmentInfo#locationRange location range} that has been set before. + * Setter:This location has to be inside the segment infos location range. + * Getter:

+ * For horizontal segments, this is the vertical location; for vertical segments, this is the horizontal location. + *

+ * @throws {yfiles.lang.Exception} If the segment info already has a fixed location. + * @throws {yfiles.system.ArgumentException} If the given location isn't inside the location range. + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#fixed} + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#locationRange} + */ + location:number; + /** + * Determines whether or not this segment info is fixed, that means a fixed location has been determined inside its + * {@link yfiles.router.polyline.AbstractSegmentInfo#locationRange location range}. + */ + fixed:boolean; + /** + * Determines whether or not the associated segment is vertical. + */ + vertical:boolean; + /** + * The direction the segment of this info points to. + */ + direction:yfiles.layout.Direction; + /** + * The edge this segment info belongs to. + */ + edge:yfiles.algorithms.Edge; + /** + * The index of this info's segment. + */ + segmentIndex:number; + /** + * The segment group this segment info belongs to or null if this segment info doesn't belong + * to any group. + * @see {@link yfiles.router.polyline.SegmentGroup#commonLocationRange} + */ + segmentGroup:yfiles.router.polyline.SegmentGroup; + } + var AbstractSegmentInfo:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance for the segment. + * @param {yfiles.algorithms.Edge} edge The edge the segment of this info belongs to. + * @param {number} segmentIndex The index of the segment this info belongs to. + * @param {yfiles.layout.Direction} direction The direction the segment points to. + * @param {yfiles.router.polyline.Interval} locationRange The range the common location of this segment has to be inside. + * @param {yfiles.router.polyline.Interval} minExtension The minimal interval in extension direction this segment is known to intersect. + * @param {yfiles.router.polyline.Interval} maxExtension The maximum interval in extension direction this segment will span. + */ + new (edge:yfiles.algorithms.Edge,segmentIndex:number,direction:yfiles.layout.Direction,locationRange:yfiles.router.polyline.Interval,minExtension:yfiles.router.polyline.Interval,maxExtension:yfiles.router.polyline.Interval):yfiles.router.polyline.AbstractSegmentInfo; + /** + * Creates a new instance using a line segment to describe the edge segment. + *

+ * This constructor is meant to be used for fixed orthogonal edge segments. + *

+ * @param {yfiles.algorithms.Edge} edge The edge this segment info belongs to. + * @param {number} segmentNo The number of the segment this info belongs to. + * @param {yfiles.algorithms.LineSegment} segment A line segment describing the edge segment. + */ + FromLineSegment:{ + new (edge:yfiles.algorithms.Edge,segmentNo:number,segment:yfiles.algorithms.LineSegment):yfiles.router.polyline.AbstractSegmentInfo; + }; + }; + /** + * Encapsulates the information that determines the route of a specific edge within a specific partition cell. + */ + export interface EdgeCellInfo extends Object{ + /** + * The number of bends the edge has inside this cell. + */ + bendCount:number; + /** + * Returns a String representation of the shape in which the edge crosses the {@link yfiles.router.polyline.PartitionCell}. + * @return {string} + * A String representation of the shape in which the edge crosses the {@link yfiles.router.polyline.PartitionCell}. + */ + toString():string; + /** + * The routing type the edge uses in this cell. + * This is one of: + *
    + *
  • {@link yfiles.router.polyline.RoutingType#STRAIGHT}
  • + *
  • {@link yfiles.router.polyline.RoutingType#STRAIGHT_BENDING}
  • + *
  • {@link yfiles.router.polyline.RoutingType#BENDING}
  • + *
  • {@link yfiles.router.polyline.RoutingType#U_TURN}
  • + *
  • {@link yfiles.router.polyline.RoutingType#END}
  • + *
+ */ + type:yfiles.router.polyline.RoutingType; + /** + * The index of the edge segment that enters this cell. + */ + enterSegmentNo:number; + /** + * The index of the edge segment that exits this cell. + */ + exitSegmentNo:number; + /** + * The segment group containing the entering segment. + * @see {@link yfiles.router.polyline.SegmentGroup#commonLocationRange} + */ + enterSegmentGroup:yfiles.router.polyline.SegmentGroup; + /** + * The segment group containing the exiting segment. + * @see {@link yfiles.router.polyline.SegmentGroup#commonLocationRange} + */ + exitSegmentGroup:yfiles.router.polyline.SegmentGroup; + /** + * The edge whose routing in the cell is described. + */ + edge:yfiles.algorithms.Edge; + /** + * The cell the edge is routed in. + */ + cell:yfiles.router.polyline.PartitionCell; + /** + * The interval, the edge uses to enter this cell. + */ + enterInterval:yfiles.router.polyline.OrthogonalInterval; + /** + * The interval, the edge uses to exit this cell. + */ + exitInterval:yfiles.router.polyline.OrthogonalInterval; + /** + * The direction, this edge uses to enter this cell. + */ + enterDirection:yfiles.layout.Direction; + /** + * The direction, this edge uses to exit this cell. + */ + exitDirection:yfiles.layout.Direction; + /** + * The{@link yfiles.router.polyline.CellSegmentInfo}s for the the segment parts of this edge that run inside this cell. + */ + cellSegmentInfos:yfiles.algorithms.YList; + } + var EdgeCellInfo:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + * @param {yfiles.algorithms.Edge} edge The edge whose routing in the cell is described. + * @param {yfiles.router.polyline.PartitionCell} cell The cell the edge is routed in. + * @param {yfiles.router.polyline.OrthogonalInterval} enterInterval The interval, the edge uses to enter the cell. + * @param {yfiles.router.polyline.OrthogonalInterval} exitInterval The interval, the edge uses to exit the cell. + * @param {yfiles.layout.Direction} enterDirection The direction, the edge enters the cell. + * @param {yfiles.layout.Direction} exitDirection The direction, the edge exits the cell. + * @param {number} enterSegmentNo The index of the edge segment that enters the cell. + */ + new (edge:yfiles.algorithms.Edge,cell:yfiles.router.polyline.PartitionCell,enterInterval:yfiles.router.polyline.OrthogonalInterval,exitInterval:yfiles.router.polyline.OrthogonalInterval,enterDirection:yfiles.layout.Direction,exitDirection:yfiles.layout.Direction,enterSegmentNo:number):yfiles.router.polyline.EdgeCellInfo; + }; + /** + * Encapsulates the information required to route an edge with a path routing algorithm. + * @see {@link yfiles.router.polyline.ChannelBasedPathRouting} + */ + export interface EdgeInfo extends Object{ + /** + * Determines whether the path of this {@link yfiles.router.polyline.EdgeInfo#edge edge} is fixed or shall be routed by the path search + * algorithm. + */ + fixed:boolean; + /** + * The edge whose route is described by this info. + */ + edge:yfiles.algorithms.Edge; + /** + * A list of{@link yfiles.router.polyline.EdgeCellInfo}s describing how the edge traverses each {@link yfiles.router.polyline.PartitionCell} on its path. + */ + edgeCellInfos:yfiles.algorithms.IList; + /** + * Returns the {@link yfiles.router.polyline.EdgeCellInfo} of the given {@link yfiles.router.polyline.CellEntrance} in the path. + * @param {yfiles.router.polyline.CellEntrance} entrance The entrance to get the edge cell info for. + * @return {yfiles.router.polyline.EdgeCellInfo} The EdgeCellInfo of the given CellEntrance in the path. + */ + getEdgeCellInfo(entrance:yfiles.router.polyline.CellEntrance):yfiles.router.polyline.EdgeCellInfo; + /** + * Returns the segment info the the segment with the given index. + * @param {number} segmentIndex The index of the edge segment to return the segment info for. + * @return {yfiles.router.polyline.SegmentInfo} The segment info the the segment with the given index. + */ + getSegmentInfo(segmentIndex:number):yfiles.router.polyline.SegmentInfo; + /** + * Returns the segment info of the segment preceding the segment of the given segment info. + * @param {yfiles.router.polyline.SegmentInfo} segment The segmentInfo for which the previous segment info shall be returned. + * @return {yfiles.router.polyline.SegmentInfo} The segment info of the segment preceding the segment of the given segment info. + */ + getPreviousSegment(segment:yfiles.router.polyline.SegmentInfo):yfiles.router.polyline.SegmentInfo; + /** + * Returns the segment info of the segment following the segment of the given segment info. + * @param {yfiles.router.polyline.SegmentInfo} segment The segmentInfo for which the following segment info shall be returned. + * @return {yfiles.router.polyline.SegmentInfo} The segment info of the segment following the segment of the given segment info. + */ + getNextSegment(segment:yfiles.router.polyline.SegmentInfo):yfiles.router.polyline.SegmentInfo; + /** + * Returns the number of segments of the edge. + * @return {number} The number of segments of the edge. + */ + segmentCount():number; + toString():string; + /** + * The location of the strong source port the edge uses. + * @throws {yfiles.system.ArgumentException} + * If the first segment is already fixed and the given port location contradicts + * the segments fixed location. + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#location} + * @see {@link yfiles.router.polyline.SegmentInfo#atStrongPortConstraint} + */ + strongSourcePort:yfiles.algorithms.YPoint; + /** + * The location of the strong target port the edge uses. + * @throws {yfiles.system.ArgumentException} + * If the last segment is already fixed and the given port location contradicts + * the segments fixed location. + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#location} + * @see {@link yfiles.router.polyline.SegmentInfo#atStrongPortConstraint} + */ + strongTargetPort:yfiles.algorithms.YPoint; + /** + * Returns an array of {@link yfiles.algorithms.LineSegment}s created from the {@link yfiles.router.polyline.EdgeInfo#calculatePathPoints calculated path points}. + * @return {yfiles.algorithms.LineSegment[]} An array of LineSegments created from the calculated path points. + */ + calculateLineSegments():yfiles.algorithms.LineSegment[]; + /** + * Returns a list of {@link yfiles.algorithms.YPoint}s containing the source port, bend and target port locations. + * @return {yfiles.algorithms.YList} A list of YPoints containing the source port, bend and target port locations. + */ + calculatePathPoints():yfiles.algorithms.YList; + } + var EdgeInfo:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + * @param {yfiles.router.polyline.Path} path The path that shall be used to route the edge. + * @param {yfiles.router.polyline.PathSearchConfiguration} configuration The configuration of the path search algorithm. + */ + new (path:yfiles.router.polyline.Path,configuration:yfiles.router.polyline.PathSearchConfiguration):yfiles.router.polyline.EdgeInfo; + }; + /** + * Routes edges using their pre-calculated {@link yfiles.router.polyline.Path} information. + *

+ * {@link yfiles.router.polyline.ChannelBasedPathRouting#initialize Initialize} must be called before the edges can be + * {@link yfiles.router.polyline.ChannelBasedPathRouting#route route}d. + *

+ *

+ * The basic approach of this router is to bundle edge {@link yfiles.router.polyline.SegmentInfo segment}s into so-called {@link yfiles.router.polyline.Channel}s + * and route each channel individually. + *

+ * @see {@link yfiles.router.polyline.EdgeInfo#getSegmentInfo} + * @see {@link yfiles.layout.LayoutGraph#setPathWithPointList} + */ + export interface ChannelBasedPathRouting extends Object{ + /** + * Initializes this class for routing paths that were found with the given configuration. + * Must be called + * before {@link yfiles.router.polyline.ChannelBasedPathRouting#route}. + * @param {yfiles.router.polyline.PathSearchConfiguration} configuration The configuration to use for the following path routings. + * @see {@link yfiles.router.polyline.ChannelBasedPathRouting#route} + */ + initialize(configuration:yfiles.router.polyline.PathSearchConfiguration):void; + /** + * Resets all channel information and the reference to the PathSearchConfiguration. + * So, + * ChannelBasedPathRouting is ready to calculate paths for a new layout. + */ + cleanup():void; + /** + * The configuration this class was initialized with. + * @see {@link yfiles.router.polyline.ChannelBasedPathRouting#initialize} + */ + configuration:yfiles.router.polyline.PathSearchConfiguration; + /** + * Routes the given edges. + * {@link yfiles.router.polyline.ChannelBasedPathRouting#initialize} must be called first. + *

+ * As a first step, the {@link yfiles.router.polyline.SegmentInfo}s of all edge paths are distributed to {@link yfiles.router.polyline.Channel}s. + * After that, the segments in each of these Channels are sorted and locations are assigned respecting + * the segment's location ranges by calling the subsequent methods: + *

    + *
  • {@link yfiles.router.polyline.ChannelBasedPathRouting#optimizeSegmentOrder}
  • + *
  • {@link yfiles.router.polyline.ChannelBasedPathRouting#calculateSegmentLocations}
  • + *
  • {@link yfiles.router.polyline.ChannelBasedPathRouting#adjustSegmentLocations}
  • + *
+ *

+ *

+ * Finally the control points for the paths are calculated. + *

+ * @param {yfiles.algorithms.EdgeList} edges The edges to route. + * @param {yfiles.router.polyline.PathSearchResult} pathSearchResult The path search results containing the Path objects for the edges. + * @see {@link yfiles.router.polyline.PathSearchResult#getPath} + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#locationRange} + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#location} + * @throws {yfiles.system.InvalidOperationException} If the locations are not inside of the segment's location range. + */ + route(edges:yfiles.algorithms.EdgeList,pathSearchResult:yfiles.router.polyline.PathSearchResult):void; + /** + * Creates a comparator for {@link yfiles.router.polyline.SegmentInfo}s that can be used to sort the segment infos in a {@link yfiles.router.polyline.Channel} from + * left to right (for vertical segments) or top to bottom (for horizontal segments), respectively. + * @param {yfiles.algorithms.YList} channels The channels this comparator will be used for later. + * @param {yfiles.router.polyline.PathSearchResult} pathSearchResult + * The path search result containing the {@link yfiles.router.polyline.EdgeInfo}s with the SegmentInfos + * this comparator that will be used for later. + * @param {yfiles.router.polyline.PathSearchConfiguration} configuration The configuration used during this path search. + * @return {yfiles.objectcollections.IComparer} + * A comparator for SegmentInfos that can be used to sort the segment infos in a + * Channel. + */ + createSegmentInfoComparator(channels:yfiles.algorithms.YList,pathSearchResult:yfiles.router.polyline.PathSearchResult,configuration:yfiles.router.polyline.PathSearchConfiguration):yfiles.objectcollections.IComparer; + /** + * Sorts the given list of SegmentInfos using the given comparator. + * @param {yfiles.algorithms.IList} segmentInfos The list of SegmentInfos to sort. + * @param {yfiles.objectcollections.IComparer} segmentInfoComparator The comparator to use for the sorting. + */ + sortSegmentInfos(segmentInfos:yfiles.algorithms.IList,segmentInfoComparator:yfiles.objectcollections.IComparer):void; + /** + * Optimizes the order of the segments in the given channel. + *

+ * After the segments in the channel have been sorted using the + * {@link yfiles.router.polyline.ChannelBasedPathRouting#createSegmentInfoComparator segment info comparator}, + * segment infos having a common {@link yfiles.router.polyline.SegmentGroup} are replaced by their common + * {@link yfiles.router.polyline.SegmentGroup#commonSegmentInfo representative segment info}. + *

+ * This method further improves the order of the resulting segment info list is to make sure that the subsequent + * {@link yfiles.router.polyline.ChannelBasedPathRouting#calculateSegmentLocations location calculation} is able to respect the segment infos + * {@link yfiles.router.polyline.AbstractSegmentInfo#locationRange location ranges} and if possible the + * minimal edge to edge distances and possible grid constraints for the segments. + * @param {yfiles.router.polyline.Channel} channel The channel to optimize the segment info order for. + */ + optimizeSegmentOrder(channel:yfiles.router.polyline.Channel):void; + /** + * Calculates locations for the segment infos in the given channel. + *

+ * Precondition: The locations of the segments are {@link yfiles.router.polyline.Channel#setCurrentLocation stored} in the Channel. They should respect minimal edge to edge distances and grid constraints and must lie in the + * respective {@link yfiles.router.polyline.AbstractSegmentInfo#locationRange location range}s. + *

+ * @param {yfiles.router.polyline.Channel} channel The channel to calculate locations for the segment infos for. + * @see {@link yfiles.router.polyline.Channel#setCurrentLocation} + */ + calculateSegmentLocations(channel:yfiles.router.polyline.Channel):void; + /** + * Tries to adjust the location set for a segment info in the channel to consider the preferred alignment of the + * segment. + * This method is called after the segments have been distributed in the channel but before the final + * locations of the segments are assigned to the segment infos. + * @param {yfiles.router.polyline.Channel} channel The channel of the segment infos to consider the alignments for. + * @see {@link yfiles.router.polyline.Channel#getCurrentLocation} + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#preferredAlignment} + */ + adjustSegmentLocations(channel:yfiles.router.polyline.Channel):void; + } + var ChannelBasedPathRouting:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the ChannelBasedPathRouting class. + */ + new ():yfiles.router.polyline.ChannelBasedPathRouting; + }; + /** + * A channel is a set of vertical or horizontal edge segments whose locations depend on each other. + * Channels are used + * by the {@link yfiles.router.polyline.ChannelBasedPathRouting} to route edges using {@link yfiles.router.polyline.SegmentInfo}s describing their path. + */ + export interface Channel extends Object{ + /** + * Adds a new segment info to the channel. + * @param {yfiles.router.polyline.SegmentInfo} segment The segment info to add to this channel. + * @throws {yfiles.system.ArgumentException} + * If the given segment has a different orientation then the segments already + * contained in the channel. + */ + addSegment(segment:yfiles.router.polyline.SegmentInfo):void; + /** + * An interval spanning the union of the segment infos' location ranges. + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#locationRange} + */ + widthInterval:yfiles.router.polyline.Interval; + /** + * An interval spanning the union of the segment infos' maximum extension. + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#maxExtension} + */ + lengthInterval:yfiles.router.polyline.Interval; + /** + * Returns the number of segment infos in this channel. + * @return {number} The number of segment infos in this channel. + */ + segmentCount():number; + /** + * Determines whether or not the segments in this channel are vertical. + */ + vertical:boolean; + /** + * Returns the SegmentInfo with the given index in the segments list. + * @param {number} index The index of the segment in the list. + * @return {yfiles.router.polyline.SegmentInfo} The SegmentInfo with the given index in the segments list. + */ + getSegment(index:number):yfiles.router.polyline.SegmentInfo; + /** + * Returns the number of segment groups in this channel. + * @return {number} the number of segment groups in this channel + */ + segmentGroupCount():number; + /** + * Adds a segment group to this channel. + * @param {yfiles.router.polyline.SegmentGroup} group segment group to add + */ + addSegmentGroup(group:yfiles.router.polyline.SegmentGroup):void; + /** + * Returns the segment group with the given index of this channel. + * @param {number} index index of the segment group to return + * @return {yfiles.router.polyline.SegmentGroup} the segment group with the given index of this channel + */ + getSegmentGroup(index:number):yfiles.router.polyline.SegmentGroup; + /** + * Returns the current location the given {@link yfiles.router.polyline.SegmentInfo} is assigned inside its {@link yfiles.router.polyline.AbstractSegmentInfo#locationRange location range}. + * @param {yfiles.router.polyline.SegmentInfo} segmentInfo The segmentInfo to return the current location for. + * @return {number} The current location of the segment info or Double.NaN if no location was set before. + */ + getCurrentLocation(segmentInfo:yfiles.router.polyline.SegmentInfo):number; + /** + * Sets the current location the given {@link yfiles.router.polyline.SegmentInfo} is assigned inside its {@link yfiles.router.polyline.AbstractSegmentInfo#locationRange location range}. + *

+ * During the distribution of the segments in the channel, different locations can be assigned and only the last one + * is finally set at the segment info. + *

+ * @param {yfiles.router.polyline.SegmentInfo} segmentInfo The segment info to set the current location for. + * @param {number} location The current location of the segment info in its location range. + * @see {@link yfiles.router.polyline.AbstractSegmentInfo#location} + */ + setCurrentLocation(segmentInfo:yfiles.router.polyline.SegmentInfo,location:number):void; + /** + * The bounds of this channel. + * These bounds are determined by the channel's {@link yfiles.router.polyline.Channel#widthInterval width} + * and {@link yfiles.router.polyline.Channel#lengthInterval length}. + * @see {@link yfiles.router.polyline.Channel#widthInterval} + * @see {@link yfiles.router.polyline.Channel#lengthInterval} + */ + bounds:yfiles.algorithms.YRectangle; + toString():string; + } + var Channel:{ + $class:yfiles.lang.Class; + /** + * Creates a new channel containing the given segment info. + * @param {yfiles.router.polyline.SegmentInfo} segment The segment info the channel shall be created for. + */ + new (segment:yfiles.router.polyline.SegmentInfo):yfiles.router.polyline.Channel; + }; + /** + * An {@link yfiles.router.polyline.IObstaclePartition} that decomposes its area dynamically and implements the {@link yfiles.router.polyline.IDynamicDecomposition} interface. + *

+ * The partitioning strategy is based on binary space partitioning. It divides the partition space recursively in two + * cells until each cell is completely covered from one or more obstacles or completely empty. + *

+ */ + export interface DynamicObstacleDecomposition extends Object,yfiles.router.polyline.IObstaclePartition,yfiles.router.polyline.IDynamicDecomposition{ + /** + * The costs incurred for every obstacle that must be cut in a subdivision. + */ + cutObstacleCost:number; + /** + * The costs incurred if the distribution after a subdivision of obstacles is unbalanced in sub-cells. + */ + unbalancedObstaclesCost:number; + /** + * The costs incurred if the subdivision produces unbalanced rectangles. + */ + unbalancedRatioCost:number; + /** + * Adds the given dynamic decomposition listener to receive {@link yfiles.router.polyline.PartitionCell} subdivision and creation events from + * this decomposition. + * These events occur when the decomposition changes the partition by subdividing cells into + * sub-cells or new cell are created. + * @param {yfiles.router.polyline.DynamicDecompositionCompanion.IListener} listener the dynamic decomposition listener. + * @see {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener} + * @see Specified by {@link yfiles.router.polyline.IDynamicDecomposition#addDynamicDecompositionListener}. + */ + addDynamicDecompositionListener(listener:yfiles.router.polyline.DynamicDecompositionCompanion.IListener):void; + /** + * Removes the given dynamic decomposition listener so that it no longer receives {@link yfiles.router.polyline.PartitionCell} subdivision + * and creation events from this decomposition. + * @param {yfiles.router.polyline.DynamicDecompositionCompanion.IListener} listener the dynamic decomposition listener. + * @see {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener} + * @see Specified by {@link yfiles.router.polyline.IDynamicDecomposition#removeDynamicDecompositionListener}. + */ + removeDynamicDecompositionListener(listener:yfiles.router.polyline.DynamicDecompositionCompanion.IListener):void; + /** + * Notifies all registered dynamic decomposition listeners about a subdivision. + * @param {yfiles.router.polyline.PartitionCell} cell The cell that has been subdivided. + * @param {yfiles.algorithms.IList} subCells The new sub cells of the divided cell. + * @see {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener} + */ + fireSubdividedEvent(cell:yfiles.router.polyline.PartitionCell,subCells:yfiles.algorithms.IList):void; + /** + * Notifies all registered dynamic decomposition listeners about the finalized cell. + * @param {yfiles.router.polyline.PartitionCell} finalizedCell The cell that has been finalized. + * @see {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener} + */ + fireFinalizeCellEvent(finalizedCell:yfiles.router.polyline.PartitionCell):void; + /** + * Notifies all registered dynamic decomposition listeners about the newly created cell. + * @param {yfiles.router.polyline.PartitionCell} createdCell The newly created cell. + * @see {@link yfiles.router.polyline.DynamicDecompositionCompanion.IListener} + */ + fireCreateCellEvent(createdCell:yfiles.router.polyline.PartitionCell):void; + /** + * Initializes this dynamic obstacle decomposition with the given obstacles and partition bounds. + * This method must be + * called before any other method is invoked. + * @param {yfiles.algorithms.IList} obstacles + * A list of {@link yfiles.router.polyline.Obstacle} objects. + * @param {yfiles.algorithms.YRectangle} partitionBounds The bounds of the partition. + * @see Specified by {@link yfiles.router.polyline.IObstaclePartition#init}. + */ + init(obstacles:yfiles.algorithms.IList,partitionBounds:yfiles.algorithms.YRectangle):void; + /** + * Clears the partition data so the ObstaclePartition can be reused and + * {@link yfiles.router.polyline.IObstaclePartition#init initialized} with new Obstacles. + * @see Specified by {@link yfiles.router.polyline.IObstaclePartition#clear}. + */ + clear():void; + /** + * Calculates the cost of a cut with respect to the subdivided obstacles. + * The cost ranges between 0 and 1. + * @param {number} numObstaclesInFirstHalf The number of obstacles that lie completely in the first half. + * @param {number} numObstaclesInSecondHalf The number of obstacles that lie completely in the second half. + * @param {number} numObstaclesOnCut The number of obstacles that lie on the cut. + * @return {number} Costs of a cut with respect to the subdivided obstacles. + */ + getObstacleCutCosts(numObstaclesInFirstHalf:number,numObstaclesInSecondHalf:number,numObstaclesOnCut:number):number; + /** + * Calculates the cost of a cut with respect to the geometry of the sub-cells. + * The cost ranges between 0 and 1. + * @param {number} cut The coordinate of the cut. + * @param {number} min The left side of the subdivided cell. + * @param {number} max The right side of the subdivided cell. + * @param {number} orthogonalMin The upper side of the subdivided cell. + * @param {number} orthogonalMax The lower side of the subdivided cell. + * @return {number} Costs of a cut with respect to the geometry of the sub-cells. + */ + getGeometricCutCosts(cut:number,min:number,max:number,orthogonalMin:number,orthogonalMax:number):number; + /** + * Returns the neighbor cells of the given cell. + * @param {yfiles.router.polyline.PartitionCell} cell The cell to get the neighbors for. + * @return {yfiles.algorithms.IList} The neighbor cells of the given cell. + * @see Specified by {@link yfiles.router.polyline.IPartition#getNeighbors}. + */ + getNeighbors(cell:yfiles.router.polyline.PartitionCell):yfiles.algorithms.IList; + /** + * Returns all obstacles that cover the given partition cell. + * @param {yfiles.router.polyline.PartitionCell} cell The cell to get the obstacles for. + * @return {yfiles.algorithms.IList} + * An unmodifiable list of {@link yfiles.router.polyline.Obstacle} instances that cover the given cell. + * @see Specified by {@link yfiles.router.polyline.IObstaclePartition#getObstacles}. + */ + getObstacles(cell:yfiles.router.polyline.PartitionCell):yfiles.algorithms.IList; + /** + * Returns all cells that are completely covered by the given obstacle. + * @param {yfiles.router.polyline.Obstacle} obstacle The obstacle to get the covered cells for. + * @return {yfiles.algorithms.IList} + * An unmodifiable list of {@link yfiles.router.polyline.PartitionCell} instances that are + * completely covered by the given obstacle. + * @see Specified by {@link yfiles.router.polyline.IObstaclePartition#getCellsWithObstacle}. + */ + getCellsWithObstacle(obstacle:yfiles.router.polyline.Obstacle):yfiles.algorithms.IList; + /** + * Returns the {@link yfiles.router.polyline.PartitionCell}s in which the given rectangle lies. + * @param {yfiles.algorithms.YRectangle} rect The rectangle to get the cells for. + * @return {yfiles.algorithms.IList} The cells in which the given rectangle lies. + * @see Specified by {@link yfiles.router.polyline.IPartition#getCells}. + */ + getCells(rect:yfiles.algorithms.YRectangle):yfiles.algorithms.IList; + /** + * The bounds of the decomposition area. + * @see Specified by {@link yfiles.router.polyline.IPartition#bounds}. + */ + bounds:yfiles.algorithms.YRectangle; + } + var DynamicObstacleDecomposition:{ + $class:yfiles.lang.Class; + /** + * Constructs a dynamic obstacle decomposition. + */ + new ():yfiles.router.polyline.DynamicObstacleDecomposition; + }; + /** + * Manages the best {@link yfiles.router.polyline.Path}s found for each edge and provides according {@link yfiles.router.polyline.EdgeInfo}s. + * These are used by the {@link yfiles.router.polyline.ChannelBasedPathRouting} algorithm to calculate the final segment locations for the + * segments of an edge path. + */ + export interface PathSearchResult extends Object{ + /** + * Returns an {@link yfiles.router.polyline.EdgeInfo} for the given path. + *

+ * If no {@link yfiles.router.polyline.EdgeInfo} has been created for this path by this context before, a new one is instantiated, + * otherwise the stored one is returned. + *

+ * @param {yfiles.router.polyline.Path} path + * The path to return the {@link yfiles.router.polyline.EdgeInfo} for. + * @return {yfiles.router.polyline.EdgeInfo} + * An {@link yfiles.router.polyline.EdgeInfo} describing this path. + */ + getEdgeInfoWithPath(path:yfiles.router.polyline.Path):yfiles.router.polyline.EdgeInfo; + /** + * Returns an {@link yfiles.router.polyline.EdgeInfo} for the given edge. + *

+ * If the given edge shall be routed but no path has been set for, yet, null is returned. + * If no {@link yfiles.router.polyline.EdgeInfo} has been created for the path by this context before, a new one is instantiated, + * otherwise the stored one is returned. + *

+ * @param {yfiles.algorithms.Edge} edge + * The edge to return the {@link yfiles.router.polyline.EdgeInfo}. + * @return {yfiles.router.polyline.EdgeInfo} + * An {@link yfiles.router.polyline.EdgeInfo} describing this the path of the edge. + * @see {@link yfiles.router.polyline.PathSearchResult#setPath} + */ + getEdgeInfo(edge:yfiles.algorithms.Edge):yfiles.router.polyline.EdgeInfo; + /** + * Sets a found path for an edge. + * @param {yfiles.algorithms.Edge} edge The edge to set the path for. + * @param {yfiles.router.polyline.Path} path The found path. + */ + setPath(edge:yfiles.algorithms.Edge,path:yfiles.router.polyline.Path):void; + /** + * Returns the earlier registered found path for the edge. + * @param {yfiles.algorithms.Edge} edge The edge to provide the found path for. + * @return {yfiles.router.polyline.Path} The earlier registered found path for the edge or null, if no path has been registered, yet. + */ + getPath(edge:yfiles.algorithms.Edge):yfiles.router.polyline.Path; + } + var PathSearchResult:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + * @param {yfiles.router.polyline.PathSearchConfiguration} configuration The configuration used for the path search. + */ + new (configuration:yfiles.router.polyline.PathSearchConfiguration):yfiles.router.polyline.PathSearchResult; + }; + /** + * Extensions are added to a {@link yfiles.router.polyline.PathSearch} to influence the search process. + *

+ * It contains several callback methods that are used by the {@link yfiles.router.polyline.PathSearch} to e.g. calculate the costs for + * the next possible steps (i.e. entering the next partition cell) and to decide when the target is reached. + *

+ *

+ * The {@link yfiles.router.polyline.PathSearch} uses the callbacks in the following order: + *

    + *
  • {@link yfiles.router.polyline.PathSearchExtension#initialize initialize}
  • + *
  • {@link yfiles.router.polyline.PathSearchExtension#initializeEdges initializeEdges}
  • + *
  • {@link yfiles.router.polyline.PathSearchExtension#initializeCurrentEdge initializeCurrentEdge}
  • + *
  • {@link yfiles.router.polyline.PathSearchExtension#appendStartEntrances appendStartEntrances}
  • + *
  • {@link yfiles.router.polyline.PathSearchExtension#calculateStartEntranceCost calculateStartEntranceCost}
  • + *
  • {@link yfiles.router.polyline.PathSearchExtension#calculateCosts calculateCosts}
  • + *
  • {@link yfiles.router.polyline.PathSearchExtension#calculateHeuristicCosts calculateHeuristicCosts}
  • + *
  • {@link yfiles.router.polyline.PathSearchExtension#isValidTargetEntrance isValidTargetEntrance}
  • + *
  • {@link yfiles.router.polyline.PathSearchExtension#finalizePath finalizePath}
  • + *
  • {@link yfiles.router.polyline.PathSearchExtension#finalizeCurrentEdge finalizeCurrentEdge} or {@link yfiles.router.polyline.PathSearchExtension#cancelCurrentEdge cancelCurrentEdge}
  • + *
  • {@link yfiles.router.polyline.PathSearchExtension#finalizeEdges finalizeEdges}
  • + *
  • {@link yfiles.router.polyline.PathSearchExtension#finalizePathSearchResult finalizePathSearchResult}
  • + *
  • {@link yfiles.router.polyline.PathSearchExtension#cleanup cleanup}
  • + *
+ *

+ * @see {@link yfiles.router.polyline.PathSearch#addPathSearchExtension} + * @see {@link yfiles.router.polyline.PathSearchContext#currentEdge} + */ + export interface PathSearchExtension extends Object{ + /** + * The configuration used for the path search. + * This property is initialized in the {@link yfiles.router.polyline.PathSearchExtension#initialize init} method. + */ + configuration:yfiles.router.polyline.PathSearchConfiguration; + /** + * The current context of the path search. + * This property is initialized in the {@link yfiles.router.polyline.PathSearchExtension#initializeEdges initEdges} method. + */ + context:yfiles.router.polyline.PathSearchContext; + /** + * Initializes this extension for path searches using the given configuration. + *

+ * This method is the first one to be called by the {@link yfiles.router.polyline.PathSearch}. + *

+ * @param {yfiles.router.polyline.PathSearchConfiguration} configuration The configuration to use for the following path searches. + */ + initialize(configuration:yfiles.router.polyline.PathSearchConfiguration):void; + /** + * Initializes this extension with the context that contains the list of edges for which paths are calculated. + * May be + * called several times during a path search. Each call will be balanced by calls to {@link yfiles.router.polyline.PathSearchExtension#finalizeEdges} and {@link yfiles.router.polyline.PathSearchExtension#finalizePathSearchResult}. + * @param {yfiles.router.polyline.PathSearchContext} context The context containing the list of edges, paths shall be found for. + * @see {@link yfiles.router.polyline.PathSearchContext#edges} + */ + initializeEdges(context:yfiles.router.polyline.PathSearchContext):void; + /** + * Initializes this extension with the current edge set in the given context. + * Called for each of the {@link yfiles.router.polyline.PathSearchExtension#context context's edges}. Each call will be balanced by a call to either finalizeCurrentEdge(PathSearchContext) + * or cancelCurrentEdge(PathSearchContext). + * @param {yfiles.router.polyline.PathSearchContext} context The context containing the current edge. + * @see {@link yfiles.router.polyline.PathSearchContext#currentEdge} + */ + initializeCurrentEdge(context:yfiles.router.polyline.PathSearchContext):void; + /** + * Appends additional start entrances for the path search of the current edge to the given list of all previously + * generated entrances. + * @param {yfiles.algorithms.IList} allStartEntrances a list of all previously generated entrances + */ + appendStartEntrances(allStartEntrances:yfiles.algorithms.IList):void; + /** + * Returns the cost for starting the path in the given entrance. + * This method is called called for each start entrance of the current edge. + * @param {yfiles.router.polyline.CellEntrance} startEntrance The start entrance to calculate the cost for. + * @return {number} The cost for starting the path in the given entrance. + */ + calculateStartEntranceCost(startEntrance:yfiles.router.polyline.CellEntrance):number; + /** + * Calculate the costs for entering the enteredCell via the enterInterval. + *

+ * The given {@link yfiles.router.polyline.EdgeCellInfo} describes how the partition cell, that has been entered by the current entrance, + * would be traversed if this enter interval to the neighbor cell would be chosen. + *

+ *

+ * The maxAllowedCosts describe the maximum costs the entering of the neighbor cell via this + * enter intervals may induce. If the maximum cost is exceeded, calculations that may further increase its cost + * may be skipped because this interval won't be chosen anyway. + *

+ * @param {yfiles.router.polyline.CellEntrance} currentEntrance The entrance that was used to enter the current cell. + * @param {yfiles.router.polyline.PartitionCell} enteredCell The neighbor cell that shall be entered. + * @param {yfiles.router.polyline.OrthogonalInterval} enterInterval The interval that shall be used to enter the neighbor cell. + * @param {yfiles.router.polyline.EdgeCellInfo} edgeCellInfo + * Information about how the current cell would be traversed if the neighbor cell would be + * entered by this enter interval. + * @param {number} maxAllowedCosts The maximum allowed costs for this enter intervals. + * @return {number} The costs for entering the neighbor cell via the enter interval. + */ + calculateCosts(currentEntrance:yfiles.router.polyline.CellEntrance,enteredCell:yfiles.router.polyline.PartitionCell,enterInterval:yfiles.router.polyline.OrthogonalInterval,edgeCellInfo:yfiles.router.polyline.EdgeCellInfo,maxAllowedCosts:number):number; + /** + * Calculates the heuristic costs for the given entrance that describe the minimal costs that will arise to finish + * the path if the given cell entrance is used as next step. + *

+ * After evaluating the costs for each enter interval to a neighbor cell, this method is called for each of the + * resulting {@link yfiles.router.polyline.CellEntrance}s. + *

+ * @param {yfiles.router.polyline.CellEntrance} entrance The entrance to calculate the heuristic costs for the rest of the path. + * @return {number} The minimal costs that will arise to finish the path if the given cell entrance is used as next step. + */ + calculateHeuristicCosts(entrance:yfiles.router.polyline.CellEntrance):number; + /** + * Determines whether this extension considers the given entrance a valid target entrance, i.e. + * the path may + * end with this entrance. + *

+ * Each time a {@link yfiles.router.polyline.CellEntrance} is chosen as next step, all registered extension are asked if this entrance + * is a valid target entrance. Only if none of the extensions returns false, a {@link yfiles.router.polyline.Path} is created. + *

+ * @param {yfiles.router.polyline.CellEntrance} entrance The entrance to decide if it is a valid target entrance. + * @return {boolean} true, if the path may end with this entrance; false otherwise. + */ + isValidTargetEntrance(entrance:yfiles.router.polyline.CellEntrance):boolean; + /** + * After finding a valid target entrance and creating a {@link yfiles.router.polyline.Path}, the extension is notified about the found path. + *

+ * If the path search is configured to calculate several possible paths for an edge, the path search proceeds + * with choosing another unhandled CellEntrance. + *

+ * @param {yfiles.router.polyline.Path} path The path found for the current edge in the context. + * @see {@link yfiles.router.polyline.PathSearchContext#currentEdge} + */ + finalizePath(path:yfiles.router.polyline.Path):void; + /** + * This callback notifies the extension when the path search for the current edge is cancelled. + *

+ * After that, the path search will proceed with altering the penalties of the current edge and reinitializing it again. + *

+ * @param {yfiles.router.polyline.PathSearchContext} context The context containing the current edge the path search has been finished for. + * @see {@link yfiles.router.polyline.PathSearchExtension#initializeCurrentEdge} + * @see {@link yfiles.router.polyline.PathSearchExtension#finalizeEdges} + */ + cancelCurrentEdge(context:yfiles.router.polyline.PathSearchContext):void; + /** + * This callback notifies the extension when enough paths are found for the current edge. + *

+ * After that, the path search either proceed with initializing the next current edge in the context's edge list or + * calls {@link yfiles.router.polyline.PathSearchExtension#finalizeEdges} if all edges in this list have been handled. + *

+ * @param {yfiles.router.polyline.PathSearchContext} context The context containing the current edge the path search has been finished for. + * @see {@link yfiles.router.polyline.PathSearchExtension#initializeCurrentEdge} + * @see {@link yfiles.router.polyline.PathSearchExtension#finalizeEdges} + */ + finalizeCurrentEdge(context:yfiles.router.polyline.PathSearchContext):void; + /** + * This callback notifies the extension if enough paths have been found for all edges in the context's edge list. + * @param {yfiles.router.polyline.PathSearchContext} context The context containing the list of edges, paths have been found for. + * @see {@link yfiles.router.polyline.PathSearchContext#edges} + */ + finalizeEdges(context:yfiles.router.polyline.PathSearchContext):void; + /** + * Callback notifying the extension about the paths chosen for the edges in the current context. + *

+ * After calling {@link yfiles.router.polyline.PathSearchExtension#finalizeEdges finalizeEdges}, the PathSearch decides, which of the found + * paths to use for each edge and adds them to the {@link yfiles.router.polyline.PathSearchResult}. + *

+ *

+ * With this callback the registered extensions are notified about this result before the path search either + * initializes the next list of edges to route or ends the path search by calling {@link yfiles.router.polyline.PathSearchExtension#cleanup}. + *

+ * @param {yfiles.router.polyline.PathSearchResult} pathSearchResult The path search result for the edge in the current context's edge list. + * @see {@link yfiles.router.polyline.PathSearchExtension#initializeEdges} + * @see {@link yfiles.router.polyline.PathSearchExtension#cleanup} + */ + finalizePathSearchResult(pathSearchResult:yfiles.router.polyline.PathSearchResult):void; + /** + * Cleans the extension up from the path searches with the current configuration. + */ + cleanup():void; + } + var PathSearchExtension:{ + $class:yfiles.lang.Class; + }; + /** + * Provides context information that is useful for the path search algorithm. + *

+ * Most notably, the context provides access to the edge that is currently being routed (see {@link yfiles.router.polyline.PathSearchContext#currentEdge}). + *

+ */ + export interface PathSearchContext extends Object{ + /** + * The path search that uses this context. + */ + pathSearch:yfiles.router.polyline.PathSearch; + /** + * The configuration used for the path search. + */ + configuration:yfiles.router.polyline.PathSearchConfiguration; + /** + * The edges that are routed. + */ + edges:yfiles.algorithms.IEdgeCursor; + /** + * Sets the list of edges that shall be routed. + * @param {yfiles.algorithms.EdgeList} edges The list of edges that shall be routed. + */ + setEdges(edges:yfiles.algorithms.EdgeList):void; + /** + * The edge that is routed. + *

+ * This edge is one of those in {@link yfiles.router.polyline.PathSearchContext#edges}. + *

+ */ + currentEdge:yfiles.algorithms.Edge; + /** + * The edge layout descriptor for the{@link yfiles.router.polyline.PathSearchContext#currentEdge} containing edge specific settings for the path + * search. + */ + currentEdgeLayoutDescriptor:yfiles.router.polyline.EdgeLayoutDescriptor; + /** + * Returns the number of all cells that are covered by the source node of the {@link yfiles.router.polyline.PathSearchContext#currentEdge}. + * @return {number} + * the number of all cells that are covered by the source node of the {@link yfiles.router.polyline.PathSearchContext#currentEdge} + */ + sourceCellCount():number; + /** + * Adds an additional source cell of the {@link yfiles.router.polyline.PathSearchContext#currentEdge} if it is not already contained in the list of + * source cells. + * @param {yfiles.router.polyline.PartitionCell} cell The new source cell to add. + * @see {@link yfiles.router.polyline.PathSearchContext#sourceCellCount} + * @see {@link yfiles.router.polyline.PathSearchContext#getSourceCell} + */ + addSourceCell(cell:yfiles.router.polyline.PartitionCell):void; + /** + * Returns the source cell with the given index in the list of all cells that are covered by the source node of the + * {@link yfiles.router.polyline.PathSearchContext#currentEdge}. + * @return {yfiles.router.polyline.PartitionCell} + * the source cell with the given index in the list of all cells that are covered by the source node of the + * {@link yfiles.router.polyline.PathSearchContext#currentEdge}. + */ + getSourceCell(index:number):yfiles.router.polyline.PartitionCell; + /** + * Determines if the given cell is a source cell of the {@link yfiles.router.polyline.PathSearchContext#currentEdge}. + * @param {yfiles.router.polyline.PartitionCell} cell The cell to be tested. + * @return {boolean} true if the given cell is in the list of source cells, false otherwise. + * @see {@link yfiles.router.polyline.PathSearchContext#sourceCellCount} + * @see {@link yfiles.router.polyline.PathSearchContext#getSourceCell} + */ + isSourceCell(cell:yfiles.router.polyline.PartitionCell):boolean; + /** + * An artificial partition cell with the size of the bounding box of all source cells of the{@link yfiles.router.polyline.PathSearchContext#currentEdge}. + */ + combinedSourceCell:yfiles.router.polyline.PartitionCell; + /** + * Returns the number of all cells that are covered by the target node of the {@link yfiles.router.polyline.PathSearchContext#currentEdge}. + * @return {number} + * the number of all cells that are covered by the target node of the {@link yfiles.router.polyline.PathSearchContext#currentEdge} + */ + targetCellCount():number; + /** + * Adds an additional target cell of the {@link yfiles.router.polyline.PathSearchContext#currentEdge} if it is not already contained in the list of + * target cells. + * @param {yfiles.router.polyline.PartitionCell} cell the new target cell to add + * @see {@link yfiles.router.polyline.PathSearchContext#targetCellCount} + * @see {@link yfiles.router.polyline.PathSearchContext#getTargetCell} + */ + addTargetCell(cell:yfiles.router.polyline.PartitionCell):void; + /** + * Returns the target cell with the given index in the list of all cells that are covered by the target node of the + * {@link yfiles.router.polyline.PathSearchContext#currentEdge}. + * @return {yfiles.router.polyline.PartitionCell} + * the target cell with the given index in the list of all cells that are covered by the target node of the + * {@link yfiles.router.polyline.PathSearchContext#currentEdge}. + */ + getTargetCell(index:number):yfiles.router.polyline.PartitionCell; + /** + * Determines if the given cell is a target cell of the {@link yfiles.router.polyline.PathSearchContext#currentEdge}. + * @param {yfiles.router.polyline.PartitionCell} cell The cell to be tested. + * @return {boolean} true if the given cell is in the list of target cells, false otherwise. + * @see {@link yfiles.router.polyline.PathSearchContext#targetCellCount} + * @see {@link yfiles.router.polyline.PathSearchContext#getTargetCell} + */ + isTargetCell(cell:yfiles.router.polyline.PartitionCell):boolean; + /** + * An artificial partition cell with the size of the bounding box of all target cells of the{@link yfiles.router.polyline.PathSearchContext#currentEdge}. + */ + combinedTargetCell:yfiles.router.polyline.PartitionCell; + /** + * The results of the path search. + */ + pathSearchResult:yfiles.router.polyline.PathSearchResult; + } + var PathSearchContext:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + * @param {yfiles.router.polyline.PathSearch} pathSearch The path search that uses this context. + * @param {yfiles.router.polyline.PathSearchConfiguration} configuration The configuration used for the path search. + */ + new (pathSearch:yfiles.router.polyline.PathSearch,configuration:yfiles.router.polyline.PathSearchConfiguration):yfiles.router.polyline.PathSearchContext; + }; + /** + * A Path represents the result of a path search as a list of consecutive {@link yfiles.router.polyline.CellEntrance}s. + * A Path + * starts with an entrance into a {@link yfiles.router.polyline.PartitionCell} of the source node and ends with one into a {@link yfiles.router.polyline.PartitionCell} of the target node. + * @see {@link yfiles.router.polyline.PathSearch} + * @see {@link yfiles.router.polyline.PathSearchResult} + */ + export interface Path extends Object{ + /** + * The edge this path was calculated for. + */ + edge:yfiles.algorithms.Edge; + /** + * The overall cost of this path. + */ + cost:number; + /** + * Returns the {@link yfiles.router.polyline.CellEntrance} at the given position of this path. + * @param {number} position + * position of the {@link yfiles.router.polyline.CellEntrance} to return + * @return {yfiles.router.polyline.CellEntrance} + * the {@link yfiles.router.polyline.CellEntrance} at the given position of this path + */ + getEntrance(position:number):yfiles.router.polyline.CellEntrance; + /** + * Replaces the {@link yfiles.router.polyline.CellEntrance} at the given position of this path with the given {@link yfiles.router.polyline.CellEntrance}. + * @param {number} position + * position of the {@link yfiles.router.polyline.CellEntrance} to replace + * @param {yfiles.router.polyline.CellEntrance} entrance + * {@link yfiles.router.polyline.CellEntrance} to be stored at the given position + */ + setEntrance(position:number,entrance:yfiles.router.polyline.CellEntrance):void; + /** + * Returns the position of the first occurrence of the given {@link yfiles.router.polyline.CellEntrance} in this path, or -1 if this path + * does not contain the {@link yfiles.router.polyline.CellEntrance}. + * @param {yfiles.router.polyline.CellEntrance} entrance + * {@link yfiles.router.polyline.CellEntrance} to search for + * @return {number} + * the position of the first occurrence of the given {@link yfiles.router.polyline.CellEntrance} in this path, or -1 if this path + * does not contain the {@link yfiles.router.polyline.CellEntrance} + */ + positionOf(entrance:yfiles.router.polyline.CellEntrance):number; + /** + * Returns the count of {@link yfiles.router.polyline.CellEntrance} objects this path consists of. + * @return {number} + * The count of {@link yfiles.router.polyline.CellEntrance} objects this path consists of. + */ + length():number; + } + var Path:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + * @param {yfiles.algorithms.Edge} edge The edge the path was calculated for. + * @param {yfiles.algorithms.IList} entrances + * A list of {@link yfiles.router.polyline.CellEntrance} objects describing the edge path from source node to target node. + * @param {number} cost The overall cost of this path. + */ + new (edge:yfiles.algorithms.Edge,entrances:yfiles.algorithms.IList,cost:number):yfiles.router.polyline.Path; + }; + /** + * Contains the basic configuration used by path search algorithms. + */ + export interface PathSearchConfiguration extends Object{ + /** + * The graph of the edge whose path is searched. + */ + graph:yfiles.layout.LayoutGraph; + /** + * The grouping information of the graph. + */ + grouping:yfiles.layout.GraphGrouping; + /** + * The orthogonal layout algorithm using this configuration. + */ + edgeRouter:yfiles.router.polyline.EdgeRouter; + /** + * The remaining time in that the calculation of the algorithm should be completed. + */ + restOfComputingTime:number; + } + var PathSearchConfiguration:{ + $class:yfiles.lang.Class; + /** + * Creates a new configuration used for a path search. + * @param {yfiles.layout.LayoutGraph} graph The graph of the edges whose path will be searched. + * @param {yfiles.layout.GraphGrouping} grouping The grouping information of the graph. + * @param {yfiles.router.polyline.EdgeRouter} edgeRouter The orthogonal layout algorithm using this configuration. + */ + new (graph:yfiles.layout.LayoutGraph,grouping:yfiles.layout.GraphGrouping,edgeRouter:yfiles.router.polyline.EdgeRouter):yfiles.router.polyline.PathSearchConfiguration; + }; + /** + * A pathfinding algorithm that calculates the shortest (that means the cheapest) paths for a set of edges through a + * {@link yfiles.router.polyline.GraphPartition}. + *

+ * It is based on an A*-algorithm and uses + * {@link yfiles.router.polyline.PartitionCell}s as steps between source node and target node. + * In each step, the algorithm takes a {@link yfiles.router.polyline.CellEntrance}, that consists mainly of a PartitionCell and + * from where it was entered, from a queue with all seen CellEntrances, determines all possible neighbor + * cells and their enter intervals and enqueues the resulting CellEntrances. + * To influence the order in which the CellEntrances will be processed, the path search assigns real + * costs (like Dijkstra) as well as heuristic costs (A*-algorithm's heuristic) to the enqueued + * CellEntrances. The real costs arise from entering a neighbor cell, e.g. a bend has to be created, + * while the heuristic costs are an estimation of how expensive it will be to reach the target node continuing the + * path with this neighbor cell. Therefor, the path search prefers searching in the direction where the target node + * lies. The CellEntrance with the lowest combined costs is processed next until a target cell is reached. + *

+ *

+ * {@link yfiles.router.polyline.PathSearchExtension PathSearchExtension}s modify the path search as they are able to add start + * entrances and weigh them with costs. They also add real and heuristic costs to CellEntrances that are + * created for the currently entered PartitionCell and calculate shorter enter intervals that are less + * expensive to pass. + *

+ *

+ * The algorithm gets a {@link yfiles.router.polyline.PathSearchContext} which provides information about the graph and the currently routed + * edge. It also stores the results of the path search that can be retrieved calling + * {@link yfiles.router.polyline.PathSearchContext#pathSearchResult}. + *

+ * @see {@link yfiles.router.polyline.PathSearch#addPathSearchExtension} + * @see {@link yfiles.router.polyline.PathSearch#addAdditionalEnterIntervalCalculator} + */ + export interface PathSearch extends Object{ + /** + * Adds the given extension to the list of path search extensions. + * @param {yfiles.router.polyline.PathSearchExtension} extension The extension to add to this path search. + * @return {boolean} true, if the extension has been added, false otherwise. + */ + addPathSearchExtension(extension:yfiles.router.polyline.PathSearchExtension):boolean; + /** + * Removes the given extension from the list of path search extensions. + * @param {yfiles.router.polyline.PathSearchExtension} extension The extension to remove from the path search. + * @return {boolean} true, if an extension was removed as a result of this call. + */ + removePathSearchExtension(extension:yfiles.router.polyline.PathSearchExtension):boolean; + /** + * Adds a new interval calculator to the list of registered interval calculators. + * @param {yfiles.router.polyline.IEnterIntervalCalculator} enterIntervalCalculator The calculator to add. + * @return {boolean} true, if the calculator could be added, false otherwise. + */ + addAdditionalEnterIntervalCalculator(enterIntervalCalculator:yfiles.router.polyline.IEnterIntervalCalculator):boolean; + /** + * Removes the given interval calculator from the list of registered interval calculators. + * @param {yfiles.router.polyline.IEnterIntervalCalculator} enterIntervalCalculator The calculator to remove. + * @return {boolean} true, if an interval calculator was removed as a result of this call. + */ + removeAdditionalEnterIntervalCalculator(enterIntervalCalculator:yfiles.router.polyline.IEnterIntervalCalculator):boolean; + /** + * Initializes the path search. + *

+ * This method also calls {@link yfiles.router.polyline.PathSearchExtension#initialize} for all registered + * path search extensions. + *

+ * @param {yfiles.router.polyline.PathSearchConfiguration} configuration The configuration, the path search shall use. + */ + init(configuration:yfiles.router.polyline.PathSearchConfiguration):void; + /** + * Resets all registered path search extensions and {@link yfiles.algorithms.DataProviders} added by PathSearch. + * So, + * PathSearch is ready to calculate paths for a new layout. + * @see {@link yfiles.router.polyline.PathSearchExtension#cleanup} + */ + clear():void; + /** + * Returns the path for the given edge, if it has been finalized already. + * @param {yfiles.algorithms.Edge} edge The edge to return the path for. + * @return {yfiles.router.polyline.Path} The finalized path for the given edge or null if no path has been found and finalized. + */ + getFinalizedPath(edge:yfiles.algorithms.Edge):yfiles.router.polyline.Path; + /** + * Finds the path for the current edge in the given context. + * This method: + *
    + *
  • calls {@link yfiles.router.polyline.PathSearchExtension#initializeCurrentEdge} for all extensions
  • + *
  • collects and enqueues all start entrances
  • + *
  • iteratively processes the next cheapest cell entrance and + *
      + *
    • adds a Path result after a {@link yfiles.router.polyline.PathSearch#finalizePath} call if it is a valid target entrance and/or
    • + *
    • calls {@link yfiles.router.polyline.PathSearch#handleNeighbor} for all neighbor cells of the entered cell
    • + *
    + *
  • + *
  • calls {@link yfiles.router.polyline.PathSearchExtension#finalizeCurrentEdge} for all extensions
  • + *
+ */ + findPathsForCurrentEdge(context:yfiles.router.polyline.PathSearchContext):void; + /** + * Decreases the given penalty settings for the current edge. + *

+ * If finding a path for the current edge takes too long according to the maximum duration of the edge router, + * the path search for the current edge is canceled and restarted using decreased penalties. The + * decreaseFactor indicates, how strong the penalties shall be reduced. + *

+ *

+ * If overriding this method please note that the penalty for creating bends should not be reduced as this results + * in more possible turns of the edge path and therefore a longer runtime of the path search. Furthermore not all + * penalties should be decreased equally as these decreases would neutralize each other. + *

+ * @param {yfiles.router.polyline.PenaltySettings} penaltySettings The penalty settings whose penalties shall be reduced. + * @param {number} decreaseFactor + * A factor with values between 0 and 1 that indicates how strong to reduce the penalties. + * 0 means no reduction while 1 means to strongest reduction. + * @param {yfiles.router.polyline.PathSearchContext} context The context of the current path search. + */ + decreasePenaltySettings(penaltySettings:yfiles.router.polyline.PenaltySettings,decreaseFactor:number,context:yfiles.router.polyline.PathSearchContext):void; + /** + * Finds paths for the edges in the given context and stores them in its + * {@link yfiles.router.polyline.PathSearchContext#pathSearchResult PathSearchResult}. + *

+ * It initializes its extensions using {@link yfiles.router.polyline.PathSearchExtension#initializeEdges} and + * delegates the path search for each edge to {@link yfiles.router.polyline.PathSearch#findPathsForCurrentEdge}. + *

+ *

+ * The paths calculations for all edges are finalized by calling the extensions' + * {@link yfiles.router.polyline.PathSearchExtension#finalizeEdges} method and after that the path search result + * if filled with the path for each edge. + *

+ *

+ * At last the extensions are asked to finalize the path search result using their + * {@link yfiles.router.polyline.PathSearchExtension#finalizePathSearchResult} callback. + *

+ * @param {yfiles.router.polyline.PathSearchContext} context The context to use during the path search. + * @see {@link yfiles.router.polyline.PathSearchContext#edges} + * @see {@link yfiles.router.polyline.PathSearchContext#pathSearchResult} + */ + findPaths(context:yfiles.router.polyline.PathSearchContext):void; + /** + * Informs all registered path search extensions about completing a path by calling their + * {@link yfiles.router.polyline.PathSearchExtension#finalizePath finalizePath(Path)} method. + * That way, extensions can collect data about this + * path to use it later in path search. + * @param {yfiles.router.polyline.Path} path The path to finalize. + */ + finalizePath(path:yfiles.router.polyline.Path):void; + /** + * Adds {@link yfiles.router.polyline.CellEntrance}s for every interval through which the neighbor cell can be entered from the current + * entrance to the queue. + * The algorithm calls this method in every step for every neighbor of the current cell to + * collect all next possible entrances for the current path. This path consists of several entrances where each knows + * the entrance they were entered through. + *

+ * After calculating all possible enter intervals to the given neighbor cell, each interval gets rated with costs. + * If there already is an entrance for the neighbor cell whose interval is the same as one of these intervals, this + * entrance will be used and re-enqueued, so the path search can still reach it. The current entrance is set as its + * predecessor within the current path and its enter interval and costs will be updated. + * If there is an entrance for the neighbor cell whose interval is intersected by a current interval, new entrances + * will be created with the new enter intervals and enqueued. The same happens if there is no entrance that matches + * one of the current intervals, yet. Costs will be added. + * If there are some entries afterwards, that are intersected by the current interval and have higher costs, they + * will be removed from the queue. + *

+ * @param {yfiles.router.polyline.CellEntrance} currentEntrance the current cell entrance + * @param {yfiles.router.polyline.PartitionCell} neighborCell the neighbor cell that is handled. + * @param {yfiles.router.polyline.PathSearchContext} context context information + * @see {@link yfiles.router.polyline.PathSearch#calculateCosts} + * @see {@link yfiles.router.polyline.PathSearch#calculateHeuristicCosts} + */ + handleNeighbor(currentEntrance:yfiles.router.polyline.CellEntrance,neighborCell:yfiles.router.polyline.PartitionCell,context:yfiles.router.polyline.PathSearchContext):void; + /** + * Returns the costs for getting from the current {@link yfiles.router.polyline.CellEntrance} to the neighboring {@link yfiles.router.polyline.PartitionCell} using + * different enter intervals. + * It is called by {@link yfiles.router.polyline.PathSearch#handleNeighbor} + * to determine the costs for all {@link yfiles.router.polyline.CellEntrance}s that it will create and enqueue afterwards. + *

+ * The costs for the given enter intervals are retrieved from all registered {@link yfiles.router.polyline.PathSearchExtension PathSearchExtension}s. The calculation stops when it reaches the given maximum cost value. + *

+ * @param {yfiles.router.polyline.CellEntrance} currentEntrance the current cell entrance. + * @param {yfiles.router.polyline.PartitionCell} enteredCell the cell to enter. + * @param {yfiles.router.polyline.OrthogonalInterval[]} enterIntervals the different entering intervals of the entered cell. + * @param {yfiles.router.polyline.EdgeCellInfo[]} lastEdgeCellInfos information about how the last cell was crossed. + * @param {yfiles.router.polyline.PathSearchContext} context context information. + * @param {number[]} costs + * The array the calculated costs for entering the neighbor cell via the according enter intervals + * shall be written to. + * @param {number[]} maxAllowedCosts + * the maximum costs an enter interval may induce. If this cost is exceeded, no further + * additional costs for this interval are calculated. Note that the entries in this + * array get modified during cost calculation + * @see {@link yfiles.router.polyline.PathSearchExtension#calculateCosts} + */ + calculateCosts(currentEntrance:yfiles.router.polyline.CellEntrance,enteredCell:yfiles.router.polyline.PartitionCell,enterIntervals:yfiles.router.polyline.OrthogonalInterval[],lastEdgeCellInfos:yfiles.router.polyline.EdgeCellInfo[],context:yfiles.router.polyline.PathSearchContext,costs:number[],maxAllowedCosts:number[]):void; + /** + * Returns estimated costs for the rest of the path when using the given {@link yfiles.router.polyline.CellEntrance} for the next step in + * path search. + * It is called by {@link yfiles.router.polyline.PathSearch#handleNeighbor} + * to determine the heuristic part of the costs the entrance will be enqueued with. + *

+ * The heuristic costs for the given entrance are retrieved from all registered {@link yfiles.router.polyline.PathSearchExtension PathSearchExtension}s. + *

+ * @param {yfiles.router.polyline.CellEntrance} entrance The current entrance. + * @param {yfiles.router.polyline.PathSearchContext} context Context information. + * @return {number} the heuristic costs for the rest of the past if using the given entrance. + * @see {@link yfiles.router.polyline.PathSearchExtension#calculateHeuristicCosts} + */ + calculateHeuristicCosts(entrance:yfiles.router.polyline.CellEntrance,context:yfiles.router.polyline.PathSearchContext):number; + } + var PathSearch:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + */ + new ():yfiles.router.polyline.PathSearch; + }; + /** + * Represents a group of segments of different edges, that shall be combined at the common source or target side. + *

+ * Grouped edges have the same source or target group id assigned in the data provider registered at the graph with + * the {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} or {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} + * key. + *

+ * The segment group contains the common location range for the edge group and provides a common segment info + * representing the grouped segment infos. + */ + export interface SegmentGroup extends Object{ + /** + * The common location range for the segment infos in this group. + */ + commonLocationRange:yfiles.router.polyline.Interval; + /** + * The segment infos contained in this group. + */ + segmentInfos:yfiles.algorithms.IList; + /** + * The common segment info representing the grouped segment infos. + */ + commonSegmentInfo:yfiles.router.polyline.SegmentInfo; + hashCode():number; + } + var SegmentGroup:{ + $class:yfiles.lang.Class; + /** + * Creates a new segment group. + * @param {yfiles.router.polyline.Interval} commonLocationRange The location range of the segment infos. + * @param {yfiles.algorithms.IList} segmentInfos A list containing the grouped segment infos. + */ + new (commonLocationRange:yfiles.router.polyline.Interval,segmentInfos:yfiles.algorithms.IList):yfiles.router.polyline.SegmentGroup; + }; + /** + * Adds polyline segment to the orthogonal edge paths of a graph. + * The current implementation only adds octilinear segments to all orthogonal edges (non-orthogonal edges are completely ignored). + * Between two succeeding vertical and + * horizontal segments, an octilinear segment is added whose length can be influenced by the + * {@link yfiles.router.polyline.PolylineLayoutStage#maximumNonOrthogonalSegmentRatio maximum non orthogonal segment ratio} and the + * {@link yfiles.router.polyline.PolylineLayoutStage#preferredPolylineSegmentLength preferred polyline segment length}. The new octilinear segments + * keep a {@link yfiles.router.polyline.PolylineLayoutStage#minimalNodeToEdgeDistance minimum distance} between the edges and all nodes in the graph if possible. + */ + export interface PolylineLayoutStage extends yfiles.layout.AbstractLayoutStage{ + /** + * The data provider key used to look up the selected state of the nodes of the graph to be laid out. + * By default, {@link yfiles.layout.LayouterKeys#SELECTED_NODES_DP_KEY} is used. + *

+ * If the sphere of action is set to {@link yfiles.router.SphereOfAction#ROUTE_EDGES_AT_SELECTED_NODES}, only edges of selected nodes are routed + * while all other edges are considered to have fixed routes. + *

+ * @see {@link yfiles.router.polyline.PolylineLayoutStage#sphereOfAction} + * @throws {yfiles.system.ArgumentException} if the specified key is null. + * @see {@link yfiles.router.polyline.PolylineLayoutStage#sphereOfAction} + */ + selectedNodesDpKey:Object; + /** + * The data provider key used to look up the selected state of the edges of the graph to be laid out. + * By default, {@link yfiles.layout.LayouterKeys#SELECTED_EDGES_DP_KEY} is used. + *

+ * If the sphere of action is set to {@link yfiles.router.SphereOfAction#ROUTE_SELECTED_EDGES}, only the selected keys are routed while all + * other edges are considered to have fixed routes. + *

+ * @see {@link yfiles.router.polyline.PolylineLayoutStage#sphereOfAction} + * @throws {yfiles.system.ArgumentException} if the specified key is null. + * @see {@link yfiles.router.polyline.PolylineLayoutStage#sphereOfAction} + */ + selectedEdgesDpKey:Object; + /** + * Determines the (sub-)set of edges to be routed polylinear. + * Default setting is {@link yfiles.router.SphereOfAction#ROUTE_ALL_EDGES}. + * @throws {yfiles.system.ArgumentException} if the given argument is not one of the above constants. + * @see {@link yfiles.router.polyline.PolylineLayoutStage#selectedEdgesDpKey} + * @see {@link yfiles.router.polyline.PolylineLayoutStage#selectedNodesDpKey} + * @see {@link yfiles.router.polyline.PolylineLayoutStage#selectedEdgesDpKey} + * @see {@link yfiles.router.polyline.PolylineLayoutStage#selectedNodesDpKey} + */ + sphereOfAction:yfiles.router.SphereOfAction; + /** + * Specifies the minimal distance between edges and node bounds. + * Default is 10. + * @throws {yfiles.system.ArgumentException} If distance is less than 0. + */ + minimalNodeToEdgeDistance:number; + /** + * The maximum segment length ratio at each end of an orthogonal segment that may get converted into a (non-orthogonal) + * polyline segment. + * Default is 0.5. + * @throws {yfiles.system.ArgumentException} If the ratio is out of bounds. + */ + maximumNonOrthogonalSegmentRatio:number; + /** + * The preferred segment length for (non-orthogonal) polyline segments. + * Default is 50. + * @throws {yfiles.system.ArgumentException} If length is less than 0. + */ + preferredPolylineSegmentLength:number; + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + } + var PolylineLayoutStage:{ + $class:yfiles.lang.Class; + /** + * Initializes this layout stage with the given core layouter. + * @param {yfiles.layout.ILayouter} coreLayouter The core layouter to wrap with this layout stage. + */ + WithCoreLayouter:{ + new (coreLayouter:yfiles.layout.ILayouter):yfiles.router.polyline.PolylineLayoutStage; + }; + new ():yfiles.router.polyline.PolylineLayoutStage; + }; + /** + * Provides the cost penalties that are applied for violating restrictions during a path search. + *

+ * The {@link yfiles.router.polyline.PathSearch} calculates the 'shortest' path from a source to a target at which 'shortest' path means the + * path with the lowest costs. Costs results from violations of restrictions that are defined by the different {@link yfiles.router.polyline.PathSearchExtension}s. This class defines penalties for the various violations. The path search can be + * adapted to specific needs by varying these penalties. In order to avoid a certain violation, the appropriate penalty + * must be increased. + *

+ */ + export interface PenaltySettings extends Object{ + /** + * The penalty for the edge length. + * This penalty will make long routes more expensive than short routes so edges + * will be routed preferably short. + *

+ * Increasing edge length penalty will raise the importance of short edges in relation to all other penalties while + * decreasing this penalty will raise the importance of all other restrictions. A high edge length penalty will + * result in routes that have less bends and more edge crossings to keep the edge as short as possible. + *

+ *

+ * {@link yfiles.router.polyline.PenaltySettings#OPTIMIZATION_EDGE_LENGTHS} is a predefined configuration of PenaltySettings where short + * edges are preferred over a small amount of bends and edge crossings. + *

+ *

+ * By default this value is set to 1. + * The value must be >= 0, otherwise the default value will be assigned. + *

+ */ + edgeLengthPenalty:number; + /** + * The penalty for an edge bend. + * This penalty will make routes with many bends more expensive than routes with + * few or no bends, so edges will have preferably few bends. + *

+ * Increasing bend penalty will raise the importance of avoiding bends in relation to other penalties while + * decreasing this penalty will raise the importance of all other restrictions. A high bend penalty will result in + * routes that will preferably cross other edges instead of bending to avoid other edges. + * When rising edge bend penalty, the resulting route will have more edge crossings. Note that a very low bend + * penalty (less than 1) can lead to squiggles when the algorithm tries to avoid more expensive restrictions. + *

+ *

+ * {@link yfiles.router.polyline.PenaltySettings#OPTIMIZATION_EDGE_BENDS} is a predefined configuration of PenaltySettings where bends are + * expensive and more other edges will be crossed to avoid bending. + *

+ *

+ * By default this value is set to 3. The value must be >= 0, otherwise the default + * value will be assigned. + *

+ */ + bendPenalty:number; + /** + * The penalty for a crossing of two edges. + * This penalty will make routes that cross many other edges more + * expensive than routes that only cross some other edges or no edges at all, so edges preferably won't cross other + * edges. + *

+ * Increasing edge crossing penalty will raise the importance of avoiding edge crossings in relation to other + * penalties while decreasing this penalty will raise the importance of all other restrictions. + * When rising edge crossing penalty, the resulting route will be longer and have more bends because crossing other edges + * needs to be avoided. + *

+ *

+ * {@link yfiles.router.polyline.PenaltySettings#OPTIMIZATION_EDGE_CROSSINGS} is a predefined configuration of PenaltySettings where edge + * crossings are expensive and the routes get favourably longer with more bends to avoid crossing other edges. + *

+ *

+ * By default this value is set to 1. + * The value must be >= 0, otherwise the default value will be assigned. + *

+ */ + edgeCrossingPenalty:number; + /** + * The penalty for an edge crossing a regular node. + * This penalty will make routes that cross normal nodes + * more expensive than routes that avoid crossing nodes, so edges won't preferably cross any nodes. + *

+ * Increasing node crossing penalty will raise the importance of avoiding node crossings in relation to other + * penalties while decreasing this penalty will raise the importance of all other restrictions. + *

+ *

+ * Node crossing penalty should always be one of the highest penalties to make sure that edges go around nodes. + *

+ *

+ * By default this value is set to 30. + * The value must be >= 0, otherwise the default value will be assigned. + *

+ */ + nodeCrossingPenalty:number; + /** + * The penalty for an edge crossing a group node. + * This penalty will make routes that cross group nodes more + * expensive than routes that avoid crossing group nodes, so edges won't preferably cross any group nodes. + *

+ * Increasing group node crossing penalty will raise the importance of avoiding group node crossings in relation to + * other penalties while decreasing this penalty will raise the importance of all other restrictions. + *

+ *

+ * Like {@link yfiles.router.polyline.PenaltySettings#nodeCrossingPenalty node crossing penalty}, this penalty should be one of the highest penalties + * to make sure that these nodes are avoided. But as group nodes may be very large it might be useful to allow group + * node crossings to achieve more direct edge routes. + *

+ */ + groupNodeCrossingPenalty:number; + /** + * The penalty for an edge crossing a node label. + * Getter:This penalty will make routes that cross node labels more + * expensive than routes that avoid crossing node labels, so edges won't preferably cross any node labels. + *

+ * Increasing node label crossing penalty will raise the importance of avoiding node labels crossings in relation to + * other penalties while decreasing this penalty will raise the importance of all other restrictions. A high label + * crossing penalty will cause edges to bend more often to avoid passing straight through the label. + *

+ *

+ * The crossing penalty can be weighted for each label individually using the + * {@link yfiles.router.polyline.EdgeRouter#LABEL_CROSSING_COST_FACTOR_DP_KEY}. + *

+ *

+ * Use {@link yfiles.router.polyline.EdgeRouter#considerNodeLabels} to set whether node labels should be considered when + * routing the edges at all. + *

+ *

+ * Note that this only applies to labels that are placed outside the bounds of their owner nodes as long as the + * {@link yfiles.router.polyline.PenaltySettings#nodeCrossingPenalty node crossing penalty} is higher than the node label crossing penalty. Unless + * the route connects from outside a group to one of its inner nodes, then the node label will also be considered. + *

+ * Setter:This penalty will make routes that cross node labels more + * expensive than routes that avoid crossing node labels, so edges won't preferably cross any node labels. + *

+ * Increasing node label crossing penalty will raise the importance of avoiding node labels crossings in relation to + * other penalties while decreasing this penalty will raise the importance of all other restrictions. A high label + * crossing penalty will cause edges to bend more often to avoid passing straight through the label. + *

+ *

+ * Use {@link yfiles.router.polyline.EdgeRouter#considerNodeLabels} to set whether node labels should be considered when + * routing the edges. + *

+ *

+ * Note that this only applies to labels that are placed outside the bounds of their owner nodes as long as the + * {@link yfiles.router.polyline.PenaltySettings#nodeCrossingPenalty node crossing penalty} is higher than the node label crossing penalty. Unless + * the route connects from outside a group to one of its inner nodes, then the node label will also be considered. + *

+ *

+ * By default this value is set to 13. The value must be >= 0, otherwise the default + * value will be assigned. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#considerNodeLabels} + * @see {@link yfiles.router.polyline.EdgeRouter#considerNodeLabels} + */ + nodeLabelCrossingPenalty:number; + /** + * The penalty for an edge crossing an edge label. + * Getter:This penalty will make routes that cross edge labels of + * fixed edges more expensive than routes that avoid crossing edge labels, so edges won't preferably cross any edge labels + * that belong to fixed edges. + *

+ * Increasing edge label crossing penalty will raise the importance of avoiding edge labels crossings in relation to + * other penalties while decreasing this penalty will raise the importance of all other restrictions. A high label + * crossing penalty will cause edges to bend more often to avoid passing straight through the label. + *

+ *

+ * The crossing penalty can be weighted for each label individually using the + * {@link yfiles.router.polyline.EdgeRouter#LABEL_CROSSING_COST_FACTOR_DP_KEY}. + *

+ *

+ * Use {@link yfiles.router.polyline.EdgeRouter#considerEdgeLabels} to set whether edge labels should be considered when + * routing the edges. + *

+ * Setter:This penalty will make routes that cross edge labels of + * fixed edges more expensive than routes that avoid crossing edge labels, so edges won't preferably cross any edge labels + * that belong to fixed edges. + *

+ * Increasing edge label crossing penalty will raise the importance of avoiding edge labels crossings in relation to + * other penalties while decreasing this penalty will raise the importance of all other restrictions. A high label + * crossing penalty will cause edges to bend more often to avoid passing straight through the label. + *

+ *

+ * Use {@link yfiles.router.polyline.EdgeRouter#considerEdgeLabels} to set whether edge labels should be considered when + * routing the edges. + *

+ *

+ * By default this value is set to 13. The value must be >= 0, otherwise the default + * value will be assigned. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#considerEdgeLabels} + * @see {@link yfiles.router.polyline.EdgeRouter#considerEdgeLabels} + */ + edgeLabelCrossingPenalty:number; + /** + * The penalty for violations of the minimal distance between any edge and any normal node side. + * This + * penalty will make routes that pass normal nodes too close more expensive than routes that keep the specified + * minimal node to edge distance. + *

+ * Increasing minimal node to edge distance penalty will raise the importance of keeping the minimal distance to + * nodes while decreasing this penalty will raise the importance of all other restrictions. A high penalty for + * violating the minimal distance between edges and nodes will produce edges that rather use a long route around + * nodes to keep the specified distance than pass through a small channel between two nodes. + *

+ *

+ * By default this value is set to 10. The value must be >= 0, otherwise the default + * value will be assigned. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#minimalNodeToEdgeDistance} + * @see {@link yfiles.router.polyline.EdgeRouter#minimalNodeToEdgeDistance} + */ + minimalNodeToEdgeDistancePenalty:number; + /** + * The penalty for violations of the minimal distance between any edge and any group node side. + * This penalty will + * make routes that pass group nodes too close more expensive than routes that keep the specified minimal node to edge + * distance. + *

+ * Increasing minimal group node to edge distance penalty will raise the importance of keeping the minimal + * distance to group nodes while decreasing this penalty will raise the importance of all other restrictions. A high + * penalty for violating the minimal distance between edges and group nodes will produce edges that rather use a + * long route around group nodes to keep the specified distance than pass through a small channel between two group + * nodes. + *

+ *

+ * Use {@link yfiles.router.polyline.EdgeRouter#minimalNodeToEdgeDistance} to set the minimal distance. + *

+ *

+ * By default this value is set to 10. The value must be >= 0, otherwise the default + * value will be assigned. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#minimalNodeToEdgeDistance} + * @see {@link yfiles.router.polyline.EdgeRouter#minimalNodeToEdgeDistance} + */ + minimalGroupNodeToEdgeDistancePenalty:number; + /** + * The penalty for violations of the minimal distance between any two edges. + * This penalty will make routes that + * pass other edges too close more expensive than routes that keep the specified minimal edge to edge distance. + *

+ * Increasing minimal edge to edge distance penalty will raise the importance of keeping the minimal distance to + * other edges while decreasing this penalty will raise the importance of all other restrictions. + * When this penalty has a high value, edges will keep the specified distance. This may also reduce the number of + * edge that pass through a small channel between nodes. So, if such a channel is part of the shortest routes for + * many edges, some of them will take a longer way. + *

+ *

+ * Use {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalEdgeToEdgeDistance} to set the minimal distance for a certain + * edge to any other edge. + *

+ *

+ * By default this value is set to 5. The value must be >= 0, otherwise the default + * value will be assigned. + *

+ * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalEdgeToEdgeDistance} + * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalEdgeToEdgeDistance} + */ + minimalEdgeToEdgeDistancePenalty:number; + /** + * The penalty for violations of the minimal distance the edge shall keep from node corners when entering or + * leaving the node. + * This penalty will make routes that end too close to the corner of their source or target node + * more expensive than routes that keep the specified minimal node corner distance. + *

+ * Increasing node corner distance penalty will raise the importance of keeping the minimal distance to the corner + * of the adjacent nodes while decreasing this penalty will raise the importance of all other restrictions. + *

+ *

+ * Use {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalNodeCornerDistance} to set the minimal distance for a certain + * edge. + *

+ *

+ * By default this value is set to 6. The value must be >= 0, otherwise the default + * value will be assigned. + *

+ * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalNodeCornerDistance} + * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalNodeCornerDistance} + */ + minimalNodeCornerDistancePenalty:number; + /** + * The penalty for violations of the minimal length of the first and last segment of an edge. + * This penalty + * will make routes whose first/last bend is too close to their source or target node more expensive than routes that + * keep the specified minimal first/last segment length. + *

+ * Increasing minimal first last segment length penalty will raise the importance of keeping the first and last + * segment as long as they fit the minimal first/last segment length while decreasing this penalty will raise the + * importance of all other restrictions. + *

+ *

+ * Use {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalFirstSegmentLength} to set the minimal length of the first + * segment and {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalLastSegmentLength} to set the minimal length of the + * last segment of a certain edge. + *

+ *

+ * By default this value is set to 12. The value must be >= 0, otherwise the default + * value will be assigned. + *

+ * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalFirstSegmentLength} + * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalLastSegmentLength} + * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalFirstSegmentLength} + * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#minimalLastSegmentLength} + */ + minimalFirstLastSegmentLengthPenalty:number; + /** + * The penalty for an edge bend being closer to the border of the source node, the target node or one of their + * ancestor group nodes than the minimal node to edge distance. + * This penalty will make routes that bend too close to + * their source or target node more expensive than routes that keep the specified minimal node to edge distance. + *

+ * Increasing bends in node to edge distance penalty will raise the importance of avoiding bends that violate the + * minimal node to edge distance while decreasing this penalty will raise the importance of all other restrictions. + * This penalty supports {@link yfiles.router.polyline.EdgeRouter#minimalNodeToEdgeDistance}. In case the path search finally reaches + * the target node, the minimal node to edge distance for this node must be violated. Punishing bends too close to + * the node forces the edge to directly cross this distance and connect to the node. + *

+ *

+ * By default this value is set to 10. The value must be >= 0, otherwise the default + * value will be assigned. In principle, this penalty can always be set to the same value as + * {@link yfiles.router.polyline.PenaltySettings#minimalNodeToEdgeDistancePenalty} since they are used for the same feature. + *

+ * @see {@link yfiles.router.polyline.EdgeRouter#minimalNodeToEdgeDistance} + * @see {@link yfiles.router.polyline.EdgeRouter#minimalNodeToEdgeDistance} + */ + bendsInNodeToEdgeDistancePenalty:number; + /** + * The penalty for violation the monotonic path restrictions of an edge. + * This penalty will make routes with + * detours more expensive than routes that stay monotone. + *

+ * Increasing monotony violation penalty will raise the importance of avoiding detours in the specified direction + * while decreasing this penalty will raise the importance of all other restrictions. + *

+ *

+ * Use {@link yfiles.router.polyline.EdgeLayoutDescriptor#monotonicPathRestriction} to set the monotonic path restrictions of a + * certain edge. + *

+ *

+ * By default this value is set to 14. The value must be >= 0, otherwise the default + * value will be assigned. + *

+ * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#monotonicPathRestriction} + * @see {@link yfiles.router.polyline.EdgeLayoutDescriptor#monotonicPathRestriction} + */ + monotonyViolationPenalty:number; + /** + * The penalty for an edge leaving and reentering in the same partition grid cell. + * This penalty will make + * routes that reenter the same partition grid cell more expensive than routes taking a more direct way. + *

+ * Increasing partition grid reentrance penalty will raise the importance of taking the most direct way through the + * partition grid while decreasing this penalty will raise the importance of all other restrictions. + *

+ *

+ * By default this value is set to 7. The value must be >= 0, otherwise the default + * value will be assigned. + *

+ */ + partitionGridCellReentrancePenalty:number; + /** + * The penalty if an edge does not comply with its{@link yfiles.layout.PortCandidate}s or {@link yfiles.layout.PortConstraint}s. + * This penalty will make routes that start or end on a point that doesn't answer to its + * port constraints more expensive than routes that obey them. + *

+ * Increasing port violation penalty will raise the importance of keeping port constraints while decreasing this + * penalty will raise the importance of all other restrictions. It is recommended to have high penalties for port + * violation since the constraints loose purpose if they are disregarded. + *

+ *

+ * By default this value is set to 115. The value must be >= 0, otherwise the default + * value will be assigned. + *

+ * @see {@link yfiles.layout.PortCandidate} + * @see {@link yfiles.layout.PortConstraint} + * @see {@link yfiles.layout.PortCandidate} + * @see {@link yfiles.layout.PortConstraint} + */ + portViolationPenalty:number; + /** + * The penalty for an edge with a group id that is not grouped at source or target side. + * This penalty will make + * routes for grouped edges that don't use partly the same path as the other edges in this group more expensive than + * routes that stick to the group. + *

+ * Increasing invalid edge grouping penalty will raise the importance of grouping edges with the same group id while + * decreasing this penalty will raise the importance of all other restrictions. + * As edge groups require that the route of an edge belonging to an edge group stays partly identical to the other + * edges of the group, the route may not be the optimal way regarding the other restrictions. To keep the edges + * together as long as possible this penalty should be higher than most others. + *

+ *

+ * Grouped edges have the same source or target group id assigned in the data provider registered at the graph with + * the {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} or + * {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} key. + *

+ *

+ * By default this value is set to 25. The value must be >= 0, otherwise the default + * value will be assigned. + *

+ * @see {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} + * @see {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} + * @see {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} + * @see {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} + */ + invalidEdgeGroupingPenalty:number; + /** + * Creates a copy of this instance. + * Uses {@link yfiles.router.polyline.PenaltySettings#newInstance} to get a new instance. + * @return {yfiles.router.polyline.PenaltySettings} a copy of this instance + */ + createCopy():yfiles.router.polyline.PenaltySettings; + /** + * Factory method, which is used by {@link yfiles.router.polyline.PenaltySettings#createCopy}. + * Subclasses can override this method in order to return a + * more specialized version. + * @return {yfiles.router.polyline.PenaltySettings} + * a specialized {@link yfiles.router.polyline.PenaltySettings} + */ + newInstance():yfiles.router.polyline.PenaltySettings; + } + var PenaltySettings:{ + $class:yfiles.lang.Class; + /** + * Optimization strategy that balances bends and edge crossings in the edge routes. + * These are the default settings. + */ + OPTIMIZATION_BALANCED:yfiles.router.polyline.PenaltySettings; + /** + * Optimization strategy that minimizes bends in the edge routes. + * Edges may cross other edges to prevent bending to + * run around them. + */ + OPTIMIZATION_EDGE_BENDS:yfiles.router.polyline.PenaltySettings; + /** + * Optimization strategy that minimizes edge crossings in the edge routes. + * This may cause more bends. + */ + OPTIMIZATION_EDGE_CROSSINGS:yfiles.router.polyline.PenaltySettings; + /** + * Optimization strategy that minimizes the length of the edge routes. + * There may be more edge crossings. + */ + OPTIMIZATION_EDGE_LENGTHS:yfiles.router.polyline.PenaltySettings; + /** + * Creates a new instance. + */ + new ():yfiles.router.polyline.PenaltySettings; + }; + /** + * Stores information about the possible location of an orthogonal edge segment. + * Most notable, SegmentInfo holds the segment's direction and the interval that restricts the segment's location. + */ + export interface SegmentInfo extends yfiles.router.polyline.AbstractSegmentInfo{ + /** + * Returns the number of {@link yfiles.router.polyline.CellSegmentInfo} of this segment info. + * @return {number} + * the number of {@link yfiles.router.polyline.CellSegmentInfo} of this segment info + */ + cellSegmentInfoCount():number; + /** + * Returns the {@link yfiles.router.polyline.CellSegmentInfo} at the given index of this segment info. + * @param {number} index + * index of the {@link yfiles.router.polyline.CellSegmentInfo} to return + * @return {yfiles.router.polyline.CellSegmentInfo} + * the {@link yfiles.router.polyline.CellSegmentInfo} at the given index of this segment info + */ + getCellSegmentInfo(index:number):yfiles.router.polyline.CellSegmentInfo; + /** + * The segment group for this segment info and its cell segment infos and adjusts their{@link yfiles.router.polyline.AbstractSegmentInfo#locationRange}s to use the {@link yfiles.router.polyline.SegmentGroup#commonLocationRange}. + * @see {@link yfiles.router.polyline.SegmentGroup} + * @see Overrides {@link yfiles.router.polyline.AbstractSegmentInfo#segmentGroup} + */ + segmentGroup:yfiles.router.polyline.SegmentGroup; + /** + * Determines whether or not this edge segment has the restriction of a strong port constraint. + */ + atStrongPortConstraint:boolean; + } + var SegmentInfo:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance for the segment. + * @param {yfiles.algorithms.Edge} edge The edge the segment of this info belongs to. + * @param {number} segmentIndex The index of the segment this info belongs to. + * @param {yfiles.layout.Direction} direction The direction the segment points to. + * @param {yfiles.router.polyline.Interval} locationRange The range the common location of this segment has to be inside. + * @param {yfiles.router.polyline.Interval} minExtension The minimal interval in extension direction this segment is known to intersect. + * @param {yfiles.router.polyline.Interval} maxExtension The maximum interval in extension direction this segment will span. + * @param {yfiles.algorithms.IList} cellSegmentInfos A list of cell segment infos this segment info is build upon. + */ + WithCompleteSpecification:{ + new (edge:yfiles.algorithms.Edge,segmentIndex:number,direction:yfiles.layout.Direction,locationRange:yfiles.router.polyline.Interval,minExtension:yfiles.router.polyline.Interval,maxExtension:yfiles.router.polyline.Interval,cellSegmentInfos:yfiles.algorithms.IList):yfiles.router.polyline.SegmentInfo; + }; + /** + * Creates a new instance using a line segment to describe the edge segment. + *

+ * This constructor is meant to be used for fixed orthogonal edge segments already knowing their extension and location. + *

+ * @param {yfiles.algorithms.Edge} edge The edge this segment info belongs to. + * @param {number} segmentIndex The index of the segment this info belongs to. + * @param {yfiles.algorithms.LineSegment} segment A line segment describing the edge segment. + */ + new (edge:yfiles.algorithms.Edge,segmentIndex:number,segment:yfiles.algorithms.LineSegment):yfiles.router.polyline.SegmentInfo; + }; + export interface PartitionCellKeysCompanion extends Object{ + } + var PartitionCellKeysCompanion:{ + $class:yfiles.lang.Class; + /** + * The key references a {@link yfiles.algorithms.IList} of nodes whose bounds are covering a certain {@link yfiles.router.polyline.PartitionCell}. + */ + NODES_KEY:Object; + /** + * The key references a {@link yfiles.algorithms.IList} of nodes being in node to edge distance to a certain {@link yfiles.router.polyline.PartitionCell}. + */ + NODES_IN_NODE_TO_EDGE_DISTANCE_KEY:Object; + /** + * The key references a {@link yfiles.algorithms.IList} of {@link yfiles.layout.INodeLabelLayout}s covering a certain {@link yfiles.router.polyline.PartitionCell}. + */ + NODE_LABEL_LAYOUTS_KEY:Object; + /** + * The key references a {@link yfiles.algorithms.IList} of {@link Number}s representing factors that are multiplied + * with an edge's {@link yfiles.router.polyline.PenaltySettings#nodeLabelCrossingPenalty node label crossing cost}s if the edge crosses + * the corresponding {@link yfiles.layout.INodeLabelLayout} registered by the key {@link yfiles.router.polyline.PartitionCellKeysCompanion#NODE_LABEL_LAYOUTS_KEY}. + */ + NODE_LABEL_CROSSING_COST_FACTORS_KEY:Object; + /** + * The key references a {@link yfiles.algorithms.IList} of {@link yfiles.layout.IEdgeLabelLayout}s covering a certain {@link yfiles.router.polyline.PartitionCell}. + */ + EDGE_LABEL_LAYOUTS_KEY:Object; + /** + * The key references a {@link yfiles.algorithms.IList} of {@link Number}s representing factors that are multiplied + * with an edge's {@link yfiles.router.polyline.PenaltySettings#edgeLabelCrossingPenalty edge label crossing cost}s + * if the edge crosses the corresponding {@link yfiles.layout.IEdgeLabelLayout} registered by the key {@link yfiles.router.polyline.PartitionCellKeysCompanion#EDGE_LABEL_LAYOUTS_KEY}. + */ + EDGE_LABEL_CROSSING_COST_FACTORS_KEY:Object; + /** + * The key references the {@link yfiles.layout.PartitionCellId} of the partition grid cell covering + * a certain {@link yfiles.router.polyline.PartitionCell}. + */ + PARTITION_GRID_CELL_ID_KEY:Object; + /** + * The key references the row index of the partition grid cell covering a certain {@link yfiles.router.polyline.PartitionCell}. + */ + PARTITION_GRID_ROW_INDEX_KEY:Object; + /** + * The key references the column index of the partition grid cell covering a certain {@link yfiles.router.polyline.PartitionCell}. + */ + PARTITION_GRID_COLUMN_INDEX_KEY:Object; + }; + /** + * This interface defines keys to obtain additional information about a {@link yfiles.router.polyline.PartitionCell}. + * Use {@link yfiles.router.polyline.PartitionCell#getData} to get the data associated to a given key for the current + * partition cell. + */ + export interface IPartitionCellKeys extends Object{ + } + var IPartitionCellKeys:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class represents a one-dimensional, closed interval. + */ + export interface Interval extends Object{ + /** + * The lower bound of the interval. + */ + min:number; + /** + * The upper bound of the interval. + */ + max:number; + /** + * The midpoint of the interval. + */ + center:number; + /** + * Checks if the given value is inside the interval. + * @param {number} value the value to check + * @return {boolean} true, if the value is inside the interval, false otherwise. + */ + contains(value:number):boolean; + /** + * The size of the interval. + */ + size:number; + /** + * Checks if this interval intersects the given interval. + * This means that both intervals have at least one common + * value. + * @param {yfiles.router.polyline.Interval} other the other interval to check + * @return {boolean} true, if the intervals have at least one common value, false otherwise. + */ + intersects(other:yfiles.router.polyline.Interval):boolean; + /** + * Checks if this interval intersects the given interval and the intersection has a length of at least + * minIntersection. + * @param {yfiles.router.polyline.Interval} other the other interval to check + * @param {number} minIntersection the minimal length the intervals have to intersect + * @return {boolean} + * true, if the intervals intersect by at least minIntersection, false + * otherwise. + */ + intersectsWithOtherAndMinIntersection(other:yfiles.router.polyline.Interval,minIntersection:number):boolean; + /** + * Returns the distance between the value and the interval. + *

+ * If this interval contains the specified value, the distance is 0. Otherwise, it is the minimum of dist(value, lower + * bound) and dist(value, upper bound). + *

+ * @param {number} value the value to calculate the distance to + * @return {number} the distance between the value and the interval + */ + distanceTo(value:number):number; + /** + * Returns the distance between this interval and the given interval. + *

+ * If the intervals {@link yfiles.router.polyline.Interval#intersects}, the distance is 0. Otherwise, it is dist(minimum of upper bounds, maximum of + * lower bounds)." + *

+ * @param {yfiles.router.polyline.Interval} other the other interval to calculate the distance to + * @return {number} the distance between this interval and the given interval + */ + distanceToWithOther(other:yfiles.router.polyline.Interval):number; + /** + * Checks if the given interval covers this interval fully. + *

+ * The given interval covers this interval, if lower bound other - epsilon <= lower bound this and + * upper bound this <= upper bound other + epsilon where epsilon is a small value. + *

+ * @param {yfiles.router.polyline.Interval} other the other interval + * @return {boolean} true if this interval is fully covered by the other interval, false otherwise. + */ + coveredBy(other:yfiles.router.polyline.Interval):boolean; + /** + * Checks if the given interval covers this interval fully. + *

+ * The given interval covers this interval, if lower bound other - epsilon <= lower bound this and + * upper bound this <= upper bound other + epsilon. + *

+ * @param {yfiles.router.polyline.Interval} other the other interval + * @param {number} eps The epsilon value the range of the other interval is extended. + * @return {boolean} true if this interval is fully covered by the other interval, false otherwise. + */ + coveredByWithOtherAndEps(other:yfiles.router.polyline.Interval,eps:number):boolean; + /** + * Returns the interval bound that is closest to the given value. + * @param {number} value the value to get the closest interval bound for + * @return {number} + * value, if the given value is inside the interval, the lower bound if the given value is + * lesser than or equal the lower bound and the upper bound if the given value is greater than or equal the upper + * bound. + */ + getClosest(value:number):number; + /** + * Checks if the upper bound of this interval is lesser than the lower bound of the given interval. + * @param {yfiles.router.polyline.Interval} other the interval to compare. + * @return {boolean} true if the current interval is left of the given one, false otherwise. + */ + isLessThan(other:yfiles.router.polyline.Interval):boolean; + /** + * Checks if the lower bound of this interval is greater than the upper bound of the given interval. + * @param {yfiles.router.polyline.Interval} other the interval to compare. + * @return {boolean} true if the current interval is right of the given one, false otherwise. + */ + isGreaterThan(other:yfiles.router.polyline.Interval):boolean; + /** + * Returns a string representation of this interval. + * @return {string} a string representation of this interval + */ + toString():string; + /** + * Checks if this interval and the given interval cover about the same range. + *

+ * The intervals are considered to cover the same range, if their minimum values as well as their maximum values differ + * only in an epsilon value. + *

+ * @param {yfiles.router.polyline.Interval} other the other interval + * @return {boolean} true if the intervals cover the same range, false otherwise. + */ + hasSameRange(other:yfiles.router.polyline.Interval):boolean; + /** + * Checks if this interval and the given interval cover the same range. + * @param {yfiles.router.polyline.Interval} other the other interval + * @param {number} eps The maximum distance between the two minimum and the two maximum values. + * @return {boolean} true if the intervals cover the same range, false otherwise. + */ + hasSameRangeWithOtherAndEps(other:yfiles.router.polyline.Interval,eps:number):boolean; + /** + * Checks if this interval equals the given interval. + *

+ * Two intervals are equal if the have the same lower and upper bounds. + *

+ * @param {Object} other the other interval + * @return {boolean} true if this and the given interval are equal, false otherwise. + */ + equals(other:Object):boolean; + /** + * Returns the hash code for this interval. + * @return {number} the hash code for this interval. + */ + hashCode():number; + } + var Interval:{ + $class:yfiles.lang.Class; + /** + * Creates a new interval between the given bounds. + * Determines automatically the upper and lower bound of the two + * given values. + * @param {number} bound1 the first interval bound + * @param {number} bound2 the second interval bound + */ + new (bound1:number,bound2:number):yfiles.router.polyline.Interval; + /** + * Returns the intersection of the given intervals. + *

+ * The intersection is null if the given intervals do not intersect. Otherwise the intersection is + * [maximum lower bounds, minimum upper bounds]. + *

+ * @param {yfiles.router.polyline.Interval} i1 the first interval + * @param {yfiles.router.polyline.Interval} i2 the second interval + * @return {yfiles.router.polyline.Interval} the intersection of the given intervals or null if the intervals do not intersect. + */ + calculateIntersection(i1:yfiles.router.polyline.Interval,i2:yfiles.router.polyline.Interval):yfiles.router.polyline.Interval; + /** + * Returns the union of the given intervals. + *

+ * The union is [minimum lower bounds, maximum upper bounds]. + *

+ * @param {yfiles.router.polyline.Interval} i1 the first interval + * @param {yfiles.router.polyline.Interval} i2 the second interval + * @return {yfiles.router.polyline.Interval} the union of the given intervals. + */ + calculateUnionWithIntervalAndInterval(i1:yfiles.router.polyline.Interval,i2:yfiles.router.polyline.Interval):yfiles.router.polyline.Interval; + /** + * Returns the union of the given interval and the given value. + *

+ * The union is between the + * minimal of the lower bound of interval and value and the maximum of the upper bound of + * interval and value. + *

+ * @param {yfiles.router.polyline.Interval} interval the interval to extend + * @param {number} value the value to be in the union + * @return {yfiles.router.polyline.Interval} the union of the given interval and the given value. + */ + calculateUnion(interval:yfiles.router.polyline.Interval,value:number):yfiles.router.polyline.Interval; + /** + * Returns the bridging interval between the given intervals. + *

+ * The bridging interval is null if the given intervals intersect. Otherwise the bridging interval is + * [minimum upper bounds, maximum lower bounds]. + *

+ * @param {yfiles.router.polyline.Interval} i1 the first interval + * @param {yfiles.router.polyline.Interval} i2 the second interval + * @return {yfiles.router.polyline.Interval} the bridging interval between the given intervals or null if the intervals intersect. + */ + calculateBridge(i1:yfiles.router.polyline.Interval,i2:yfiles.router.polyline.Interval):yfiles.router.polyline.Interval; + /** + * Returns the spanning rectangle between the given intervals. + *

+ * The first interval spans the rectangle in horizontal dimension, the second interval in vertical dimension. + *

+ * @param {yfiles.router.polyline.Interval} horizontal the interval that defines the location and length of the rectangle in horizontal dimension + * @param {yfiles.router.polyline.Interval} vertical the interval that defines the location and length of the rectangle in vertical dimension + * @return {yfiles.algorithms.YRectangle} the spanning rectangle between the given intervals. + */ + calculateSpanningRectangle(horizontal:yfiles.router.polyline.Interval,vertical:yfiles.router.polyline.Interval):yfiles.algorithms.YRectangle; + }; + /** + * Divides a rectangular area into one or more {@link yfiles.router.polyline.PartitionCell}s. + * Partition cells have to be disjoint. The union of all partition cells covers the original area. + */ + export interface IPartition extends Object{ + /** + * Returns a list of all {@link yfiles.router.polyline.PartitionCell}s that are neighbors of the given cell, this means those cells have a + * common border segment with the given cell. + * @param {yfiles.router.polyline.PartitionCell} cell The cell to get the neighbors for. + * @return {yfiles.algorithms.IList} + * A list of {@link yfiles.router.polyline.PartitionCell}s that are neighbors of the given cell. + * @see Specified by {@link yfiles.router.polyline.IPartition#getNeighbors}. + */ + getNeighbors(cell:yfiles.router.polyline.PartitionCell):yfiles.algorithms.IList; + /** + * Returns a list of all {@link yfiles.router.polyline.PartitionCell}s that intersect or cover the given rectangle. + * @param {yfiles.algorithms.YRectangle} rect The rectangular area to get (partially) covered cells for. + * @return {yfiles.algorithms.IList} + * A list containing (partially) covered {@link yfiles.router.polyline.PartitionCell}s. + * @see Specified by {@link yfiles.router.polyline.IPartition#getCells}. + */ + getCells(rect:yfiles.algorithms.YRectangle):yfiles.algorithms.IList; + /** + * The rectangular area that is partitioned. + * @see Specified by {@link yfiles.router.polyline.IPartition#bounds}. + */ + bounds:yfiles.algorithms.YRectangle; + } + var IPartition:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A {@link yfiles.router.polyline.IPartition} that takes a list of {@link yfiles.router.polyline.Obstacle}s as input to subdivide an area into {@link yfiles.router.polyline.PartitionCell}s. + *

+ * Implementations have to satisfy the following condition for each pair of obstacle and partition cell: + * Obstacles either completely cover partition cells or do not intersect partition cells at all. + *

+ *

+ *

+ * + *
+ *
+ * Fig 1: Example of an obstacle partition of a graph consisting of two gray colored nodes connected by one edge. + * The two nodes are considered to be obstacles. The blue colored partition cells subdivide the area such that + * each obstacle either completely covers a partition cell or do not intersect with a partition cell. + *
+ *

+ */ + export interface IObstaclePartition extends Object,yfiles.router.polyline.IPartition{ + /** + * Initializes a new partition of the area with the given bounds using the list of {@link yfiles.router.polyline.Obstacle}s. + * @param {yfiles.algorithms.IList} obstacles + * A list of {@link yfiles.router.polyline.Obstacle}s that shall be considered by the partition. + * @param {yfiles.algorithms.YRectangle} bounds The bounds of the partition. + * @see Specified by {@link yfiles.router.polyline.IObstaclePartition#init}. + */ + init(obstacles:yfiles.algorithms.IList,bounds:yfiles.algorithms.YRectangle):void; + /** + * Returns all obstacles that cover the given partition cell. + * @param {yfiles.router.polyline.PartitionCell} cell The cell to get the obstacles for. + * @return {yfiles.algorithms.IList} + * An unmodifiable list of {@link yfiles.router.polyline.Obstacle} instances that cover the given cell. + * @see Specified by {@link yfiles.router.polyline.IObstaclePartition#getObstacles}. + */ + getObstacles(cell:yfiles.router.polyline.PartitionCell):yfiles.algorithms.IList; + /** + * Returns all cells that are completely covered by the given obstacle. + * @param {yfiles.router.polyline.Obstacle} obstacle The obstacle to get the covered cells for. + * @return {yfiles.algorithms.IList} + * An unmodifiable list of {@link yfiles.router.polyline.PartitionCell} instances that are + * completely covered by the given obstacle. + * @see Specified by {@link yfiles.router.polyline.IObstaclePartition#getCellsWithObstacle}. + */ + getCellsWithObstacle(obstacle:yfiles.router.polyline.Obstacle):yfiles.algorithms.IList; + /** + * Clears the partition data so the ObstaclePartition can be reused and + * {@link yfiles.router.polyline.IObstaclePartition#init initialized} with new Obstacles. + * @see Specified by {@link yfiles.router.polyline.IObstaclePartition#clear}. + */ + clear():void; + } + var IObstaclePartition:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A horizontal or vertical {@link yfiles.router.polyline.Interval} that additionally stores a y- (in the horizontal case) or x-coordinate (in + * the vertical case). + *

+ * During a {@link yfiles.router.polyline.PathSearch}, orthogonal intervals are used to describe where an edge enters or leaves a + * {@link yfiles.router.polyline.PartitionCell}. + *

+ * @see {@link yfiles.router.polyline.PathSearch} + */ + export interface OrthogonalInterval extends Object{ + /** + * Determines whether the orthogonal interval is oriented vertically. + */ + vertical:boolean; + /** + * The lower bound of the orthogonal interval. + */ + min:number; + /** + * The upper bound of the orthogonal interval. + */ + max:number; + /** + * The length of the orthogonal interval. + * @see {@link yfiles.router.polyline.Interval#size} + */ + size:number; + /** + * The range of this orthogonal interval. + */ + range:yfiles.router.polyline.Interval; + /** + * The vertical coordinate for horizontal intervals or the horizontal coordinate for vertical intervals, + * respectively. + */ + location:number; + /** + * The center of this orthogonal interval in the 2d-coordinate system. + */ + center:yfiles.algorithms.YPoint; + /** + * Determines whether this orthogonal interval crosses the given one. + *

+ * The orthogonal intervals must have different orientations. + *

+ * @param {yfiles.router.polyline.OrthogonalInterval} other The other orthogonal interval. + * @return {boolean} true if this orthogonal interval crosses the given one, false otherwise. + * @throws {yfiles.system.ArgumentException} if orthogonal intervals have same orientation + */ + crosses(other:yfiles.router.polyline.OrthogonalInterval):boolean; + /** + * Returns the distance of the {@link yfiles.router.polyline.OrthogonalInterval#range}s of this orthogonal interval and the given orthogonal interval. + *

+ * The orthogonal intervals must have same orientation. + *

+ * @param {yfiles.router.polyline.OrthogonalInterval} other The second orthogonal interval. + * @return {number} + * 0 if the orthogonal intervals {@link yfiles.router.polyline.OrthogonalInterval#intersects}, otherwise the + * minimal distance between the orthogonal intervals. + * @throws {yfiles.system.ArgumentException} if the orthogonal intervals have different orientations + */ + distanceTo(other:yfiles.router.polyline.OrthogonalInterval):number; + /** + * Returns the manhattan distance of this orthogonal interval and the given orthogonal interval. + *

+ * If both intervals have the same orientation, the manhattan distance is the sum of the distance between the intervals' + * ranges and the distance between the intervals' locations. + *

+ *

+ * If the intervals have different orientations, the manhattan distance is the sum of the distances between one + * interval's range with the other interval's location. + *

+ * @param {yfiles.router.polyline.OrthogonalInterval} other The second orthogonal interval. + * @return {number} The manhattan distance between this interval and the given one. + */ + manhattanDistanceTo(other:yfiles.router.polyline.OrthogonalInterval):number; + /** + * Checks if this orthogonal interval intersects the given orthogonal interval. + *

+ * Orthogonal intervals intersect each other, if their ranges intersect each other. The location of both orthogonal + * intervals is ignored. The orthogonal intervals must have same orientation. + *

+ * @param {yfiles.router.polyline.OrthogonalInterval} other the second orthogonal interval. + * @return {boolean} true if both orthogonal intervals intersect, false otherwise. + * @throws {yfiles.system.ArgumentException} if the orthogonal intervals have different orientations + * @see {@link yfiles.router.polyline.PartitionCell} + */ + intersects(other:yfiles.router.polyline.OrthogonalInterval):boolean; + /** + * Checks if this orthogonal interval intersects the given orthogonal interval and the intersection has a minimal + * size of minIntersection. + *

+ * Orthogonal intervals intersect each other, if their ranges intersect each other by at least + * minIntersection. The location of both orthogonal intervals is ignored. The orthogonal intervals must + * have same orientation. + *

+ * @param {yfiles.router.polyline.OrthogonalInterval} other the second orthogonal interval. + * @param {number} minIntersection The minimal size of the intersection. + * @return {boolean} true if both orthogonal intervals intersect, false otherwise. + * @throws {yfiles.system.ArgumentException} if the orthogonal intervals have different orientations + * @see {@link yfiles.router.polyline.PartitionCell} + */ + intersectsWithOtherAndMinIntersection(other:yfiles.router.polyline.OrthogonalInterval,minIntersection:number):boolean; + /** + * Checks if the given orthogonal interval covers this one fully. + *

+ * The given orthogonal interval covers this orthogonal interval, if this interval's range is covered by the given + * interval's range. The location of both orthogonal intervals is ignored. The orthogonal intervals must have same + * orientation. + *

+ * @param {yfiles.router.polyline.OrthogonalInterval} other The other orthogonal interval + * @return {boolean} + * true, if this orthogonal interval is fully covered by the other orthogonal interval, + * false otherwise. + * @throws {yfiles.system.ArgumentException} if the orthogonal intervals have different orientations + * @see {@link yfiles.router.polyline.PartitionCell} + */ + coveredBy(other:yfiles.router.polyline.OrthogonalInterval):boolean; + /** + * Checks if this orthogonal interval and the given orthogonal interval cover the same range. + *

+ * If both orthogonal intervals cover the same range, they are considered same. The location of both orthogonal + * intervals is ignored. The orthogonal intervals must have same orientation. + *

+ * @param {yfiles.router.polyline.OrthogonalInterval} other The second orthogonal interval + * @return {boolean} true, if the orthogonal intervals cover the same range, false otherwise. + * @throws {yfiles.system.ArgumentException} if the orthogonal intervals have different orientations + * @see {@link yfiles.router.polyline.PartitionCell} + */ + hasSameRange(other:yfiles.router.polyline.OrthogonalInterval):boolean; + toString():string; + } + var OrthogonalInterval:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the from and to value as interval bounds. + * @param {number} from the start of the interval bounds + * @param {number} to the end of the interval bounds + * @param {number} location the location in the 2D coordinate system + * @param {boolean} isVertical + * true, if the orthogonal interval is vertical; false, if it is + * horizontal vertical. + */ + FromCoordinates:{ + new (from:number,to:number,location:number,isVertical:boolean):yfiles.router.polyline.OrthogonalInterval; + }; + /** + * Creates a new instance using the range as interval bounds. + * @param {yfiles.router.polyline.Interval} range the range + * @param {number} location the location in the 2D coordinate system + * @param {boolean} isVertical + * true, if the orthogonal interval is vertical; false, if it is + * horizontal. + * @throws {yfiles.system.ArgumentException} if range is null + */ + new (range:yfiles.router.polyline.Interval,location:number,isVertical:boolean):yfiles.router.polyline.OrthogonalInterval; + /** + * Calculates the intersection of the given orthogonal intervals. + *

+ * If the created orthogonal interval is vertical, it will have the same horizontal location as i2 and the shared + * vertical range of both intervals. If it is horizontal, it will have the same vertical location as i2 and the shared + * horizontal range of both intervals. The orthogonal intervals must have same orientation. + *

+ * @param {yfiles.router.polyline.OrthogonalInterval} i1 The first orthogonal interval. + * @param {yfiles.router.polyline.OrthogonalInterval} i2 The second orthogonal interval. + * @return {yfiles.router.polyline.OrthogonalInterval} The shared orthogonal interval of both given orthogonal intervals. + * @throws {yfiles.system.ArgumentException} if the orthogonal intervals have different orientations + * @see {@link yfiles.router.polyline.OrthogonalInterval#intersectsWithOtherAndMinIntersection} + */ + calculateIntersection(i1:yfiles.router.polyline.OrthogonalInterval,i2:yfiles.router.polyline.OrthogonalInterval):yfiles.router.polyline.OrthogonalInterval; + /** + * Calculates the union of the given orthogonal intervals. + *

+ * If the created orthogonal interval is vertical, it will have the same horizontal location as i2 and the shared + * vertical range of both orthogonal intervals. If it is horizontal, it will have the same vertical location as i2 and + * the shared vertical range of both orthogonal intervals. The orthogonal intervals must have same orientation. + *

+ * @param {yfiles.router.polyline.OrthogonalInterval} i1 The first orthogonal interval. + * @param {yfiles.router.polyline.OrthogonalInterval} i2 The second orthogonal interval. + * @return {yfiles.router.polyline.OrthogonalInterval} The union of both given orthogonal intervals. + * @throws {yfiles.system.ArgumentException} if the orthogonal intervals have different orientations + * @see {@link yfiles.router.polyline.OrthogonalInterval#intersectsWithOtherAndMinIntersection} + */ + calculateUnion(i1:yfiles.router.polyline.OrthogonalInterval,i2:yfiles.router.polyline.OrthogonalInterval):yfiles.router.polyline.OrthogonalInterval; + }; + /** + * Represents a rectangular part of the {@link yfiles.router.polyline.IPartition} as result of the decomposition process. + * Each instance of + * PartitionCell provides a data store ({@link yfiles.router.polyline.PartitionCell#putData}, {@link yfiles.router.polyline.PartitionCell#getData} and {@link yfiles.router.polyline.PartitionCell#removeData}) that could be used to bind additional information to it, e.g. what element of the graph is + * covered by this PartitionCell. + * @see {@link yfiles.router.polyline.IPartitionCellKeys} + */ + export interface PartitionCell extends Object{ + /** + * Stores additional data to which the given key is mapped for this partition cell. + * @param {Object} key The key with which the given data is to be associated. + * @param {Object} data The additional data. + * @return {Object} The previous data associated with key, or null if there was no mapping for key. + * @see {@link yfiles.router.polyline.PartitionCell#getData} + * @see {@link yfiles.router.polyline.PartitionCell#removeData} + * @see {@link yfiles.router.polyline.PartitionCell#clearData} + * @see {@link yfiles.router.polyline.IPartitionCellKeys} + */ + putData(key:Object,data:Object):Object; + /** + * Returns additional data to which the given key is mapped for this partition cell. + * @param {Object} key The Key with which the given data is to be associated. + * @return {Object} The additional data to which the given key is mapped, or null if there was no mapping for key. + * @see {@link yfiles.router.polyline.PartitionCell#putData} + * @see {@link yfiles.router.polyline.PartitionCell#removeData} + * @see {@link yfiles.router.polyline.PartitionCell#clearData} + * @see {@link yfiles.router.polyline.IPartitionCellKeys} + */ + getData(key:Object):Object; + /** + * Removes additional data to which the given key is mapped for this partition cell. + * @param {Object} key The Key with which the given data is to be associated. + * @return {Object} The additional data to which the given key is mapped, or null if there was no mapping for key. + * @see {@link yfiles.router.polyline.PartitionCell#getData} + * @see {@link yfiles.router.polyline.PartitionCell#putData} + * @see {@link yfiles.router.polyline.PartitionCell#clearData} + * @see {@link yfiles.router.polyline.IPartitionCellKeys} + */ + removeData(key:Object):Object; + /** + * Clears all additional data. + * @see {@link yfiles.router.polyline.PartitionCell#getData} + * @see {@link yfiles.router.polyline.PartitionCell#putData} + * @see {@link yfiles.router.polyline.PartitionCell#removeData} + */ + clearData():void; + /** + * The{@link yfiles.router.polyline.DynamicObstacleDecomposition partition} to which this partition cell belongs. + * @see {@link yfiles.router.polyline.IPartition} + */ + partition:yfiles.router.polyline.IPartition; + /** + * A unique identifier of this partition cell. + */ + id:number; + /** + * The bounds the partition cell. + */ + bounds:yfiles.algorithms.YRectangle; + /** + * The x value of the left border of this partition cell. + */ + minX:number; + /** + * The y value of the upper border of this partition cell. + */ + minY:number; + /** + * The x value of the right border of this partition cell. + */ + maxX:number; + /** + * The y value of the lower border of this partition cell. + */ + maxY:number; + /** + * The width of this partition cell. + */ + width:number; + /** + * The height of this partition cell. + */ + height:number; + /** + * Returns an {@link yfiles.router.polyline.OrthogonalInterval} that defines location, size and orientation of the given border. + * The values + * defining the border are + *
    + *
  • {@link yfiles.router.polyline.PartitionCell.PartitionCellBorder#WEST}
  • + *
  • {@link yfiles.router.polyline.PartitionCell.PartitionCellBorder#EAST}
  • + *
  • {@link yfiles.router.polyline.PartitionCell.PartitionCellBorder#NORTH}
  • + *
  • {@link yfiles.router.polyline.PartitionCell.PartitionCellBorder#SOUTH}
  • + *
+ * @param {yfiles.router.polyline.PartitionCell.PartitionCellBorder} border A border of this partition cell. + * @return {yfiles.router.polyline.OrthogonalInterval} + * An {@link yfiles.router.polyline.OrthogonalInterval} that defines location, size and orientation of the given border. + * @see {@link yfiles.router.polyline.PartitionCell.PartitionCellBorder} + */ + createBorderInterval(border:yfiles.router.polyline.PartitionCell.PartitionCellBorder):yfiles.router.polyline.OrthogonalInterval; + } + export module PartitionCell{ + /** + * Type-safe enumeration that is used to define the border of a partition cell. + * @see {@link yfiles.router.polyline.PartitionCell#createBorderInterval} + */ + export interface PartitionCellBorder extends Object{ + /** + * The type of the border that is on the opposite side of the border defined by this type. + */ + mirrorBorder:yfiles.router.polyline.PartitionCell.PartitionCellBorder; + } + } + var PartitionCell:{ + $class:yfiles.lang.Class; + /** + * Creates a new partition cell of the given partition with location and size of the given rectangle. + * @param {yfiles.algorithms.YRectangle} bounds The bounds of the partition cell. + * @param {yfiles.router.polyline.IPartition} partition The partition to which the partition cell belongs. + * @see {@link yfiles.router.polyline.IPartition} + */ + FromRectangle:{ + new (bounds:yfiles.algorithms.YRectangle,partition:yfiles.router.polyline.IPartition):yfiles.router.polyline.PartitionCell; + }; + /** + * Creates a new partition cell of the given partition with the given bounds. + * @param {number} x The x-coordinate of upper left corner of the partition cell. + * @param {number} y The y-coordinate of upper left corner of the partition cell. + * @param {number} width The width of the partition cell. + * @param {number} height The height of the partition cell. + * @param {yfiles.router.polyline.IPartition} partition The partition to which the partition cell belongs. + */ + new (x:number,y:number,width:number,height:number,partition:yfiles.router.polyline.IPartition):yfiles.router.polyline.PartitionCell; + PartitionCellBorder:{ + $class:yfiles.lang.Class; + /** + * Type constant to define the upper border of a {@link yfiles.router.polyline.PartitionCell}. + */ + NORTH:yfiles.router.polyline.PartitionCell.PartitionCellBorder; + /** + * Type constant to define the lower border of a {@link yfiles.router.polyline.PartitionCell}. + */ + SOUTH:yfiles.router.polyline.PartitionCell.PartitionCellBorder; + /** + * Type constant to define the right border of a {@link yfiles.router.polyline.PartitionCell}. + */ + EAST:yfiles.router.polyline.PartitionCell.PartitionCellBorder; + /** + * Type constant to define the left border of a {@link yfiles.router.polyline.PartitionCell}. + */ + WEST:yfiles.router.polyline.PartitionCell.PartitionCellBorder; + /** + * Returns the type of the border that is passed through when leaving a {@link yfiles.router.polyline.PartitionCell} in the given + * direction. + * @param {yfiles.layout.Direction} direction + * The direction in which a {@link yfiles.router.polyline.PartitionCell} is left. + * @return {yfiles.router.polyline.PartitionCell.PartitionCellBorder} The type of the border that is passed through. + * @see {@link yfiles.router.polyline.PartitionCell} + */ + valueOfExitDirection(direction:yfiles.layout.Direction):yfiles.router.polyline.PartitionCell.PartitionCellBorder; + /** + * Returns the type of the border that is passed through when entering a {@link yfiles.router.polyline.PartitionCell} in the given + * direction. + * @param {yfiles.layout.Direction} direction + * The direction in which a {@link yfiles.router.polyline.PartitionCell} is entered. + * @return {yfiles.router.polyline.PartitionCell.PartitionCellBorder} The type of the border that is passed through. + * @see {@link yfiles.router.polyline.PartitionCell} + */ + valueOfEnterDirection(direction:yfiles.layout.Direction):yfiles.router.polyline.PartitionCell.PartitionCellBorder; + /** + * Returns the type of the border that is defined by the given port constraint. + * @param {yfiles.layout.PortConstraint} pc The port constraint for that the border type is returned. + * @return {yfiles.router.polyline.PartitionCell.PartitionCellBorder} The type of the border that is defined by the given port constraint. + * @see {@link yfiles.layout.PortConstraint} + */ + valueOfPortConstraint(pc:yfiles.layout.PortConstraint):yfiles.router.polyline.PartitionCell.PartitionCellBorder; + /** + * Returns the type of the border that is defined by the given port candidate. + * @param {yfiles.layout.PortCandidate} pc The port candidate for that the border type is returned. + * @return {yfiles.router.polyline.PartitionCell.PartitionCellBorder} The type of the border that is defined by the given port candidate. + * @see {@link yfiles.layout.PortCandidate} + */ + valueOfPortCandidate(pc:yfiles.layout.PortCandidate):yfiles.router.polyline.PartitionCell.PartitionCellBorder; + }; + }; + /** + * Obstacles are used by implementations of {@link yfiles.router.polyline.IObstaclePartition} to subdivide an area into {@link yfiles.router.polyline.PartitionCell}s. + */ + export interface Obstacle extends Object{ + /** + * The bounds of the obstacle. + */ + bounds:yfiles.algorithms.YRectangle; + /** + * The additional data related to the obstacle. + */ + data:Object; + } + var Obstacle:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + * @param {yfiles.algorithms.YRectangle} bounds The bounds of the obstacle. + * @param {Object} data The additional data related to the obstacle. + */ + new (bounds:yfiles.algorithms.YRectangle,data:Object):yfiles.router.polyline.Obstacle; + }; + } + } + export module seriesparallel{ + /** + * This interface is used by {@link yfiles.seriesparallel.SeriesParallelLayouter}. + * Classes implementing + * this interface are responsible for the assignment of the edges' ports. + */ + export interface IPortAssignment extends Object{ + /** + * Called by {@link yfiles.seriesparallel.SeriesParallelLayouter} before the actual layout of the graph takes place. + * This method assigns both the incoming edges target ports as well as all source ports for the outgoing edges. + * At this point outgoing edges are ordered according the specified out-edge comparator from left to right and + * incoming edges are in the order of the subgraphs their coming from. + * @param {yfiles.layout.LayoutGraph} graph the graph instance the node is part of + * @param {yfiles.algorithms.Node} node the node whose adjacent edges' ports should be set + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#SUBGRAPH_COMPARATOR_DP_KEY} + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#defaultOutEdgeComparator} + * @see Specified by {@link yfiles.seriesparallel.IPortAssignment#assignPorts}. + */ + assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; + } + var IPortAssignment:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This class implements a layout algorithm for drawing series-parallel graphs. + *

+ * Series parallel graphs are directed graphs with a single source (node without incoming edges) and a single sink + * (node without outgoing edges) that are build using only the following two rules: + *

    + *
  • Series composition: The source of a subgraph is merged with the sink of a second subgraph.
  • + *
  • Parallel composition: The sources and sinks of two subgraphs are merged.
  • + *
+ *

+ *

+ *

+ *

+ *

+ * Features: + *

    + *
  • node labels consideration in spacing and edge routing
  • + *
  • integrated edge labeling according to the {@link yfiles.layout.PreferredPlacementDescriptor preferred placement}
  • + *
  • different {@link yfiles.seriesparallel.SeriesParallelLayouter#defaultPortAssignment port assignment}s
  • + *
  • different {@link yfiles.seriesparallel.SeriesParallelLayouter#verticalAlignment vertical alignments} for parallel subgraphs
  • + *
  • several {@link yfiles.seriesparallel.SeriesParallelLayouter#routingStyle edge routing styles}
  • + *
  • customizable {@link yfiles.seriesparallel.SeriesParallelLayouter#defaultOutEdgeComparator order} of parallel subgraphs
  • + *
  • support of grouped graphs that remain series-parallel if the groups are seen as normal nodes and the inner + * graphs are series-parallel, too; edges which are connected to non-empty group nodes are not allowed
  • + *
  • {@link yfiles.seriesparallel.SeriesParallelLayouter#fromSketchMode from-sketch mode} which considers the original node positions
  • + *
  • support of non-series-parallel input graphs
  • + *
  • {@link yfiles.layout.PortConstraint}s are considered when assigning the ports and strong + * PortConstraints will fix the end point. However, the direction of the + * PortConstraint will be the graph's flow direction
  • + *
+ *

+ */ + export interface SeriesParallelLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * Checks whether or not the given graph is series-parallel and can be layouted by + * {@link yfiles.seriesparallel.SeriesParallelLayouter}. + * @param {yfiles.layout.LayoutGraph} graph the graph to be checked. + * @return {boolean} true if the given graph is series-parallel, false otherwise. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Calculates a series-parallel layout for the given graph. + * @param {yfiles.layout.LayoutGraph} graph the graph to be layouted. + * @throws {yfiles.algorithms.InvalidGraphStructureException} if the graph is not series-parallel. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * Specifies whether or not node labels are considered. + * If enabled, the layouter will reserve space for the node labels to avoid overlaps. + *

+ * By default, node labels are not considered. + *

+ */ + considerNodeLabels:boolean; + /** + * Specifies whether or not integrated edge labeling is enabled. + * If enabled, the layouter will place edge labels and reserve space for them. + *

+ * By default, integrated edge labeling is disabled. + *

+ */ + integratedEdgeLabeling:boolean; + /** + * The vertical alignment of parallel subgraphs. + * A value of 0 means nodes are top aligned; + * a value of 1 means nodes are bottom aligned; + * a value of 0.5 means nodes are center aligned. + * Values outside the interval [0,1] will be matched with the nearest interval end. + *

+ * In grouped graphs, the vertical alignment only applies to parallel subgraphs that belong to the same group. + *

+ *

+ * By default the subgraphs are center aligned. + *

+ */ + verticalAlignment:number; + /** + * Specifies whether or not general graphs are handled by this layouter. + *

+ * If general graphs are handled, they will be transformed before layout to fit the criteria of series-parallel + * graphs. After layout, they will be restored and the edges which weren't series-parallel are routed by an + * {@link yfiles.seriesparallel.SeriesParallelLayouter#nonSeriesParallelEdgeRouter} edge router}. + *

+ *

+ * By default only series-parallel graphs are handled. + *

+ */ + generalGraphHandling:boolean; + /** + * The edge router used for edges of a general graph that are not part of the series-parallel subgraph whose layout + * is calculated. + * It is required that a suitable {@link yfiles.seriesparallel.SeriesParallelLayouter#nonSeriesParallelEdgesDpKey selection key} is + * used. + *

+ * By default is used. + *

+ * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#generalGraphHandling} + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#nonSeriesParallelEdgesDpKey} + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#generalGraphHandling} + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#nonSeriesParallelEdgesDpKey} + */ + nonSeriesParallelEdgeRouter:yfiles.layout.ILayouter; + /** + * The key that is used to mark non-series-parallel edges. + * Note that this layouter automatically marks these edges and registers the DataProvider using the specified key. + * This key is used to determine the edges that are + * not part of the series-parallel structure in a general graph, so the specified non-series parallel + * edge router should only route marked edges. + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#generalGraphHandling} + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#nonSeriesParallelEdgeRouter} + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#generalGraphHandling} + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#nonSeriesParallelEdgeRouter} + */ + nonSeriesParallelEdgesDpKey:Object; + /** + * The default{@link yfiles.seriesparallel.IPortAssignment} that will be used for those nodes, that don't + * have their own specific instance set via the appropriate DataProvider. + *

+ * By default, all ports are placed in the center of the node. + *

+ */ + defaultPortAssignment:yfiles.seriesparallel.IPortAssignment; + /** + * The default{@link yfiles.objectcollections.IComparer} that will be used for those nodes, that don't + * have their own specific instance set via + * {@link yfiles.seriesparallel.SeriesParallelLayouter#PORT_ASSIGNMENT_DP_KEY appropriate DataProvider}. + *

+ * By default, {@link yfiles.seriesparallel.DefaultOutEdgeComparator} is used which uses the edge order of the + * graph along with a special {@link yfiles.layout.PortConstraint} and edge group handling. + *

+ *

+ * If you simply want to use the graph's current edge order you can set the default comparator to null. + *

+ */ + defaultOutEdgeComparator:yfiles.objectcollections.IComparer; + /** + * The currently used routing style for edges. + * Note that the routing style has no effect on + * {@link yfiles.seriesparallel.SeriesParallelLayouter#generalGraphHandling non-series-parallel} edges. + *

+ * By default, edges are routed orthogonally. + *

+ * @see {@link yfiles.seriesparallel.RoutingStyle#ORTHOGONAL} + * @see {@link yfiles.seriesparallel.RoutingStyle#OCTILINEAR} + * @see {@link yfiles.seriesparallel.RoutingStyle#POLYLINE} + * @see {@link yfiles.seriesparallel.RoutingStyle#ORTHOGONAL} + * @see {@link yfiles.seriesparallel.RoutingStyle#OCTILINEAR} + * @see {@link yfiles.seriesparallel.RoutingStyle#POLYLINE} + */ + routingStyle:yfiles.seriesparallel.RoutingStyle; + /** + * Specifies the minimum segment length for a polyline edge segment. + * This distance will only be considered when the + * routing style property is set to polyline edge routes. + *

+ * By default, this distance is 30. + *

+ * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#minimumSlope} + * @see {@link yfiles.seriesparallel.RoutingStyle#POLYLINE} + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#minimumSlope} + * @see {@link yfiles.seriesparallel.RoutingStyle#POLYLINE} + */ + minimumPolylineSegmentLength:number; + /** + * The minimum slope which a polyline edge segment should have. + * A higher minimum slope prevents polyline + * segments in very wide graphs to get nearly horizontal. This distance will only be considered when the routing style + * property is set to polyline edge routes. + *

+ * By default, the minimum slope is 0.25. + *

+ * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#minimumPolylineSegmentLength} + * @see {@link yfiles.seriesparallel.RoutingStyle#POLYLINE} + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#minimumPolylineSegmentLength} + * @see {@link yfiles.seriesparallel.RoutingStyle#POLYLINE} + */ + minimumSlope:number; + /** + * The preferred length for non-orthogonal segments in octilinear edge routes. + * This segment length will only + * be considered when the routing style property is set to octilinear edge routes. + *

+ * By default, the preferred length is 10. + *

+ * @see {@link yfiles.seriesparallel.RoutingStyle#OCTILINEAR} + * @see {@link yfiles.seriesparallel.RoutingStyle#OCTILINEAR} + */ + preferredOctilinearSegmentLength:number; + /** + * The default{@link yfiles.seriesparallel.EdgeLayoutDescriptor}. + * This instance is used for all those edges, that do not have a specific layout descriptor assigned. + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + */ + defaultEdgeLayoutDescriptor:yfiles.seriesparallel.EdgeLayoutDescriptor; + /** + * The minimum distance between nodes. + *

+ * By default the distance between nodes is 10. + *

+ */ + minimumNodeToNodeDistance:number; + /** + * The minimum distance between nodes and edges. + *

+ * By default the distance between nodes and edges is 10. + *

+ */ + minimumNodeToEdgeDistance:number; + /** + * The minimum distance between edges. + *

+ * By default the distance between edges is 5. + *

+ */ + minimumEdgeToEdgeDistance:number; + /** + * Specifies whether or not to take the coordinates of the input diagram into account when arranging the nodes. + * The order of edges with the same source node will stay the same an in the original layout. + *

+ * Note that previously specified {@link yfiles.seriesparallel.SeriesParallelLayouter#SUBGRAPH_COMPARATOR_DP_KEY comparators} will be ignored if from-sketch-mode + * is activated. + *

+ *

+ * By default this feature is disabled. + *

+ */ + fromSketchMode:boolean; + } + var SeriesParallelLayouter:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key used to store the {@link yfiles.seriesparallel.EdgeLayoutDescriptor} for each edge. + * If there is no descriptor mapped for an edge, the default descriptor is used. + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#defaultEdgeLayoutDescriptor} + */ + EDGE_LAYOUT_DESCRIPTOR_DP_KEY:Object; + /** + * DataProvider key that can be registered with the graph to provide each node with its own + * {@link yfiles.objectcollections.IComparer} instance that will be used to sort the outgoing edges. + * If the Comparator + * associated with a node is null, the outgoing edges are not sorted. + *

+ * Note that the order cannot be kept in all cases because the target nodes may not be completely independent. + *

+ *

+ * For general graphs the comparators are only used for the series-parallel part of the graph. Non-series-parallel + * edges are not included and will be routed by the + * {@link yfiles.seriesparallel.SeriesParallelLayouter#nonSeriesParallelEdgeRouter edge router for non-series-parallel edges}. + *

+ * @see {@link yfiles.algorithms.DataProviders#createConstantDataProvider} + */ + SUBGRAPH_COMPARATOR_DP_KEY:Object; + /** + * DataProvider key that can be registered with the graph to provide each node with its own + * {@link yfiles.seriesparallel.IPortAssignment} instance. + */ + PORT_ASSIGNMENT_DP_KEY:Object; + /** + * Creates a new SeriesParallelLayouter with default settings. + */ + new ():yfiles.seriesparallel.SeriesParallelLayouter; + /** + * Determines whether or not the given graph has a series-parallel structure. + *

+ * The current implementation detects the series-parallel graph structure in linear runtime. + *

+ * @param {yfiles.algorithms.Graph} graph the graph to be checked. + * @return {boolean} true if the given graph is series-parallel, false otherwise. + */ + isSeriesParallelGraph(graph:yfiles.algorithms.Graph):boolean; + }; + /** + * This class is used by {@link yfiles.seriesparallel.SeriesParallelLayouter} to determine the routing details of a + * graph's edges. + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#EDGE_LAYOUT_DESCRIPTOR_DP_KEY} + */ + export interface EdgeLayoutDescriptor extends Object{ + /** + * The minimum length for the associated edge. + */ + minimumLength:number; + /** + * The minimum length for the first segment of the associated edge. + */ + minimumFirstSegmentLength:number; + /** + * The minimum length for the last segment of the associated edge. + */ + minimumLastSegmentLength:number; + } + var EdgeLayoutDescriptor:{ + $class:yfiles.lang.Class; + }; + export enum PortAssignmentMode{ + /** + * Mode constant describing the strategy where ports are reset to the center of their nodes unless their are strong + * {@link yfiles.layout.PortConstraint}s registered which will be kept. + */ + CENTER, + /** + * Mode constant describing the strategy where the ports of incoming and outgoing edges are distributed evenly at the + * side of their nodes. + *

+ * The source ports of edges without {@link yfiles.layout.PortConstraint}s will be distributed at the sides of + * their source and target nodes. + * Edges with weak PortConstraints are distributed at the side of the nodes that is specified in the + * PortConstraint. Strong PortConstraints are excluded from the even distribution to keep + * their port locations. + *

+ *

+ * Grouped edges will get the same port location. + *

+ */ + DISTRIBUTED + } + /** + * Default implementation for the out-edge comparator used in {@link yfiles.seriesparallel.SeriesParallelLayouter}. + *

+ * It keeps the order of the edges in the graph for edges without {@link yfiles.layout.PortConstraint}s and considers the + * PortConstraints so the order of the target nodes of the out-edges is similar to the port location at + * the source node. Note that this won't work for all cases because the target nodes may not be completely + * independent. + *

+ * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#defaultOutEdgeComparator} + */ + export interface DefaultOutEdgeComparator extends Object,yfiles.objectcollections.IComparer{ + /** + * Compares two objects. + * @param {Object} x The first object. + * @param {Object} y The second object. + * @return {number}
    + *
  • -1: x is less than y
  • + *
  • 0: x is equal to y
  • + *
  • 1: x is greater than y
  • + *
+ * @see Specified by {@link yfiles.objectcollections.IComparer#compare}. + */ + compare(o1:Object,o2:Object):number; + } + var DefaultOutEdgeComparator:{ + $class:yfiles.lang.Class; + }; + export enum ForkStyle{ + /** + * Constant that describes a fork style outside a node. Edges leave/enter the nodes south/north + * and bend between their source and target. + */ + OUTSIDE_NODE, + /** + * Constant that describes fork style on a node. Edges leave/enter the nodes south/north if + * they are straight (no bends) or east and west of the node. + */ + AT_NODE + } + export enum RoutingStyle{ + /** + * Style constant describing an orthogonal edge style. If this style is used, edges will have only horizontal or + * vertical segments. + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#routingStyle} + */ + ORTHOGONAL, + /** + * Style constant describing an octilinear edge style. If this style is used, edges will have horizontal, vertical + * and 45-degree sloped segments. + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#routingStyle} + */ + OCTILINEAR, + /** + * Style constant describing an polyline edge style. If this style is used, edges will have vertical + * and sloped segments. + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#routingStyle} + */ + POLYLINE + } + /** + * This class implements the default port assignment strategy. + * Ports are either placed at the {@link yfiles.seriesparallel.PortAssignmentMode#CENTER center} or get {@link yfiles.seriesparallel.PortAssignmentMode#DISTRIBUTED distributed} at the sides of the node. + *

+ * If {@link yfiles.layout.PortConstraint}s are specified the strong PortConstraints are handled separately + * and keep their initial location relative to the node while weak PortConstraints just influence on which + * side the port is placed. + *

+ *

+ * If there are edge groups specified the edges which belong to the same group get the same port locations. + *

+ */ + export interface DefaultPortAssignment extends Object,yfiles.seriesparallel.IPortAssignment{ + /** + * Called by {@link yfiles.seriesparallel.SeriesParallelLayouter} before the actual layout of the graph takes place. + * This method assigns both the incoming edges target ports as well as all source ports for the outgoing edges. + * At this point outgoing edges are ordered according the specified out-edge comparator from left to right and + * incoming edges are in the order of the subgraphs their coming from. + * @param {yfiles.layout.LayoutGraph} graph the graph instance the node is part of + * @param {yfiles.algorithms.Node} node the node whose adjacent edges' ports should be set + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#SUBGRAPH_COMPARATOR_DP_KEY} + * @see {@link yfiles.seriesparallel.SeriesParallelLayouter#defaultOutEdgeComparator} + * @see Specified by {@link yfiles.seriesparallel.IPortAssignment#assignPorts}. + */ + assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; + /** + * Callback method used to determine the port border gap for each node and + * side. + * @param {number} sideLength the width/height of the side + * @param {number} edgeCount the number of edges/port that connect to this side + * @return {number} the absolute gap to be used on both sides of the ports + */ + getPortBorderGap(sideLength:number,edgeCount:number):number; + /** + * Callback method used to determine the distance between two adjacent ports. + * @param {number} sideLength the width/height of the side + * @param {number} edgeCount the number of edges/port that connect to this side + * @param {number} portBorderGap the previously calculated port border gap + * @return {number} the absolute distance to be used between two adjacent ports + */ + getPortDistanceDelta(sideLength:number,edgeCount:number,portBorderGap:number):number; + /** + * The port assignment mode. + * Possible values are + *
    + *
  • {@link yfiles.seriesparallel.PortAssignmentMode#CENTER}: all ports lie on the same point.
  • + *
  • {@link yfiles.seriesparallel.PortAssignmentMode#DISTRIBUTED}: ports are distributed among the northern and southern side of the node.
  • + *
+ */ + mode:yfiles.seriesparallel.PortAssignmentMode; + /** + * The ratio of the gap between the border of the node and the next port and the gap between the ports. + * For example, 0.5 sets the border gap as wide as half the gap between the ports. Thus, + * the lower the value is, the wider "spread" the ports at the side of the node. + *

+ * Note: This setting is only useful for distributed port assignment. + *

+ */ + borderGapToPortGapRatio:number; + /** + * The fork style which influences the port assignment. + *

+ * If the fork style is set to {@link yfiles.seriesparallel.ForkStyle#OUTSIDE_NODE}, edges without port constraints will be + * assigned in flow direction. + *

+ *

+ * If the fork style is set to {@link yfiles.seriesparallel.ForkStyle#AT_NODE} the ports of edges in flow direction also get + * distributed to the sides unless they are without bends. Note that edges may overlap due to large + * minimum first/last segment lengths. + *

+ * @see {@link yfiles.seriesparallel.ForkStyle#AT_NODE} + * @see {@link yfiles.seriesparallel.ForkStyle#OUTSIDE_NODE} + * @see {@link yfiles.seriesparallel.ForkStyle#AT_NODE} + * @see {@link yfiles.seriesparallel.ForkStyle#OUTSIDE_NODE} + */ + forkStyle:yfiles.seriesparallel.ForkStyle; + } + var DefaultPortAssignment:{ + $class:yfiles.lang.Class; + /** + * Creates a new DefaultPortAssignment instance using mode {@link yfiles.seriesparallel.PortAssignmentMode#CENTER}. + */ + new ():yfiles.seriesparallel.DefaultPortAssignment; + /** + * Creates a new DefaultPortAssignment instance using the given mode and the default value for + * the ratio of the gap between the border and the ports and the gap between the ports themselves. + * The default value is 0.5. + * Possible values for mode are: + *
    + *
  • {@link yfiles.seriesparallel.PortAssignmentMode#CENTER}: all ports lie on the same point.
  • + *
  • {@link yfiles.seriesparallel.PortAssignmentMode#DISTRIBUTED}: ports are distributed among the sides of the node.
  • + *
+ */ + WithMode:{ + new (mode:yfiles.seriesparallel.PortAssignmentMode):yfiles.seriesparallel.DefaultPortAssignment; + }; + /** + * Creates a new DefaultPortAssignment instance using the given mode and a given value for + * the ratio of the {@link yfiles.seriesparallel.DefaultPortAssignment#borderGapToPortGapRatio gap between the border and the ports} and the gap + * between the ports themselves. + *

+ * Possible values for mode are: + *

    + *
  • {@link yfiles.seriesparallel.PortAssignmentMode#CENTER}: all ports lie on the same point.
  • + *
  • {@link yfiles.seriesparallel.PortAssignmentMode#DISTRIBUTED}: ports are distributed among the sides of the node.
  • + *
+ *

+ */ + WithModeAndRatio:{ + new (mode:yfiles.seriesparallel.PortAssignmentMode,ratio:number):yfiles.seriesparallel.DefaultPortAssignment; + }; + }; + } + export module support{ + /** + * An {@link yfiles.collections.IEnumerable} implementation that + * applies a {@link system.Predicate} to determine which elements + * to yield in the enumeration. + */ + export interface FilteredEnumerable extends Object,yfiles.collections.IEnumerable{ + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + } + var FilteredEnumerable:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.support.FilteredEnumerable} class. + * @param {yfiles.collections.IEnumerable.} backing The backing enumerable to filter. + * @param {function(T):boolean} predicate The predicate that determines which items should be yielded. + */ + new (backing:yfiles.collections.IEnumerable,predicate:(obj:T)=>boolean):yfiles.support.FilteredEnumerable; + }; + /** + * An {@link yfiles.collections.IEnumerator} implementation that + * applies a {@link system.Predicate} to filter a backing enumerator. + */ + export interface FilteredEnumerator extends Object,yfiles.collections.IEnumerator{ + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Moves this enumerator to the next element. + * A newly created enumerator's {@link yfiles.objectcollections.IEnumerator#currentObject current position} is before the first element. Thus, this method + * must be called before first access to the {@link yfiles.objectcollections.IEnumerator#currentObject} property. The same applies to the state after + * calling {@link yfiles.objectcollections.IEnumerator#reset}. + * @return {boolean} true if the enumerator was moved to a valid position + * @see Specified by {@link yfiles.objectcollections.IEnumerator#moveNext}. + */ + moveNext():boolean; + /** + * Resets the enumerator to its starting state. + * In other words: sets the current position before the first element. + * @see Specified by {@link yfiles.objectcollections.IEnumerator#reset}. + */ + reset():void; + /** + * Gets the element at the enumerator's current position. + * This value is undefined if the enumerator is in initial state (after creation or {@link yfiles.collections.IEnumerator#reset}) or has been moved past the + * end of the represented collection. + * @see Specified by {@link yfiles.collections.IEnumerator#current}. + */ + current:T; + } + var FilteredEnumerator:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.support.FilteredEnumerator} class. + * @param {yfiles.collections.IEnumerator.} backing The backing enumerator. + * @param {function(T):boolean} predicate The predicate to use. + */ + new (backing:yfiles.collections.IEnumerator,predicate:(obj:T)=>boolean):yfiles.support.FilteredEnumerator; + }; + /** + * An {@link yfiles.collections.IEnumerable} that casts items. + */ + export interface CastingEnumerable extends Object,yfiles.collections.IEnumerable{ + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + } + var CastingEnumerable:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance wrapping the provided one. + * @param {yfiles.collections.IEnumerable.} wrapped The instance to wrap. + */ + new (wrapped:yfiles.collections.IEnumerable):yfiles.support.CastingEnumerable; + }; + /** + * Utility interface that can be used in conjunction with {@link yfiles.support.MementoUndoUnit} + * to create {@link yfiles.support.IUndoUnit} implementations. + * This interface uses the memento design pattern to implement undoability. + */ + export interface IMementoSupport extends Object{ + /** + * Retrieves the state of a given subject as a memento. + * The state memento returned can later be reapplied to the subject using + * the {@link yfiles.support.IMementoSupport#applyState} method. + * @param {Object} subject The subject to read the state from + * @return {Object} An instance that describes the current state of subject. + * @see Specified by {@link yfiles.support.IMementoSupport#getState}. + */ + getState(subject:Object):Object; + /** + * Reapplies a previously queried state memento object to a given subject. + * The state object has been created using the {@link yfiles.support.IMementoSupport#getState} method. + * @param {Object} subject The subject to modify the state. + * @param {Object} state The state memento object as returned by {@link yfiles.support.IMementoSupport#getState} + * @see Specified by {@link yfiles.support.IMementoSupport#applyState}. + */ + applyState(subject:Object,state:Object):void; + /** + * Utility method that can determine whether two state memento object are equal. + * Conservative implementations my simply return false. If this method yields true + * The state is considered not to have changed and no undo unit will be created. + * @param {Object} state1 The first state as obtained from {@link yfiles.support.IMementoSupport#getState} + * @param {Object} state2 The first state as obtained from {@link yfiles.support.IMementoSupport#getState} + * @return {boolean} If the states equal and thus there is no need to apply state1 to an instance + * whose state is already state2 + * @see Specified by {@link yfiles.support.IMementoSupport#stateEquals}. + */ + stateEquals(state1:Object,state2:Object):boolean; + } + var IMementoSupport:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A wrapping implementation of an {@link yfiles.collections.IEnumerator} + * that upcasts elements from a given enumerator to + * another one. + */ + export interface CastingEnumerator2 extends Object,yfiles.collections.IEnumerator{ + /** + * Gets the element at the enumerator's current position. + * This value is undefined if the enumerator is in initial state (after creation or {@link yfiles.collections.IEnumerator#reset}) or has been moved past the + * end of the represented collection. + * @see Specified by {@link yfiles.collections.IEnumerator#current}. + */ + current:T; + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Moves this enumerator to the next element. + * A newly created enumerator's {@link yfiles.objectcollections.IEnumerator#currentObject current position} is before the first element. Thus, this method + * must be called before first access to the {@link yfiles.objectcollections.IEnumerator#currentObject} property. The same applies to the state after + * calling {@link yfiles.objectcollections.IEnumerator#reset}. + * @return {boolean} true if the enumerator was moved to a valid position + * @see Specified by {@link yfiles.objectcollections.IEnumerator#moveNext}. + */ + moveNext():boolean; + /** + * Resets the enumerator to its starting state. + * In other words: sets the current position before the first element. + * @see Specified by {@link yfiles.objectcollections.IEnumerator#reset}. + */ + reset():void; + } + var CastingEnumerator2:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance wrapping the provided one. + * @param {yfiles.collections.IEnumerator.} enumerator The enumerator to wrap. + */ + new (enumerator:yfiles.collections.IEnumerator):yfiles.support.CastingEnumerator2; + }; + /** + * A specialized {@link yfiles.model.IMapper}-like implementation that + * uses {@link yfiles.support.TypedKey}s as the keys and their corresponding strongly typed + * values as the values. + */ + export interface TypedKeyMapper extends Object{ + /** + * Finds the associated value for the given key in the mapping or + * (re-)associates the given key with the value provided, removing previous associations. + * In order to remove an association the {@link yfiles.support.TypedKeyMapper#removeValue} method should be + * preferred over calling this method using a default value. + * @param {yfiles.support.TypedKey.} key The key to use as the index. + * @see {@link yfiles.support.TypedKeyMapper#removeValue} + */ + get(key:yfiles.support.TypedKey):T; + /** + * Sets the specified key/value pair. + * Previous values are overwritten. + * @param {yfiles.support.TypedKey.} key The key. + * @param {T} value The value. + */ + set(key:yfiles.support.TypedKey,value:T):void; + /** + * Removes a previously created association with the given key. + * @param {yfiles.support.TypedKey.} key The key to remove from the mapping. + */ + removeValue(key:yfiles.support.TypedKey):void; + /** + * Determines whether this instance contains the specified key. + * @param {yfiles.support.TypedKey.} key The key. + * @return {boolean} + * true if this instance contains the specified key; otherwise, false. + */ + contains(key:yfiles.support.TypedKey):boolean; + /** + * Clears this instance. + */ + clear():void; + } + var TypedKeyMapper:{ + $class:yfiles.lang.Class; + new ():yfiles.support.TypedKeyMapper; + }; + /** + * A utility class that can be used as a key in dictionary like use cases to provide type-safe values. + * Equality and {@link yfiles.support.TypedKey#hashCode hash code} is based on both the type and the {@link yfiles.support.TypedKey#name} + */ + export interface TypedKey extends Object{ + /** + * Gets the name for this key. + * Value: The name. + */ + name:string; + /** + * Gets a default value that can be used if there is no value explicitly defined for this key. + * It is up to the implementation that makes use of this key whether this value is interpreted. + * Value: The default value. + */ + defaultValue:T; + /** + * Determines equality based on the type and {@link yfiles.support.TypedKey#name}. + * @param {yfiles.support.TypedKey.} other The other instance. + * @return {boolean} Whether the items are of the exact same type and have the same {@link yfiles.support.TypedKey#name}. + */ + equalsWithOther(other:yfiles.support.TypedKey):boolean; + /** + * Determines equality based on the type, type parameter, and {@link yfiles.support.TypedKey#name}. + * @param {Object} obj The other instance. + * @return {boolean} Whether the items are of the exact same type and have the same {@link yfiles.support.TypedKey#name}. + */ + equals(obj:Object):boolean; + /** + * Returns a hash code for this instance based on the type parameter and the {@link yfiles.support.TypedKey#name}. + * @return {number} + * A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + */ + hashCode():number; + /** + * Returns the {@link yfiles.support.TypedKey#name}. + * @return {string} + * Returns the {@link yfiles.support.TypedKey#name}. + */ + toString():string; + } + var TypedKey:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.support.TypedKey} class using the given name. + * @param {string} name The name for the key. + * @see {@link yfiles.support.TypedKey#name} + */ + new (keyType:yfiles.lang.Class,name:string):yfiles.support.TypedKey; + /** + * Initializes a new instance of the {@link yfiles.support.TypedKey} class. + * @param {string} name The name. + * @param {T} defaultValue The {@link yfiles.support.TypedKey#defaultValue default value}. + * @see {@link yfiles.support.TypedKey#name} + */ + WithDefaultValue:{ + new (keyType:yfiles.lang.Class,name:string,defaultValue:T):yfiles.support.TypedKey; + }; + }; + /** + * A generic support class that can manage {@link yfiles.support.IUndoUnit} instances + * to support undoability. + */ + export interface UndoEngine extends Object,yfiles.system.INotifyPropertyChanged{ + /** + * Whether or not this instance should try to merge newly added units. + * If true this instance will try to {@link yfiles.support.IUndoUnit#addUnit merge} or + * {@link yfiles.support.IUndoUnit#replaceUnit replace} units in the queue. + */ + mergeUnits:boolean; + /** + * Returns the current undo name. + */ + undoName:string; + /** + * Gets or sets the timespan during which two events will be {@link yfiles.support.UndoEngine#mergeUnits merged}. + * Setting this to {@link yfiles.system.TimeSpan#ZERO} will effectively disable automatic merging. + */ + autoAddTimeSpan:yfiles.system.TimeSpan; + /** + * Returns the current redo name. + */ + redoName:string; + /** + * Adds a new {@link yfiles.support.IUndoUnit} to the queue. + * This implementation will automatically group multiple units + * into a single unit if the time since the last add is + * less than {@link yfiles.support.UndoEngine#autoAddTimeSpan}. + * @param {yfiles.support.IUndoUnit} unit The unit of work to add. + */ + addUnit(unit:yfiles.support.IUndoUnit):void; + /** + * Begins a compound edit that will use the provided name. + * This will create a new edit that can independently be {@link yfiles.support.ICompoundEdit#cancel canceled} + * or {@link yfiles.support.ICompoundEdit#end ended}. Note that only if the outer-most instances is + * ended, the corresponding {@link yfiles.support.IUndoUnit} units will be enqueued into this instance. + * @param {string} undoName The undo name to use for the edit. + * @param {string} redoName The redo name to use for the edit. + * @return {yfiles.support.ICompoundEdit} A compound edit implementation that needs to be {@link yfiles.support.ICompoundEdit#cancel canceled} or + * {@link yfiles.support.ICompoundEdit#end ended later}. + * @see {@link yfiles.support.UndoEngine#currentCompoundEdit} + */ + beginCompoundEdit(undoName:string,redoName:string):yfiles.support.ICompoundEdit; + /** + * Returns a token that can be used to store and compare the state of the + * undo queue. + * E.g. an application can retrieve the token once the user has saved his document. + * Comparing the token returned by this instance with another one retrieved at + * a later point in time enables the application to determine whether the + * document is in the same state. + * @return {Object} An object that can be checked against other tokens via the {@link Object#equals} method. + */ + getToken():Object; + /** + * Gets or sets the maximum size of the undo queue this instance is managing. + * A size of 0 effectively disables this implementation. + */ + size:number; + /** + * Returns the {@link yfiles.support.IUndoUnit#undoName} of the next + * {@link yfiles.support.UndoEngine#undo} operation. + */ + undoText:string; + /** + * Returns the {@link yfiles.support.IUndoUnit#redoName} of the next + * {@link yfiles.support.UndoEngine#redo} operation. + */ + redoText:string; + /** + * Clears the internal queue. + */ + clear():void; + /** + * Undoes the next {@link yfiles.support.IUndoUnit}. + * @throws {yfiles.system.NotSupportedException} If an undo operation is already in progress. + * @throws {yfiles.lang.Exception} If {@link yfiles.support.UndoEngine#canUndo} would yield false. + */ + undo():void; + /** + * Gets a possibly open current {@link yfiles.support.UndoEngine#beginCompoundEdit compound edit}. + * Indicates and possibly returns the currently active {@link yfiles.support.ICompoundEdit} + * that has been started using {@link yfiles.support.UndoEngine#beginCompoundEdit}. + * Value: The current compound edit or null. + */ + currentCompoundEdit:yfiles.support.ICompoundEdit; + /** + * Redoes the next {@link yfiles.support.IUndoUnit}. + * @throws {yfiles.system.NotSupportedException} If an undo operation is already in progress. + * @throws {yfiles.lang.Exception} If {@link yfiles.support.UndoEngine#canRedo} would yield false. + */ + redo():void; + /** + * Indicates whether this instance is currently performing an undo operation. + */ + performingUndo:boolean; + /** + * Indicates whether this instance is currently performing a redo operation. + */ + performingRedo:boolean; + /** + * Determines whether a call to {@link yfiles.support.UndoEngine#undo} can be made. + */ + canUndo():boolean; + /** + * Determines whether a call to {@link yfiles.support.UndoEngine#redo} can be made. + */ + canRedo():boolean; + /** + * This will trigger the corresponding {@link yfiles.support.UndoEngine#addPropertyChangedListener PropertyChanged} event. + * @param {string} name The name of the property that changed. + */ + onPropertyChanged(name:string):void; + /** + * Event that will be triggered if {@link yfiles.support.UndoEngine#canUndo}, {@link yfiles.support.UndoEngine#canRedo}, + * {@link yfiles.support.UndoEngine#undoName}, or {@link yfiles.support.UndoEngine#redoName} changed its value. + */ + addPropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Event that will be triggered if {@link yfiles.support.UndoEngine#canUndo}, {@link yfiles.support.UndoEngine#canRedo}, + * {@link yfiles.support.UndoEngine#undoName}, or {@link yfiles.support.UndoEngine#redoName} changed its value. + */ + removePropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Disposes this unit and all of its contents. + */ + dispose():void; + toString():string; + } + var UndoEngine:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.support.UndoEngine} class. + */ + new ():yfiles.support.UndoEngine; + }; + /** + * A wrapping implementation of an {@link yfiles.collections.IEnumerator} + * that casts elements from a given non-generic enumerator to + * another one. + */ + export interface CastingEnumerator extends Object,yfiles.collections.IEnumerator{ + /** + * Gets the element at the enumerator's current position. + * This value is undefined if the enumerator is in initial state (after creation or {@link yfiles.collections.IEnumerator#reset}) or has been moved past the + * end of the represented collection. + * @see Specified by {@link yfiles.collections.IEnumerator#current}. + */ + current:T; + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Moves this enumerator to the next element. + * A newly created enumerator's {@link yfiles.objectcollections.IEnumerator#currentObject current position} is before the first element. Thus, this method + * must be called before first access to the {@link yfiles.objectcollections.IEnumerator#currentObject} property. The same applies to the state after + * calling {@link yfiles.objectcollections.IEnumerator#reset}. + * @return {boolean} true if the enumerator was moved to a valid position + * @see Specified by {@link yfiles.objectcollections.IEnumerator#moveNext}. + */ + moveNext():boolean; + /** + * Resets the enumerator to its starting state. + * In other words: sets the current position before the first element. + * @see Specified by {@link yfiles.objectcollections.IEnumerator#reset}. + */ + reset():void; + } + var CastingEnumerator:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance wrapping the provided one. + * @param {yfiles.objectcollections.IEnumerator} enumerator The enumerator to wrap. + */ + new (enumerator:yfiles.objectcollections.IEnumerator):yfiles.support.CastingEnumerator; + }; + /** + * Implements a unit that can be undone and redone. + * This is main interface that implements undoability. + * {@link yfiles.support.UndoEngine} can be used to manage implementations of this interface. + */ + export interface IUndoUnit extends Object,yfiles.system.IDisposable{ + /** + * Undoes the change that is represented by this unit. + * This method will only succeed if {@link yfiles.support.IUndoUnit#canUndo} yields true. + * @see {@link yfiles.support.IUndoUnit#canUndo} + * @see {@link yfiles.support.IUndoUnit#undoName} + * @see Specified by {@link yfiles.support.IUndoUnit#undo}. + */ + undo():void; + /** + * Redoes the change that is represented by this unit. + * This method will only succeed if {@link yfiles.support.IUndoUnit#canRedo} yields true. + * @see {@link yfiles.support.IUndoUnit#canRedo} + * @see {@link yfiles.support.IUndoUnit#redoName} + * @see Specified by {@link yfiles.support.IUndoUnit#redo}. + */ + redo():void; + /** + * Determines whether this instance can currently {@link yfiles.support.IUndoUnit#undo} its work. + * @return {boolean} Whether a call to {@link yfiles.support.IUndoUnit#undo} will succeed. + * @see Specified by {@link yfiles.support.IUndoUnit#canUndo}. + */ + canUndo():boolean; + /** + * Determines whether this instance can currently {@link yfiles.support.IUndoUnit#redo} its work. + * @return {boolean} Whether a call to {@link yfiles.support.IUndoUnit#redo} will succeed. + * @see Specified by {@link yfiles.support.IUndoUnit#canRedo}. + */ + canRedo():boolean; + /** + * Returns the name of the undo unit. + * Depending on the implementation and context this might be a human readable + * representation of the undo action or a symbolic name that needs localization. + * @see Specified by {@link yfiles.support.IUndoUnit#undoName}. + */ + undoName:string; + /** + * Returns the name of the redo unit. + * Depending on the implementation and context this might be a human readable + * representation of the redo action or a symbolic name that needs localization. + * @see Specified by {@link yfiles.support.IUndoUnit#redoName}. + */ + redoName:string; + /** + * Allows for collapsing multiple units into one. + * Implementation should try to incorporate the change of unit + * into this and if successful return true. + * This method will be called by the {@link yfiles.support.UndoEngine} to collapse multiple events + * into single events. + * Typically this unit has been placed onto an undo stack and unit + * should be placed on top of it. Both units have been done and might be undone in an upcoming action. + * If this method yields true, the provided unit will not be placed onto the stack but will be + * {@link yfiles.system.IDisposable#dispose}d. + * @param {yfiles.support.IUndoUnit} unit The unit to incorporate that happened after this unit. + * @return {boolean} Whether the state change of unit has been incorporated into this + * unit and unit can be disposed of. + * @see Specified by {@link yfiles.support.IUndoUnit#addUnit}. + */ + addUnit(unit:yfiles.support.IUndoUnit):boolean; + /** + * Allows for collapsing multiple units into one. + * Implementation should try to incorporate the change of unit + * into this and if successful return true. + * This method will be called by the {@link yfiles.support.UndoEngine} to collapse multiple events + * into single events. + * Typically this unit has already been placed onto an undo stack and this + * should be placed on top of it. Both units have been done and might be undone in an upcoming action. + * If this method yields true, this unit will replace the unit on the top of the stack and unit will be + * {@link yfiles.system.IDisposable#dispose}d. + * @param {yfiles.support.IUndoUnit} unit The unit to incorporate that happened before this unit. + * @return {boolean} Whether the state change of unit has been incorporated into this + * unit and unit can be disposed of. + * @see Specified by {@link yfiles.support.IUndoUnit#replaceUnit}. + */ + replaceUnit(unit:yfiles.support.IUndoUnit):boolean; + } + var IUndoUnit:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A simple {@link yfiles.support.IUndoUnit} implementation that uses + * a {@link yfiles.support.IMementoSupport} to track, undo, and redo state changes + * on a given subject. + */ + export interface MementoUndoUnit extends yfiles.support.AbstractUndoUnit{ + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Reads the current state and applies the old one. + * @see Overrides {@link yfiles.support.AbstractUndoUnit#undoImpl} + */ + undoImpl():void; + /** + * Stores the current state and applies the state saved in {@link yfiles.support.MementoUndoUnit#undoImpl}. + * @see Overrides {@link yfiles.support.AbstractUndoUnit#redoImpl} + */ + redoImpl():void; + /** + * Merges this unit if unit is of this type and they describe the + * same subject. + * @see Overrides {@link yfiles.support.AbstractUndoUnit#addUnit} + * @see Specified by {@link yfiles.support.IUndoUnit#addUnit}. + */ + addUnit(unit:yfiles.support.IUndoUnit):boolean; + /** + * Replaces this unit if unit is of this type and they describe the + * same subject. + * @see Overrides {@link yfiles.support.AbstractUndoUnit#replaceUnit} + * @see Specified by {@link yfiles.support.IUndoUnit#replaceUnit}. + */ + replaceUnit(unit:yfiles.support.IUndoUnit):boolean; + /** + * @see Overrides {@link yfiles.support.AbstractUndoUnit#toString} + */ + toString():string; + } + var MementoUndoUnit:{ + $class:yfiles.lang.Class; + /** + * Initializes this unit using a given support instance, the subject and the state that to which + * this unit should undo initially. + * @param {yfiles.support.IMementoSupport} support The support that will be used to update and apply the state. + * @param {Object} subject The instance that will be modified. + * @param {Object} oldState The memento state object to which the subject will be rolled back + * upon the first undo operation. + * @param {string} undoName The name of the undo action. + * @param {string} redoName The name of the redo action. + */ + new (support:yfiles.support.IMementoSupport,subject:Object,oldState:Object,undoName:string,redoName:string):yfiles.support.MementoUndoUnit; + /** + * Initializes this unit using a given support instance, the subject and the state that to which + * this unit should undo initially. + * @param {yfiles.support.IMementoSupport} support The support that will be used to update and apply the state. + * @param {Object} subject The instance that will be modified. + * @param {Object} oldState The memento state object to which the subject will be rolled back + * upon the first undo operation. + * @param {Object} newState The memento state object to which the subject will be rolled back + * upon the first redo operation. + * @param {string} undoName The name of the undo action. + * @param {string} redoName The name of the redo action. + */ + WithOldState:{ + new (support:yfiles.support.IMementoSupport,subject:Object,oldState:Object,newState:Object,undoName:string,redoName:string):yfiles.support.MementoUndoUnit; + }; + }; + /** + * An {@link yfiles.support.ICompoundEdit} implementation that uses + * {@link yfiles.support.IMementoSupport} to track changes on a set of items. + */ + export interface MementoUndoableEdit extends Object,yfiles.support.ICompoundEdit{ + /** + * Ends the editing and enqueues appropriate {@link yfiles.support.IUndoUnit}s into the undo engine. + * @see {@link yfiles.support.MementoUndoUnit} + * @see {@link yfiles.support.UndoEngine#addUnit} + * @see Specified by {@link yfiles.support.ICompoundEdit#end}. + */ + end():void; + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * This method cancels the compound editing process that has been initialized in {@link yfiles.support.UndoEngine#beginCompoundEdit}. + * Calling this method will cancel the recorded {@link yfiles.support.IUndoUnit}s and will hinder this instance + * from enqueuing any more units. + * @see Specified by {@link yfiles.support.ICompoundEdit#cancel}. + */ + cancel():void; + } + var MementoUndoableEdit:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using a set of {@link yfiles.support.MementoStateStruct}s. + * @param {yfiles.support.IUndoSupport} undoSupport The support item that will be used to {@link yfiles.support.IUndoSupport#addUnit enqueue} the + * undo units. + * @param {yfiles.collections.IEnumerable.} mementos The structs that hold the state information about a set of items. + * @param {string} undoName The name for the undo units to create. + * @param {string} redoName The name for the undo units to create. + */ + new (undoSupport:yfiles.support.IUndoSupport,mementos:yfiles.collections.IEnumerable,undoName:string,redoName:string):yfiles.support.MementoUndoableEdit; + }; + /** + * A convenience implementation of the {@link yfiles.support.IUndoUnit} interface that uses simple delegates + * for the actual undo and redo operations. + */ + export interface DelegateUndoUnit extends yfiles.support.AbstractUndoUnit{ + /** + * Calls the undo delegate using the undo parameter. + * @see Overrides {@link yfiles.support.AbstractUndoUnit#undoImpl} + */ + undoImpl():void; + /** + * Calls the redo delegate using the redo parameter. + * @see Overrides {@link yfiles.support.AbstractUndoUnit#redoImpl} + */ + redoImpl():void; + } + var DelegateUndoUnit:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the provided name and a undo and redo handler + * that take default values as argument. + * @param {string} undoName The name of the undo. + * @param {function(T)} undo The undo handler delegate. + * @param {function(T)} redo The redo handler delegate. + */ + WithDelegates:{ + new (undoName:string,undo:(param:T)=> void,redo:(param:T)=> void):yfiles.support.DelegateUndoUnit; + }; + /** + * Creates a new instance using the provided name and a undo and redo handler + * as well as the parameter to pass to the delegates. + * @param {string} undoName The name of the undo. + * @param {function(T)} undo The undo handler delegate. + * @param {function(T)} redo The redo handler delegate. + * @param {T} param The parameter to pass to the two delegates. + */ + WithParam:{ + new (undoName:string,undo:(param:T)=> void,redo:(param:T)=> void,param:T):yfiles.support.DelegateUndoUnit; + }; + /** + * Creates a new instance using the provided name and a undo/redo handler + * as well as the parameters to pass to the delegates. + * @param {string} undoName The name of the undo. + * @param {function(T)} undoRedo The undo and redo handler delegate. + * @param {T} undoParam The undo parameter to pass to the delegate. + * @param {T} redoParam The redo parameter to pass to the delegate. + */ + WithUndoDelegate:{ + new (undoName:string,undoRedo:(param:T)=> void,undoParam:T,redoParam:T):yfiles.support.DelegateUndoUnit; + }; + /** + * Creates a new instance using the provided name and a undo and redo handler + * as well as the parameters to pass to the delegates. + * @param {string} undoName The name of the undo. + * @param {function(T)} undo The undo handler delegate. + * @param {function(T)} redo The redo handler delegate. + * @param {T} undoParam The undo parameter to pass to the delegate. + * @param {T} redoParam The redo parameter to pass to the delegate. + */ + new (undoName:string,undo:(param:T)=> void,redo:(param:T)=> void,undoParam:T,redoParam:T):yfiles.support.DelegateUndoUnit; + }; + /** + * A simple struct that holds a tuple consisting of an implementation + * of {@link yfiles.support.IMementoSupport}, an object instance and its state memento. + * This struct is used by {@link yfiles.support.MementoUndoUnit} and the like. + */ + export interface MementoStateStruct extends yfiles.lang.Struct{ + /** + * The subject for which the state is changed. + */ + subject:Object; + /** + * The state of the subject before the subject has been changed. + */ + state:Object; + /** + * The implementation that can {@link yfiles.support.IMementoSupport#applyState apply} + * and {@link yfiles.support.IMementoSupport#getState retrieve} the current state from the subject. + */ + mementoSupport:yfiles.support.IMementoSupport; + } + var MementoStateStruct:{ + $class:yfiles.lang.Class; + /** + * Creates and initializes a new instance of this struct. + */ + new (mementoSupport:yfiles.support.IMementoSupport,subject:Object,state:Object):yfiles.support.MementoStateStruct; + }; + export interface XmlNamespace extends Object{ + /** + * Gets the URI of the namespace. + * Value: + * The name of the namespace. + */ + namespaceName:string; + } + var XmlNamespace:{ + $class:yfiles.lang.Class; + /** + * Gets the XML namespace. + */ + xmlns:yfiles.support.XmlNamespace; + /** + * Initializes a new instance of the {@link yfiles.support.XmlNamespace} class. + * @param {string} ns The namespace URI. + */ + new (ns:string):yfiles.support.XmlNamespace; + convertFrom(namespaceName:string):yfiles.support.XmlNamespace; + /** + * Combines a namespace with a local name, creating a fully-qualified {@link yfiles.support.XmlName}. + * @param {yfiles.support.XmlNamespace} ns The namespace. + * @param {string} localName The local name of the element. + * @return {yfiles.support.XmlName} + * The result of the combination. + */ + add(ns:yfiles.support.XmlNamespace,localName:string):yfiles.support.XmlName; + /** + * Compares a namespace to another. + * @param {yfiles.support.XmlNamespace} ns1 The first namespace. + * @param {yfiles.support.XmlNamespace} ns2 The second namespace. + * @return {boolean} + * true if the namespaces are equal; false, otherwise. + */ + equals(ns1:yfiles.support.XmlNamespace,ns2:yfiles.support.XmlNamespace):boolean; + /** + * Compares a namespace to another. + * @param {yfiles.support.XmlNamespace} ns1 The first namespace. + * @param {yfiles.support.XmlNamespace} ns2 The second namespace. + * @return {boolean} + * false if the namespaces are equal; true, otherwise. + */ + notEquals(ns1:yfiles.support.XmlNamespace,ns2:yfiles.support.XmlNamespace):boolean; + /** + * Creates a new namespace from the given namespace URI. + * @param {string} namespaceName URI of the namespace. + * @return {yfiles.support.XmlNamespace} A new namespace object. + */ + get(namespaceName:string):yfiles.support.XmlNamespace; + }; + export interface XmlName extends Object{ + /** + * Gets or sets the local name. + * Value: + * The local name. + */ + localName:string; + /** + * Gets the namespace. + */ + xmlNamespace:yfiles.support.XmlNamespace; + /** + * Gets the URI of the namespace. + * Value: + * The URI of the namespace. + */ + namespaceName:string; + equals(obj:Object):boolean; + hashCode():number; + } + var XmlName:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.support.XmlName} class. + * @param {string} localName The local name of the element. + * @param {string} ns The namespace it belongs to. + */ + new (localName:string,ns:string):yfiles.support.XmlName; + /** + * Creates a new name from the given local name and the given namespace URI. + * @param {string} localName The local name. + * @param {string} ns The namespace. + * @return {yfiles.support.XmlName} + */ + get(localName:string,ns:string):yfiles.support.XmlName; + convertFrom(expandedName:string):yfiles.support.XmlName; + /** + * Compares two names for equality. + * @param {yfiles.support.XmlName} left The first name. + * @param {yfiles.support.XmlName} right The second name. + * @return {boolean} + * true if the names are equal; false, otherwise. + */ + equals(left:yfiles.support.XmlName,right:yfiles.support.XmlName):boolean; + /** + * Compares two names for inequality. + * @param {yfiles.support.XmlName} left The first name. + * @param {yfiles.support.XmlName} right The second name. + * @return {boolean} + * false if the names are equal; true, otherwise. + */ + notEquals(left:yfiles.support.XmlName,right:yfiles.support.XmlName):boolean; + }; + /** + * Interface that is mostly used in {@link yfiles.support.ILookup#lookup} for entities + * that support undoability. + * @see {@link yfiles.support.UndoEngine} + * @see {@link yfiles.support.IUndoUnit} + */ + export interface IUndoSupport extends Object{ + /** + * Calling this method indicates to the callee that items + * are going to be modified. + * The implementation will return an implementation of {@link yfiles.support.ICompoundEdit} + * whose {@link yfiles.support.ICompoundEdit#end} method needs to be called by the client + * after the changes to items have been done. + * Calling this method will immediately enqueue an {@link yfiles.support.IUndoUnit} into the undo queue. + * Subsequent additions to the queue will be added after the created instance, even if they + * are added to the queue before the {@link yfiles.support.ICompoundEdit#end} method has been called. + * @param {string} undoName The {@link yfiles.support.IUndoUnit#undoName} of the {@link yfiles.support.IUndoUnit} + * that will be placed into the undo queue after {@link yfiles.support.ICompoundEdit#end} has been called. + * @param {string} redoName The {@link yfiles.support.IUndoUnit#redoName} of the {@link yfiles.support.IUndoUnit} + * that will be placed into the undo queue after {@link yfiles.support.ICompoundEdit#end} has been called. + * @param {yfiles.collections.IEnumerable.} items The items that will be changed after this call and before the call + * to {@link yfiles.support.ICompoundEdit#end}. + * @return {yfiles.support.ICompoundEdit} An implementation of the {@link yfiles.support.ICompoundEdit} interface whose + * {@link yfiles.support.ICompoundEdit#end} or {@link yfiles.support.ICompoundEdit#cancel} methods + * need to be called after the items have been modified. + * @see Specified by {@link yfiles.support.IUndoSupport#beginEditForItems}. + */ + beginEditForItems(undoName:string,redoName:string,items:yfiles.collections.IEnumerable):yfiles.support.ICompoundEdit; + /** + * Directly enqueues a custom {@link yfiles.support.IUndoUnit} into the queue that this instance + * represents. + * @param {yfiles.support.IUndoUnit} unit The unit to place onto the undo stack. + * @see {@link yfiles.support.UndoEngine#addUnit} + * @see Specified by {@link yfiles.support.IUndoSupport#addUnit}. + */ + addUnit(unit:yfiles.support.IUndoUnit):void; + /** + * Starts a compound unit of edits. + * This method can be used to create a bracketing effect. All edits added to the queue after this call + * and before a call to {@link yfiles.support.ICompoundEdit#cancel} or {@link yfiles.support.ICompoundEdit#end} will + * be placed into the queue as a single block. + * Client code needs to make sure that either the {@link yfiles.support.ICompoundEdit#cancel} or {@link yfiles.support.ICompoundEdit#end} + * method is called on the returned instance. + * Implementations should store the state of the current subject at this point and track subsequent changes, until + * {@link yfiles.support.ICompoundEdit#end} has been called. + * @param {string} undoName The undo name for the compound edit. + * @param {string} redoName The redo name for the compound edit. + * @return {yfiles.support.ICompoundEdit} The handle to call {@link yfiles.support.ICompoundEdit#cancel} or {@link yfiles.support.ICompoundEdit#end} on. + * @see Specified by {@link yfiles.support.IUndoSupport#beginEdit}. + */ + beginEdit(undoName:string,redoName:string):yfiles.support.ICompoundEdit; + } + var IUndoSupport:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A copy of the implementation of the same {@link yfiles.lang.Attribute} found in WPF and .net + * Indicates that an enumeration can be treated as a bit field; that is, a set of flags. + */ + export interface FlagsAttribute extends yfiles.lang.Attribute{ + } + var FlagsAttribute:{ + $class:yfiles.lang.Class; + new ():yfiles.support.FlagsAttribute; + }; + /** + * A state for use in a {@link yfiles.support.StateMachine}. + * A state may be connected to other states via {@link yfiles.support.Transition}s. + * Creating a state is done via the {@link yfiles.support.StateMachine#createState} method and its variants. + */ + export interface State extends Object{ + /** + * Gets or sets a custom tag that is associated with this state. + */ + tag:Object; + /** + * An event that will be triggered once the machine enters this state. + */ + addStateEnteredListener(value:(newState:yfiles.support.State,lastState:yfiles.support.State)=> void):void; + /** + * An event that will be triggered once the machine enters this state. + */ + removeStateEnteredListener(value:(newState:yfiles.support.State,lastState:yfiles.support.State)=> void):void; + /** + * An event that will be triggered once the machine exits this state. + */ + addStateExitedListener(value:(newState:yfiles.support.State,lastState:yfiles.support.State)=> void):void; + /** + * An event that will be triggered once the machine exits this state. + */ + removeStateExitedListener(value:(newState:yfiles.support.State,lastState:yfiles.support.State)=> void):void; + /** + * Returns a string representation of this state that mentions the {@link yfiles.support.State#tag}. + */ + toString():string; + /** + * Enables or disables this state. + * A state machine will not automatically enter a state that is disabled. + */ + enabled:boolean; + } + var State:{ + $class:yfiles.lang.Class; + }; + /** + * Interface implemented by items that can be tagged with arbitrary objects. + * The object held by implementations of this interface is usually a user defined object. + * Implementations don't depend on this tag. They just serve as a storage for the tag that + * will be used by other parts of the implementation. + */ + export interface ITagOwner extends Object{ + /** + * Gets or sets the tag associated with this instance. + * Value: The user object associated with this instance. + * The implementation + * itself does not normally depend on the tag associated with it. It serves as storage for + * the object only. + * @see Specified by {@link yfiles.support.ITagOwner#tag}. + */ + tag:Object; + } + var ITagOwner:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Can be used to associate a specific {@link yfiles.system.ValueSerializer} type declaratively to a target. + */ + export interface ValueSerializerAttribute extends yfiles.lang.Attribute{ + /** + * Gets the type of the value serializer implementation. + * Value: The type of the value serializer implementation. + */ + valueSerializerType:yfiles.lang.Class; + } + var ValueSerializerAttribute:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.support.ValueSerializerAttribute} class. + * @param {yfiles.lang.Class} valueSerializerType Type of the value serializer. + */ + new (valueSerializerType:yfiles.lang.Class):yfiles.support.ValueSerializerAttribute; + }; + /** + * Static utility class that servers as a factory for various {@link yfiles.support.ILookup} + * implementations and provides static utility methods that simplify the usage of {@link yfiles.support.ILookup#lookup} + * calls. + */ + export interface Lookups extends Object{ + } + var Lookups:{ + $class:yfiles.lang.Class; + /** + * An ILookup instance that always returns null. + */ + EMPTY:yfiles.support.ILookup; + /** + * An ILookupContext instance that always returns null. + */ + EMPTY_CONTEXT_LOOKUP:yfiles.support.IContextLookup; + /** + * Utility method that helps keeping code more clean when using {@link yfiles.support.ILookup} + * {@link yfiles.support.ILookup#lookup} calls. + * This code can be referenced in places where otherwise it would be used like this: + *

+      * var result = lookup.lookup(MyInterface.$class);
+      * if (result === null) {
+      *     result = new myFallbackImplementation;
+      * }
+      * 
+ * The replacement is + *

+      * var result = yfiles.support.Lookups.getWithFallback(MyInterface.$class, lookup, myFallbackImplementation);
+      * 
+ * and will save you from doing not-null check. + * @param {yfiles.support.ILookup} lookup The actual lookup provider. + * @param {T} fallback The fallback value to use if the lookup yields null + * @return {T} The value returned by lookup or fallback if the former yields null. + */ + getWithFallback(tType:yfiles.lang.Class,lookup:yfiles.support.ILookup,fallback:T):T; + /** + * Utility method that helps keeping code more clean when using {@link yfiles.support.IContextLookup} + * {@link yfiles.support.IContextLookup#lookupForItem} calls. + * This code can be referenced in places where otherwise it would be used like this: + *

+      * var result = lookup.lookupForItem(context, MyInterface.$class);
+      * if (result === null){
+      *   result = myFallbackImplementation;
+      * }
+      * 
+ * The replacement is + *

+      * var result = yfiles.support.Lookups.getWithContextAndFallback(MyInterface.$class, context, lookup, myFallbackImplementation);
+      * 
+ * @param {Object} context The context object to pass to the lookup. + * @param {yfiles.support.IContextLookup} lookup The actual lookup provider. + * @param {T} fallback The fallback value to use if the lookup yields null + * @return {T} The value returned by lookup or fallback if the former yields null. + */ + getWithContextAndFallback(tType:yfiles.lang.Class,context:Object,lookup:yfiles.support.IContextLookup,fallback:T):T; + /** + * The static default lookup instance. + */ + DEFAULT_LOOKUP:yfiles.support.ILookup; + /** + * Creates a simple lookup implementation that yields subject + * if type is queried. + * @param {Object} subject the subject to yield + * @param {yfiles.lang.Class} type the type that should yield the subject + * @return {yfiles.support.ILookup} an ILookup implementation + */ + singleForType(subject:Object,type:yfiles.lang.Class):yfiles.support.ILookup; + /** + * Creates a simple lookup implementation that yields subject + * if type is queried. + * @param {T} subject the subject to yield + * @return {yfiles.support.ILookup} an ILookup implementation + */ + single(tType:yfiles.lang.Class,subject:T):yfiles.support.ILookup; + /** + * Creates a lookup chain link that is backed by the given callback. + * If the callback returns null the request is passed to the chain. + * @param {function(Object, yfiles.lang.Class):Object} callback The callback to invoke. + * @return {yfiles.support.IContextLookupChainLink} The implementation of the link that uses the callback. + */ + createContextLookupChainLink(callback:(subject:Object,type:yfiles.lang.Class)=>Object):yfiles.support.IContextLookupChainLink; + /** + * Creates a lookup implementation that wraps an existing ILookup + * instance using an additional lookup implementations. + * For each lookup call that the additionalLookup would yield + * null, the basicLookup will be queried instead. + * @param {yfiles.support.ILookup} basicLookup the fallback lookup implementation + * @param {yfiles.support.ILookup} additionalLookup the lookup that has precedence over the fallback + * @return {yfiles.support.ILookup} an implementation that decorates the first with the latter + */ + wrapped(basicLookup:yfiles.support.ILookup,additionalLookup:yfiles.support.ILookup):yfiles.support.ILookup; + /** + * Factory method for a lookup chain element that removes the entry from the lookup chain + * for a given type. + * @param {yfiles.lang.Class} type The type to hide from the lookup. + * @return {yfiles.support.IContextLookupChainLink} An instance that can be used in a lookup chain. + */ + hidingLookupChainLink(type:yfiles.lang.Class):yfiles.support.IContextLookupChainLink; + /** + * Factory method for a lookup chain element that uses a function of type function(TContext) + * to yield a TResult for a specific TContext. + * If the resulting link is {@link yfiles.support.IContextLookup#lookupForItem queried} for TResult + * and the context is of type TContext, the factory method will + * be queried and the result will be returned. Otherwise the {@link yfiles.support.IContextLookupChainLink#setNext next} + * chain link will be delegated the request to. + * @param {function(TContext):TResult} factory The factory delegate to use that yields the result for a given context. + * @return {yfiles.support.IContextLookupChainLink} An instance that can be used in a lookup chain. + */ + factoryLookupChainLink(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,factory:(context:TContext)=>TResult):yfiles.support.IContextLookupChainLink; + /** + * Factory method for a lookup chain element that simply adds an entry to a lookup chain. + * @param {yfiles.lang.Class} type The type to add to the lookup. + * @param {Object} instance The instance to return if the typeis being looked up. + * @return {yfiles.support.IContextLookupChainLink} An instance that can be used in a lookup chain. + */ + addingLookupChainLinkForTypeAndInstance(type:yfiles.lang.Class,instance:Object):yfiles.support.IContextLookupChainLink; + /** + * Factory method for a lookup chain element that adds an dynamic instance to a lookup chain. + * The instance returned will check whether instance is of the queried type and + * will then return the instance. + * @param {Object} instance The instance to query the type from dynamically. + * @return {yfiles.support.IContextLookupChainLink} An instance that can be used in a lookup chain. + */ + addingLookupChainLinkForInstance(instance:Object):yfiles.support.IContextLookupChainLink; + /** + * Factory method for a lookup chain element that adds an ILookup layer to a lookup chain. + * If the lookup returns null, the call will be propagated to the chain. + * @param {yfiles.support.ILookup} lookup The lookup to use. + * @return {yfiles.support.IContextLookupChainLink} An instance that can be used in a lookup chain. + */ + addingLookupChainLink(lookup:yfiles.support.ILookup):yfiles.support.IContextLookupChainLink; + /** + * Creates a dynamic lookup implementation that for each type that the given subject + * can be assigned to yields that subject. + * @param {Object} subject the subject to yield if it is assignable to the type in the lookup query + * @return {yfiles.support.ILookup} an instance that will either yield subject or null + */ + dynamic(subject:Object):yfiles.support.ILookup; + }; + /** + * A subclass of {@link yfiles.model.ItemEventArgs} + * that stores a typed {@link yfiles.model.ItemEventArgs#item} + * and that can be marked as {@link yfiles.support.ItemInputEventArgs#handled}. + */ + export interface ItemInputEventArgs extends yfiles.model.ItemEventArgs{ + /** + * Gets or sets a value indicating whether this {@link yfiles.support.ItemInputEventArgs} is handled. + * Setting the event to handled indicates whether the event should be further propagated or whether there has not been any code that + * actively handled the event to the event source. + * How this flag is actually being treated depends on the source of the event. + */ + handled:boolean; + } + var ItemInputEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.support.ItemInputEventArgs} class. + * @param {T} item The item which is the subject of the event. + */ + new (item:T):yfiles.support.ItemInputEventArgs; + }; + /** + * An implementation of a chain of {@link yfiles.support.IContextLookupChainLink}s. + */ + export interface LookupChain extends Object,yfiles.support.IContextLookup,yfiles.system.INotifyPropertyChanged{ + /** + * Adds the given link to the end of the chain. + * @param {yfiles.support.IContextLookupChainLink} link The link to add. + * @see {@link yfiles.support.LookupChain#remove} + */ + add(link:yfiles.support.IContextLookupChainLink):void; + /** + * Removes the link that has previously been added to this instance from this chain. + * @param {yfiles.support.IContextLookupChainLink} link The link to remove. + */ + remove(link:yfiles.support.IContextLookupChainLink):void; + /** + * Can be called by client code to trigger the {@link yfiles.support.LookupChain#addPropertyChangedListener PropertyChanged} + * event manually. + */ + notifyChange():void; + /** + * Notifies client code that the lookup of this instance might have changed. + * @param {yfiles.system.PropertyChangedEventArgs} eventArgs The arguments + */ + onPropertyChanged(eventArgs:yfiles.system.PropertyChangedEventArgs):void; + /** + * Performs the actual lookup operation. + * This call will traverse the chain to satisfy the query. + * @param {Object} item The item to use as the context. + * @param {yfiles.lang.Class} type The type of the query. + * @return {Object} The result of the query. + * @see Specified by {@link yfiles.support.IContextLookup#lookupForItem}. + */ + lookupForItem(item:Object,type:yfiles.lang.Class):Object; + /** + * This event will be triggered if the lookup of this instance + * has changed for some or all of the types or items. + */ + addPropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * This event will be triggered if the lookup of this instance + * has changed for some or all of the types or items. + */ + removePropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * This method is the same as calling {@link yfiles.support.LookupExtensions#addChainWithDelegateAndNullIsFallback} + * with a true as the final argument. + * This is a bridge method that delegates to {@link yfiles.support.LookupExtensions#addChainWithDelegate}. + * @param {function(TContext):TResult} factory The factory that will be called for queries to TResult. + * @return {yfiles.support.IContextLookupChainLink} The link that has been registered with the chain. + */ + addWithFactory(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,factory:(context:TContext)=>TResult):yfiles.support.IContextLookupChainLink; + /** + * A convenience method that adds a {@link yfiles.support.IContextLookupChainLink} to the given chain + * that is based on a function of type function(TContext). + * This is a bridge method that delegates to {@link yfiles.support.LookupExtensions#addChainWithDelegateAndNullIsFallback}. + * @param {function(TContext):TResult} factory The factory that will be called for queries to TResult. + * @param {boolean} nullIsFallback If set to true, null return values of the factory method will be + * interpreted as the final result, otherwise the request will propagate down the chain. + * @return {yfiles.support.IContextLookupChainLink} The link that has been registered with the chain. + */ + addWithFactoryAndNullIsFallback(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,factory:(context:TContext)=>TResult,nullIsFallback:boolean):yfiles.support.IContextLookupChainLink; + /** + * This method is the same as calling {@link yfiles.support.LookupExtensions#addChainWithWrapperFactoryAndNullIsFallback} + * with a false as the final argument. + * This is a bridge method that delegates to {@link yfiles.support.LookupExtensions#addChainWithWrapperFactory}. + * @param {function(TContext, TResult):TResult} wrapperFactory The wrapper factory that will be called for queries to TResult. + * @return {yfiles.support.IContextLookupChainLink} The link that has been registered with the chain. + */ + addWithWrapperFactory(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,wrapperFactory:(item:TContext,baseImplementation:TResult)=>TResult):yfiles.support.IContextLookupChainLink; + /** + * A convenience method that adds a {@link yfiles.support.IContextLookupChainLink} to the given chain + * that is based on a function of type function(object, object). + * This is a bridge method that delegates to {@link yfiles.support.LookupExtensions#addChainWithWrapperFactoryAndNullIsFallback}. + * @param {function(TContext, TResult):TResult} wrapperFactory The wrapper factory that will be called for queries to TResult to + * wrap the result of the query to the remainder of the chain. + * @param {boolean} decorateNull if set to true null return values of the remainder of the chain + * will be passed to the wrapper factory so that it can decorate the null, otherwise null will be yielded as the final result. + * @return {yfiles.support.IContextLookupChainLink} The link that has been registered with the chain. + */ + addWithWrapperFactoryAndDecorateNull(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,wrapperFactory:(item:TContext,baseImplementation:TResult)=>TResult,decorateNull:boolean):yfiles.support.IContextLookupChainLink; + /** + * Convenience method that can be used instead of the {@link yfiles.support.LookupChain#add} + * method to easily add a lookup implementation for a given type that always yields a constant result. + * This is a bridge method that delegates to {@link yfiles.support.LookupExtensions#addConstantChain}. + * @param {TResult} result The constant value to yield if the chain is queried for an implementation of type TResult. + * @return {yfiles.support.IContextLookupChainLink} The {@link yfiles.support.IContextLookupChainLink} instance that has been added to the chain. + */ + addConstant(resultType:yfiles.lang.Class,result:TResult):yfiles.support.IContextLookupChainLink; + } + var LookupChain:{ + $class:yfiles.lang.Class; + new ():yfiles.support.LookupChain; + }; + /** + * Interface that can be used to decorate the lookup result for a set of types. + * @see {@link yfiles.support.ILookup} + * @see {@link yfiles.support.IContextLookupChainLink} + */ + export interface ILookupDecorator extends Object{ + /** + * Determines whether this instance can be used to decorate the lookup for a certain type. + * @param {yfiles.lang.Class} t The type to decorate the lookup for. + * @return {boolean} + * @see Specified by {@link yfiles.support.ILookupDecorator#canDecorate}. + */ + canDecorate(t:yfiles.lang.Class):boolean; + /** + * Adds a lookup chain element to the chain of lookups for a given type. + * The lookup chain is context specific. This method will not generally decorate the + * lookup of all instances of type t, but only those that + * stand in context of this instance. This method will only succeed if {@link yfiles.support.ILookupDecorator#canDecorate} + * yields true for t. + * @param {yfiles.lang.Class} t The type to decorate the lookup. + * @param {yfiles.support.IContextLookupChainLink} lookup The chain element to add to the lookup of the given type. + * @see {@link yfiles.support.ILookupDecorator#removeLookup} + * @see {@link yfiles.support.LookupExtensions#addDecoratorWithDelegate} + * @see {@link yfiles.support.LookupExtensions#addDecoratorWithDelegateAndNullIsFallback} + * @see {@link yfiles.support.LookupExtensions#addDecorator} + * @see {@link yfiles.support.LookupExtensions#addDecoratorWithWrapperFactoryAndNullIsFallback} + * @see {@link yfiles.support.LookupExtensions#addConstantDecorator} + * @see Specified by {@link yfiles.support.ILookupDecorator#addLookup}. + */ + addLookup(t:yfiles.lang.Class,lookup:yfiles.support.IContextLookupChainLink):void; + /** + * Removes a previously registered lookup chain element from the chain of lookups for a given type. + * @param {yfiles.lang.Class} t The type to remove the decorator from. + * @param {yfiles.support.IContextLookupChainLink} lookup The chain element to remove from the lookup of the given type. + * @see {@link yfiles.support.ILookupDecorator#addLookup} + * @see Specified by {@link yfiles.support.ILookupDecorator#removeLookup}. + */ + removeLookup(t:yfiles.lang.Class,lookup:yfiles.support.IContextLookupChainLink):void; + /** + * Convenience method that can be used instead of the {@link yfiles.support.ILookupDecorator#addLookup} + * method to easily add a lookup implementation for a given type using a function of type function(TContext). + * This is a bridge method that delegates to {@link yfiles.support.LookupExtensions#addDecoratorWithDelegate}. + * @param {function(TContext):TResult} factory The factory delegate that will be used to satisfy queries of type TResult. + * If the factory delegate yields null, this implementation will fallback to the lookup chain and return + * the result of the remainder of the chain. (See {@link yfiles.support.LookupExtensions#addDecoratorWithDelegateAndNullIsFallback}). + * @return {yfiles.support.IContextLookupChainLink} The {@link yfiles.support.IContextLookupChainLink} instance as returned by the {@link yfiles.support.ILookupDecorator#addLookup} + * call or null, if either decorator was null, or it + * {@link yfiles.support.ILookupDecorator#canDecorate could not decorate} the TContext type. + */ + addWithFactory(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,factory:(context:TContext)=>TResult):yfiles.support.IContextLookupChainLink; + /** + * Convenience method that can be used instead of the {@link yfiles.support.ILookupDecorator#addLookup} + * method to easily add a lookup implementation for a given type using a function of type function(TContext). + * This is a bridge method that delegates to {@link yfiles.support.LookupExtensions#addDecoratorWithDelegateAndNullIsFallback}. + * @param {function(TContext):TResult} factory The factory delegate that will be used to satisfy queries of type TResult. + * @param {boolean} nullIsFallback Whether to treat null-results of the factory + * as hints to use the remainder of the chain link or to actually yield the value as the final result. + * @return {yfiles.support.IContextLookupChainLink} The {@link yfiles.support.IContextLookupChainLink} instance as returned by the {@link yfiles.support.ILookupDecorator#addLookup} + * call or null, if either decorator was null, or it + * {@link yfiles.support.ILookupDecorator#canDecorate could not decorate} the TContext type. + */ + addWithFactoryAndNullIsFallback(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,factory:(context:TContext)=>TResult,nullIsFallback:boolean):yfiles.support.IContextLookupChainLink; + /** + * Convenience method that can be used instead of the {@link yfiles.support.ILookupDecorator#addLookup} + * method to easily add a lookup implementation for a given type using a function of type function(object, object). + * This is a bridge method that delegates to {@link yfiles.support.LookupExtensions#addDecoratorWithWrapperFactoryAndNullIsFallback}. + * @param {function(TContext, TResult):TResult} wrapperFactory The factory delegate that will be used to satisfy queries of type TResult + * @param {boolean} decorateNull Whether to treat actually decorate null-results of remainder of the chain. + * If this is set to false, the wrapperFactory will never be called with null + * as the second argument but the result of the query for this chain link will be the null value. + * @return {yfiles.support.IContextLookupChainLink} The {@link yfiles.support.IContextLookupChainLink} instance as returned by the {@link yfiles.support.ILookupDecorator#addLookup} + * call or null, if either decorator was null, or it + * {@link yfiles.support.ILookupDecorator#canDecorate could not decorate} the TContext type. + */ + addWithWrapperFactoryAndDecorateNull(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,wrapperFactory:(item:TContext,baseImplementation:TResult)=>TResult,decorateNull:boolean):yfiles.support.IContextLookupChainLink; + /** + * Convenience method that can be used instead of the {@link yfiles.support.ILookupDecorator#addLookup} + * method to easily add a lookup implementation for a given type using a function of type function(object, object). + * This is a bridge method that delegates to {@link yfiles.support.LookupExtensions#addDecorator}. + * @param {function(TContext, TResult):TResult} wrapperFactory The factory delegate that will be used to satisfy queries of type TResult. + * If the factory delegate yields null, this implementation will yield that value. So in order to + * not modify the result, the wrapperFactory's second parameter should be returned by the delegate. + * Note that the second parameter may be null, if this method is used. If such values shall not be wrapped, + * use the {@link yfiles.support.LookupExtensions#addDecoratorWithWrapperFactoryAndNullIsFallback} method with false + * as the last argument. + * @return {yfiles.support.IContextLookupChainLink} The {@link yfiles.support.IContextLookupChainLink} instance as returned by the {@link yfiles.support.ILookupDecorator#addLookup} + * call or null, if either decorator was null, or it + * {@link yfiles.support.ILookupDecorator#canDecorate could not decorate} the TContext type. + */ + addWithWrapperFactory(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,wrapperFactory:(item:TContext,baseImplementation:TResult)=>TResult):yfiles.support.IContextLookupChainLink; + /** + * Convenience method that can be used instead of the {@link yfiles.support.ILookupDecorator#addLookup} + * method to easily add a lookup implementation for a given type that always yields a constant result. + * This is a bridge method that delegates to {@link yfiles.support.LookupExtensions#addConstantDecorator}. + * @param {TResult} result The constant value to yield if the chain is queried for an implementation of type TResult. + * @return {yfiles.support.IContextLookupChainLink} The {@link yfiles.support.IContextLookupChainLink} instance as returned by the {@link yfiles.support.ILookupDecorator#addLookup} + * call or null, if either decorator was null, or it + * {@link yfiles.support.ILookupDecorator#canDecorate could not decorate} the TContext type. + */ + addConstant(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,result:TResult):yfiles.support.IContextLookupChainLink; + } + var ILookupDecorator:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A transition for use in a {@link yfiles.support.StateMachine}. + * A transition connects to {@link yfiles.support.State}s and is created + * using the {@link yfiles.support.StateMachine#createTransitionWithDefaults} method and its related variants. + */ + export interface Transition extends Object{ + /** + * The event that gets triggered once the transition is performed. + */ + addTransitionDoneListener(value:(t:yfiles.support.Transition)=> void):void; + /** + * The event that gets triggered once the transition is performed. + */ + removeTransitionDoneListener(value:(t:yfiles.support.Transition)=> void):void; + /** + * Gets or sets a custom tag that is associated with this state. + */ + tag:Object; + /** + * Determines whether this transition is triggered given the pair + * of event source and event arguments. + * @param {Object} eventSource The source of an event. + * @param {yfiles.system.EventArgs} eventArgs The event argument. + * @return {boolean} Whether the state machine should traverse this transition + * in response to the event. + */ + isTrigger(eventSource:Object,eventArgs:yfiles.system.EventArgs):boolean; + /** + * Gets or sets the event recognizer that will be used in the {@link yfiles.support.Transition#isTrigger} + * method. + */ + eventRecognizer:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean; + /** + * Enables or disables this transition. + * A disabled transition will not be traversed by the state machine automatically. + */ + enabled:boolean; + /** + * Gets the source state this transition connects to. + */ + source:yfiles.support.State; + /** + * Gets the target state this transition connects to. + */ + target:yfiles.support.State; + } + var Transition:{ + $class:yfiles.lang.Class; + }; + /** + * A casting {@link yfiles.model.IMapper} implementation that uses + * the {@link yfiles.support.ITagOwner} implementation of the {@link yfiles.model.IModelItem}. + */ + export interface TagOwnerMapper extends Object,yfiles.model.IMapper{ + /** + * Finds the associated value for the given key in the mapping or + * (re-)associates the given key with the value provided, removing previous associations. + * In order to remove an association the {@link yfiles.model.IMapper#removeItem} method should be + * preferred over calling this method using a default value. + * @param {K} key The key to use as the index. + * @see {@link yfiles.model.IMapper#removeItem} + * @see Specified by {@link yfiles.model.IMapper#getItem}. + */ + getItem(key:TItemType):TValue; + /** + * Finds the associated value for the given key in the mapping or + * (re-)associates the given key with the value provided, removing previous associations. + * In order to remove an association the {@link yfiles.model.IMapper#removeItem} method should be + * preferred over calling this method using a default value. + * @param {K} key The key to use as the index. + * @see {@link yfiles.model.IMapper#removeItem} + * @see Specified by {@link yfiles.model.IMapper#getItem}. + */ + setItem(key:TItemType,value:TValue):void; + /** + * Removes a previously created association with the given key. + * @param {K} key The key to remove from the mapping. + * @see Specified by {@link yfiles.model.IMapper#removeItem}. + */ + removeItem(key:TItemType):void; + } + var TagOwnerMapper:{ + $class:yfiles.lang.Class; + new (valueType:yfiles.lang.Class):yfiles.support.TagOwnerMapper; + }; + /** + * A state machine implementation that can be used to manage complex + * state and transitions. + * The machine is built of {@link yfiles.support.State}s and {@link yfiles.support.Transition}s. + * The machine potentially changes its state in response to events. + */ + export interface StateMachine extends Object{ + /** + * An event that is triggered when the state has traversed a {@link yfiles.support.Transition} + * during a {@link yfiles.support.StateMachine#run} call. + */ + addTransitionDoneListener(value:(t:yfiles.support.Transition)=> void):void; + /** + * An event that is triggered when the state has traversed a {@link yfiles.support.Transition} + * during a {@link yfiles.support.StateMachine#run} call. + */ + removeTransitionDoneListener(value:(t:yfiles.support.Transition)=> void):void; + /** + * An event that is triggered when a state has been entered + * during a {@link yfiles.support.StateMachine#run} call. + */ + addStateEnteredListener(value:(newState:yfiles.support.State,lastState:yfiles.support.State)=> void):void; + /** + * An event that is triggered when a state has been entered + * during a {@link yfiles.support.StateMachine#run} call. + */ + removeStateEnteredListener(value:(newState:yfiles.support.State,lastState:yfiles.support.State)=> void):void; + /** + * An event that is triggered when a state has been exited + * during a {@link yfiles.support.StateMachine#run} call. + */ + addStateExitedListener(value:(newState:yfiles.support.State,lastState:yfiles.support.State)=> void):void; + /** + * An event that is triggered when a state has been exited + * during a {@link yfiles.support.StateMachine#run} call. + */ + removeStateExitedListener(value:(newState:yfiles.support.State,lastState:yfiles.support.State)=> void):void; + /** + * An event that will be triggered if a transition has been created. + */ + addTransitionCreatedListener(value:(machine:yfiles.support.StateMachine,transition:yfiles.support.Transition)=> void):void; + /** + * An event that will be triggered if a transition has been created. + */ + removeTransitionCreatedListener(value:(machine:yfiles.support.StateMachine,transition:yfiles.support.Transition)=> void):void; + /** + * An event that will be triggered if a transition has been removed. + */ + addTransitionRemovedListener(value:(machine:yfiles.support.StateMachine,transition:yfiles.support.Transition)=> void):void; + /** + * An event that will be triggered if a transition has been removed. + */ + removeTransitionRemovedListener(value:(machine:yfiles.support.StateMachine,transition:yfiles.support.Transition)=> void):void; + /** + * An event that will be triggered if a state has been created. + */ + addStateCreatedListener(value:(machine:yfiles.support.StateMachine,state:yfiles.support.State)=> void):void; + /** + * An event that will be triggered if a state has been created. + */ + removeStateCreatedListener(value:(machine:yfiles.support.StateMachine,state:yfiles.support.State)=> void):void; + /** + * An event that will be triggered if a state has been removed. + */ + addStateRemovedListener(value:(machine:yfiles.support.StateMachine,state:yfiles.support.State)=> void):void; + /** + * An event that will be triggered if a state has been removed. + */ + removeStateRemovedListener(value:(machine:yfiles.support.StateMachine,state:yfiles.support.State)=> void):void; + /** + * Gets or sets the current state the machine is in. + */ + currentState:yfiles.support.State; + /** + * Finds a transition that connects two given states. + */ + findTransition(srcState:yfiles.support.State,targetState:yfiles.support.State):yfiles.support.Transition; + /** + * Resets this machine so that the current state is the {@link yfiles.support.StateMachine#startState}. + */ + reset():void; + /** + * Removes a state from this machine. + * @param {yfiles.support.State} state A state to remove. This may not be the {@link yfiles.support.StateMachine#startState} + */ + removeState(state:yfiles.support.State):void; + /** + * Removes a transition from this state machine. + */ + removeTransition(transition:yfiles.support.Transition):void; + /** + * Returns all states in this machine. + */ + states:yfiles.collections.IEnumerable; + /** + * Returns all transitions in this machine. + */ + transitions:yfiles.collections.IEnumerable; + /** + * Gets the start state. + */ + startState:yfiles.support.State; + /** + * Creates a new state. + * @return {yfiles.support.State} The new state. + */ + createState():yfiles.support.State; + /** + * Creates a new state given a handler that will be notified if that state is entered. + */ + createStateWithHandler(stateEntered:(newState:yfiles.support.State,lastState:yfiles.support.State)=> void):yfiles.support.State; + /** + * Creates a transition between two given states. + */ + createTransitionWithDefaults(source:yfiles.support.State,target:yfiles.support.State):yfiles.support.Transition; + /** + * Creates a conditional transition between two given states. + */ + createTransitionWithCallback(source:yfiles.support.State,target:yfiles.support.State,er:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean):yfiles.support.Transition; + /** + * Creates a conditional transition between two given states. + */ + createTransitionWithEventRecognizer(source:yfiles.support.State,target:yfiles.support.State,er:yfiles.input.IEventRecognizer):yfiles.support.Transition; + /** + * Creates a conditional transition between two given states using a callback. + */ + createTransition(source:yfiles.support.State,target:yfiles.support.State,er:yfiles.input.IEventRecognizer,te:(t:yfiles.support.Transition)=> void):yfiles.support.Transition; + /** + * Creates a conditional transition between two given states using a callback. + */ + createTransitionWithCallbackAndDoneHandler(source:yfiles.support.State,target:yfiles.support.State,er:(eventSource:Object,eventArg:yfiles.system.EventArgs)=>boolean,te:(t:yfiles.support.Transition)=> void):yfiles.support.Transition; + /** + * Runs this machine using the given event source and event argument + * to determine which transition to take from the {@link yfiles.support.StateMachine#currentState}. + * The first enabled {@link yfiles.support.Transition} that will be {@link yfiles.support.Transition#isTrigger triggered} + * by the given event will be traversed. + * If this method is called reentrantly, the request will be queued and performed after the current + * request has been finished. + * @param {Object} eventSource The source of the event that caused this machine to run. + * @param {yfiles.system.EventArgs} eventArgs The event argument of the event that caused this machine to run. + */ + run(eventSource:Object,eventArgs:yfiles.system.EventArgs):void; + /** + * Executes a given transition programmatically, regardless of the fact if this + * is currently allowed or not. + * This will set the current state to the transition's target state, unless other code + * has set the state ot something different in the meantime. + * @param {yfiles.support.Transition} t The transition to traverse. + */ + performTransition(t:yfiles.support.Transition):void; + /** + * Called when the current state changes. + * @param {yfiles.support.State} s The new state. + * @param {yfiles.support.State} oldState The old state. + */ + onStateChange(s:yfiles.support.State,oldState:yfiles.support.State):void; + /** + * Called when a transition is being traversed. + */ + onTransition(t:yfiles.support.Transition):void; + } + var StateMachine:{ + $class:yfiles.lang.Class; + /** + * Creates an empty machine with no callback handlers. + */ + new ():yfiles.support.StateMachine; + /** + * Creates an empty machine using the provided callbacks. + * @param {function(yfiles.support.Transition)} td A callback. + * @param {function(yfiles.support.State, yfiles.support.State)} se A callback. + */ + WithHandlers:{ + new (td:(t:yfiles.support.Transition)=> void,se:(newState:yfiles.support.State,lastState:yfiles.support.State)=> void):yfiles.support.StateMachine; + }; + /** + * Creates an empty machine using a given start state. + * @param {function(yfiles.support.Transition)} td The handler that will handle {@link yfiles.support.StateMachine#addTransitionDoneListener TransitionDone} events. + * @param {function(yfiles.support.State, yfiles.support.State)} se The handler that will handle {@link yfiles.support.StateMachine#addStateEnteredListener StateEntered} events. + * @param {yfiles.support.State} startState The state to use as the start state. + */ + WithStartState:{ + new (td:(t:yfiles.support.Transition)=> void,se:(newState:yfiles.support.State,lastState:yfiles.support.State)=> void,startState:yfiles.support.State):yfiles.support.StateMachine; + }; + }; + /** + * An interface for instances that can be used to chain lookup operations. + * Implementations will perform the lookup in the {@link yfiles.support.IContextLookup#lookupForItem} + * method and delegate to the next implementation in the chain if they cannot satisfy the request. + */ + export interface IContextLookupChainLink extends Object,yfiles.support.IContextLookup{ + /** + * This method is called by the framework to register the fallback lookup implementation + * that should be used during a call to {@link yfiles.support.IContextLookup#lookupForItem}. + * If the implementation cannot satisfy the query, it will use the provided context as a fallback. + * Note that implementations can also use the results returned by the next lookup and decorate + * it appropriately. + * @param {yfiles.support.IContextLookup} next The context to use as a fallback. + * @see Specified by {@link yfiles.support.IContextLookupChainLink#setNext}. + */ + setNext(next:yfiles.support.IContextLookup):void; + } + var IContextLookupChainLink:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Abstract base class that simplifies the implementation of {@link yfiles.support.IContextLookupChainLink}. + * Although this class does not contain any abstract methods, subclasses need to override {@link yfiles.support.AbstractContextLookupChainLink#lookupForItem} + * in order to be of any use. + */ + export interface AbstractContextLookupChainLink extends Object,yfiles.support.IContextLookupChainLink{ + /** + * This method is called by the framework to register the fallback lookup implementation + * that will be used during a call to base.{@link yfiles.support.AbstractContextLookupChainLink#lookupForItem}. + * @param {yfiles.support.IContextLookup} next The context to use as a fallback. + * @see {@link yfiles.support.AbstractContextLookupChainLink#lookupForItem} + * @see Specified by {@link yfiles.support.IContextLookupChainLink#setNext}. + */ + setNext(next:yfiles.support.IContextLookup):void; + /** + * Returns the result of a query to the next lookup chain element. + * This implementation returns the result of a query to {@link yfiles.support.AbstractContextLookupChainLink#setNext the next} lookup in the chain. + * A typical override of this method could look like this: + *
 
+      * 'lookupForItem': function(item,type) {
+      *        if (type === (AType).public$class) {
+      *             return new MyImplementationOfAType();
+      *        } 
+      *        return $super.lookupForItem.call(this, item, type);
+      * }
+      * 
+ * @param {Object} item the item to lookup a type for + * @param {yfiles.lang.Class} type the type to look up + * @return {Object} + * an implementation or null + * @see Specified by {@link yfiles.support.IContextLookup#lookupForItem}. + */ + lookupForItem(item:Object,type:yfiles.lang.Class):Object; + } + var AbstractContextLookupChainLink:{ + $class:yfiles.lang.Class; + }; + /** + * An interface for instances that can provide a {@link yfiles.support.ILookup} capabilities + * for a given object. + * This is useful in the case where lookup functionality is not intrinsic to + * an item or where an existing object cannot implement the interface or when + * an item needs to be decorated externally with new lookup functionality. + * @see {@link yfiles.support.ILookup} + */ + export interface IContextLookup extends Object{ + /** + * Tries to create or retrieve an implementation of the given type + * for a given item. + * @param {Object} item the item to lookup a type for + * @param {yfiles.lang.Class} type the type to look up + * @return {Object} an implementation or null + * @see {@link yfiles.support.ILookup#lookup} + * @see Specified by {@link yfiles.support.IContextLookup#lookupForItem}. + */ + lookupForItem(item:Object,type:yfiles.lang.Class):Object; + /** + * Typesafe convenience method for the {@link yfiles.support.IContextLookup#lookupForItem} method. + * This is a bridge method that delegates to {@link yfiles.support.LookupExtensions#contextGet}. + * @param {Object} item The item to pass to the {@link yfiles.support.IContextLookup#lookupForItem} method. + * @return {T} The result of the query, or null. + */ + contextGet(tType:yfiles.lang.Class,item:Object):T; + /** + * Typesafe convenience method for the {@link yfiles.support.IContextLookup#lookupForItem} method. + * This is a bridge method that delegates to {@link yfiles.support.LookupExtensions#safeContextGet}. + * @param {Object} item The item to pass to the {@link yfiles.support.IContextLookup#lookupForItem} method. + * @return {T} The result of the query, never null. + * @throws {yfiles.system.KeyNotFoundException} If the context lookup did not yield a non-null result + * for the type. + */ + safeContextGet(tType:yfiles.lang.Class,item:Object):T; + } + var IContextLookup:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An enumerator that enumerates a single item, only. + * @see {@link yfiles.support.SingleEnumerable} + */ + export interface SingleEnumerator extends Object,yfiles.collections.IEnumerator{ + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Moves this enumerator to the next element. + * A newly created enumerator's {@link yfiles.objectcollections.IEnumerator#currentObject current position} is before the first element. Thus, this method + * must be called before first access to the {@link yfiles.objectcollections.IEnumerator#currentObject} property. The same applies to the state after + * calling {@link yfiles.objectcollections.IEnumerator#reset}. + * @return {boolean} true if the enumerator was moved to a valid position + * @see Specified by {@link yfiles.objectcollections.IEnumerator#moveNext}. + */ + moveNext():boolean; + /** + * Resets the enumerator to its starting state. + * In other words: sets the current position before the first element. + * @see Specified by {@link yfiles.objectcollections.IEnumerator#reset}. + */ + reset():void; + /** + * Gets the element at the enumerator's current position. + * This value is undefined if the enumerator is in initial state (after creation or {@link yfiles.objectcollections.IEnumerator#reset}) or has been moved past the + * end of the represented collection. + * @see Specified by {@link yfiles.objectcollections.IEnumerator#currentObject}. + */ + currentObject:Object; + } + var SingleEnumerator:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the provided item as the only value to enumerate. + * @param {T} value The value. + */ + new (value:T):yfiles.support.SingleEnumerator; + }; + /** + * A composite enumerator that enumerates two given enumerators one after the other. + */ + export interface CompositeEnumerator extends Object,yfiles.collections.IEnumerator{ + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Moves this enumerator to the next element. + * A newly created enumerator's {@link yfiles.objectcollections.IEnumerator#currentObject current position} is before the first element. Thus, this method + * must be called before first access to the {@link yfiles.objectcollections.IEnumerator#currentObject} property. The same applies to the state after + * calling {@link yfiles.objectcollections.IEnumerator#reset}. + * @return {boolean} true if the enumerator was moved to a valid position + * @see Specified by {@link yfiles.objectcollections.IEnumerator#moveNext}. + */ + moveNext():boolean; + /** + * Resets the enumerator to its starting state. + * In other words: sets the current position before the first element. + * @see Specified by {@link yfiles.objectcollections.IEnumerator#reset}. + */ + reset():void; + /** + * Gets the element at the enumerator's current position. + * This value is undefined if the enumerator is in initial state (after creation or {@link yfiles.objectcollections.IEnumerator#reset}) or has been moved past the + * end of the represented collection. + * @see Specified by {@link yfiles.objectcollections.IEnumerator#currentObject}. + */ + currentObject:Object; + } + var CompositeEnumerator:{ + $class:yfiles.lang.Class; + /** + * Creates an instance that enumerates over first and second. + * @param {yfiles.collections.IEnumerator.} first The first enumerator. + * @param {yfiles.collections.IEnumerator.} second The second enumerator. + */ + new (first:yfiles.collections.IEnumerator,second:yfiles.collections.IEnumerator):yfiles.support.CompositeEnumerator; + }; + /** + * A lightweight list that contains exactly one single item. + * @see {@link yfiles.support.SingleEnumerator} + * @see {@link yfiles.support.SingleEnumerable} + */ + export interface SingletonList extends yfiles.support.SingleEnumerable,yfiles.collections.IList,yfiles.model.IListEnumerable{ + /** + * Not supported by this class. + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:T):void; + /** + * Not supported by this class. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @return {boolean} true if the given item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:T):boolean; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:T[],arrayIndex:number):void; + /** + * Not supported by this class. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:T):boolean; + /** + * Returns true, always. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * The index of the given item in the list. + * @param {T} item The item to search for. + * @return {number} The index of the given item in the list. -1 if the item is not in the list. + * @see Specified by {@link yfiles.collections.IList#indexOf}. + */ + indexOf(item:T):number; + /** + * Not supported by this class. + * @see Specified by {@link yfiles.collections.IList#insert}. + */ + insert(index:number,item:T):void; + /** + * Not supported by this class. + * @see Specified by {@link yfiles.collections.IList#removeAt}. + */ + removeAt(index:number):void; + /** + * Gets or sets the item at the given index. + * @param {number} index The index of the item to access. + * @return {T} The item at the given index. + * @see Specified by {@link yfiles.collections.IList#get}. + */ + get(index:number):T; + /** + * Gets or sets the item at the given index. + * @param {number} index The index of the item to access. + * @return {T} The item at the given index. + * @see Specified by {@link yfiles.collections.IList#get}. + */ + set(index:number,value:T):void; + } + var SingletonList:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that holds the provided singleton value. + * @param {T} value The single value this collection holds. + */ + new (value:T):yfiles.support.SingletonList; + }; + /** + * An enumerable that enumerates a single item, only. + * @see {@link yfiles.support.SingleEnumerator} + */ + export interface SingleEnumerable extends Object,yfiles.model.IListEnumerable{ + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Returns the number of elements in this collection. + * @see Specified by {@link yfiles.model.IListEnumerable#count}. + */ + count:number; + /** + * Returns the i-th element in the collection. + * @param {number} i the zero-based index of the item in this collection + * @return {T} the item for the given index + * @see Specified by {@link yfiles.model.IListEnumerable#getItem}. + */ + getItem(i:number):T; + } + var SingleEnumerable:{ + $class:yfiles.lang.Class; + /** + * Creates this instance using the provided single item. + * @param {T} value The single item. + */ + new (value:T):yfiles.support.SingleEnumerable; + }; + /** + * A lightweight collection that contains exactly one single item. + * @see {@link yfiles.support.SingleEnumerator} + * @see {@link yfiles.support.SingleEnumerable} + */ + export interface SingletonCollection extends yfiles.support.SingleEnumerable,yfiles.collections.ICollection{ + /** + * Not supported by this class. + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:T):void; + /** + * Not supported by this class. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @return {boolean} true if the given item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:T):boolean; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:T[],arrayIndex:number):void; + /** + * Not supported by this class. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:T):boolean; + /** + * Returns true, always. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + } + var SingletonCollection:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance that holds the provided singleton value. + * @param {T} value The single value this collection holds. + */ + new (value:T):yfiles.support.SingletonCollection; + }; + /** + * A utility class that implements an immutable always empty {@link yfiles.model.IListEnumerable}. + * @see {@link yfiles.support.EmptyListEnumerable#INSTANCE} + */ + export interface EmptyListEnumerable extends Object,yfiles.model.IListEnumerable{ + /** + * Always returns 0. + * @see Specified by {@link yfiles.model.IListEnumerable#count}. + */ + count:number; + /** + * Throws an {@link yfiles.system.ArgumentOutOfRangeException}. + * @see Specified by {@link yfiles.model.IListEnumerable#getItem}. + */ + getItem(i:number):T; + /** + * Always returns true. + */ + isReadOnly:boolean; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + } + var EmptyListEnumerable:{ + $class:yfiles.lang.Class; + /** + * A shareable static instance of this class. + * @see {@link yfiles.support.EmptyEnumerable#INSTANCE} + * @see {@link yfiles.support.EmptyEnumerator#INSTANCE} + */ + INSTANCE:yfiles.model.IListEnumerable; + }; + /** + * A utility class that implements an immutable always empty {@link yfiles.collections.ICollection}. + * @see {@link yfiles.support.EmptyList#INSTANCE} + * @see {@link yfiles.support.EmptyEnumerable} + * @see {@link yfiles.support.EmptyEnumerator} + */ + export interface EmptyList extends Object,yfiles.collections.IList{ + /** + * Not supported by this implementation. + * @throws {yfiles.system.NotSupportedException} Always. + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:T):void; + /** + * Removes all items from this collection. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Always returns false. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:T):boolean; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:T[],arrayIndex:number):void; + /** + * Always returns false since this item cannot be contained in this implementation. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:T):boolean; + /** + * Always returns 0. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * Always returns true. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * The index of the given item in the list. + * @param {T} item The item to search for. + * @return {number} The index of the given item in the list. -1 if the item is not in the list. + * @see Specified by {@link yfiles.collections.IList#indexOf}. + */ + indexOf(item:T):number; + /** + * Not supported by this instance. + * @see Specified by {@link yfiles.collections.IList#insert}. + */ + insert(index:number,item:T):void; + /** + * Not supported by this instance. + * @see Specified by {@link yfiles.collections.IList#removeAt}. + */ + removeAt(index:number):void; + /** + * Not supported by this instance. + * @see Specified by {@link yfiles.collections.IList#get}. + */ + get(index:number):T; + /** + * Not supported by this instance. + * @see Specified by {@link yfiles.collections.IList#get}. + */ + set(index:number,value:T):void; + } + var EmptyList:{ + $class:yfiles.lang.Class; + /** + * A shareable static instance of this class. + * @see {@link yfiles.support.EmptyEnumerable#INSTANCE} + * @see {@link yfiles.support.EmptyEnumerator#INSTANCE} + */ + INSTANCE:yfiles.collections.IList; + }; + /** + * A utility class that implements an immutable always empty {@link yfiles.collections.ICollection}. + * @see {@link yfiles.support.EmptyCollection#INSTANCE} + * @see {@link yfiles.support.EmptyEnumerable} + * @see {@link yfiles.support.EmptyEnumerator} + */ + export interface EmptyCollection extends Object,yfiles.collections.ICollection{ + /** + * Not supported by this implementation. + * @throws {yfiles.system.NotSupportedException} Always. + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:T):void; + /** + * Removes all items from this collection. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Always returns false. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:T):boolean; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:T[],arrayIndex:number):void; + /** + * Always returns false since this item cannot be contained in this implementation. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:T):boolean; + /** + * Always returns 0. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * Always returns true. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + } + var EmptyCollection:{ + $class:yfiles.lang.Class; + /** + * A shareable static instance of this class. + * @see {@link yfiles.support.EmptyEnumerable#INSTANCE} + * @see {@link yfiles.support.EmptyEnumerator#INSTANCE} + */ + INSTANCE:yfiles.collections.ICollection; + }; + /** + * A generic support class that can manage {@link yfiles.support.IUndoUnit} instances + * to support undoability. + */ + export interface CompoundUndoUnit extends Object,yfiles.support.IUndoUnit{ + /** + * Yields the number of units that are contained in this compound unit. + */ + count:number; + /** + * Returns the current redo name. + * @see Specified by {@link yfiles.support.IUndoUnit#redoName}. + */ + redoName:string; + /** + * Returns the current redo name. + * @see Specified by {@link yfiles.support.IUndoUnit#undoName}. + */ + undoName:string; + /** + * Implements the {@link yfiles.support.IUndoUnit} interface. + * This implementation will always yield false. + * @see Specified by {@link yfiles.support.IUndoUnit#addUnit}. + */ + addUnit(unit:yfiles.support.IUndoUnit):boolean; + /** + * Implements the {@link yfiles.support.IUndoUnit} interface. + * This implementation will always yield false. + * @see Specified by {@link yfiles.support.IUndoUnit#replaceUnit}. + */ + replaceUnit(unit:yfiles.support.IUndoUnit):boolean; + /** + * Adds a new {@link yfiles.support.IUndoUnit} to the queue. + * @param {yfiles.support.IUndoUnit} unit The unit of work to add. + */ + addToCompound(unit:yfiles.support.IUndoUnit):void; + /** + * Clears the internal collection of units. + */ + clear():void; + /** + * Undoes the next {@link yfiles.support.IUndoUnit}. + * @throws {yfiles.system.NotSupportedException} If an undo operation is already in progress. + * @throws {yfiles.lang.Exception} If {@link yfiles.support.CompoundUndoUnit#canUndo} would yield false. + * @see Specified by {@link yfiles.support.IUndoUnit#undo}. + */ + undo():void; + /** + * Redoes the next {@link yfiles.support.IUndoUnit}. + * @throws {yfiles.system.NotSupportedException} If an undo operation is already in progress. + * @throws {yfiles.lang.Exception} If {@link yfiles.support.CompoundUndoUnit#canRedo} would yield false. + * @see Specified by {@link yfiles.support.IUndoUnit#redo}. + */ + redo():void; + /** + * Tries to remove a given unit from this compound unit. + * This method will throw an exception if this unit has been undone or + * an undo or redo is in progress or this unit has already been disposed. + * This method will not automatically {@link yfiles.system.IDisposable#dispose Dispose} removed units. + * @param {yfiles.support.IUndoUnit} unit The unit to remove. + * @return {boolean} true iff the unit has been removed from this instance. + */ + removeUnit(unit:yfiles.support.IUndoUnit):boolean; + /** + * Determines whether a call to {@link yfiles.support.CompoundUndoUnit#undo} can be made. + * @see Specified by {@link yfiles.support.IUndoUnit#canUndo}. + */ + canUndo():boolean; + /** + * Determines whether a call to {@link yfiles.support.CompoundUndoUnit#redo} can be made. + * @see Specified by {@link yfiles.support.IUndoUnit#canRedo}. + */ + canRedo():boolean; + /** + * Disposes this unit and all of its contents. + * This unit cannot be used anymore after this has been invoked. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Determines whether this instance has been {@link yfiles.support.CompoundUndoUnit#dispose disposed.}. + * An instance that has been disposed cannot be {@link yfiles.support.CompoundUndoUnit#undo undone} or {@link yfiles.support.CompoundUndoUnit#redo redone}. + */ + disposed:boolean; + toString():string; + } + var CompoundUndoUnit:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with null names. + */ + new ():yfiles.support.CompoundUndoUnit; + /** + * Creates a new instance using the provided names. + */ + WithUndoAndRedoName:{ + new (undoName:string,redoName:string):yfiles.support.CompoundUndoUnit; + }; + }; + /** + * A simple mutable {@link yfiles.support.ILookup} implementation that + * is backed by a dictionary. + */ + export interface DictionaryLookup extends Object,yfiles.support.ILookup{ + /** + * Adds an in instance to the map for the given type. + * If value is null the entry is removed + * from the map. + * @param {yfiles.lang.Class} type the type that will be used as a key for queries + * @param {Object} value the instance implementing type or null + * @throws {yfiles.system.ArgumentException} if the parameters do not match + */ + put(type:yfiles.lang.Class,value:Object):void; + /** + * Performs the lookup using the map as the backing store. + * @param {yfiles.lang.Class} type the type to query + * @return {Object} the instance found in the map or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Determines whether the specified type exists in this lookup. + * @param {yfiles.lang.Class} type The type to look up. + * @return {boolean} + * true if the specified type exists in this lookup; otherwise, false. + */ + hasLookup(type:yfiles.lang.Class):boolean; + /** + * Removes the specified type from this lookup. + * @param {yfiles.lang.Class} type The type to remove from this instance. + */ + remove(type:yfiles.lang.Class):void; + } + var DictionaryLookup:{ + $class:yfiles.lang.Class; + /** + * Creates an instance with an initially empty map as backing store. + */ + new ():yfiles.support.DictionaryLookup; + /** + * Creates an instance with the given map as the backing store. + * @param {yfiles.collections.IDictionary.} map + * @throws {yfiles.system.ArgumentNullException} if the map is null + */ + WithDictionary:{ + new (map:yfiles.collections.IDictionary):yfiles.support.DictionaryLookup; + }; + }; + /** + * An abstract base implementation of {@link yfiles.support.IUndoUnit}. + * Subclasses need to override {@link yfiles.support.AbstractUndoUnit#undoImpl} and {@link yfiles.support.AbstractUndoUnit#redoImpl}, only. + */ + export interface AbstractUndoUnit extends Object,yfiles.support.IUndoUnit{ + /** + * Undoes the change that is represented by this unit. + * This method will only succeed if {@link yfiles.support.IUndoUnit#canUndo} yields true. + * @see {@link yfiles.support.IUndoUnit#canUndo} + * @see {@link yfiles.support.IUndoUnit#undoName} + * @see Specified by {@link yfiles.support.IUndoUnit#undo}. + */ + undo():void; + /** + * Actually undoes the operation. + */ + undoImpl():void; + /** + * Redoes the change that is represented by this unit. + * This method will only succeed if {@link yfiles.support.IUndoUnit#canRedo} yields true. + * @see {@link yfiles.support.IUndoUnit#canRedo} + * @see {@link yfiles.support.IUndoUnit#redoName} + * @see Specified by {@link yfiles.support.IUndoUnit#redo}. + */ + redo():void; + /** + * Actually redoes the operation. + */ + redoImpl():void; + /** + * Determines whether this instance can currently {@link yfiles.support.IUndoUnit#undo} its work. + * @return {boolean} Whether a call to {@link yfiles.support.IUndoUnit#undo} will succeed. + * @see Specified by {@link yfiles.support.IUndoUnit#canUndo}. + */ + canUndo():boolean; + /** + * Determines whether this instance can currently {@link yfiles.support.IUndoUnit#redo} its work. + * @return {boolean} Whether a call to {@link yfiles.support.IUndoUnit#redo} will succeed. + * @see Specified by {@link yfiles.support.IUndoUnit#canRedo}. + */ + canRedo():boolean; + /** + * Returns the name of the undo unit. + * Depending on the implementation and context this might be a human readable + * representation of the undo action or a symbolic name that needs localization. + * @see Specified by {@link yfiles.support.IUndoUnit#undoName}. + */ + undoName:string; + /** + * Returns the name of the redo unit. + * Depending on the implementation and context this might be a human readable + * representation of the redo action or a symbolic name that needs localization. + * @see Specified by {@link yfiles.support.IUndoUnit#redoName}. + */ + redoName:string; + /** + * Allows for collapsing multiple units into one. + * Implementation should try to incorporate the change of unit + * into this and if successful return true. + * This method will be called by the {@link yfiles.support.UndoEngine} to collapse multiple events + * into single events. + * Typically this unit has been placed onto an undo stack and unit + * should be placed on top of it. Both units have been done and might be undone in an upcoming action. + * If this method yields true, the provided unit will not be placed onto the stack but will be + * {@link yfiles.system.IDisposable#dispose}d. + * @param {yfiles.support.IUndoUnit} unit The unit to incorporate that happened after this unit. + * @return {boolean} Whether the state change of unit has been incorporated into this + * unit and unit can be disposed of. + * @see Specified by {@link yfiles.support.IUndoUnit#addUnit}. + */ + addUnit(unit:yfiles.support.IUndoUnit):boolean; + /** + * Allows for collapsing multiple units into one. + * Implementation should try to incorporate the change of unit + * into this and if successful return true. + * This method will be called by the {@link yfiles.support.UndoEngine} to collapse multiple events + * into single events. + * Typically this unit has already been placed onto an undo stack and this + * should be placed on top of it. Both units have been done and might be undone in an upcoming action. + * If this method yields true, this unit will replace the unit on the top of the stack and unit will be + * {@link yfiles.system.IDisposable#dispose}d. + * @param {yfiles.support.IUndoUnit} unit The unit to incorporate that happened before this unit. + * @return {boolean} Whether the state change of unit has been incorporated into this + * unit and unit can be disposed of. + * @see Specified by {@link yfiles.support.IUndoUnit#replaceUnit}. + */ + replaceUnit(unit:yfiles.support.IUndoUnit):boolean; + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + toString():string; + } + var AbstractUndoUnit:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the given name as undo and redo name. + * @param {string} undoName The undo and redo name. + */ + WithName:{ + new (undoName:string):yfiles.support.AbstractUndoUnit; + }; + /** + * Creates a new instance using the given name as undo and redo name. + * @param {string} undoName The undo name. + * @param {string} redoName The redo name. + */ + WithUndoAndRedoName:{ + new (undoName:string,redoName:string):yfiles.support.AbstractUndoUnit; + }; + }; + /** + * Indicates that the value of marked element could be null sometimes, so the check for null is necessary before its usage. + * This attribute can be used by tools like Resharper to aid during coding and error analysis. + */ + export interface CanBeNullAttribute extends yfiles.lang.Attribute{ + } + var CanBeNullAttribute:{ + $class:yfiles.lang.Class; + new ():yfiles.support.CanBeNullAttribute; + }; + /** + * A {@link yfiles.model.ICollectionModel} that is the composite of two models of the same type. + */ + export interface CompositeCollectionModel extends Object,yfiles.system.IDisposable,yfiles.model.ICollectionModel{ + /** + * An event that will be triggered if an item has been added to this collection. + */ + addItemAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item has been added to this collection. + */ + removeItemAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item has been removed from this collection. + */ + addItemRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item has been removed from this collection. + */ + removeItemRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item in this collection has changed significantly. + * It is up to the implementation whether and when to trigger this event. + */ + addItemChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item in this collection has changed significantly. + * It is up to the implementation whether and when to trigger this event. + */ + removeItemChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * . + * To comply with the order induced by the enumerator, this method adds the given item to the + * second model collection. If this is a read-only instance, a {@link yfiles.system.NotSupportedException} is + * thrown instead. + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:T):void; + /** + * Removes all items from this collection. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @return {boolean} true if the given item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:T):boolean; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:T[],arrayIndex:number):void; + /** + * . + * To comply with the order induced by the enumerator, this method first tries to remove the + * given item from the first model collection, and if that is not successful, tries to remove it from + * the second model collection. If this is a read-only instance, a + * {@link yfiles.system.NotSupportedException} is thrown instead. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:T):boolean; + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * Whether this collection is read-only. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + } + var CompositeCollectionModel:{ + $class:yfiles.lang.Class; + /** + * Creates a new read-only instance using the two provided collection models. + * @param {yfiles.model.ICollectionModel.} collection1 The first collection. + * @param {yfiles.model.ICollectionModel.} collection2 The second collection. + */ + new (collection1:yfiles.model.ICollectionModel,collection2:yfiles.model.ICollectionModel):yfiles.support.CompositeCollectionModel; + /** + * Creates a instance using the two provided collection models. + * @param {yfiles.model.ICollectionModel.} collection1 The first collection. + * @param {yfiles.model.ICollectionModel.} collection2 The second collection. + * @param {boolean} readOnly Specifies whether this model is read-only. + */ + WithReadOnly:{ + new (collection1:yfiles.model.ICollectionModel,collection2:yfiles.model.ICollectionModel,readOnly:boolean):yfiles.support.CompositeCollectionModel; + }; + }; + /** + * A composite enumerable that enumerates two given enumerables one after the other. + * @see {@link yfiles.support.CompositeEnumerator} + */ + export interface CompositeEnumerable extends Object,yfiles.collections.IEnumerable{ + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + } + var CompositeEnumerable:{ + $class:yfiles.lang.Class; + /** + * Creates an instance that is a composite of the given two instances. + * @param {yfiles.collections.IEnumerable.} first The first one. + * @param {yfiles.collections.IEnumerable.} second The second one. + */ + new (first:yfiles.collections.IEnumerable,second:yfiles.collections.IEnumerable):yfiles.support.CompositeEnumerable; + }; + /** + * A read-only {@link yfiles.model.ICollectionModel} that is the composite of two models of compatible types. + */ + export interface CompositeCollectionModel2 extends Object,yfiles.system.IDisposable,yfiles.model.ICollectionModel{ + /** + * An event that will be triggered if an item has been added to this collection. + */ + addItemAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item has been added to this collection. + */ + removeItemAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item has been removed from this collection. + */ + addItemRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item has been removed from this collection. + */ + removeItemRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item in this collection has changed significantly. + * It is up to the implementation whether and when to trigger this event. + */ + addItemChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item in this collection has changed significantly. + * It is up to the implementation whether and when to trigger this event. + */ + removeItemChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * . + * Throws a {@link yfiles.system.NotSupportedException} since this is a read-only collection. + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:T):void; + /** + * Removes all items from this collection. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @return {boolean} true if the given item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:T):boolean; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:T[],arrayIndex:number):void; + /** + * . + * Throws a {@link yfiles.system.NotSupportedException} since this is a read-only collection. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:T):boolean; + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * Returns true since this is a read-only collection. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + } + var CompositeCollectionModel2:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the two provided collection models. + * @param {yfiles.model.ICollectionModel.} collection1 The first collection. + * @param {yfiles.model.ICollectionModel.} collection2 The second collection. + */ + new (rType:yfiles.lang.Class,sType:yfiles.lang.Class,collection1:yfiles.model.ICollectionModel,collection2:yfiles.model.ICollectionModel):yfiles.support.CompositeCollectionModel2; + }; + /** + * Indicates that the value of marked element could never be null. + * This attribute can be used by tools like Resharper to aid during coding and error analysis. + */ + export interface NotNullAttribute extends yfiles.lang.Attribute{ + } + var NotNullAttribute:{ + $class:yfiles.lang.Class; + new ():yfiles.support.NotNullAttribute; + }; + /** + * Utility class that implements the {@link yfiles.support.ILookup} interface + * by delegating to a function of type function(object, Type). + */ + export interface CallbackLookup extends Object,yfiles.support.ILookup{ + /** + * Gets or sets the subject to use for calls to the {@link yfiles.support.CallbackLookup#handler} function. + */ + subject:Object; + /** + * Gets or sets the actual callback implementation. + */ + handler:(subject:Object,type:yfiles.lang.Class)=>Object; + /** + * Performs the actual {@link yfiles.support.ILookup#lookup} operation. + * If a {@link yfiles.support.CallbackLookup#handler} is specified that handler is used to perform the query. + * @param {yfiles.lang.Class} type The type to query + * @return {Object} The result of the query or null if the handler is null. + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + } + var CallbackLookup:{ + $class:yfiles.lang.Class; + /** + * Creates this instance using a null + * {@link yfiles.support.CallbackLookup#subject} and specifies the {@link yfiles.support.CallbackLookup#handler}. + * @param {function(Object, yfiles.lang.Class):Object} handler The handler to use for {@link yfiles.support.CallbackLookup#lookup} calls. + */ + new (handler:(subject:Object,type:yfiles.lang.Class)=>Object):yfiles.support.CallbackLookup; + /** + * Creates this instance using the specified {@link yfiles.support.CallbackLookup#handler} and {@link yfiles.support.CallbackLookup#subject}. + * @param {Object} subject The subject to use for the calls to the {@link yfiles.support.CallbackLookup#handler} function. + * @param {function(Object, yfiles.lang.Class):Object} handler The handler to use for {@link yfiles.support.CallbackLookup#lookup} calls. + */ + WithSubject:{ + new (handler:(subject:Object,type:yfiles.lang.Class)=>Object,subject:Object):yfiles.support.CallbackLookup; + }; + }; + /** + * A utility class that implements an immutable always empty {@link yfiles.collections.IEnumerable}. + */ + export interface EmptyEnumerable extends Object,yfiles.collections.IEnumerable{ + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + } + var EmptyEnumerable:{ + $class:yfiles.lang.Class; + /** + * A shareable static instance of this class. + */ + INSTANCE:yfiles.collections.IEnumerable; + }; + /** + * Extension method holder class that extends the + * {@link yfiles.geometry.ISize} type with utility methods. + * @see {@link yfiles.geometry.ISize} + */ + export interface SizeExtensions extends Object{ + } + var SizeExtensions:{ + $class:yfiles.lang.Class; + /** + * Converts the {@link yfiles.geometry.ISize} to a {@link yfiles.geometry.SizeD} struct. + * @param {yfiles.geometry.ISize} size The size to convert (a this parameter so that this method can be used as an extension method.) + * @return {yfiles.geometry.SizeD} A {@link yfiles.geometry.SizeD} struct that has been initialized with the current values of size. + */ + toSize(size:yfiles.geometry.ISize):yfiles.geometry.SizeD; + }; + /** + * A collection model that filters items from the underlying collection given a predicate function. + */ + export interface FilteredCollectionModel extends Object,yfiles.model.ICollectionModel,yfiles.system.IDisposable{ + /** + * Callback that indicates that the item has been removed in the backing store. + * This method simply delegates to {@link yfiles.support.FilteredCollectionModel#onItemRemoved}. + * @see {@link yfiles.support.FilteredCollectionModel#onItemRemovedByFilter} + * @param {yfiles.model.ItemEventArgs.} itemEventArgs The {@link yfiles.model.ItemEventArgs} instance containing the event data. + */ + onItemRovedInBackingStore(itemEventArgs:yfiles.model.ItemEventArgs):void; + /** + * Called whenever an item has been removed. + * Fires {@link yfiles.support.FilteredCollectionModel#addItemRemovedListener ItemRemoved}. + * @param {yfiles.model.ItemEventArgs.} evt The event parameter. + */ + onItemRemoved(evt:yfiles.model.ItemEventArgs):void; + /** + * Called whenever an item has been changed. + * Fires {@link yfiles.support.FilteredCollectionModel#addItemChangedListener ItemChanged}. + * @param {yfiles.model.ItemEventArgs.} evt The event parameter. + */ + onItemChanged(evt:yfiles.model.ItemEventArgs):void; + /** + * Callback that indicates that the item has been add in the backing store. + * This method simply delegates to {@link yfiles.support.FilteredCollectionModel#onItemAdded}. + * @see {@link yfiles.support.FilteredCollectionModel#onItemAddedByFilter} + * @param {yfiles.model.ItemEventArgs.} itemEventArgs The {@link yfiles.model.ItemEventArgs} instance containing the event data. + */ + onItemAddedInBackingStore(itemEventArgs:yfiles.model.ItemEventArgs):void; + /** + * Called whenever an item has been added. + * Fires {@link yfiles.support.FilteredCollectionModel#addItemAddedListener ItemAdded}. + * @param {yfiles.model.ItemEventArgs.} evt The event parameter. + */ + onItemAdded(evt:yfiles.model.ItemEventArgs):void; + /** + * An event that will be triggered if an item has been added to this collection. + */ + addItemAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item has been added to this collection. + */ + removeItemAddedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item has been removed from this collection. + */ + addItemRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item has been removed from this collection. + */ + removeItemRemovedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item in this collection has changed significantly. + * It is up to the implementation whether and when to trigger this event. + */ + addItemChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * An event that will be triggered if an item in this collection has changed significantly. + * It is up to the implementation whether and when to trigger this event. + */ + removeItemChangedListener(value:(source:Object,evt:yfiles.model.ItemEventArgs)=> void):void; + /** + * Adds the given item to the collection. + * @param {T} item + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:T):void; + /** + * Removes all items from this collection. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @return {boolean} true if the given item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:T):boolean; + /** + * Determines whether the given item is accepted by this instance. + */ + accepts(item:T):boolean; + /** + * Called by clients to indicate that the {@link system.Predicate} function + * has changed in such a way that items that have previously been + * accepted might not be accepted anymore and vice versa. + */ + predicateChanged():void; + /** + * Callback that indicates that the item has been removed by the filter. + * This method simply delegates to {@link yfiles.support.FilteredCollectionModel#onItemRemoved}. + * @see {@link yfiles.support.FilteredCollectionModel#onItemRovedInBackingStore} + * @param {yfiles.model.ItemEventArgs.} itemEventArgs The {@link yfiles.model.ItemEventArgs} instance containing the event data. + */ + onItemRemovedByFilter(itemEventArgs:yfiles.model.ItemEventArgs):void; + /** + * Callback that indicates that the item has been add by the filter. + * This method simply delegates to {@link yfiles.support.FilteredCollectionModel#onItemAdded}. + * @see {@link yfiles.support.FilteredCollectionModel#onItemAddedInBackingStore} + * @param {yfiles.model.ItemEventArgs.} itemEventArgs The {@link yfiles.model.ItemEventArgs} instance containing the event data. + */ + onItemAddedByFilter(itemEventArgs:yfiles.model.ItemEventArgs):void; + /** + * Called by clients to indicate that the {@link system.Predicate} function + * has changed in such a way that for the provided item that has previously been + * accepted the predicate might not have changed. + */ + predicateChangedWithForItem(forItem:T):void; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:T[],arrayIndex:number):void; + /** + * Removes the given item from this collection. + * @param {T} item The item to remove. + * @return {boolean} Whether the item was removed from the collection. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:T):boolean; + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * Whether this collection is read-only. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + } + var FilteredCollectionModel:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the provided instance and predicate. + */ + new (inner:yfiles.model.ICollectionModel,itemPredicate:(obj:T)=>boolean):yfiles.support.FilteredCollectionModel; + }; + /** + * A helper holder class that can contain a {@link yfiles.support.Future#value} + * of a specific type. + * Typically {@link yfiles.support.Future#hasValue} will be false + * until at a later point in time {@link yfiles.support.Future#onValueDetermined} + * is called and the {@link yfiles.support.Future#value} + * and {@link yfiles.support.Future#hasValue} properties are being updated and + * the {@link yfiles.support.Future#addPropertyChangedListener PropertyChanged} event is triggered. + */ + export interface Future extends Object,yfiles.system.INotifyPropertyChanged{ + /** + * The value of this future, which can be a default value unless + * {@link yfiles.support.Future#hasValue} yields true. + */ + value:T; + /** + * Gets a value indicating whether this instance has been {@link yfiles.support.Future#onValueDetermined assigned} + * a {@link yfiles.support.Future#value}. + * Value: true if this instance has been assigned a value; otherwise, false. + */ + hasValue:boolean; + /** + * Called when the {@link yfiles.support.Future#value} property of this future has been determined. + * This will set the {@link yfiles.support.Future#hasValue} property to true and + * assign the {@link yfiles.support.Future#value} property. Also the corresponding {@link yfiles.support.Future#addPropertyChangedListener PropertyChanged} + * events will be triggered if necessary. + * @param {T} value The value. + */ + onValueDetermined(value:T):void; + /** + * Occurs when a property value changes. + * This event will be triggered for {@link yfiles.support.Future#hasValue} changes + * and changes of the {@link yfiles.support.Future#value} property. + * Note that if the determined future value is the same as the default, + * the event will only be triggered for the {@link yfiles.support.Future#hasValue} property. + */ + addPropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Occurs when a property value changes. + * This event will be triggered for {@link yfiles.support.Future#hasValue} changes + * and changes of the {@link yfiles.support.Future#value} property. + * Note that if the determined future value is the same as the default, + * the event will only be triggered for the {@link yfiles.support.Future#hasValue} property. + */ + removePropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + } + var Future:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.support.Future} class. + */ + new ():yfiles.support.Future; + /** + * Initializes a new instance of the {@link yfiles.support.Future} class. + * Note that {@link yfiles.support.Future#hasValue} will still be false until + * {@link yfiles.support.Future#onValueDetermined} is called. + * @param {T} defaultValue The default value. + */ + WithDefault:{ + new (defaultValue:T):yfiles.support.Future; + }; + }; + /** + * Extension method holder class that extends the + * {@link yfiles.geometry.IRectangle}, {@link yfiles.geometry.IMutableRectangle}, and {@link yfiles.geometry.IReshapeable} + * types with utility methods. + * @see {@link yfiles.geometry.IRectangle} + * @see {@link yfiles.geometry.IMutableRectangle} + * @see {@link yfiles.geometry.IReshapeable} + */ + export interface RectangleExtensions extends Object{ + } + var RectangleExtensions:{ + $class:yfiles.lang.Class; + /** + * Sets the center of the rectangle to the provided value. + * @param {yfiles.geometry.IMutableRectangle} rectangle The oriented rectangle (a this parameter so that this method can be used as an extension method.). + * @param {yfiles.geometry.PointD} center The new center coordinates. + */ + setCenter(rectangle:yfiles.geometry.IMutableRectangle,center:yfiles.geometry.PointD):void; + /** + * Reshapes the specified reshapeable to the given new bounds. + * @param {yfiles.geometry.IReshapeable} reshapeable The reshapeable (a this parameter so that this method can be used as an extension method.). + * @param {yfiles.geometry.IRectangle} newBounds The bounds to set to the reshapeable. + */ + reshapeToRectangle(reshapeable:yfiles.geometry.IReshapeable,newBounds:yfiles.geometry.IRectangle):void; + /** + * Reshapes the specified reshapeable to the given new bounds. + * @param {yfiles.geometry.IReshapeable} reshapeable The reshapeable (a this parameter so that this method can be used as an extension method.). + * @param {yfiles.geometry.RectD} newBounds The bounds to set to the reshapeable. + */ + reshapeToRectD(reshapeable:yfiles.geometry.IReshapeable,newBounds:yfiles.geometry.RectD):void; + /** + * Gets the current size of the rectangle as a {@link yfiles.geometry.SizeD} struct. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle (a this parameter so that this method can be used as an extension method.). + * @return {yfiles.geometry.SizeD} The current size of the rectangle. + */ + getRectangleSize(rectangle:yfiles.geometry.IRectangle):yfiles.geometry.SizeD; + /** + * Sets the size of the rectangle to the values of a {@link yfiles.geometry.SizeD} struct. + * @param {yfiles.geometry.IMutableRectangle} reshapeable The rectangle (a this parameter so that this method can be used as an extension method.). + * @param {yfiles.geometry.SizeD} newSize The new size to set to the rectangle. + */ + setSize(reshapeable:yfiles.geometry.IMutableRectangle,newSize:yfiles.geometry.SizeD):void; + /** + * Create a dynamic {@link yfiles.geometry.IPoint} implementation + * that always points to the center of the given rectangle. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle that will be used for providing the center + * (a this parameter so that this method can be used as an extension method.). + * @return {yfiles.geometry.IPoint} A live view of the rectangle's center. + */ + getRectangleDynamicCenter(rectangle:yfiles.geometry.IRectangle):yfiles.geometry.IPoint; + /** + * Create a dynamic {@link yfiles.geometry.IMutablePoint} implementation + * that always points to the center of the given rectangle. + * Modifying the point's x and y coordinates, will in fact move the rectangle's + * position accordingly. + * @param {yfiles.geometry.IMutableRectangle} rectangle The rectangle that will be used for providing the center + * (a this parameter so that this method can be used as an extension method.). + * @return {yfiles.geometry.IMutablePoint} A live view of the rectangle's center. + */ + getMutableRectangleDynamicCenter(rectangle:yfiles.geometry.IMutableRectangle):yfiles.geometry.IMutablePoint; + /** + * Create a dynamic {@link yfiles.geometry.IPoint} implementation + * that always points to the specified position at the given rectangle. + * @param {yfiles.geometry.IRectangle} rect The rectangle that will be used for providing the center + * (a this parameter so that this method can be used as an extension method.). + * @param {yfiles.input.HandlePositions} position The position to use. + * @return {yfiles.geometry.IPoint} A live view of the rectangle's center. + */ + getDynamicPoint(rect:yfiles.geometry.IRectangle,position:yfiles.input.HandlePositions):yfiles.geometry.IPoint; + /** + * Determines whether the given rectangle contains the provided point. + * @param {yfiles.geometry.IRectangle} rect The rectangle (a this parameter so that this method can be used as an extension method.). + * @param {yfiles.geometry.IPoint} point The point to test. + * @return {boolean} true iff the point lies inside the rectangle. + */ + containsPoint(rect:yfiles.geometry.IRectangle,point:yfiles.geometry.IPoint):boolean; + /** + * Determines whether the given rectangle contains the provided point. + * @param {yfiles.geometry.IRectangle} rect The rectangle (a this parameter so that this method can be used as an extension method.). + * @param {yfiles.geometry.PointD} point The point to test. + * @return {boolean} true iff the point lies inside the rectangle. + */ + containsPointD(rect:yfiles.geometry.IRectangle,point:yfiles.geometry.PointD):boolean; + /** + * Creates the union of two rectangles, placing the result in the this parameter. + * Either of the two parameters rectangles may be the same as the first parameter. + * The result is placed into the this parameter. + * This method treats rectangles with negative width or height as empty. + * @param {yfiles.geometry.IRectangle} rect1 The first rectangle to create the union of. + * @param {yfiles.geometry.IRectangle} rect2 The second rectangle to create the union of. + * @param {yfiles.geometry.IMutableRectangle} rect The rectangle to hold the result (a this parameter so that this method can be used as an extension method.). + */ + setToUnion(rect:yfiles.geometry.IMutableRectangle,rect1:yfiles.geometry.IRectangle,rect2:yfiles.geometry.IRectangle):void; + /** + * Copies the current values of the rectangle to {@link yfiles.geometry.RectD} struct. + * This method can be used to obtain a copy of the current state of the rectangle + * and for using the utility methods that are available for the {@link yfiles.geometry.RectD} + * type. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle to read the values from (a this parameter so that this method can be used as an extension method.). + * @return {yfiles.geometry.RectD} A {@link yfiles.geometry.RectD} that holds the values of the rectangle + * at the time of the invocation. + * @see {@link yfiles.support.RectangleExtensions#reshapeToRectD} + * @see {@link yfiles.geometry.RectD#toMutableRectangle} + * @see {@link yfiles.geometry.RectD#toImmutableRectangle} + */ + toRectD(rectangle:yfiles.geometry.IRectangle):yfiles.geometry.RectD; + /** + * Gets the coordinates of the top left corner of the rectangle as a {@link yfiles.geometry.PointD}. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle to read the coordinates from + * (a this parameter so that this method can be used as an extension method.). + * @return {yfiles.geometry.PointD} The current coordinates of the corner. + */ + getTopLeft(rectangle:yfiles.geometry.IRectangle):yfiles.geometry.PointD; + /** + * Gets the coordinates of the bottom left corner of the rectangle as a {@link yfiles.geometry.PointD}. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle to read the coordinates from + * (a this parameter so that this method can be used as an extension method.). + * @return {yfiles.geometry.PointD} The current coordinates of the corner. + */ + getBottomLeft(rectangle:yfiles.geometry.IRectangle):yfiles.geometry.PointD; + /** + * Gets the coordinates of the center of the rectangle as a {@link yfiles.geometry.PointD}. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle to read the coordinates from + * (a this parameter so that this method can be used as an extension method.). + * @return {yfiles.geometry.PointD} The current coordinates of the center. + */ + getRectangleCenter(rectangle:yfiles.geometry.IRectangle):yfiles.geometry.PointD; + /** + * Gets the maximum X coordinate of the rectangle. + * This is the x coordinate of the right side of the rectangle, + * or the left side if the rectangle is {@link yfiles.support.RectangleExtensions#isEmpty}. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle (a this parameter so that this method can be used as an extension method.). + * @return {number} The maximum x coordinate of the rectangle's corners. + */ + getMaxX(rectangle:yfiles.geometry.IRectangle):number; + /** + * Determines whether the specified rectangle is empty. + * {@link yfiles.geometry.IRectangle} instances are considered empty if + * their {@link yfiles.geometry.ISize#width} or {@link yfiles.geometry.ISize#height} + * is less than 0.0d. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle + * (a this parameter so that this method can be used as an extension method.). + * @return {boolean} + * true if the specified rectangle is empty; otherwise, false. + */ + isEmpty(rectangle:yfiles.geometry.IRectangle):boolean; + /** + * Gets the maximum Y coordinate of the rectangle. + * This is the y coordinate of the bottom side of the rectangle, + * or the top side if the rectangle is {@link yfiles.support.RectangleExtensions#isEmpty}. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle (a this parameter so that this method can be used as an extension method.). + * @return {number} The maximum y coordinate of the rectangle's corners. + */ + getMaxY(rectangle:yfiles.geometry.IRectangle):number; + /** + * Gets the coordinates of the top right corner of the rectangle as a {@link yfiles.geometry.PointD}. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle to read the coordinates from + * (a this parameter so that this method can be used as an extension method.). + * @return {yfiles.geometry.PointD} The current coordinates of the corner. + */ + getTopRight(rectangle:yfiles.geometry.IRectangle):yfiles.geometry.PointD; + /** + * Gets the coordinates of the bottom right corner of the rectangle as a {@link yfiles.geometry.PointD}. + * @param {yfiles.geometry.IRectangle} rectangle The rectangle to read the coordinates from + * (a this parameter so that this method can be used as an extension method.). + * @return {yfiles.geometry.PointD} The current coordinates of the corner. + */ + getBottomRight(rectangle:yfiles.geometry.IRectangle):yfiles.geometry.PointD; + /** + * Adds a rectangle to another one. + * The result is placed into the first rectangle, which is returned. + * If either of the two rectangles is empty, i.e. it's width or height + * is negative, the result will be the other rectangle. + * @param {yfiles.geometry.IMutableRectangle} rect1 The rectangle to modify + * (a this parameter so that this method can be used as an extension method.). + * @param {yfiles.geometry.IRectangle} rect2 The rectangle to be added. + * @return {void} The first rectangle. + */ + addRectangle(rect1:yfiles.geometry.IMutableRectangle,rect2:yfiles.geometry.IRectangle):void; + /** + * Adds a point to a rectangle, possibly enlarging the rectangle. + * If the rectangle is initially empty, i.e. its width or height is negative, + * the bounds of the rectangle will be set to (p.x, p.y, 0, 0) + * @param {yfiles.geometry.IMutableRectangle} rect The rectangle to add to + * (a this parameter so that this method can be used as an extension method.). + * @param {yfiles.geometry.IPoint} p The coordinate to include in the bounds. + * @return {void} the resulting rectangle, which is rect + */ + addPoint(rect:yfiles.geometry.IMutableRectangle,p:yfiles.geometry.IPoint):void; + }; + /** + * Extension method holder class that extends the + * {@link yfiles.support.ILookup} and {@link yfiles.support.ILookupDecorator} types with utility methods. + * @see {@link yfiles.support.ILookup} + * @see {@link yfiles.support.ILookupDecorator} + */ + export interface LookupExtensions extends Object{ + } + var LookupExtensions:{ + $class:yfiles.lang.Class; + /** + * Typesafe convenience method for the {@link yfiles.support.ILookup#lookup} method. + * @param {yfiles.support.ILookup} lookup The lookup to operate on (a this parameter so that this method can be used as an extension method.). + * @return {T} The result of the query, or null. + */ + get(tType:yfiles.lang.Class,lookup:yfiles.support.ILookup):T; + /** + * Typesafe convenience method for the {@link yfiles.support.ILookup#lookup} method. + * @param {yfiles.support.ILookup} lookup The lookup to operate on (a this parameter so that this method can be used as an extension method.). + * @return {T} The result of the query, never null. + * @throws {yfiles.system.KeyNotFoundException} If the lookup did not yield a non-null result + * for the type. + */ + safeGet(tType:yfiles.lang.Class,lookup:yfiles.support.ILookup):T; + /** + * Typesafe convenience method for the {@link yfiles.support.IContextLookup#lookupForItem} method. + * @param {yfiles.support.IContextLookup} lookup The context lookup to operate on (a this parameter so that this method can be used as an extension method.). + * @param {Object} item The item to pass to the {@link yfiles.support.IContextLookup#lookupForItem} method. + * @return {T} The result of the query, or null. + */ + contextGet(tType:yfiles.lang.Class,lookup:yfiles.support.IContextLookup,item:Object):T; + /** + * Typesafe convenience method for the {@link yfiles.support.IContextLookup#lookupForItem} method. + * @param {yfiles.support.IContextLookup} lookup The context lookup to operate on (a this parameter so that this method can be used as an extension method.). + * @param {Object} item The item to pass to the {@link yfiles.support.IContextLookup#lookupForItem} method. + * @return {T} The result of the query, never null. + * @throws {yfiles.system.KeyNotFoundException} If the context lookup did not yield a non-null result + * for the type. + */ + safeContextGet(tType:yfiles.lang.Class,lookup:yfiles.support.IContextLookup,item:Object):T; + /** + * Convenience method that can be used instead of the {@link yfiles.support.ILookupDecorator#addLookup} + * method to easily add a lookup implementation for a given type using a function of type function(TContext). + * Since this extension method is safe to invoke on null {@link yfiles.support.ILookupDecorator} + * objects, it can be used to conveniently decorate the lookup of various types with very little but concise code: + *

+      * var decorator = model.lookup(yfiles.support.ILookupDecorator.$class);
+      * var chainLink = decorator.addWithFactory(ItemType.$class, IQueryType.$class, factory);
+      * 
+ * @param {yfiles.support.ILookupDecorator} decorator The decorator instance to use, which may be null. (a this parameter so that this method can be used as an extension method.) + * @param {function(TContext):TResult} factory The factory delegate that will be used to satisfy queries of type TResult. + * If the factory delegate yields null, this implementation will fallback to the lookup chain and return + * the result of the remainder of the chain. (See {@link yfiles.support.LookupExtensions#addDecoratorWithDelegateAndNullIsFallback}). + * @return {yfiles.support.IContextLookupChainLink} The {@link yfiles.support.IContextLookupChainLink} instance as returned by the {@link yfiles.support.ILookupDecorator#addLookup} + * call or null, if either decorator was null, or it + * {@link yfiles.support.ILookupDecorator#canDecorate could not decorate} the TContext type. + */ + addDecoratorWithDelegate(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,decorator:yfiles.support.ILookupDecorator,factory:(context:TContext)=>TResult):yfiles.support.IContextLookupChainLink; + /** + * Convenience method that can be used instead of the {@link yfiles.support.ILookupDecorator#addLookup} + * method to easily add a lookup implementation for a given type using a function of type function(TContext). + * Since this extension method is safe to invoke on null {@link yfiles.support.ILookupDecorator} + * objects, it can be used to conveniently decorate the lookup of various types with very little but concise code: + *

+      * var decorator = model.lookup(yfiles.support.ILookupDecorator.$class);
+      * var chainLink = decorator.addWithFactoryAndNullIsFallback (ItemType.$class, IQueryType.$class, factory, false);
+      * 
+ * @param {yfiles.support.ILookupDecorator} decorator The decorator instance to use, which may be null. (a this parameter so that this method can be used as an extension method.) + * @param {function(TContext):TResult} factory The factory delegate that will be used to satisfy queries of type TResult. + * @param {boolean} nullIsFallback Whether to treat null-results of the factory + * as hints to use the remainder of the chain link or to actually yield the value as the final result. + * @return {yfiles.support.IContextLookupChainLink} The {@link yfiles.support.IContextLookupChainLink} instance as returned by the {@link yfiles.support.ILookupDecorator#addLookup} + * call or null, if either decorator was null, or it + * {@link yfiles.support.ILookupDecorator#canDecorate could not decorate} the TContext type. + */ + addDecoratorWithDelegateAndNullIsFallback(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,decorator:yfiles.support.ILookupDecorator,factory:(context:TContext)=>TResult,nullIsFallback:boolean):yfiles.support.IContextLookupChainLink; + /** + * This method is the same as calling {@link yfiles.support.LookupExtensions#addChainWithDelegateAndNullIsFallback} + * with a true as the final argument. + * @param {yfiles.support.LookupChain} chain The chain to add the link to. + * @param {function(TContext):TResult} factory The factory that will be called for queries to TResult. + * @return {yfiles.support.IContextLookupChainLink} The link that has been registered with the chain. + */ + addChainWithDelegate(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,chain:yfiles.support.LookupChain,factory:(context:TContext)=>TResult):yfiles.support.IContextLookupChainLink; + /** + * A convenience method that adds a {@link yfiles.support.IContextLookupChainLink} to the given chain + * that is based on a function of type function(TContext). + * Depending on nullIsFallback, null return values of the + * factory will be interpreted as the final result or indicate to the implementation + * that the chain should be queried for the result. + * @param {yfiles.support.LookupChain} chain The chain to add the link to. + * @param {function(TContext):TResult} factory The factory that will be called for queries to TResult. + * @param {boolean} nullIsFallback If set to true, null return values of the factory method will be + * interpreted as the final result, otherwise the request will propagate down the chain. + * @return {yfiles.support.IContextLookupChainLink} The link that has been registered with the chain. + */ + addChainWithDelegateAndNullIsFallback(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,chain:yfiles.support.LookupChain,factory:(context:TContext)=>TResult,nullIsFallback:boolean):yfiles.support.IContextLookupChainLink; + /** + * Convenience method that can be used instead of the {@link yfiles.support.ILookupDecorator#addLookup} + * method to easily add a lookup implementation for a given type using a function of type function(object, object). + * This method is closely related to the {@link yfiles.support.LookupExtensions#addDecoratorWithDelegate} + * method, however it passes the result of the remaining chain to the delegate for convenient wrapping of + * the result. Note that if the implementation does not depend on the previous result in order to wrap it, it + * is better to use that variant, in order to avoid the possibly costly evaluation + * of the remainder of the lookup chain. + * Since this extension method is safe to invoke on null {@link yfiles.support.ILookupDecorator} + * objects, it can be used to conveniently decorate the lookup of various types with very little but concise code: + *

+      * var decorator = model.lookup(yfiles.support.ILookupDecorator.$class);
+      * var chainLink = decorator.addWithWrapperFactoryAndDecorateNull(ItemType.$class, IQueryType.$class, queryTypeWrapper, true);
+      * 
+ * @param {yfiles.support.ILookupDecorator} decorator The decorator instance to use, which may be null. (a this parameter so that this method can be used as an extension method.) + * @param {function(TContext, TResult):TResult} wrapperFactory The factory delegate that will be used to satisfy queries of type TResult + * @param {boolean} decorateNull Whether to treat actually decorate null-results of remainder of the chain. + * If this is set to false, the wrapperFactory will never be called with null + * as the second argument but the result of the query for this chain link will be the null value. + * @return {yfiles.support.IContextLookupChainLink} The {@link yfiles.support.IContextLookupChainLink} instance as returned by the {@link yfiles.support.ILookupDecorator#addLookup} + * call or null, if either decorator was null, or it + * {@link yfiles.support.ILookupDecorator#canDecorate could not decorate} the TContext type. + */ + addDecoratorWithWrapperFactoryAndNullIsFallback(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,decorator:yfiles.support.ILookupDecorator,wrapperFactory:(item:TContext,baseImplementation:TResult)=>TResult,decorateNull:boolean):yfiles.support.IContextLookupChainLink; + /** + * This method is the same as calling {@link yfiles.support.LookupExtensions#addChainWithWrapperFactoryAndNullIsFallback} + * with a false as the final argument. + * @param {yfiles.support.LookupChain} chain The chain to add the link to. + * @param {function(TContext, TResult):TResult} wrapperFactory The wrapper factory that will be called for queries to TResult. + * @return {yfiles.support.IContextLookupChainLink} The link that has been registered with the chain. + */ + addChainWithWrapperFactory(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,chain:yfiles.support.LookupChain,wrapperFactory:(item:TContext,baseImplementation:TResult)=>TResult):yfiles.support.IContextLookupChainLink; + /** + * A convenience method that adds a {@link yfiles.support.IContextLookupChainLink} to the given chain + * that is based on a function of type function(object, object). + * Depending on decorateNull, null results of the underlying chain will + * be passed to the wrapperFactory, or simply yielded as the final result. + * @param {yfiles.support.LookupChain} chain The chain to add the link to. + * @param {function(TContext, TResult):TResult} wrapperFactory The wrapper factory that will be called for queries to TResult to + * wrap the result of the query to the remainder of the chain. + * @param {boolean} decorateNull if set to true null return values of the remainder of the chain + * will be passed to the wrapper factory so that it can decorate the null, otherwise null will be yielded as the final result. + * @return {yfiles.support.IContextLookupChainLink} The link that has been registered with the chain. + */ + addChainWithWrapperFactoryAndNullIsFallback(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,chain:yfiles.support.LookupChain,wrapperFactory:(item:TContext,baseImplementation:TResult)=>TResult,decorateNull:boolean):yfiles.support.IContextLookupChainLink; + /** + * Convenience method that can be used instead of the {@link yfiles.support.ILookupDecorator#addLookup} + * method to easily add a lookup implementation for a given type using a function of type function(object, object). + * This method is closely related to the {@link yfiles.support.LookupExtensions#addDecoratorWithDelegate} + * method, however it passes the result of the remaining chain to the delegate for convenient wrapping of + * the result. Note that if the implementation does not depend on the previous result in order to wrap it, it + * is better to use that variant, in order to avoid the possibly costly evaluation + * of the remainder of the lookup chain. + * Since this extension method is safe to invoke on null {@link yfiles.support.ILookupDecorator} + * objects, it can be used to conveniently decorate the lookup of various types with very little but concise code: + *

+      * var decorator = model.lookup(yfiles.support.ILookupDecorator.$class);
+      * var chainLink = decorator.addWithWrapperFactory(ItemType.$class, IQueryType.$class, queryTypeWrapper);
+      * 
+ * @param {yfiles.support.ILookupDecorator} decorator The decorator instance to use, which may be null. (a this parameter so that this method can be used as an extension method.) + * @param {function(TContext, TResult):TResult} wrapperFactory The factory delegate that will be used to satisfy queries of type TResult. + * If the factory delegate yields null, this implementation will yield that value. So in order to + * not modify the result, the wrapperFactory's second parameter should be returned by the delegate. + * Note that the second parameter may be null, if this method is used. If such values shall not be wrapped, + * use the {@link yfiles.support.LookupExtensions#addDecoratorWithWrapperFactoryAndNullIsFallback} method with false + * as the last argument. + * @return {yfiles.support.IContextLookupChainLink} The {@link yfiles.support.IContextLookupChainLink} instance as returned by the {@link yfiles.support.ILookupDecorator#addLookup} + * call or null, if either decorator was null, or it + * {@link yfiles.support.ILookupDecorator#canDecorate could not decorate} the TContext type. + */ + addDecorator(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,decorator:yfiles.support.ILookupDecorator,wrapperFactory:(item:TContext,baseImplementation:TResult)=>TResult):yfiles.support.IContextLookupChainLink; + /** + * Convenience method that can be used instead of the {@link yfiles.support.ILookupDecorator#addLookup} + * method to easily add a lookup implementation for a given type that always yields a constant result. + * Since this extension method is safe to invoke on null {@link yfiles.support.ILookupDecorator} + * objects, it can be used to conveniently decorate the lookup of various types with very little but concise code: + *

+      * var decorator = model.lookup(yfiles.support.ILookupDecorator.$class);
+      * var chainLink = decorator.addConstant(ItemType.$class, IQueryType.$class, new StaticQueryTypeImpl());
+      * 
+ * @param {yfiles.support.ILookupDecorator} decorator The decorator instance to use, which may be null. (a this parameter so that this method can be used as an extension method.) + * @param {TResult} result The constant value to yield if the chain is queried for an implementation of type TResult. + * @return {yfiles.support.IContextLookupChainLink} The {@link yfiles.support.IContextLookupChainLink} instance as returned by the {@link yfiles.support.ILookupDecorator#addLookup} + * call or null, if either decorator was null, or it + * {@link yfiles.support.ILookupDecorator#canDecorate could not decorate} the TContext type. + */ + addConstantDecorator(contextType:yfiles.lang.Class,resultType:yfiles.lang.Class,decorator:yfiles.support.ILookupDecorator,result:TResult):yfiles.support.IContextLookupChainLink; + /** + * Convenience method that can be used instead of the {@link yfiles.support.LookupChain#add} + * method to easily add a lookup implementation for a given type that always yields a constant result. + * @param {yfiles.support.LookupChain} chain The chain instance to use (a this parameter so that this method can be used as an extension method.) + * @param {TResult} result The constant value to yield if the chain is queried for an implementation of type TResult. + * @return {yfiles.support.IContextLookupChainLink} The {@link yfiles.support.IContextLookupChainLink} instance that has been added to the chain. + */ + addConstantChain(resultType:yfiles.lang.Class,chain:yfiles.support.LookupChain,result:TResult):yfiles.support.IContextLookupChainLink; + }; + /** + * Extension method holder class that extends the + * {@link yfiles.geometry.IOrientedRectangle} and {@link yfiles.geometry.IMutableOrientedRectangle} types with utility methods. + * @see {@link yfiles.geometry.IOrientedRectangle} + * @see {@link yfiles.geometry.IMutableOrientedRectangle} + */ + export interface OrientedRectangleExtensions extends Object{ + } + var OrientedRectangleExtensions:{ + $class:yfiles.lang.Class; + /** + * Gets the up vector of the oriented rectangle as a {@link yfiles.geometry.PointD} struct. + * @param {yfiles.geometry.IOrientedRectangle} orientedRectangle The rectangle to get the up vector from (a this parameter so that this method can be used as an extension method.) + * @return {yfiles.geometry.PointD} The value of the up vector of the rectangle at the time of the invocation. + */ + getUp(orientedRectangle:yfiles.geometry.IOrientedRectangle):yfiles.geometry.PointD; + /** + * Determines whether the given oriented rectangle contains the provided point, using + * an epsilon value. + * @param {yfiles.geometry.IOrientedRectangle} orientedRectangle The rectangle to test (a this parameter so that this method can be used as an extension method.) + * @param {yfiles.geometry.PointD} point The coordinates of the point 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} true iff the point lies inside the rectangle. + */ + containsPointWithEps(orientedRectangle:yfiles.geometry.IOrientedRectangle,point:yfiles.geometry.PointD,eps:number):boolean; + /** + * Gets the transform that can be used to transform points that are in the local + * coordinate system of the oriented rectangle if the top-left corner is the origin. + * @param {yfiles.geometry.IOrientedRectangle} orientedRectangle The oriented rectangle to use for defining the coordinate space. + * @return {yfiles.geometry.Matrix2D} A matrix that can be used to transform from oriented rectangle coordinates to world coordinates. + */ + getTransform(orientedRectangle:yfiles.geometry.IOrientedRectangle):yfiles.geometry.Matrix2D; + /** + * Sets up vector of the oriented rectangle to the given value. + * @param {yfiles.geometry.IMutableOrientedRectangle} orientedRectangle The rectangle to set the up vector to (a this parameter so that this method can be used as an extension method.) + * @param {yfiles.geometry.PointD} up The coordinates of the new up vector. + */ + setUpVector(orientedRectangle:yfiles.geometry.IMutableOrientedRectangle,up:yfiles.geometry.PointD):void; + /** + * Sets the size of the rectangle to the provided value. + * @param {yfiles.geometry.IMutableOrientedRectangle} orientedRectangle The oriented rectangle to set the size properties. + * @param {yfiles.geometry.SizeD} size The size to set. + */ + setSizeD(orientedRectangle:yfiles.geometry.IMutableOrientedRectangle,size:yfiles.geometry.SizeD):void; + /** + * Sets the size of the rectangle to the provided value. + * @param {yfiles.geometry.IMutableOrientedRectangle} orientedRectangle The oriented rectangle to set the size properties. + * @param {yfiles.geometry.ISize} size The size to set. + */ + setSize(orientedRectangle:yfiles.geometry.IMutableOrientedRectangle,size:yfiles.geometry.ISize):void; + /** + * Sets the center of the oriented rectangle to the given value. + * @param {yfiles.geometry.IMutableOrientedRectangle} orientedRectangle The rectangle to set the center of (a this parameter so that this method can be used as an extension method.) + * @param {yfiles.geometry.PointD} center The coordinates of the new center. + */ + setCenter(orientedRectangle:yfiles.geometry.IMutableOrientedRectangle,center:yfiles.geometry.PointD):void; + /** + * Sets the anchor vector of the oriented rectangle to the given value. + * @param {yfiles.geometry.IMutableOrientedRectangle} orientedRectangle The rectangle to set the anchor (a this parameter so that this method can be used as an extension method.) + * @param {yfiles.geometry.PointD} newAnchorLocation The coordinates of the new anchor location. + */ + setAnchor(orientedRectangle:yfiles.geometry.IMutableOrientedRectangle,newAnchorLocation:yfiles.geometry.PointD):void; + /** + * Gets the anchor location of the oriented rectangle as a {@link yfiles.geometry.PointD} struct. + * @param {yfiles.geometry.IOrientedRectangle} orientedRectangle The rectangle to get the anchor from (a this parameter so that this method can be used as an extension method.) + * @return {yfiles.geometry.PointD} The anchor location of the rectangle at the time of the invocation. + */ + getAnchorLocation(orientedRectangle:yfiles.geometry.IOrientedRectangle):yfiles.geometry.PointD; + /** + * Gets the location of the top left corner of the oriented rectangle as a {@link yfiles.geometry.PointD}. + * The top left corner is the one the up vector points to. + * @param {yfiles.geometry.IOrientedRectangle} orientedRectangle The rectangle to get the top left from (a this parameter so that this method can be used as an extension method.) + * @return {yfiles.geometry.PointD} The top left location of the rectangle at the time of the invocation. + */ + getTopLeftLocation(orientedRectangle:yfiles.geometry.IOrientedRectangle):yfiles.geometry.PointD; + /** + * Gets the size of the oriented rectangle. + * @param {yfiles.geometry.IOrientedRectangle} orientedRectangle The oriented rectangle to get the size properties from. + * @return {yfiles.geometry.SizeD} The width and height of the oriented rectangle. + */ + getSize(orientedRectangle:yfiles.geometry.IOrientedRectangle):yfiles.geometry.SizeD; + /** + * Create a dynamic {@link yfiles.geometry.IPoint} implementation + * that always points to the center of the given oriented rectangle. + * @param {yfiles.geometry.IOrientedRectangle} rectangle The rectangle that will be used for providing the center (a this parameter so that this method can be used as an extension method.). + * @return {yfiles.geometry.IPoint} A live view of the rectangle's center. + */ + getOrientedRectangleDynamicCenter(rectangle:yfiles.geometry.IOrientedRectangle):yfiles.geometry.IPoint; + /** + * Gets the current center of the oriented rectangle as a {@link yfiles.geometry.PointD} struct. + * @param {yfiles.geometry.IOrientedRectangle} rectangle The rectangle that will be used for providing the center (a this parameter so that this method can be used as an extension method.). + * @return {yfiles.geometry.PointD} The current coordinates of the center. + */ + getCenter(rectangle:yfiles.geometry.IOrientedRectangle):yfiles.geometry.PointD; + /** + * Determines whether the oriented rectangle contains the provided point, using + * an epsilon value. + * @param {yfiles.geometry.IOrientedRectangle} rect The oriented rectangle (a this parameter so that this method can be used as an extension method.). + * @param {yfiles.geometry.PointD} location The coordinates of the point 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} true iff the point lies inside the rectangle. + */ + hits(rect:yfiles.geometry.IOrientedRectangle,location:yfiles.geometry.PointD,eps:number):boolean; + /** + * Determines the bounds of an oriented rectangle. + * Bounding rectangles are parallel to the coordinate axes. + * @param {yfiles.geometry.IOrientedRectangle} rect The rectangle to determine the bounds (a this parameter so that this method can be used as an extension method.). + * @return {yfiles.geometry.RectD} The bounds. + */ + getBounds(rect:yfiles.geometry.IOrientedRectangle):yfiles.geometry.RectD; + }; + /** + * Extension method holder class that extends the + * {@link yfiles.geometry.IPoint}, {@link yfiles.geometry.IMutablePoint}, and {@link yfiles.geometry.IPointSetter} types + * with utility methods. + * @see {@link yfiles.geometry.IPoint} + * @see {@link yfiles.geometry.IMutablePoint} + * @see {@link yfiles.geometry.IPointSetter} + */ + export interface PointExtensions extends Object{ + } + var PointExtensions:{ + $class:yfiles.lang.Class; + /** + * Sets the coordinates of the point to the given values. + * @param {yfiles.geometry.IPointSetter} pointSetter The point setter to use for setting the values + * (a this parameter so that this method can be used as an extension method.). + * @param {yfiles.geometry.PointD} newLocation The new location. + */ + setPointDLocation(pointSetter:yfiles.geometry.IPointSetter,newLocation:yfiles.geometry.PointD):void; + /** + * Sets the coordinates of the point to the given values. + * @param {yfiles.geometry.IPointSetter} pointSetter The point setter to use for setting the values + * (a this parameter so that this method can be used as an extension method.). + * @param {yfiles.geometry.IPoint} newLocation The new location. + */ + setPointLocation(pointSetter:yfiles.geometry.IPointSetter,newLocation:yfiles.geometry.IPoint):void; + /** + * Copies the current values of the coordinates of the point to a {@link yfiles.geometry.PointD} struct. + * This method is useful to obtain a copy of the state and for making use of the + * various utility methods that are provided by {@link yfiles.geometry.PointD}. + * @param {yfiles.geometry.IPoint} point The point (a this parameter so that this method can be used as an extension method.). + * @return {yfiles.geometry.PointD} The current values of the coordinates of the point. + * @see {@link yfiles.geometry.PointD#toImmutablePoint} + * @see {@link yfiles.geometry.PointD#toMutablePoint} + * @see {@link yfiles.support.PointExtensions#setPointDLocation} + */ + toPoint(point:yfiles.geometry.IPoint):yfiles.geometry.PointD; + /** + * Calculates the Euclidean distance between two points. + * @param {yfiles.geometry.IPoint} p The first point (a this parameter so that this method can be used as an extension method.). + * @param {yfiles.geometry.IPoint} q The second point. + * @return {number} The distance between the two points. + */ + distanceTo(p:yfiles.geometry.IPoint,q:yfiles.geometry.IPoint):number; + }; + /** + * The basic lookup interface that allows for retrieving implementations + * for different aspects of the current instance. + * The lookup idiom allows for dynamically providing, adding, changing, and removing + * implementation aspects of an instance that would not be possible to achieve + * using ordinary object oriented methods. + * @see {@link yfiles.support.Lookups} + * @see {@link yfiles.support.DictionaryLookup} + */ + export interface ILookup extends Object{ + /** + * Returns an instance that implements the given type or null. + * Typically, this method will be called in order to obtain a different view or + * aspect of the current instance. This is quite similar to casting or using + * a super type or interface of this instance, but is not limited to inheritance or + * compile time constraints. An instance implementing this method is not + * required to return non-null implementations for the types, nor does it + * have to return the same instance any time. Also it depends on the + * type and context whether the instance returned stays up to date or needs to + * be reobtained for subsequent use. + * @param {yfiles.lang.Class} type the type for which an instance shall be returned + * @return {Object} an instance that is assignable to type or null + * @see Specified by {@link yfiles.support.ILookup#lookup}. + */ + lookup(type:yfiles.lang.Class):Object; + /** + * Typesafe convenience method for the {@link yfiles.support.ILookup#lookup} method. + * This is a bridge method that delegates to {@link yfiles.support.LookupExtensions#safeGet}. + * @return {T} The result of the query, never null. + * @throws {yfiles.system.KeyNotFoundException} If the lookup did not yield a non-null result + * for the type. + */ + safeGet(tType:yfiles.lang.Class):T; + } + var ILookup:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface for instances that can provide an {@link yfiles.support.ILookup} implementation + * for a given object. + * This is useful in the case where lookup functionality is not intrinsic to + * an item or where an existing object cannot implement the interface or when + * an item needs to be decorated externally with new lookup functionality. + */ + export interface ILookupProvider extends Object{ + /** + * Creates or retrieves an {@link yfiles.support.ILookup} implementation + * for a given item of type T. + * @param {T} item the item to find a lookup implementation for + * @return {yfiles.support.ILookup} an implementation or null + * @see Specified by {@link yfiles.support.ILookupProvider#getContext}. + */ + getContext(item:T):yfiles.support.ILookup; + } + var ILookupProvider:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A static class that provides a helper method to load a GraphML file using XMLHttpRequest. + */ + export interface XmlLoader extends Object{ + } + var XmlLoader:{ + $class:yfiles.lang.Class; + READY_STATE_DONE:number; + HTTP_STATUS_OK:number; + FS_STATUS_OK:number; + /** + * Tries to load a XML file from the specified URL and invokes the callback once the file has been loaded. + * @param {string} url The URL. + * @param {function(Document)} callback The callback. + */ + load(url:string,callback:(doc:Document)=> void):void; + }; + /** + * A generic linked list implementation. + */ + export interface GenericYList extends Object,yfiles.collections.INotifyCollectionChanged,yfiles.system.INotifyPropertyChanged,yfiles.collections.IList{ + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * Returns whether this list allows concurrent access. + * Value: Always returns false + */ + isSynchronized:boolean; + /** + * Returns the syncroot instance. + */ + syncRoot:Object; + /** + * Inserts the contents of the list into the target array, starting from index index. + * @param {Object} array The target array + * @param {number} index The starting index + */ + copyTo(array:Object,index:number):void; + /** + * Inserts Object o at the head of this list. + * @param {T} o The object to store + * @return {yfiles.support.GenericListCell.} the GenericListCell where the object o is stored. + */ + addFirst(o:T):yfiles.support.GenericListCell; + /** + * Get the GenericListCell at index index. + * @param {number} index The index for which to retrieve the cell + * @return {yfiles.support.GenericListCell.} the GenericListCell at index index. + */ + getCell(index:number):yfiles.support.GenericListCell; + /** + * Return whether this List is read-only. + * Value: Always returns false + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Return whether this List has a fixed size. + * Value: Always returns false + */ + isFixedSize:boolean; + /** + * Inserts Object o at the tail of this list. + * @param {T} o The object to store + * @return {yfiles.support.GenericListCell.} the GenericListCell where the object o is stored. + */ + addLast(o:T):yfiles.support.GenericListCell; + /** + * Adds a formerly removed GenericListCell at the tail of this list. + * Attention: If the GenericListCell is still part of a list, this + * list will be corrupted afterwards. + * @param {yfiles.support.GenericListCell.} cell A list cell which is not part of any list. + */ + addLastCell(cell:yfiles.support.GenericListCell):void; + /** + * Adds a formerly removed GenericListCell at the head of this list. + * Attention: If the GenericListCell is still part of a list, this + * list will be corrupted afterwards. + * @param {yfiles.support.GenericListCell.} cell A list cell which is not part of any list. + */ + addFirstCell(cell:yfiles.support.GenericListCell):void; + /** + * Same as {@link yfiles.support.GenericYList#addLast}. + * @param {T} o The object to add + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(o:T):void; + /** + * Inserts the given object to this list. + * The newly created GenericListCell will be inserted + * to this list immediately before refCell. + * If refCell == null the given object is appended + * to the list. + * @param {T} o the object to be inserted + * @param {yfiles.support.GenericListCell.} refCell the cell used to reference the position + * @return {yfiles.support.GenericListCell.} the newly created GenericListCell, which contains o + */ + insertBefore(o:T,refCell:yfiles.support.GenericListCell):yfiles.support.GenericListCell; + /** + * Inserts a formerly removed GenericListCell before the specified position. + * Attention: If the GenericListCell is still part of a list, this + * list will be corrupted afterwards. + * @param {yfiles.support.GenericListCell.} cellToInsert A list cell which is not part of any list. + * @param {yfiles.support.GenericListCell.} refCell A list cell that is contained in this list + */ + insertCellBefore(cellToInsert:yfiles.support.GenericListCell,refCell:yfiles.support.GenericListCell):void; + /** + * Inserts a formerly removed GenericListCell after the specified position. + * Attention: If the GenericListCell is still part of a list, this + * list will be corrupted afterwards. + * @param {yfiles.support.GenericListCell.} cellToInsert A list cell which is not part of any list. + * @param {yfiles.support.GenericListCell.} refCell A list cell that is contained in this list + */ + insertCellAfter(cellToInsert:yfiles.support.GenericListCell,refCell:yfiles.support.GenericListCell):void; + /** + * Inserts the given object to this list. + * The newly created GenericListCell will be inserted + * to this list immediately after refCell. + * If refCell == null the given object is prepended + * to the list. + * @param {T} o the object to be inserted + * @param {yfiles.support.GenericListCell.} refCell the cell used to reference the position + * @return {yfiles.support.GenericListCell.} the newly created GenericListCell, which contains o + */ + insertAfter(o:T,refCell:yfiles.support.GenericListCell):yfiles.support.GenericListCell; + /** + * Checks whether this list contains elements. + * Value: Returns true iff this list does not contain any elements + */ + isEmpty:boolean; + /** + * Removes all elements from this list. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Returns the first element in this list. + * The list must not be empty + */ + first:T; + /** + * Removes the first element from this list and returns it. + * @return {T} The first element in this list + */ + pop():T; + /** + * Same as {@link yfiles.support.GenericYList#addFirst}. + * @param {T} o + * @return {yfiles.support.GenericListCell.} + */ + push(o:T):yfiles.support.GenericListCell; + /** + * Same as {@link yfiles.support.GenericYList#first}. + */ + peek():T; + /** + * Returns the last element in this list. + * The list must not be empty + */ + last:T; + /** + * Removes the last element from this list and returns it. + * @return {T} The last element in this list + */ + popLast():T; + /** + * Returns the i-th element in this list. + * i must be a valid index, i.e. i >= 0 && i < Count + * @param {number} i The index of the list element + * @return {T} The element at index i + * @see Specified by {@link yfiles.collections.IList#get}. + */ + get(i:number):T; + /** + * Returns the i-th element in this list. + * i must be a valid index, i.e. i >= 0 && i < Count + * @param {number} i The index of the list element + * @return {T} The element at index i + * @see Specified by {@link yfiles.collections.IList#get}. + */ + set(i:number,value:T):void; + /** + * Returns the first cell in this list. + * The list must not be empty + * Value: the first cell in this list. + */ + firstCell:yfiles.support.GenericListCell; + /** + * Returns the last cell in this list. + * The list must not be empty + * Value: the first cell in this list. + */ + lastCell:yfiles.support.GenericListCell; + /** + * Removes the GenericListCell c + * and the element stored in it from this list. + * c must be a cell of this list + * @param {yfiles.support.GenericListCell.} c + * @return {T} The element the contained in the removed cell c + */ + removeCell(c:yfiles.support.GenericListCell):T; + /** + * Returns the cell where object o is stored. + * @param {T} o The object to search for + * @return {yfiles.support.GenericListCell.} The first cell containing o, or null + * if no such cell exists + */ + findCell(o:T):yfiles.support.GenericListCell; + /** + * Gets the index of the given cell. + * @param {yfiles.support.GenericListCell.} cell The cell. + * @return {number} The zero based index of the cell. + */ + getIndex(cell:yfiles.support.GenericListCell):number; + /** + * The index of the given item in the list. + * @param {T} item The item to search for. + * @return {number} The index of the given item in the list. -1 if the item is not in the list. + * @see Specified by {@link yfiles.collections.IList#indexOf}. + */ + indexOf(o:T):number; + /** + * Inserts the given item at the given index. + * @param {number} index The index to insert the item at. + * @param {T} item The item to insert. + * @see Specified by {@link yfiles.collections.IList#insert}. + */ + insert(index:number,o:T):void; + /** + * Returns an array representation of this List. + * @return {T[]} An array representation of this List. + */ + toArray():T[]; + /** + * The tag that is associated with this list. + */ + userObject:Object; + /** + * Removes the given item from this collection. + * @param {T} item The item to remove. + * @return {boolean} Whether the item was removed from the collection. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(o:T):boolean; + /** + * Removes the item at the given index from the list. + * @param {number} index The index of the item to remove. + * @see Specified by {@link yfiles.collections.IList#removeAt}. + */ + removeAt(index:number):void; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @return {boolean} true if the given item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:T):boolean; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:T[],index:number):void; + /** + * Enumerates the items in this list. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Implements the {@link yfiles.collections.INotifyCollectionChanged} interface. + * Sends notification about changes in this collection to registered delegates. + */ + addCollectionChangedListener(value:(sender:Object,e:yfiles.collections.NotifyCollectionChangedEventArgs)=> void):void; + /** + * Implements the {@link yfiles.collections.INotifyCollectionChanged} interface. + * Sends notification about changes in this collection to registered delegates. + */ + removeCollectionChangedListener(value:(sender:Object,e:yfiles.collections.NotifyCollectionChangedEventArgs)=> void):void; + /** + * Implements the {@link yfiles.system.INotifyPropertyChanged} interface. + * Sends notification about changes in the properties of this collection to registered delegates. + */ + addPropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Implements the {@link yfiles.system.INotifyPropertyChanged} interface. + * Sends notification about changes in the properties of this collection to registered delegates. + */ + removePropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + } + var GenericYList:{ + $class:yfiles.lang.Class; + /** + * Creates an empty doubly linked list. + */ + new ():yfiles.support.GenericYList; + /** + * Creates a list that is initialized with the elements provided + * by the given array of objects. + * @param {T[]} a The source array + */ + FromArray:{ + new (a:T[]):yfiles.support.GenericYList; + }; + /** + * Creates a list that is initialized with the elements provided + * by the given enumerable. + * @param {yfiles.collections.IEnumerable.} enumerable The source enumerable. + */ + FromEnumerable:{ + new (enumerable:yfiles.collections.IEnumerable):yfiles.support.GenericYList; + }; + }; + /** + * The cell class that constitutes {@link yfiles.support.GenericYList}s. + */ + export interface GenericListCell extends Object{ + /** + * Returns the successor cell of this cell. + * Value: Returns the successor cell of this cell, or null if there is no successor. + */ + next:yfiles.support.GenericListCell; + /** + * Returns the predecessor cell of this cell. + * Value: Returns the predecessor cell of this cell, or null if there is no predecessor. + */ + previous:yfiles.support.GenericListCell; + /** + * Get or set the actual value stored in this cell. + */ + value:T; + } + var GenericListCell:{ + $class:yfiles.lang.Class; + }; + /** + * An event "filter" implementation that can be used to collapse events within a given + * time span and fire a final event after the time has elapsed. + */ + export interface EventFilter extends Object{ + /** + * Whether another arriving event restarts the timer. + * The default is false + */ + eventRestartsTimer:boolean; + /** + * Gets or sets the duration during which events should be collapsed. + * The default is half a second. + */ + duration:yfiles.system.TimeSpan; + /** + * Cancels any pending events. + */ + cancel():void; + /** + * Called once the timer goes off. + */ + onTick():void; + /** + * Event handler that can be used to trigger the start of the timer. + */ + onEventWithSource(source:Object,eventArgs:T):void; + /** + * Event handler that can be used to trigger the start of the timer. + */ + onEventWithEventArgs(eventArgs:T):void; + /** + * Event handler that can be used to trigger the start of the timer. + */ + onEvent():void; + /** + * Flushes pending events and immediately fires them. + */ + flush():void; + /** + * Generic Event handler that can be used to trigger the start of the timer. + */ + onEventWithTypedArgs(EventArgsType:yfiles.lang.Class,source:Object,eventArgs:TEventArgs):void; + /** + * Called whenever an event is captured. + */ + onEventCaptured(lastSender:Object,lastArgs:T):void; + /** + * Starts the timer. + */ + startTimer():void; + /** + * Restarts the timer. + */ + restartTimer():void; + /** + * Stops the timer. + */ + stopTimer():void; + /** + * Called once the timer went off to trigger the {@link yfiles.support.EventFilter#addEventListener Event}. + */ + onFilteredEvent(lastSender:Object,lastArgs:T):void; + /** + * The event clients can register with. + */ + addEventListener(value:(sender:Object,e:T)=> void):void; + /** + * The event clients can register with. + */ + removeEventListener(value:(sender:Object,e:T)=> void):void; + } + var EventFilter:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance using the container for the construction of the internal timer. + * @param {Object} container The container for the timer or null. + */ + ForContainer:{ + new (eventType:yfiles.lang.Class,container:Object):yfiles.support.EventFilter; + }; + /** + * Creates the filter for the control. + * @param {yfiles.canvas.Control} control The control to use {@link yfiles.system.Dispatcher#beginInvokeAction} for the safe + * starting and stopping of the Timer instance. + */ + ForControl:{ + new (eventType:yfiles.lang.Class,control:yfiles.canvas.Control):yfiles.support.EventFilter; + }; + /** + * Creates the filter for the control. + * @param {yfiles.canvas.Control} control The control to use {@link yfiles.system.Dispatcher#beginInvokeAction} for the safe + * starting and stopping of the Timer instance. + * @param {yfiles.system.TimeSpan} duration The initial value for {@link yfiles.support.EventFilter#duration}. + */ + ForControlWithDuration:{ + new (eventType:yfiles.lang.Class,control:yfiles.canvas.Control,duration:yfiles.system.TimeSpan):yfiles.support.EventFilter; + }; + /** + * Creates a new instance. + */ + new (eventType:yfiles.lang.Class):yfiles.support.EventFilter; + }; + /** + * A utility class that implements an always empty {@link yfiles.collections.IEnumerator}. + */ + export interface EmptyEnumerator extends Object,yfiles.collections.IEnumerator{ + /** + * Gets the element at the enumerator's current position. + * This value is undefined if the enumerator is in initial state (after creation or {@link yfiles.collections.IEnumerator#reset}) or has been moved past the + * end of the represented collection. + * @see Specified by {@link yfiles.collections.IEnumerator#current}. + */ + current:T; + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + /** + * Moves this enumerator to the next element. + * A newly created enumerator's {@link yfiles.objectcollections.IEnumerator#currentObject current position} is before the first element. Thus, this method + * must be called before first access to the {@link yfiles.objectcollections.IEnumerator#currentObject} property. The same applies to the state after + * calling {@link yfiles.objectcollections.IEnumerator#reset}. + * @return {boolean} true if the enumerator was moved to a valid position + * @see Specified by {@link yfiles.objectcollections.IEnumerator#moveNext}. + */ + moveNext():boolean; + /** + * Resets the enumerator to its starting state. + * In other words: sets the current position before the first element. + * @see Specified by {@link yfiles.objectcollections.IEnumerator#reset}. + */ + reset():void; + } + var EmptyEnumerator:{ + $class:yfiles.lang.Class; + /** + * A shareable static instance of this class. + */ + INSTANCE:yfiles.collections.IEnumerator; + }; + /** + * The interface used by {@link yfiles.support.IUndoSupport}'s and {@link yfiles.support.UndoEngine}'s {@link yfiles.support.UndoEngine#beginCompoundEdit} implementation. + * {@link yfiles.support.UndoEngine} and {@link yfiles.support.IUndoSupport} implementations create instances of this class. + * You don't have to implement this class yourself. + * This class serves as a token for compound edits, only. + * Once this token has been obtained from the engine, it is essential for the functionality of the issuer of + * this instance that either {@link yfiles.support.ICompoundEdit#end} or {@link yfiles.support.ICompoundEdit#cancel} be called. + * If this instance gets {@link yfiles.system.IDisposable#dispose disposed} before either of the {@link yfiles.support.ICompoundEdit#end} or + * {@link yfiles.support.ICompoundEdit#cancel} method has been called, the {@link yfiles.support.ICompoundEdit#end} method will be called automatically. + * @see {@link yfiles.support.IUndoSupport} + * @see {@link yfiles.support.UndoEngine} + * @see {@link yfiles.support.IUndoUnit} + */ + export interface ICompoundEdit extends Object,yfiles.system.IDisposable{ + /** + * This method cancels the compound editing process that has been initialized in {@link yfiles.support.UndoEngine#beginCompoundEdit}. + * Calling this method will cancel the recorded {@link yfiles.support.IUndoUnit}s and will hinder this instance + * from enqueuing any more units. + * @see Specified by {@link yfiles.support.ICompoundEdit#cancel}. + */ + cancel():void; + /** + * This method ends the compound editing process that has been initialized in {@link yfiles.support.UndoEngine#beginCompoundEdit} + * or in the {@link yfiles.support.IUndoSupport#beginEdit} methods. + * Calling this method will automatically enqueue the corresponding {@link yfiles.support.IUndoUnit}s into the + * corresponding {@link yfiles.support.UndoEngine} instance. + * Alternatively client code can use the {@link yfiles.system.IDisposable#dispose} method of this instance to end this instance. + * This can be done conveniently using a using statement. + * @see Specified by {@link yfiles.support.ICompoundEdit#end}. + */ + end():void; + } + var ICompoundEdit:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + } + export module system{ + /** + * Provides a method which can be used to free resources used by the implementor. + */ + export interface IDisposable extends Object{ + /** + * Causes the implementor to free all resources. + * @see Specified by {@link yfiles.system.IDisposable#dispose}. + */ + dispose():void; + } + var IDisposable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Implemented by objects which can create a clone of themselves. + */ + export interface ICloneable extends Object{ + /** + * Create a clone of this object. + * @return {Object} A clone of this object. + * @see Specified by {@link yfiles.system.ICloneable#clone}. + */ + clone():Object; + } + var ICloneable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Contains information about a generic method. + */ + export interface GenericMethodInfo extends yfiles.system.MethodInfo{ + /** + * Gets the type arguments. + */ + typeArguments:yfiles.lang.Class[]; + /** + * Invokes the method bound to the thisArg and with the given parameters. The + * type parameters of this method are passed before the parameters. + * @param {Object} thisArg The context for the invocation. This argument is ignored when the method is static or a constructor. + * @param {Object[]} parameters The parameters of the invocation. + * @return {Object} + * The return value of the method invocation. + * @see Overrides {@link yfiles.system.MethodBase#invoke} + */ + invoke(thisArg:Object,parameters:Object[]):Object; + } + var GenericMethodInfo:{ + $class:yfiles.lang.Class; + new (name:string,reflectedType:yfiles.lang.Class,declaringType:yfiles.lang.Class,attributes:yfiles.lang.Attribute[],fn:Function,isStatic:boolean,noPolymorphicCall:boolean,typeArguments:yfiles.lang.Class[]):yfiles.system.GenericMethodInfo; + }; + /** + * Contains information about a method. + */ + export interface MethodInfo extends yfiles.system.MethodBase{ + /** + * Gets the return type of the method. + * Value: + * The type of the return value. + */ + returnType:yfiles.lang.Class; + /** + * Gets a value indicating whether the method is a constructor. + * Value: + * Always false. + * @see Overrides {@link yfiles.system.MethodBase#isConstructor} + */ + isConstructor:boolean; + /** + * Gets the type of the member. + * Value: + * The type of the member. + */ + memberType:yfiles.system.MemberTypes; + /** + * Makes the method generic. + * @param {yfiles.lang.Class[]} typeArguments The type arguments. + * @return {yfiles.system.MethodInfo} A generic variant of the method + */ + makeGenericMethod(typeArguments:yfiles.lang.Class[]):yfiles.system.MethodInfo; + } + var MethodInfo:{ + $class:yfiles.lang.Class; + new (name:string,reflectedType:yfiles.lang.Class,declaringType:yfiles.lang.Class,attributes:yfiles.lang.Attribute[],fn:Function,isStatic:boolean,noPolymorphicCall:boolean):yfiles.system.MethodInfo; + }; + /** + * An abstract base class for information about methods. + * There are different types of methods that a Type can have: Constructors and actual methods. + * This class is the base for both and contains all information available for both types of methods. + */ + export interface MethodBase extends yfiles.system.MemberInfo{ + /** + * Gets a value indicating whether the method is static. + * Value: + * true if the method is static; otherwise, false. + */ + isStatic:boolean; + /** + * Gets a value indicating whether the method is a constructor. + * Value: + * true if the method is a constructor; otherwise, false. + */ + isConstructor:boolean; + fn:Function; + noPolymorphicCall:boolean; + /** + * Gets the parameters of the method. + * This method requires the {@link yfiles.system.ParameterAttribute} on the method to collect the required + * information. Therefore it is important that every parameter of the method has an associated + * {@link yfiles.system.ParameterAttribute}. The order of the {@link yfiles.system.ParameterAttribute} must be the same as + * the order of the parameters. + * @return {yfiles.system.ParameterInfo[]} An array of {@link yfiles.system.ParameterInfo}s for the parameters of the method. + */ + getParameters():yfiles.system.ParameterInfo[]; + /** + * Invokes the method bound to the thisArg and the given parameters. + * @param {Object} thisArg The context for the invocation. This argument is ignored when the method is static or a constructor. + * @param {Object[]} parameters The parameters of the invocation. + * @return {Object} The return value of the method invocation. + */ + invoke(thisArg:Object,parameters:Object[]):Object; + /** + * Gets the method attributes of this method. + */ + attributes:yfiles.system.MethodAttributes; + } + var MethodBase:{ + $class:yfiles.lang.Class; + new (name:string,reflectedType:yfiles.lang.Class,declaringType:yfiles.lang.Class,attributes:yfiles.lang.Attribute[],fn:Function,isStatic:boolean,noPolymorphicCall:boolean):yfiles.system.MethodBase; + }; + /** + * An abstract base class for more specific member information classes. + * Instances of this class provide information about a member of a type, i.e. a method, field or property. + */ + export interface MemberInfo extends Object{ + /** + * Contains the attributes associated with this member. + */ + _attributes:yfiles.lang.Attribute[]; + /** + * Gets the declaring type, i.e. the type where the member was declared. + * Value: + * The declaring type. + */ + declaringType:yfiles.lang.Class; + /** + * Gets the reflected type, i.e. the type that was asked about its member. + * Value: + * The reflected type. + */ + reflectedType:yfiles.lang.Class; + /** + * Gets the name of the member. + */ + name:string; + /** + * Gets the type of the member. + * Value: + * The type of the member. + */ + memberType:yfiles.system.MemberTypes; + /** + * Gets a value indicating whether the member is private. + * Value: + * true if the member is private; otherwise, false. + */ + isPrivate:boolean; + /** + * Gets a value indicating whether the member is public. + * Value: + * true if the member is public; otherwise, false. + */ + isPublic:boolean; + /** + * Gets the custom attributes of this member and (optionally) the inherited ones if the member was declared + * by a parent type. + * @param {boolean} inherit if set to true then inherited attributes will be considered as well. + * @return {yfiles.lang.Attribute[]} The attributes associated with the member. + */ + getCustomAttributes(inherit:boolean):yfiles.lang.Attribute[]; + /** + * Gets the type of the custom attributes of the specified type. + * @param {yfiles.lang.Class} attributeType The type of attributes that are interesting. + * @param {boolean} inherit if set to true then inherited attributes will be considered as well. + * @return {yfiles.lang.Attribute[]} An array of all attributes that are instances of the given type. + */ + getCustomAttributesOfType(attributeType:yfiles.lang.Class,inherit:boolean):yfiles.lang.Attribute[]; + /** + * Determines whether the specified attribute type is defined. + * @param {yfiles.lang.Class} attributeType Type of the attribute. + * @param {boolean} inherit if set to true then inherited attributes will be considered as well. + * @return {boolean} + * true if the specified attribute type is defined; otherwise, false. + */ + isDefined(attributeType:yfiles.lang.Class,inherit:boolean):boolean; + } + var MemberInfo:{ + $class:yfiles.lang.Class; + new (name:string,reflectedType:yfiles.lang.Class,declaringType:yfiles.lang.Class,attributes:yfiles.lang.Attribute[]):yfiles.system.MemberInfo; + }; + export enum BindingFlags{ + /** + * The default bindings. + */ + DEFAULT, + /** + * The case should be ignored, i.e. it doesn't matter if a method is named "toString" or "ToStRiNg". + */ + IGNORE_CASE, + /** + * The member must be declared explicitly and not inherited from a parent type. + */ + DECLARED_ONLY, + /** + * The member should be the member of an instance of the type. + */ + INSTANCE, + /** + * The member should be the member of the type and not an instance of it. + */ + STATIC, + /** + * The member must have {@link yfiles.system.Visibility#PUBLIC public visibility}. + */ + PUBLIC, + /** + * The member must not have {@link yfiles.system.Visibility#PUBLIC public visibility}. + */ + NON_PUBLIC, + /** + * Traverse the parent types to find the member. + */ + FLATTEN_HIERARCHY + } + /** + * Contains information about a constructor. + */ + export interface ConstructorInfo extends yfiles.system.MethodBase{ + /** + * Gets a value indicating whether the method is a constructor. + * Value: + * Always true. + * @see Overrides {@link yfiles.system.MethodBase#isConstructor} + */ + isConstructor:boolean; + /** + * Invokes the constructor with the given parameters. + * The thisArg is ignored since constructors can't be bound to a context. + * @param {Object} thisArg This argument is ignored. + * @param {Object[]} parameters The parameters of the invocation. + * @return {Object} + * A new instance of the type the constructor belongs to. + * @see Overrides {@link yfiles.system.MethodBase#invoke} + */ + invoke(thisArg:Object,parameters:Object[]):Object; + /** + * Invokes the constructor with the given parameters.. + * @param {Object[]} parameters The parameters. + * @return {Object} + * A new instance of the type the constructor belongs to. + */ + invokeConstructor(parameters:Object[]):Object; + /** + * Gets the type of the member. + * Value: + * The type of the member. + */ + memberType:yfiles.system.MemberTypes; + } + var ConstructorInfo:{ + $class:yfiles.lang.Class; + new (name:string,reflectedType:yfiles.lang.Class,declaringType:yfiles.lang.Class,attributes:yfiles.lang.Attribute[],fn:Function,isStatic:boolean):yfiles.system.ConstructorInfo; + }; + /** + * Contains information about a parameter of a method. + */ + export interface ParameterInfo extends Object{ + /** + * Gets the name of the parameter. + */ + name:string; + /** + * Gets the type of the parameter. + * Value: + * The type of the parameter. + */ + parameterType:yfiles.lang.Class; + /** + * Gets the position of the parameter. + * The first parameter has the position 0. + */ + position:number; + /** + * Gets a value indicating whether the parameter is optional. + * Value: + * true if the parameter is optional; otherwise, false. + */ + isOptional:boolean; + /** + * Gets the {@link yfiles.system.MemberInfo} that the parameter belongs to. + */ + member:yfiles.system.MemberInfo; + } + var ParameterInfo:{ + $class:yfiles.lang.Class; + new (name:string,parameterType:yfiles.lang.Class,position:number,isOptional:boolean,member:yfiles.system.MemberInfo):yfiles.system.ParameterInfo; + }; + /** + * Provides information about a field. + */ + export interface FieldInfo extends yfiles.system.MemberInfo{ + /** + * Gets a value indicating whether this field is static. + * Value: + * true if this field is static; otherwise, false. + */ + isStatic:boolean; + /** + * Gets the type of the field. + * Value: + * The type of the field. + */ + fieldType:yfiles.lang.Class; + /** + * Gets the value stored in the field on the specified object. + * @param {Object} obj The object. This parameter is ignored if the field is static. + * @return {Object} + */ + getValue(obj:Object):Object; + /** + * Sets the field on the specified object to the given value. + * @param {Object} obj The object. This parameter is ignored if the field is static. + * @param {Object} value The new value of the field. + */ + setValue(obj:Object,value:Object):void; + /** + * Gets the type of the member. + * Value: + * The type of the member. + */ + memberType:yfiles.system.MemberTypes; + } + var FieldInfo:{ + $class:yfiles.lang.Class; + new (name:string,reflectedType:yfiles.lang.Class,declaringType:yfiles.lang.Class,attributes:yfiles.lang.Attribute[],isStatic:boolean):yfiles.system.FieldInfo; + }; + /** + * Contains information about a property. + */ + export interface PropertyInfo extends yfiles.system.MemberInfo{ + /** + * Gets a value indicating whether the property can be read. + * Value: + * true if the property can be read; otherwise, false. + */ + canRead:boolean; + /** + * Gets a value indicating whether the property can be written. + * Value: + * true if the property can be written; otherwise, false. + */ + canWrite:boolean; + /** + * Gets the type of the property. + * Value: + * The type of the property. + */ + propertyType:yfiles.lang.Class; + /** + * Provides access to a method that can be used to read the value of the property. + * @return {yfiles.system.MethodInfo} The "getter" for this property. + */ + getGetMethod():yfiles.system.MethodInfo; + /** + * Provides access to a method that can be used to write the value of the property. + * @return {yfiles.system.MethodInfo} The "setter" for this property. + */ + getSetMethod():yfiles.system.MethodInfo; + /** + * Gets the index parameters. + * @return {yfiles.system.ParameterInfo[]} + */ + getIndexParameters():yfiles.system.ParameterInfo[]; + /** + * Gets the value of the property from the given object. + * @param {Object} obj The object which has the property. + * @param {Object[]} index The indices. This parameter can be safely ignored. + * @return {Object} The value of the property from the given object. + * @throws {yfiles.system.ArgumentException} If the property is not readable. + * @throws {yfiles.system.TargetException} + * If the given object is null (and the property is not static) + * - or - + * if the given object is not of the type that this property belongs to. + */ + getValue(obj:Object,index:Object[]):Object; + /** + * Sets the value of the property on the given object. + * @param {Object} obj The object whose property should be written. + * @param {Object[]} index The indices. This parameter can be safely ignored. + * @throws {yfiles.system.ArgumentException} If the property is not writable. + * @throws {yfiles.system.TargetException} + * If the given object is null (and the property is not static) + * - or - + * if the given object is not of the type that this property belongs to. + */ + setValue(obj:Object,value:Object,index:Object[]):void; + /** + * Gets the type of the member. + * Value: + * The type of the member. + */ + memberType:yfiles.system.MemberTypes; + } + var PropertyInfo:{ + $class:yfiles.lang.Class; + new (name:string,reflectedType:yfiles.lang.Class,declaringType:yfiles.lang.Class,attributes:yfiles.lang.Attribute[],getMethod:yfiles.system.MethodInfo,setMethod:yfiles.system.MethodInfo):yfiles.system.PropertyInfo; + }; + export interface MissingManifestResourceException extends yfiles.lang.Exception{ + } + var MissingManifestResourceException:{ + $class:yfiles.lang.Class; + new (message:string):yfiles.system.MissingManifestResourceException; + }; + export enum PenLineCap{ + /** + * Indicates that the line cap of a pen should be squared. + */ + SQUARE, + /** + * Indicates that the line cap of a pen should be flat. + */ + FLAT, + /** + * Indicates that the line cap of a pen should be a semicircle. + */ + ROUND + } + export enum PenLineJoin{ + /** + * Indicates that the line joins of a pen should be beveled. + */ + BEVEL, + /** + * Indicates that the line joins of a pen should be rounded. + */ + ROUND, + /** + * Indicates that the line joins of a pen should be sharp. + */ + MITER + } + /** + * The ResourceManager handles the retrieval of string and object resources like keyboard shortcuts and I18N names. + */ + export interface ResourceManager extends Object{ + /** + * Gets or sets a value indicating whether the case of the keys should be ignored. + * Value: + * true if the case should be ignored; otherwise, false. + */ + ignoreCase:boolean; + /** + * Gets the string stored under the specified s. + * @param {string} s The key. + * @return {string} The string stored under the key or null, if there is no such key. + */ + getString(s:string):string; + /** + * Gets the string stored under the specified s and {@link yfiles.system.CultureInfo}. + * @param {string} s The key. + * @param {yfiles.system.CultureInfo} info The culture info. + * @return {string} The string stored under the key or null, if there is no such key. + */ + getStringForCulture(s:string,info:yfiles.system.CultureInfo):string; + /** + * Gets the object stored under the specified s. + * @param {string} s The key. + * @return {Object} The object stored under the key or null, if there is no such key. + */ + getObject(s:string):Object; + /** + * Gets the object stored under the specified s and {@link yfiles.system.CultureInfo}. + * @param {string} s The key. + * @param {yfiles.system.CultureInfo} info The culture info. + * @return {Object} The object stored under the key or null, if there is no such key. + */ + getObjectForCulture(s:string,info:yfiles.system.CultureInfo):Object; + } + var ResourceManager:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.ResourceManager} class with no resources. + */ + new ():yfiles.system.ResourceManager; + /** + * Looks for a resource object under the specified global name. + * The global object will be queried for the JS object under the given name. + * Queries will be made to the {@link yfiles.system.CultureInfo#name} of the culture first and + * if they are not satisfied, the {@link yfiles.system.CultureInfo#parent} chain will be traversed + * until the {@link yfiles.system.CultureInfo#INVARIANT_CULTURE1} is reached. + * So in a "en-US" culture the following objects will be queried: + *

+      * window.globalName["en-US"][key]
+      * window.globalName["en"][key]
+      * window.globalName["invariant"][key]
+      * 
+ * @param {string} globalName The global name to look for a resource object. + */ + FromGlobalName:{ + new (globalName:string):yfiles.system.ResourceManager; + }; + /** + * Uses the given object as the resource backing store. + * Queries will be made to the {@link yfiles.system.CultureInfo#name} of the culture first and + * if they are not satisfied, the {@link yfiles.system.CultureInfo#parent} chain will be traversed + * until the {@link yfiles.system.CultureInfo#INVARIANT_CULTURE1} is reached. + * So in a "en-US" culture the following objects will be queried: + *

+      * store["en-US"][key]
+      * store["en"][key]
+      * store["invariant"][key]
+      * 
+ * @param {Object} store The object to query the resources for. + */ + FromStore:{ + new (store:Object):yfiles.system.ResourceManager; + }; + }; + /** + * Contains information about the culture that should be used, i.e. "en-US", "de-de", etc. + */ + export interface CultureInfo extends Object{ + /** + * Gets the name of the culture, e.g. "en-US". + */ + name:string; + /** + * Gets the parent culture. + * If the current culture is "en-US", this property would point to the "en" culture. The parent + * of the "en" culture is the {@link yfiles.system.CultureInfo#INVARIANT_CULTURE}. The parent of the {@link yfiles.system.CultureInfo#INVARIANT_CULTURE} + * is the {@link yfiles.system.CultureInfo#INVARIANT_CULTURE} itself. + */ + parent:yfiles.system.CultureInfo; + } + var CultureInfo:{ + $class:yfiles.lang.Class; + /** + * Gets the invariant culture. + */ + INVARIANT_CULTURE:yfiles.system.CultureInfo; + /** + * Gets or sets the current UI culture. + * Value: + * The current UI culture. + */ + currentUICulture:yfiles.system.CultureInfo; + /** + * Initializes a new instance of the {@link yfiles.system.CultureInfo} class to the invariant culture. + */ + new ():yfiles.system.CultureInfo; + /** + * Initializes a new instance of the {@link yfiles.system.CultureInfo} class to the given name. + * @param {string} name The name. + */ + FromCultureId:{ + new (name:string):yfiles.system.CultureInfo; + }; + }; + /** + * Defines an event which is dispatched when a property changes. + */ + export interface INotifyPropertyChanged extends Object{ + /** + * Event which is dispatched when a property changes. + */ + addPropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + /** + * Event which is dispatched when a property changes. + */ + removePropertyChangedListener(value:(sender:Object,e:yfiles.system.PropertyChangedEventArgs)=> void):void; + } + var INotifyPropertyChanged:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Event arguments which contain information for a {@link yfiles.system.INotifyPropertyChanged#addPropertyChangedListener PropertyChanged} event. + */ + export interface PropertyChangedEventArgs extends yfiles.system.EventArgs{ + /** + * The name of the changed property. + */ + propertyName:string; + } + var PropertyChangedEventArgs:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + * @param {string} propertyName The name of the changed property. + */ + new (propertyName:string):yfiles.system.PropertyChangedEventArgs; + }; + export enum StringTrimming{ + /** + * Indicates that the text should be wrapped at characters. + */ + CHARACTER, + /** + * Indicates that the text should be wrapped at characters with an ellipsis at the end. + */ + ELLIPSIS_CHARACTER, + /** + * Indicates that the text should be wrapped at words with an ellipsis at the end. + */ + ELLIPSIS_WORD, + /** + * Indicates that the text should not be wrapped. + */ + NONE, + /** + * Indicates that the text should be wrapped at words. + */ + WORD + } + export enum TextAlignment{ + /** + * Indicates that the text should be centered. + */ + CENTER, + /** + * Indicates that the text should be aligned to the left. + */ + LEFT, + /** + * Indicates that the text should be aligned to the right. + */ + RIGHT + } + /** + * A convenience class that creates {@link yfiles.system.SolidColorBrush}es + * for the default colors. + */ + export interface Brushes extends Object{ + } + var Brushes:{ + $class:yfiles.lang.Class; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color AliceBlue. + * This method will yield a new value for every call because it is mutable. + */ + ALICE_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color AntiqueWhite. + * This method will yield a new value for every call because it is mutable. + */ + ANTIQUE_WHITE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Aqua. + * This method will yield a new value for every call because it is mutable. + */ + AQUA:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Aquamarine. + * This method will yield a new value for every call because it is mutable. + */ + AQUAMARINE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Azure. + * This method will yield a new value for every call because it is mutable. + */ + AZURE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Beige. + * This method will yield a new value for every call because it is mutable. + */ + BEIGE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Bisque. + * This method will yield a new value for every call because it is mutable. + */ + BISQUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Black. + * This method will yield a new value for every call because it is mutable. + */ + BLACK:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color BlanchedAlmond. + * This method will yield a new value for every call because it is mutable. + */ + BLANCHED_ALMOND:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Blue. + * This method will yield a new value for every call because it is mutable. + */ + BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color BlueViolet. + * This method will yield a new value for every call because it is mutable. + */ + BLUE_VIOLET:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Brown. + * This method will yield a new value for every call because it is mutable. + */ + BROWN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color BurlyWood. + * This method will yield a new value for every call because it is mutable. + */ + BURLY_WOOD:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color CadetBlue. + * This method will yield a new value for every call because it is mutable. + */ + CADET_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Chartreuse. + * This method will yield a new value for every call because it is mutable. + */ + CHARTREUSE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Chocolate. + * This method will yield a new value for every call because it is mutable. + */ + CHOCOLATE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Coral. + * This method will yield a new value for every call because it is mutable. + */ + CORAL:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color CornflowerBlue. + * This method will yield a new value for every call because it is mutable. + */ + CORNFLOWER_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Cornsilk. + * This method will yield a new value for every call because it is mutable. + */ + CORNSILK:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Crimson. + * This method will yield a new value for every call because it is mutable. + */ + CRIMSON:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Cyan. + * This method will yield a new value for every call because it is mutable. + */ + CYAN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkBlue. + * This method will yield a new value for every call because it is mutable. + */ + DARK_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkCyan. + * This method will yield a new value for every call because it is mutable. + */ + DARK_CYAN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkGoldenrod. + * This method will yield a new value for every call because it is mutable. + */ + DARK_GOLDENROD:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkGray. + * This method will yield a new value for every call because it is mutable. + */ + DARK_GRAY:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkGreen. + * This method will yield a new value for every call because it is mutable. + */ + DARK_GREEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkKhaki. + * This method will yield a new value for every call because it is mutable. + */ + DARK_KHAKI:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkMagenta. + * This method will yield a new value for every call because it is mutable. + */ + DARK_MAGENTA:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkOliveGreen. + * This method will yield a new value for every call because it is mutable. + */ + DARK_OLIVE_GREEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkOrange. + * This method will yield a new value for every call because it is mutable. + */ + DARK_ORANGE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkOrchid. + * This method will yield a new value for every call because it is mutable. + */ + DARK_ORCHID:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkRed. + * This method will yield a new value for every call because it is mutable. + */ + DARK_RED:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkSalmon. + * This method will yield a new value for every call because it is mutable. + */ + DARK_SALMON:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkSeaGreen. + * This method will yield a new value for every call because it is mutable. + */ + DARK_SEA_GREEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkSlateBlue. + * This method will yield a new value for every call because it is mutable. + */ + DARK_SLATE_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkSlateGray. + * This method will yield a new value for every call because it is mutable. + */ + DARK_SLATE_GRAY:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkTurquoise. + * This method will yield a new value for every call because it is mutable. + */ + DARK_TURQUOISE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DarkViolet. + * This method will yield a new value for every call because it is mutable. + */ + DARK_VIOLET:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DeepPink. + * This method will yield a new value for every call because it is mutable. + */ + DEEP_PINK:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DeepSkyBlue. + * This method will yield a new value for every call because it is mutable. + */ + DEEP_SKY_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DimGray. + * This method will yield a new value for every call because it is mutable. + */ + DIM_GRAY:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color DodgerBlue. + * This method will yield a new value for every call because it is mutable. + */ + DODGER_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Firebrick. + * This method will yield a new value for every call because it is mutable. + */ + FIREBRICK:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color FloralWhite. + * This method will yield a new value for every call because it is mutable. + */ + FLORAL_WHITE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color ForestGreen. + * This method will yield a new value for every call because it is mutable. + */ + FOREST_GREEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Fuchsia. + * This method will yield a new value for every call because it is mutable. + */ + FUCHSIA:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Gainsboro. + * This method will yield a new value for every call because it is mutable. + */ + GAINSBORO:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color GhostWhite. + * This method will yield a new value for every call because it is mutable. + */ + GHOST_WHITE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Gold. + * This method will yield a new value for every call because it is mutable. + */ + GOLD:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Goldenrod. + * This method will yield a new value for every call because it is mutable. + */ + GOLDENROD:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Gray. + * This method will yield a new value for every call because it is mutable. + */ + GRAY:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Green. + * This method will yield a new value for every call because it is mutable. + */ + GREEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color GreenYellow. + * This method will yield a new value for every call because it is mutable. + */ + GREEN_YELLOW:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Honeydew. + * This method will yield a new value for every call because it is mutable. + */ + HONEYDEW:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color HotPink. + * This method will yield a new value for every call because it is mutable. + */ + HOT_PINK:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color IndianRed. + * This method will yield a new value for every call because it is mutable. + */ + INDIAN_RED:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Indigo. + * This method will yield a new value for every call because it is mutable. + */ + INDIGO:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Ivory. + * This method will yield a new value for every call because it is mutable. + */ + IVORY:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Khaki. + * This method will yield a new value for every call because it is mutable. + */ + KHAKI:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Lavender. + * This method will yield a new value for every call because it is mutable. + */ + LAVENDER:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LavenderBlush. + * This method will yield a new value for every call because it is mutable. + */ + LAVENDER_BLUSH:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LawnGreen. + * This method will yield a new value for every call because it is mutable. + */ + LAWN_GREEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LemonChiffon. + * This method will yield a new value for every call because it is mutable. + */ + LEMON_CHIFFON:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LightBlue. + * This method will yield a new value for every call because it is mutable. + */ + LIGHT_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LightCoral. + * This method will yield a new value for every call because it is mutable. + */ + LIGHT_CORAL:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LightCyan. + * This method will yield a new value for every call because it is mutable. + */ + LIGHT_CYAN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LightGoldenrodYellow. + * This method will yield a new value for every call because it is mutable. + */ + LIGHT_GOLDENROD_YELLOW:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LightGray. + * This method will yield a new value for every call because it is mutable. + */ + LIGHT_GRAY:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LightGreen. + * This method will yield a new value for every call because it is mutable. + */ + LIGHT_GREEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LightPink. + * This method will yield a new value for every call because it is mutable. + */ + LIGHT_PINK:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LightSalmon. + * This method will yield a new value for every call because it is mutable. + */ + LIGHT_SALMON:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LightSeaGreen. + * This method will yield a new value for every call because it is mutable. + */ + LIGHT_SEA_GREEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LightSkyBlue. + * This method will yield a new value for every call because it is mutable. + */ + LIGHT_SKY_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LightSlateGray. + * This method will yield a new value for every call because it is mutable. + */ + LIGHT_SLATE_GRAY:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LightSteelBlue. + * This method will yield a new value for every call because it is mutable. + */ + LIGHT_STEEL_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LightYellow. + * This method will yield a new value for every call because it is mutable. + */ + LIGHT_YELLOW:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Lime. + * This method will yield a new value for every call because it is mutable. + */ + LIME:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color LimeGreen. + * This method will yield a new value for every call because it is mutable. + */ + LIME_GREEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Linen. + * This method will yield a new value for every call because it is mutable. + */ + LINEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Magenta. + * This method will yield a new value for every call because it is mutable. + */ + MAGENTA:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Maroon. + * This method will yield a new value for every call because it is mutable. + */ + MAROON:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color MediumAquamarine. + * This method will yield a new value for every call because it is mutable. + */ + MEDIUM_AQUAMARINE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color MediumBlue. + * This method will yield a new value for every call because it is mutable. + */ + MEDIUM_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color MediumOrchid. + * This method will yield a new value for every call because it is mutable. + */ + MEDIUM_ORCHID:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color MediumPurple. + * This method will yield a new value for every call because it is mutable. + */ + MEDIUM_PURPLE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color MediumSeaGreen. + * This method will yield a new value for every call because it is mutable. + */ + MEDIUM_SEA_GREEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color MediumSlateBlue. + * This method will yield a new value for every call because it is mutable. + */ + MEDIUM_SLATE_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color MediumSpringGreen. + * This method will yield a new value for every call because it is mutable. + */ + MEDIUM_SPRING_GREEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color MediumTurquoise. + * This method will yield a new value for every call because it is mutable. + */ + MEDIUM_TURQUOISE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color MediumVioletRed. + * This method will yield a new value for every call because it is mutable. + */ + MEDIUM_VIOLET_RED:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color MidnightBlue. + * This method will yield a new value for every call because it is mutable. + */ + MIDNIGHT_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color MintCream. + * This method will yield a new value for every call because it is mutable. + */ + MINT_CREAM:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color MistyRose. + * This method will yield a new value for every call because it is mutable. + */ + MISTY_ROSE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Moccasin. + * This method will yield a new value for every call because it is mutable. + */ + MOCCASIN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color NavajoWhite. + * This method will yield a new value for every call because it is mutable. + */ + NAVAJO_WHITE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Navy. + * This method will yield a new value for every call because it is mutable. + */ + NAVY:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color OldLace. + * This method will yield a new value for every call because it is mutable. + */ + OLD_LACE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Olive. + * This method will yield a new value for every call because it is mutable. + */ + OLIVE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color OliveDrab. + * This method will yield a new value for every call because it is mutable. + */ + OLIVE_DRAB:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Orange. + * This method will yield a new value for every call because it is mutable. + */ + ORANGE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color OrangeRed. + * This method will yield a new value for every call because it is mutable. + */ + ORANGE_RED:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Orchid. + * This method will yield a new value for every call because it is mutable. + */ + ORCHID:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color PaleGoldenrod. + * This method will yield a new value for every call because it is mutable. + */ + PALE_GOLDENROD:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color PaleGreen. + * This method will yield a new value for every call because it is mutable. + */ + PALE_GREEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color PaleTurquoise. + * This method will yield a new value for every call because it is mutable. + */ + PALE_TURQUOISE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color PaleVioletRed. + * This method will yield a new value for every call because it is mutable. + */ + PALE_VIOLET_RED:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color PapayaWhip. + * This method will yield a new value for every call because it is mutable. + */ + PAPAYA_WHIP:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color PeachPuff. + * This method will yield a new value for every call because it is mutable. + */ + PEACH_PUFF:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Peru. + * This method will yield a new value for every call because it is mutable. + */ + PERU:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Pink. + * This method will yield a new value for every call because it is mutable. + */ + PINK:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Plum. + * This method will yield a new value for every call because it is mutable. + */ + PLUM:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color PowderBlue. + * This method will yield a new value for every call because it is mutable. + */ + POWDER_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Purple. + * This method will yield a new value for every call because it is mutable. + */ + PURPLE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Red. + * This method will yield a new value for every call because it is mutable. + */ + RED:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color RosyBrown. + * This method will yield a new value for every call because it is mutable. + */ + ROSY_BROWN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color RoyalBlue. + * This method will yield a new value for every call because it is mutable. + */ + ROYAL_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color SaddleBrown. + * This method will yield a new value for every call because it is mutable. + */ + SADDLE_BROWN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Salmon. + * This method will yield a new value for every call because it is mutable. + */ + SALMON:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color SandyBrown. + * This method will yield a new value for every call because it is mutable. + */ + SANDY_BROWN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color SeaGreen. + * This method will yield a new value for every call because it is mutable. + */ + SEA_GREEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color SeaShell. + * This method will yield a new value for every call because it is mutable. + */ + SEA_SHELL:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Sienna. + * This method will yield a new value for every call because it is mutable. + */ + SIENNA:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Silver. + * This method will yield a new value for every call because it is mutable. + */ + SILVER:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color SkyBlue. + * This method will yield a new value for every call because it is mutable. + */ + SKY_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color SlateBlue. + * This method will yield a new value for every call because it is mutable. + */ + SLATE_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color SlateGray. + * This method will yield a new value for every call because it is mutable. + */ + SLATE_GRAY:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Snow. + * This method will yield a new value for every call because it is mutable. + */ + SNOW:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color SpringGreen. + * This method will yield a new value for every call because it is mutable. + */ + SPRING_GREEN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color SteelBlue. + * This method will yield a new value for every call because it is mutable. + */ + STEEL_BLUE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Tan. + * This method will yield a new value for every call because it is mutable. + */ + TAN:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Teal. + * This method will yield a new value for every call because it is mutable. + */ + TEAL:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Thistle. + * This method will yield a new value for every call because it is mutable. + */ + THISTLE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Tomato. + * This method will yield a new value for every call because it is mutable. + */ + TOMATO:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Transparent. + * This method will yield a new value for every call because it is mutable. + */ + TRANSPARENT:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Turquoise. + * This method will yield a new value for every call because it is mutable. + */ + TURQUOISE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Violet. + * This method will yield a new value for every call because it is mutable. + */ + VIOLET:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Wheat. + * This method will yield a new value for every call because it is mutable. + */ + WHEAT:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color White. + * This method will yield a new value for every call because it is mutable. + */ + WHITE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color WhiteSmoke. + * This method will yield a new value for every call because it is mutable. + */ + WHITE_SMOKE:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color Yellow. + * This method will yield a new value for every call because it is mutable. + */ + YELLOW:yfiles.system.Brush; + /** + * Yields a new {@link yfiles.system.SolidColorBrush} for the color YellowGreen. + * This method will yield a new value for every call because it is mutable. + */ + YELLOW_GREEN:yfiles.system.Brush; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface DoubleCollectionValueSerializerBase extends yfiles.system.ValueSerializer{ + /** + * Determines whether this instance can convert the specified value to a string. + * @param {Object} value The value. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {boolean} + * true if this instance can convert the specified value to a string; otherwise, false. + */ + canConvertToString(value:Object,context:yfiles.system.IValueSerializerContext):boolean; + /** + * Converts the given value to string. + * @param {Object} o The value. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {string} The value as string representation. + */ + convertToString(o:Object,context:yfiles.system.IValueSerializerContext):string; + /** + * Determines whether this instance can convert the specified value from the given string. + * @param {string} value The string value to convert. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {boolean} + * true if this instance can convert the specified value from the string; otherwise, false. + */ + canConvertFromString(value:string,context:yfiles.system.IValueSerializerContext):boolean; + } + var DoubleCollectionValueSerializerBase:{ + $class:yfiles.lang.Class; + new ():yfiles.system.DoubleCollectionValueSerializerBase; + }; + /** + * Helper class that can be used to store and retrieve application wide resources. + */ + export interface ApplicationResources extends Object{ + /** + * Tries to retrieve the value for the provided resource key. + * @param {yfiles.system.ResourceKey} resourceKey The resource key. + * @param {Object} value The value. + * @return {boolean} Whether the value has been found. + */ + tryGetValue(resourceKey:yfiles.system.ResourceKey,value:Object):boolean; + /** + * Determines whether the specified key is contained in this resources. + * @param {yfiles.system.ResourceKey} key The key. + * @return {boolean} + * true if the specified key is contained; otherwise, false. + */ + containsKey(key:yfiles.system.ResourceKey):boolean; + /** + * Removes the specified key from this instance. + * @param {yfiles.system.ResourceKey} key The key to remove. + * @return {boolean} Whether the key was contained in this instance. + */ + remove(key:yfiles.system.ResourceKey):boolean; + /** + * Gets or sets the item with the specified key. + * Value: The value to store with the key. + */ + getItem(key:yfiles.system.ResourceKey):Object; + /** + * Gets or sets the item with the specified key. + * Value: The value to store with the key. + */ + setItem(key:yfiles.system.ResourceKey,value:Object):void; + } + var ApplicationResources:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.ApplicationResources} class. + */ + new ():yfiles.system.ApplicationResources; + /** + * Gets the single static instance of this class for the current application. + * Value: The instance. + */ + INSTANCE:yfiles.system.ApplicationResources; + }; + export enum VerticalAlignment{ + /** + * Indicates that the object should be placed in the center of another object. + */ + CENTER, + /** + * Indicates that the object should be placed at the top of another object. + */ + TOP, + /** + * Indicates that the object should be placed at the bottom of another object. + */ + BOTTOM + } + /** + * Holds a number of default application related {@link yfiles.system.RoutedUICommand}s. + * The commands are not backed by any implementation. + */ + export interface ApplicationCommands extends Object{ + } + var ApplicationCommands:{ + $class:yfiles.lang.Class; + /** + * Gets the "select all" command. + * Value: The "select all" command. + */ + SELECT_ALL:yfiles.system.RoutedUICommand; + /** + * Gets the "close" command. + * Value: The "close" command. + */ + CLOSE:yfiles.system.RoutedUICommand; + /** + * Gets the "help" command. + * Value: The "help" command. + */ + HELP:yfiles.system.RoutedUICommand; + /** + * Gets the "Properties" command. + * Value: The "Properties" command. + */ + PROPERTIES:yfiles.system.RoutedUICommand; + /** + * Gets the delete command. + * Value: The delete command. + */ + DEL:yfiles.system.RoutedUICommand; + /** + * Gets the print command. + * Value: The print command. + */ + PRINT:yfiles.system.RoutedUICommand; + /** + * Gets the new command. + * Value: The command. + */ + NEW:yfiles.system.RoutedUICommand; + /** + * Gets the print preview command. + * Value: The print preview command. + */ + PRINT_PREVIEW:yfiles.system.RoutedUICommand; + /** + * Gets the open command. + * Value: The open command. + */ + OPEN:yfiles.system.RoutedUICommand; + /** + * Gets the save command. + * Value: The save command. + */ + SAVE:yfiles.system.RoutedUICommand; + /** + * Gets the "save as" command. + * Value: The "save as" command. + */ + SAVE_AS:yfiles.system.RoutedUICommand; + /** + * Gets the cut command. + * Value: The cut command. + */ + CUT:yfiles.system.RoutedUICommand; + /** + * Gets the copy command. + * Value: The copy command. + */ + COPY:yfiles.system.RoutedUICommand; + /** + * Gets the paste command. + * Value: The paste command. + */ + PASTE:yfiles.system.RoutedUICommand; + /** + * Gets the undo command. + * Value: The undo command. + */ + UNDO:yfiles.system.RoutedUICommand; + /** + * Gets the redo command. + * Value: The redo command. + */ + REDO:yfiles.system.RoutedUICommand; + }; + export enum MidpointRounding{ + /** + * Round to the next even value. + */ + TO_EVEN, + /** + * Round to the value which is away from 0. + */ + AWAY_FROM_ZERO + } + export enum MemberTypes{ + /** + * The member is a constructor. + */ + CONSTRUCTOR, + /** + * The member is an event. + */ + EVENT, + /** + * The member is a field. + */ + FIELD, + /** + * The member is a method. + */ + METHOD, + /** + * The member is a property. + */ + PROPERTY, + /** + * The member is a type info. + */ + TYPE_INFO, + /** + * The member is of a custom, unknown, type. + */ + CUSTOM, + /** + * The member is a nested type, i.e. a nested inner class or interface. + */ + NESTED_TYPE, + /** + * The member is of any type. + */ + ALL + } + /** + * Provides static arithmetic methods which are missing in JavaScript's Math class. + */ + export interface Math extends Object{ + } + var Math:{ + $class:yfiles.lang.Class; + /** + * Rounds the given value to the given digits. + * @param {number} value The value to round. + * @param {number} digits The number of digits to round to. + * @return {number} The rounded value. + */ + round(value:number,digits:number):number; + /** + * Rounds the given value to the given digits + * following the given midpoint for rounding 0.5. + * @param {number} value The value to round. + * @param {number} digits The number of digits to round to. + * @param {yfiles.system.MidpointRounding} midpoint The rule for rounding midpoint values. + * @return {number} The rounded value. + */ + roundMidpoint(value:number,digits:number,midpoint:yfiles.system.MidpointRounding):number; + /** + * Determines the sign of a given value. + * @param {number} value The value to determine the sign for. + * @return {number} -1 for negative values, 1 for positive values, 0 for 0. + */ + sign(value:number):number; + /** + * The negative maximum value (i.e. the minimum value) for Number. + */ + NEGATIVE_MAX_VALUE:number; + /** + * The maximum value for signed 32 bit integers. + */ + INT32_MAX_VALUE:number; + /** + * The minimum value for signed 32 bit integers. + */ + INT32_MIN_VALUE:number; + /** + * The maximum value for signed 16 bit integers. + */ + INT16_MAX_VALUE:number; + /** + * The minimum value for signed 16 bit integers. + */ + INT16_MIN_VALUE:number; + /** + * The maximum value for signed 8 bit integers. + */ + BYTE_MAX_VALUE:number; + /** + * The minimum value for signed 8 bit integers. + */ + BYTE_MIN_VALUE:number; + }; + export enum MethodAttributes{ + /** + * There is no information available. + */ + NONE, + /** + * Signals that the method is public. + */ + PUBLIC, + /** + * Signals that the method is static, i.e. it can be invoked without creating an instance of the type first. + */ + STATIC + } + export interface TargetException extends yfiles.lang.Exception{ + } + var TargetException:{ + $class:yfiles.lang.Class; + new (message:string):yfiles.system.TargetException; + }; + /** + * An attribute that can be used to specify the type of a field or property or the return type of a method. + */ + export interface TypeAttribute extends yfiles.lang.Attribute{ + /** + * Gets or sets the type. + * Value: + * The type. + */ + type:yfiles.lang.Class; + } + var TypeAttribute:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.TypeAttribute} class. + * @param {yfiles.lang.Class} type The type. + */ + new (type:yfiles.lang.Class):yfiles.system.TypeAttribute; + }; + /** + * A copy of the implementation of the Monitor class found in WPF and .net + * Provides a mechanism that synchronizes access to objects. + * This implementation is rather useless in a single-threaded environment. + */ + export interface Monitor extends Object{ + } + var Monitor:{ + $class:yfiles.lang.Class; + /** + * Notifies a thread in the waiting queue of a change in the locked object's state. + * @param {Object} obj The object a thread is waiting for. + */ + pulse(obj:Object):void; + /** + * Does nothing. + */ + pulseAll(obj:Object):void; + /** + * Does nothing. + */ + wait(obj:Object):boolean; + /** + * Does nothing. + */ + waitWithTimeout(obj:Object,millisecondsTimeout:number):boolean; + }; + /** + * An attribute which contains information about the parameters of a method. + */ + export interface ParameterAttribute extends yfiles.lang.Attribute{ + /** + * Gets the name of the parameter. + */ + name:string; + /** + * Gets the type of the parameter. + */ + type:yfiles.lang.Class; + /** + * Gets a value indicating whether the parameter is optional. + * Value: + * true if the parameter is optional; otherwise, false. + */ + isOptional:boolean; + /** + * Converts this {@link yfiles.system.ParameterAttribute} into a {@link yfiles.system.ParameterInfo} object. + * @param {yfiles.system.MemberInfo} owner The owner. + * @param {number} position The position. + * @return {yfiles.system.ParameterInfo} + */ + toParameterInfo(owner:yfiles.system.MemberInfo,position:number):yfiles.system.ParameterInfo; + } + var ParameterAttribute:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.ParameterAttribute} class. + * @param {string} name The name. + * @param {yfiles.lang.Class} type The type. + * @param {boolean} isOptional if set to true [is optional]. + */ + new (name:string,type:yfiles.lang.Class,isOptional:boolean):yfiles.system.ParameterAttribute; + }; + /** + * Static helper class that provides convenience access to + * {@link yfiles.system.Pen} instances that have a default thickness of + * 1.0d and are frozen for each of the brushes available in {@link yfiles.system.Brushes}. + */ + export interface Pens extends Object{ + } + var Pens:{ + $class:yfiles.lang.Class; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#ALICE_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + ALICE_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#ANTIQUE_WHITE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + ANTIQUE_WHITE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#AQUA} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + AQUA:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#AQUAMARINE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + AQUAMARINE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#AZURE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + AZURE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#BEIGE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + BEIGE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#BISQUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + BISQUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#BLACK} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + BLACK:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#BLANCHED_ALMOND} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + BLANCHED_ALMOND:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#BLUE_VIOLET} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + BLUE_VIOLET:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#BROWN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + BROWN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#BURLY_WOOD} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + BURLY_WOOD:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#CADET_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + CADET_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#CHARTREUSE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + CHARTREUSE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#CHOCOLATE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + CHOCOLATE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#CORAL} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + CORAL:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#CORNFLOWER_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + CORNFLOWER_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#CORNSILK} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + CORNSILK:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#CRIMSON} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + CRIMSON:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#CYAN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + CYAN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_CYAN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_CYAN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_GOLDENROD} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_GOLDENROD:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_GRAY} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_GRAY:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_GREEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_KHAKI} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_KHAKI:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_MAGENTA} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_MAGENTA:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_OLIVE_GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_OLIVE_GREEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_ORANGE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_ORANGE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_ORCHID} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_ORCHID:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_RED} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_RED:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_SALMON} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_SALMON:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_SEA_GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_SEA_GREEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_SLATE_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_SLATE_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_SLATE_GRAY} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_SLATE_GRAY:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_TURQUOISE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_TURQUOISE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DARK_VIOLET} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DARK_VIOLET:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DEEP_PINK} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DEEP_PINK:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DEEP_SKY_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DEEP_SKY_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DIM_GRAY} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DIM_GRAY:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#DODGER_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + DODGER_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#FIREBRICK} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + FIREBRICK:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#FLORAL_WHITE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + FLORAL_WHITE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#FOREST_GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + FOREST_GREEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#FUCHSIA} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + FUCHSIA:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#GAINSBORO} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + GAINSBORO:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#GHOST_WHITE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + GHOST_WHITE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#GOLD} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + GOLD:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#GOLDENROD} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + GOLDENROD:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#GRAY} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + GRAY:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + GREEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#GREEN_YELLOW} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + GREEN_YELLOW:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#HONEYDEW} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + HONEYDEW:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#HOT_PINK} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + HOT_PINK:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#INDIAN_RED} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + INDIAN_RED:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#INDIGO} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + INDIGO:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#IVORY} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + IVORY:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#KHAKI} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + KHAKI:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LAVENDER} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LAVENDER:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LAVENDER_BLUSH} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LAVENDER_BLUSH:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LAWN_GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LAWN_GREEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LEMON_CHIFFON} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LEMON_CHIFFON:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIGHT_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIGHT_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIGHT_CORAL} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIGHT_CORAL:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIGHT_CYAN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIGHT_CYAN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIGHT_GOLDENROD_YELLOW} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIGHT_GOLDENROD_YELLOW:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIGHT_GRAY} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIGHT_GRAY:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIGHT_GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIGHT_GREEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIGHT_PINK} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIGHT_PINK:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIGHT_SALMON} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIGHT_SALMON:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIGHT_SEA_GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIGHT_SEA_GREEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIGHT_SKY_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIGHT_SKY_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIGHT_SLATE_GRAY} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIGHT_SLATE_GRAY:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIGHT_STEEL_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIGHT_STEEL_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIGHT_YELLOW} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIGHT_YELLOW:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIME} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIME:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LIME_GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LIME_GREEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#LINEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + LINEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MAGENTA} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MAGENTA:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MAROON} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MAROON:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MEDIUM_AQUAMARINE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MEDIUM_AQUAMARINE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MEDIUM_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MEDIUM_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MEDIUM_ORCHID} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MEDIUM_ORCHID:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MEDIUM_PURPLE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MEDIUM_PURPLE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MEDIUM_SEA_GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MEDIUM_SEA_GREEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MEDIUM_SLATE_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MEDIUM_SLATE_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MEDIUM_SPRING_GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MEDIUM_SPRING_GREEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MEDIUM_TURQUOISE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MEDIUM_TURQUOISE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MEDIUM_VIOLET_RED} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MEDIUM_VIOLET_RED:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MIDNIGHT_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MIDNIGHT_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MINT_CREAM} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MINT_CREAM:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MISTY_ROSE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MISTY_ROSE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#MOCCASIN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + MOCCASIN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#NAVAJO_WHITE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + NAVAJO_WHITE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#NAVY} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + NAVY:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#OLD_LACE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + OLD_LACE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#OLIVE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + OLIVE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#OLIVE_DRAB} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + OLIVE_DRAB:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#ORANGE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + ORANGE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#ORANGE_RED} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + ORANGE_RED:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#ORCHID} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + ORCHID:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#PALE_GOLDENROD} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + PALE_GOLDENROD:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#PALE_GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + PALE_GREEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#PALE_TURQUOISE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + PALE_TURQUOISE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#PALE_VIOLET_RED} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + PALE_VIOLET_RED:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#PAPAYA_WHIP} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + PAPAYA_WHIP:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#PEACH_PUFF} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + PEACH_PUFF:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#PERU} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + PERU:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#PINK} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + PINK:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#PLUM} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + PLUM:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#POWDER_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + POWDER_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#PURPLE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + PURPLE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#RED} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + RED:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#ROSY_BROWN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + ROSY_BROWN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#ROYAL_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + ROYAL_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#SADDLE_BROWN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + SADDLE_BROWN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#SALMON} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + SALMON:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#SANDY_BROWN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + SANDY_BROWN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#SEA_GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + SEA_GREEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#SEA_SHELL} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + SEA_SHELL:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#SIENNA} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + SIENNA:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#SILVER} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + SILVER:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#SKY_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + SKY_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#SLATE_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + SLATE_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#SLATE_GRAY} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + SLATE_GRAY:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#SNOW} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + SNOW:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#SPRING_GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + SPRING_GREEN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#STEEL_BLUE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + STEEL_BLUE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#TAN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + TAN:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#TEAL} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + TEAL:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#THISTLE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + THISTLE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#TOMATO} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + TOMATO:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#TRANSPARENT} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + TRANSPARENT:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#TURQUOISE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + TURQUOISE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#VIOLET} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + VIOLET:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#WHEAT} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + WHEAT:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#WHITE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + WHITE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#WHITE_SMOKE} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + WHITE_SMOKE:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#YELLOW} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + YELLOW:yfiles.system.Pen; + /** + * Returns a {@link yfiles.system.Freezable#isFrozen frozen} + * {@link yfiles.system.Pen} that uses {@link yfiles.system.Brushes#YELLOW_GREEN} + * as its {@link yfiles.system.Pen#brush} and has a {@link yfiles.system.Pen#thickness} + * of 1. + */ + YELLOW_GREEN:yfiles.system.Pen; + }; + /** + * Helper class that can be used to perform drag and drop operations within a yFiles for HTML application. + * @see {@link yfiles.system.DragSource} + * @see {@link yfiles.system.DropTarget} + */ + export interface DragDrop extends Object{ + } + var DragDrop:{ + $class:yfiles.lang.Class; + /** + * Gets the singleton instance of this class. + * Value: The instance. + */ + INSTANCE:yfiles.system.DragDrop; + /** + * Whether to update the mouse cursor during the drag operation using CSS classes. + * If enabled, the following CSS classes are assigned to elements hovered during a drag operation, + * depending on the allowed drag-drop operations for these elements: + *
    + *
  • yfiles-cursor-dragdrop-move
  • + *
  • yfiles-cursor-dragdrop-link
  • + *
  • yfiles-cursor-dragdrop-scroll
  • + *
  • yfiles-cursor-dragdrop-all
  • + *
  • yfiles-cursor-dragdrop-no-drop
  • + *
+ * @see {@link yfiles.system.Drag#dragDropCursor} + */ + dragDropCursor:boolean; + /** + * The {@link yfiles.system.DependencyProperty} which binds a {@link yfiles.system.DropTarget} to an HTML element. + */ + DROP_TARGET_PROPERTY:yfiles.system.DependencyProperty; + /** + * Gets the drop target for the given element. + * @param {Node} element The element to get the drop target instance of. + * @return {yfiles.system.DropTarget} The target instance or null. + */ + getDropTarget(element:Node):yfiles.system.DropTarget; + /** + * The attached property for use on {@link HTMLElement}s that hold {@link yfiles.system.DragSource} + * instances if the element should play the source part during a drag and drop operation. + * @see {@link yfiles.system.DragSource} + */ + DRAG_SOURCE_PROPERTY:yfiles.system.DependencyProperty; + /** + * Sets the drag source for the given element. + * @param {HTMLElement} element The element to set the drag source instance for. + * @param {yfiles.system.DragSource} source The source or null. + */ + setDragSource(element:HTMLElement,source:yfiles.system.DragSource):void; + /** + * Gets the drag source registered with the given element. + * @param {HTMLElement} element The element. + * @return {yfiles.system.DragSource} The drag source instance or null. + */ + getDragSource(element:HTMLElement):yfiles.system.DragSource; + /** + * Initiates a drag and drop operation. + * @param {HTMLElement} dragSource The source of the drag operation. + * @param {Object} data The data to drag. + * @param {yfiles.system.DragDropEffects} allowedEffects The allowed effects. + */ + doDragDrop(dragSource:HTMLElement,data:Object,allowedEffects:yfiles.system.DragDropEffects):void; + /** + * Initiates a drag and drop operation. + * @param {HTMLElement} dragSource The source of the drag operation. + * @param {yfiles.system.IDataObject} data The data to drag. + * @param {yfiles.system.DragDropEffects} allowedEffects The allowed effects. + */ + doDragDropWithDataObject(dragSource:HTMLElement,data:yfiles.system.IDataObject,allowedEffects:yfiles.system.DragDropEffects):void; + }; + /** + * The event argument class that is used by {@link yfiles.system.DragDrop} during drags + * to query the drag source whether the drag should be continued. + */ + export interface QueryContinueDragEventArgs extends yfiles.system.RoutedEventArgs{ + /** + * Gets or sets the action. + * Value: The action. + */ + action:yfiles.system.DragAction; + /** + * Gets a value indicating whether the escape key had been pressed. + * Value: true if escape was pressed; otherwise, false. + */ + escapePressed:boolean; + /** + * Gets the current state of the keys. + * Value: The key states. + */ + keyStates:yfiles.system.DragDropKeyStates; + /** + * Gets or sets a value indicating whether this {@link yfiles.system.QueryContinueDragEventArgs} is handled. + * Value: true if handled; otherwise, false. + */ + handled:boolean; + } + var QueryContinueDragEventArgs:{ + $class:yfiles.lang.Class; + }; + export enum MouseButtons{ + /** + * No mouse button. + */ + NONE, + /** + * The left mouse button. + */ + LEFT, + /** + * The right mouse button. + */ + RIGHT, + /** + * The middle mouse button. + */ + MIDDLE, + /** + * Extra mouse button 1. + */ + X1, + /** + * Extra mouse button 2. + */ + X2 + } + /** + * A DependencyProperty is a type safe way to store data on an HTML element. + * Note that the property is not auto released. In order to prevent cyclic dependencies that can't be freed by the garbage collector, the reference + * must be released manually when appropriate. + */ + export interface DependencyProperty extends Object{ + } + var DependencyProperty:{ + $class:yfiles.lang.Class; + /** + * Registers a property with the specified name and types. + * @param {string} name The name. + * @param {yfiles.lang.Class} sourceType Type of the source. + * @param {yfiles.lang.Class} targetType Type of the target. + * @param {yfiles.system.PropertyMetadata} metadata The metadata. + * @return {yfiles.system.DependencyProperty} + */ + register(name:string,sourceType:yfiles.lang.Class,targetType:yfiles.lang.Class,metadata:yfiles.system.PropertyMetadata):yfiles.system.DependencyProperty; + }; + export interface XmlExtensions extends Object{ + } + var XmlExtensions:{ + $class:yfiles.lang.Class; + escapeUriString(s:string):string; + getNamespaceOfPrefix(element:Element,prefix:string):yfiles.support.XmlNamespace; + getPrefixOfNamespace(element:Element,ns:yfiles.support.XmlNamespace):string; + getDefaultNamespace(element:Element):yfiles.support.XmlNamespace; + documentElement(doc:Document):Element; + getXmlName(element:Node):yfiles.support.XmlName; + namedElements(xContainer:Node,xName:yfiles.support.XmlName):yfiles.collections.IEnumerable; + elements(xContainer:Node):yfiles.collections.IEnumerable; + createElement(dox:Document,name:string,namespaceUri:string):Element; + appendChildToDocument(dox:Document,child:Element):void; + }; + /** + * An interface that provides a {@link yfiles.system.IDragSource#dragSource}, identifying the control as a possible source + * for a drag operation. + */ + export interface IDragSource extends Object{ + dragSource:yfiles.system.DragSource; + } + var IDragSource:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * An interface that provides a {@link yfiles.system.IDropTarget#dropTarget}, identifying the control as a possible target + * of a drag operation. + */ + export interface IDropTarget extends Object{ + dropTarget:yfiles.system.DropTarget; + } + var IDropTarget:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The event argument used by {@link yfiles.system.DragSource#addGiveFeedbackListener GiveFeedback}. + */ + export interface GiveFeedbackEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the effects that are being used for the current drag operation. + * Value: The effects that have been specified in the call to {@link yfiles.system.DragSource#doDragDropWithDataObject}. + */ + effects:yfiles.system.DragDropEffects; + } + var GiveFeedbackEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.GiveFeedbackEventArgs} using the effects that have + * been specified by {@link yfiles.system.DragSource#doDragDropWithDataObject}. + * @param {yfiles.system.DragDropEffects} effects The effects. + */ + new (effects:yfiles.system.DragDropEffects):yfiles.system.GiveFeedbackEventArgs; + }; + /** + * The event argument that will be used by {@link yfiles.system.DropTarget} to notify handlers of the + * various events during a drag and drop operation. + */ + export interface DragEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the position of the current drag operation in the coordinates system of the provided element. + * @param {HTMLElement} element The element for which the coordinates should be used. + * @return {yfiles.geometry.PointD} The position in the coordinates system of element + */ + getPosition(element:HTMLElement):yfiles.geometry.PointD; + /** + * Gets the allowed effects for the current drag operation as specified by the {@link yfiles.system.DragSource}. + * Value: The allowed effects. + */ + allowedEffects:yfiles.system.DragDropEffects; + /** + * Gets the data that is associated with the drag. + * Value: The data. + * @see {@link yfiles.system.DragSource#doDragDropWithDataObject} + */ + data:yfiles.system.IDataObject; + /** + * Gets or sets the effects that the current handler can realize. + * Value: The effects. + */ + effects:yfiles.system.DragDropEffects; + /** + * Gets the key states relevant during the drag and drop operation. + * Value: The current key states. + */ + keyStates:yfiles.system.DragDropKeyStates; + /** + * Gets or sets a value indicating whether this {@link yfiles.system.DragEventArgs} has been handled. + * This property needs to be adjusted by handlers to tell the engine that the event has been handled. + * Value: true if handled; otherwise, false. + */ + handled:boolean; + } + var DragEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.DragEventArgs} class. + * @param {yfiles.input.MouseEventArgs} mouseEventArgs The original {@link yfiles.input.MouseEventArgs} for which this event was constructed. + * @param {yfiles.system.DragDropEffects} allowedEffects The allowed effects that will be used to initialize the {@link yfiles.system.DragEventArgs#allowedEffects} + * and {@link yfiles.system.DragEventArgs#effects} properties. + * @param {yfiles.system.IDataObject} data The data that is being dragged. + * @param {yfiles.system.DragDropKeyStates} keyStates The key states relevant for drag and drop operations. + */ + new (mouseEventArgs:yfiles.input.MouseEventArgs,allowedEffects:yfiles.system.DragDropEffects,data:yfiles.system.IDataObject,keyStates:yfiles.system.DragDropKeyStates):yfiles.system.DragEventArgs; + /** + * Initializes a new instance of the {@link yfiles.system.DragEventArgs} class. + * @param {yfiles.system.TouchEventArgs} touchEventArgs The original {@link yfiles.system.TouchEventArgs} for which this event was constructed. + * @param {yfiles.system.DragDropEffects} allowedEffects The allowed effects that will be used to initialize the {@link yfiles.system.DragEventArgs#allowedEffects} + * and {@link yfiles.system.DragEventArgs#effects} properties. + * @param {yfiles.system.IDataObject} data The data that is being dragged. + * @param {yfiles.system.DragDropKeyStates} keyStates The key states relevant for drag and drop operations. + */ + FromTouchEventArgs:{ + new (touchEventArgs:yfiles.system.TouchEventArgs,allowedEffects:yfiles.system.DragDropEffects,data:yfiles.system.IDataObject,keyStates:yfiles.system.DragDropKeyStates):yfiles.system.DragEventArgs; + }; + }; + export enum DragAction{ + /** + * Whether the drag should be continued. + */ + CONTINUE, + /** + * Whether the drag should be finalized by an immediate drop. + */ + DROP, + /** + * Whether the drag operation should be canceled. + */ + CANCEL + } + export enum DragDropKeyStates{ + /** + * The left mouse button is down or a touch gesture is in progress. + */ + POINTER_DOWN, + /** + * No button is pressed. + */ + NONE, + /** + * The shift key is down. + */ + SHIFT_KEY, + /** + * The control key is down. + */ + CONTROL_KEY, + /** + * The alt key is down. + */ + ALT_KEY + } + /** + * Converts a value into another object and back, using a parameter. + * This makes it possible to add custom data- or rule-driven logic to data bindings. + */ + export interface IValueConverter extends Object{ + /** + * Converts a value into another object. + * @param {Object} value The value to convert. + * @param {Object} parameter An optional parameter to consider during conversion. + * @return {Object} The converted value. + * @see Specified by {@link yfiles.system.IValueConverter#convert}. + */ + convert(value:Object,parameter:Object):Object; + /** + * Converts an object into the original value. + * @param {Object} value The object to convert. + * @param {Object} parameter An optional parameter to consider during conversion. + * @return {Object} The original value. + * @see Specified by {@link yfiles.system.IValueConverter#convertBack}. + */ + convertBack(value:Object,parameter:Object):Object; + } + var IValueConverter:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Helper class that plays the role of the target during a drag and drop operation that is + * initiated using {@link yfiles.system.DragDrop} and {@link yfiles.system.DragSource}. + */ + export interface DropTarget extends Object{ + /** + * Occurs when a drag enters the drop target. + * The handler may adjust the {@link yfiles.system.DragEventArgs#effects} and set the {@link yfiles.system.DragEventArgs#handled} + * property accordingly. + */ + addDragEnterListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Occurs when a drag enters the drop target. + * The handler may adjust the {@link yfiles.system.DragEventArgs#effects} and set the {@link yfiles.system.DragEventArgs#handled} + * property accordingly. + */ + removeDragEnterListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Occurs when a drag leaves the drop target. + * The handler may adjust the {@link yfiles.system.DragEventArgs#effects} and set the {@link yfiles.system.DragEventArgs#handled} + * property accordingly. + */ + addDragLeaveListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Occurs when a drag leaves the drop target. + * The handler may adjust the {@link yfiles.system.DragEventArgs#effects} and set the {@link yfiles.system.DragEventArgs#handled} + * property accordingly. + */ + removeDragLeaveListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Occurs when a drag is being performed over the drop target. + * The handler may adjust the {@link yfiles.system.DragEventArgs#effects} and set the {@link yfiles.system.DragEventArgs#handled} + * property accordingly. + */ + addDragOverListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Occurs when a drag is being performed over the drop target. + * The handler may adjust the {@link yfiles.system.DragEventArgs#effects} and set the {@link yfiles.system.DragEventArgs#handled} + * property accordingly. + */ + removeDragOverListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Occurs when the drop operation is performed on the drop target. + * The handler may adjust the {@link yfiles.system.DragEventArgs#effects} and set the {@link yfiles.system.DragEventArgs#handled} + * property accordingly. + */ + addDropListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Occurs when the drop operation is performed on the drop target. + * The handler may adjust the {@link yfiles.system.DragEventArgs#effects} and set the {@link yfiles.system.DragEventArgs#handled} + * property accordingly. + */ + removeDropListener(value:(sender:Object,e:yfiles.system.DragEventArgs)=> void):void; + /** + * Gets or target {@link HTMLElement} to which this instance has been attached. + * This field is automatically populated if an instance of this class is attached to a {@link HTMLElement} + * using the attached {@link yfiles.system.DragDrop#DROP_TARGET_PROPERTY}. + * Value: The target element. + */ + target:HTMLElement; + } + var DropTarget:{ + $class:yfiles.lang.Class; + }; + /** + * Helper class for {@link yfiles.system.DragDrop} + * that is used for the source of drag and drop operations. + */ + export interface DragSource extends Object{ + /** + * Allows handlers to give feedback whenever a {@link yfiles.system.DragSource#doDragDropWithDataObject} + * operation is initiated. + */ + addGiveFeedbackListener(value:(sender:Object,e:yfiles.system.GiveFeedbackEventArgs)=> void):void; + /** + * Allows handlers to give feedback whenever a {@link yfiles.system.DragSource#doDragDropWithDataObject} + * operation is initiated. + */ + removeGiveFeedbackListener(value:(sender:Object,e:yfiles.system.GiveFeedbackEventArgs)=> void):void; + /** + * Occurs when the state of the {@link yfiles.system.DragDropKeyStates} has changed to query the source whether the + * drag operation should be continued. + * Handlers should adjust the {@link yfiles.system.QueryContinueDragEventArgs#handled} and {@link yfiles.system.QueryContinueDragEventArgs#action} + * properties accordingly. + */ + addQueryContinueDragListener(value:(sender:Object,e:yfiles.system.QueryContinueDragEventArgs)=> void):void; + /** + * Occurs when the state of the {@link yfiles.system.DragDropKeyStates} has changed to query the source whether the + * drag operation should be continued. + * Handlers should adjust the {@link yfiles.system.QueryContinueDragEventArgs#handled} and {@link yfiles.system.QueryContinueDragEventArgs#action} + * properties accordingly. + */ + removeQueryContinueDragListener(value:(sender:Object,e:yfiles.system.QueryContinueDragEventArgs)=> void):void; + /** + * Gets or sets the source element from which drags can originate. + * If the {@link yfiles.system.DragSource#allowDrag} property is enabled, this will automatically register mouse event handlers on the element that + * will recognize default drag gestures (press followed by drag) to + * {@link yfiles.system.DragSource#doDragDrop initiate a drag and drop operation}. + * Value: The source. + */ + source:HTMLElement; + /** + * Raises the {@link yfiles.system.DragSource#addGiveFeedbackListener GiveFeedback} event. + * @param {yfiles.system.GiveFeedbackEventArgs} args The {@link yfiles.system.GiveFeedbackEventArgs} instance containing the event data. + */ + onGiveFeedback(args:yfiles.system.GiveFeedbackEventArgs):void; + /** + * Raises the {@link yfiles.system.DragSource#addQueryContinueDragListener QueryContinueDrag} event. + * If the event is not {@link yfiles.system.QueryContinueDragEventArgs#handled handled}, a default logic will be applied: + * the drag operation is canceled if the left mouse button is released or escape has been pressed, otherwise + * the drag will be {@link yfiles.system.DragAction#CONTINUE continued}. + * @param {yfiles.system.QueryContinueDragEventArgs} args The {@link yfiles.system.QueryContinueDragEventArgs} instance containing the event data. + */ + onQueryContinueDrag(args:yfiles.system.QueryContinueDragEventArgs):void; + /** + * Gets or sets a value indicating whether default drag gestures should be automatically recognized on the {@link yfiles.system.DragSource#source}. + * Value: true if drags should be recognized using the default gesture; otherwise, false. + */ + allowDrag:boolean; + /** + * Gets or sets the data that will be used for the {@link yfiles.system.DragSource#doDragDrop automatic drag operation}. + * Value: The drag data, the default value is null. + */ + dragData:Object; + /** + * Gets or sets the {@link yfiles.system.DragSource#dragDropEffects} that will be used for the {@link yfiles.system.DragSource#doDragDrop automatic drag operation}. + * Value: The effects, the default value is {@link yfiles.system.DragDropEffects#ALL}. + */ + dragDropEffects:yfiles.system.DragDropEffects; + /** + * Initiates a new drag operation using the provided drag data and effects. + * @param {Object} data The data to use for the drag. + * @param {yfiles.system.DragDropEffects} effects The allowed effects. + */ + doDragDrop(data:Object,effects:yfiles.system.DragDropEffects):void; + /** + * Initiates a new drag operation using the provided drag data and effects. + * @param {yfiles.system.IDataObject} data The data to use for the drag. + * @param {yfiles.system.DragDropEffects} effects The allowed effects. + */ + doDragDropWithDataObject(data:yfiles.system.IDataObject,effects:yfiles.system.DragDropEffects):void; + } + var DragSource:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.DragSource} class. + */ + new ():yfiles.system.DragSource; + /** + * Initializes a new instance of the {@link yfiles.system.DragSource} class setting the {@link yfiles.system.DragSource#source} property to the given element. + * @param {HTMLElement} source The source. + */ + WithElement:{ + new (source:HTMLElement):yfiles.system.DragSource; + }; + }; + /** + * A writer which writes an internal builder. + */ + export interface StringWriter extends Object{ + /** + * Writes the given String. + * The String is appended to the internal builder. + * @param {string} s The String to write. + */ + write(s:string):void; + /** + * Writes the given String and starts a new line. + * The String is appended to the internal builder. + * @param {string} s The String to write. + */ + writeLine(s:string):void; + /** + * Writes the given Object's string representation. + * The String is appended to the internal builder. + * @param {Object} o The Object to write. + */ + writeObject(o:Object):void; + /** + * Writes the given Object's string representation and starts a new line. + * The String is appended to the internal builder. + * @param {Object} o The Object to write. + */ + writeLineObject(o:Object):void; + /** + * Writes a new line. + */ + writeNewLine():void; + /** + * Gets a String representation of all which was written to this instance until now. + * @return {string} The String. + */ + toString():string; + /** + * Not used here. + */ + flush():void; + } + var StringWriter:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance. + */ + new ():yfiles.system.StringWriter; + }; + /** + * An event that can be handled. + */ + export interface RoutedEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the original source. + */ + originalSource:Object; + /** + * Gets or sets a value indicating whether this {@link yfiles.system.RoutedEventArgs} is handled. + * Value: + * true if handled; otherwise, false. + */ + handled:boolean; + } + var RoutedEventArgs:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this class. + */ + new ():yfiles.system.RoutedEventArgs; + }; + /** + * Provides helper classes to manipulate Strings. + */ + export interface StringExtensions extends Object{ + } + var StringExtensions:{ + $class:yfiles.lang.Class; + /** + * Formats the given String using the string representation of the given objects to replace format items (like {0}). + * @param {string} s1 The string to format. + * @param {Object[]} obj The objects to replace the format item with. + * @return {string} The formatted String. + */ + format(s1:string,obj:Object[]):string; + }; + /** + * Provides a method for type-safe equality checks. + */ + export interface IEquatable extends Object{ + /** + * Determines whether this is equal to other. + * @param {T} other The object to compare this to. Must be of the same type. + * @return {boolean} true if this is equal to the other object. + * @see Specified by {@link yfiles.system.IEquatable#equalsTyped}. + */ + equalsTyped(other:T):boolean; + } + var IEquatable:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + export enum DragDropEffects{ + /** + * Indicates that the drop target cannot be used for dropping the data. + */ + NONE, + /** + * Indicates that the data can be copied to the drop target. + */ + COPY, + /** + * Indicates that the data can be moved to the drop target. + */ + MOVE, + /** + * Indicates that the data can be linked to the drop target. + */ + LINK, + /** + * Indicates that the drop target is currently scrolling. + */ + SCROLL, + /** + * A combination of all of the flags. + */ + ALL + } + /** + * Represents an ARGB (alpha, red, green, blue) encoded color object. + */ + export interface Color extends Object{ + /** + * Gets the value of the red component of the color. + * The value is between 0 and 255. A higher value represents a higher part of the color is made up of this component. + */ + r:number; + /** + * Gets the value of the green component of the color. + * The value is between 0 and 255. A higher value represents a higher part of the color is made up of this component. + */ + g:number; + /** + * Gets the value of the blue component of the color. + * The value is between 0 and 255. A higher value represents a higher part of the color is made up of this component. + */ + b:number; + /** + * Gets the value of the alpha component of the color. + * The value is between 0 and 255. If this component is 0, then the color will be transparent. + */ + a:number; + /** + * Determines whether this color is equal to the specified color. + * @param {yfiles.system.Color} other The other. + * @return {boolean} true, if this color is equal to the other color; false, otherwise. + */ + equalsColor(other:yfiles.system.Color):boolean; + /** + * Determines whether this color is equal to the specified object. + * @param {Object} obj The other. + * @return {boolean} true, if this color is equal to the other object; false, otherwise. + */ + equals(obj:Object):boolean; + /** + * Returns a hash code for this instance. + * @return {number} + * A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + */ + hashCode():number; + /** + * Converts the specified color to a SVG color string. + * This is a bridge method that delegates to {@link yfiles.canvas.SVGExtensions#colorToSvgColor}. + * @return {string} + */ + toSvgColor():string; + } + var Color:{ + $class:yfiles.lang.Class; + /** + * Creates a new color instance from ARGB values. All values must be between 0 and 255. + * @param {number} a A. + * @param {number} r The r. + * @param {number} g The g. + * @param {number} b The b. + * @return {yfiles.system.Color} + */ + fromArgb(a:number,r:number,g:number,b:number):yfiles.system.Color; + equals(left:yfiles.system.Color,right:yfiles.system.Color):boolean; + notEquals(left:yfiles.system.Color,right:yfiles.system.Color):boolean; + }; + /** + * Contains meta data related to the {@link yfiles.system.DependencyProperty}. + */ + export interface PropertyMetadata extends Object{ + } + var PropertyMetadata:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.PropertyMetadata} class. + * @param {Object} defaultValue The default value. + */ + WithDefault:{ + new (defaultValue:Object):yfiles.system.PropertyMetadata; + }; + /** + * Initializes a new instance of the {@link yfiles.system.PropertyMetadata} class. + * @param {function(Object, yfiles.system.PropertyChangedEventArgs)} propertyChangedCallback The property changed callback. + */ + WithCallback:{ + new (propertyChangedCallback:(src:Object,args:yfiles.system.PropertyChangedEventArgs)=> void):yfiles.system.PropertyMetadata; + }; + }; + /** + * A structure which represents a time span. + */ + export interface TimeSpan extends yfiles.lang.Struct,yfiles.lang.IComparable,yfiles.system.IEquatable{ + /** + * Compares this object to the given object of the same type. + * @param {T} 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.IComparable#compareTo}. + */ + compareTo(obj:yfiles.system.TimeSpan):number; + /** + * The days part of the time span. + */ + days:number; + /** + * The total milliseconds (i.e. ticks) of this time span. + */ + totalMilliseconds:number; + /** + * The milliseconds part of this time span. + */ + milliseconds:number; + /** + * The total seconds of this time span. + */ + totalSeconds:number; + /** + * Determines whether this is equal to other. + * @param {T} other The object to compare this to. Must be of the same type. + * @return {boolean} true if this is equal to the other object. + * @see Specified by {@link yfiles.system.IEquatable#equalsTyped}. + */ + equalsTyped(other:yfiles.system.TimeSpan):boolean; + clone():yfiles.system.TimeSpan; + } + var TimeSpan:{ + $class:yfiles.lang.Class; + /** + * Empty time span. + */ + ZERO:yfiles.system.TimeSpan; + /** + * Creates a new time span which is ticks milliseconds long. + * @param {number} ticks The length of the time span in milliseconds. + */ + FromTotalMillis:{ + new (ticks:number):yfiles.system.TimeSpan; + }; + /** + * Creates a new time span with a given length. + * @param {number} days The days part of the time span. + * @param {number} hours The hour part of the time span. + * @param {number} minutes The minute part of the time span. + * @param {number} seconds The seconds part of the time span. + * @param {number} millis The milliseconds part of the time span. + */ + FromDaysHoursMinutesSecondsAndMillis:{ + new (days:number,hours:number,minutes:number,seconds:number,millis:number):yfiles.system.TimeSpan; + }; + /** + * Creates a new time span with the given length in days. + * @param {number} days The length of the time span in days. + * @return {yfiles.system.TimeSpan} A newly created time span. + */ + fromDays(days:number):yfiles.system.TimeSpan; + /** + * Creates a new time span with the given length in milliseconds. + * @param {number} milliseconds The length of the time span in milliseconds. + * @return {yfiles.system.TimeSpan} A newly created time span. + */ + fromMilliseconds(milliseconds:number):yfiles.system.TimeSpan; + /** + * Creates a new time span with the given length in seconds. + * @param {number} seconds The length of the time span in seconds. + * @return {yfiles.system.TimeSpan} A newly created time span. + */ + fromSeconds(seconds:number):yfiles.system.TimeSpan; + /** + * Whether time span t1 is greater or equal than time span t2. + * @param {yfiles.system.TimeSpan} t1 The first time span. + * @param {yfiles.system.TimeSpan} t2 The second time span. + * @return {boolean} true if the first time span is greater or equal than the second one. + */ + greaterThanOrEqual(t1:yfiles.system.TimeSpan,t2:yfiles.system.TimeSpan):boolean; + /** + * Whether time span t1 is less or equal than time span t2. + * @param {yfiles.system.TimeSpan} t1 The first time span. + * @param {yfiles.system.TimeSpan} t2 The second time span. + * @return {boolean} true if the first time span is less or equal than the second one. + */ + lessThanOrEqual(t1:yfiles.system.TimeSpan,t2:yfiles.system.TimeSpan):boolean; + /** + * Whether time span t1 is less than time span t2. + * @param {yfiles.system.TimeSpan} t1 The first time span. + * @param {yfiles.system.TimeSpan} t2 The second time span. + * @return {boolean} true if the first time span is less than the second one. + */ + lessThan(t1:yfiles.system.TimeSpan,t2:yfiles.system.TimeSpan):boolean; + /** + * Whether time span t1 is greater than time span t2. + * @param {yfiles.system.TimeSpan} t1 The first time span. + * @param {yfiles.system.TimeSpan} t2 The second time span. + * @return {boolean} true if the first time span is greater than the second one. + */ + greaterThan(t1:yfiles.system.TimeSpan,t2:yfiles.system.TimeSpan):boolean; + /** + * Whether the given time spans are not equal. + * @param {yfiles.system.TimeSpan} t1 The first time span. + * @param {yfiles.system.TimeSpan} t2 The second time span. + * @return {boolean} true if the time spans are not equal. + */ + notEquals(t1:yfiles.system.TimeSpan,t2:yfiles.system.TimeSpan):boolean; + /** + * Whether the given time spans are equal. + * @param {yfiles.system.TimeSpan} t1 The first time span. + * @param {yfiles.system.TimeSpan} t2 The second time span. + * @return {boolean} true if the time spans are equal. + */ + equals(t1:yfiles.system.TimeSpan,t2:yfiles.system.TimeSpan):boolean; + }; + /** + * This class provides a way of converting values of arbitrary types to other types. + */ + export interface TypeConverter extends Object{ + /** + * Returns whether a value can be converted from sourceType with this converter. + * @param {yfiles.lang.Class} sourceType The source type of the conversion. + * @return {boolean} true if this instance can convert values of type sourceType. + */ + canConvertFrom(sourceType:yfiles.lang.Class):boolean; + /** + * Returns whether a value can be converted from sourceType with this converter. + * @param {yfiles.lang.Class} sourceType The source type of the conversion. + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @return {boolean} true if this instance can convert values of type sourceType. + */ + canConvertFromWithContext(context:yfiles.system.ITypeDescriptorContext,sourceType:yfiles.lang.Class):boolean; + /** + * Returns whether a value can be converted to targetType with this converter. + * @param {yfiles.lang.Class} targetType The target type of the conversion. + * @return {boolean} true if this instance can convert values of type targetType. + */ + canConvertTo(targetType:yfiles.lang.Class):boolean; + /** + * Returns whether a value can be converted from destinationType with this converter. + * @param {yfiles.lang.Class} destinationType The target type of the conversion. + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @return {boolean} true if this instance can convert values of type destinationType. + */ + canConvertToWithContext(context:yfiles.system.ITypeDescriptorContext,destinationType:yfiles.lang.Class):boolean; + /** + * Converts value to another object. + * @param {Object} value The source value + * @return {Object} The converted destination value. + */ + convertFrom(value:Object):Object; + /** + * Converts value to another object. + * @param {Object} value The source value + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @return {Object} The converted destination value. + */ + convertFromWithContext(context:yfiles.system.ITypeDescriptorContext,value:Object):Object; + /** + * Converts a string value s to another object. + * @param {string} s The string value + * @return {Object} The converted destination value. + */ + convertFromString(s:string):Object; + /** + * Converts a string value s to another object in a culture invariant way. + * @param {string} s The string value + * @return {Object} The converted destination value. + */ + convertFromInvariantString(s:string):Object; + /** + * Converts a string value s to another object in a culture invariant way. + * @param {string} s The string value + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @return {Object} The converted destination value. + */ + convertFromInvariantStringWithContext(context:yfiles.system.ITypeDescriptorContext,s:string):Object; + /** + * Converts a value value to a string in a culture invariant way. + * @param {Object} value The value to convert + * @return {string} The converted string value. + */ + convertToInvariantString(value:Object):string; + /** + * Converts an object value to a string. + * @param {Object} value The source value + * @return {string} The converted string value. + */ + convertToString(value:Object):string; + /** + * Converts a value value to a string in a culture invariant way. + * @param {Object} value The value to convert + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @return {string} The converted string value. + */ + convertToInvariantStringWithContext(context:yfiles.system.ITypeDescriptorContext,value:Object):string; + /** + * Converts value to another object. + * @param {Object} value The source value + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @param {yfiles.system.CultureInfo} culture Additional culture information. + * @return {Object} The converted destination value. + */ + convertFromWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object):Object; + /** + * Converts value to another object of type destinationType. + * @param {Object} value The source value + * @param {yfiles.lang.Class} destinationType The target type of the conversion. + * @return {Object} The converted destination value. + */ + convertTo(value:Object,destinationType:yfiles.lang.Class):Object; + /** + * Converts value to another object of type destinationType. + * @param {Object} value The source value + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @param {yfiles.system.CultureInfo} culture Additional culture information. + * @param {yfiles.lang.Class} destinationType The target type of the conversion. + * @return {Object} The converted destination value. + */ + convertToWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object,destinationType:yfiles.lang.Class):Object; + } + var TypeConverter:{ + $class:yfiles.lang.Class; + }; + export interface WeakReference extends Object{ + target:Object; + isAlive:boolean; + } + var WeakReference:{ + $class:yfiles.lang.Class; + WithTargetAndTrackResurrection:{ + new (target:Object,trackResurrection:boolean):yfiles.system.WeakReference; + }; + WithObject:{ + new (target:Object):yfiles.system.WeakReference; + }; + }; + /** + * The dispatcher is responsible for scheduling and invoking of actions at a later time. + */ + export interface Dispatcher extends Object{ + /** + * Dispatches all actions at once. + */ + dispatchAll():void; + /** + * Invokes the action at the next possible time with the specified arguments. + * @param {yfiles.lang.delegate} target The target. + * @param {Object[]} args The args. + */ + beginInvoke(target:yfiles.lang.delegate,args:Object[]):void; + /** + * Invokes the action at the next possible time. + * @param {yfiles.lang.delegate} target The target. + */ + beginInvokeNoArgs(target:yfiles.lang.delegate):void; + /** + * Invokes the action at the next possible time. + * @param {function()} target The target. + */ + beginInvokeAction(target:()=> void):void; + /** + * Invokes the action at the next possible time with the specified arguments. + * @param {yfiles.lang.delegate} target The target. + * @param {Object[]} args The args. + */ + invoke(target:yfiles.lang.delegate,args:Object[]):void; + } + var Dispatcher:{ + $class:yfiles.lang.Class; + new ():yfiles.system.Dispatcher; + /** + * The global dispatcher instance. + */ + INSTANCE:yfiles.system.Dispatcher; + }; + /** + * Continuously fires a {@link yfiles.system.DispatcherTimer#addTickListener Tick} event in a specified interval. + */ + export interface DispatcherTimer extends Object{ + /** + * Starts the timer. + */ + start():void; + /** + * Stops the timer. + */ + stop():void; + /** + * Gets or sets a value indicating whether this instance is enabled. + * Value: + * true if this instance is enabled; otherwise, false. + * Setting this property to true starts the timer, setting + * to false stops it. + */ + isEnabled:boolean; + /** + * Gets or sets the interval. + * Value: + * The interval. + */ + interval:yfiles.system.TimeSpan; + /** + * Occurs when the action should be invoked. + */ + addTickListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Occurs when the action should be invoked. + */ + removeTickListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + } + var DispatcherTimer:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.DispatcherTimer} class. + */ + new ():yfiles.system.DispatcherTimer; + }; + /** + * Support interface used by {@link yfiles.system.ValueSerializer}. + */ + export interface IValueSerializerContext extends Object,yfiles.system.ITypeDescriptorContext{ + /** + * Gets the value serializer for a specific type. + * @param {yfiles.lang.Class} type The type to obtain a serializer for. + * @return {yfiles.system.ValueSerializer} A serializer or null. + * @see Specified by {@link yfiles.system.IValueSerializerContext#getValueSerializerFor}. + */ + getValueSerializerFor(type:yfiles.lang.Class):yfiles.system.ValueSerializer; + /** + * Gets the value serializer for a specific {@link yfiles.system.PropertyInfo}. + * @param {yfiles.system.PropertyInfo} p The descriptor of the property. + * @return {yfiles.system.ValueSerializer} A serializer or null. + * @see Specified by {@link yfiles.system.IValueSerializerContext#getValueSerializerForPropertyInfo}. + */ + getValueSerializerForPropertyInfo(p:yfiles.system.PropertyInfo):yfiles.system.ValueSerializer; + } + var IValueSerializerContext:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Provides a base class for all XAML markup extensions. + *

Markup extensions return objects based on string attribute values or markup elements in XAML and/or can be used to serialize + * classes that do not fulfil XAML serialization constraints.

+ */ + export interface MarkupExtension extends Object{ + /** + * Returns an object that is set as the value of the target property for this markup extension. + * @param {yfiles.support.ILookup} serviceProvider Object that can provide services for the markup extension. + * @return {Object} The object value to set on the property where the extension is applied. + */ + provideValue(serviceProvider:yfiles.support.ILookup):Object; + } + var MarkupExtension:{ + $class:yfiles.lang.Class; + }; + /** + * A collection of {@link yfiles.system.InputGesture}s for use with {@link yfiles.system.CommandManager}. + */ + export interface InputGestureCollection extends yfiles.system.SealableCollection{ + } + var InputGestureCollection:{ + $class:yfiles.lang.Class; + new ():yfiles.system.InputGestureCollection; + }; + /** + * A collection that can be sealed. + */ + export interface SealableCollection extends Object,yfiles.objectcollections.IList,yfiles.collections.IEnumerable,yfiles.collections.INotifyCollectionChanged{ + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Adds an item to the collection. + */ + add(item:T):void; + /** + * Adds the given object at the end of the list. + * @param {Object} value The object to add. + * @return {number} The index of the added object. + * @see Specified by {@link yfiles.objectcollections.IList#addWithValue}. + */ + addWithValue(value:Object):number; + /** + * Whether this list contains the given object. + * @param {Object} value The object to search for. + * @return {boolean} true if the given object is contained in the list. + * @see Specified by {@link yfiles.objectcollections.IList#containsValue}. + */ + containsValue(value:Object):boolean; + /** + * Removes all elements from the list. + * @see Specified by {@link yfiles.objectcollections.IList#clear}. + */ + clear():void; + /** + * Determines the index of the given item in the {@link yfiles.objectcollections.IList}. + * @param {Object} item The object to get the index for + * @return {number} The index of the given item. -1 if the item is not in the list. + * @see Specified by {@link yfiles.objectcollections.IList#indexOfItem}. + */ + indexOfItem(value:Object):number; + /** + * Inserts the given item at the given index. + * @param {number} index The index at which the item should be inserted. + * @param {Object} item The item to insert. + * @see Specified by {@link yfiles.objectcollections.IList#insertAt}. + */ + insertAt(index:number,value:Object):void; + /** + * Removes the given object from the list. + * @param {Object} value The object to remove. + * @see Specified by {@link yfiles.objectcollections.IList#removeValue}. + */ + removeValue(value:Object):void; + /** + * Determines whether the collection a specific value. + */ + contains(item:T):boolean; + copyToFromIndex(array:T[],arrayIndex:number):void; + /** + * Removes the first occurrence of a specific object from the collection. + */ + remove(item:T):boolean; + /** + * Copies the elements of this collection into the given array starting at the given arrayIndex. + * @param {Object} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.objectcollections.ICollection#copyTo}. + */ + copyTo(array:Object,index:number):void; + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.objectcollections.ICollection#count}. + */ + count:number; + /** + * Whether the collection is read-only. + * @see Specified by {@link yfiles.objectcollections.IList#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Whether the collection has a fixed size. + * @see Specified by {@link yfiles.objectcollections.IList#isFixedSize}. + */ + isFixedSize:boolean; + /** + * Gets a value indicating whether this instance has been {@link yfiles.system.SealableCollection#seal}ed. + * Value: true if this instance is sealed; otherwise, false. + */ + isSealed:boolean; + /** + * Returns the index of a specific item in the collection. + * @param {T} item + * @return {number} + */ + indexOf(item:T):number; + /** + * Inserts an item to the collection at the specified index. + */ + insert(index:number,item:T):void; + /** + * Removes the item at the given index from the list. + * @param {number} index The index of the item which should be removed. + * @see Specified by {@link yfiles.objectcollections.IList#removeAt}. + */ + removeAt(index:number):void; + /** + * Gets or sets the object at the given index. + * @param {number} index The index of the object to access. + * @return {Object} The object at the given index. + * @see Specified by {@link yfiles.objectcollections.IList#getObject}. + */ + getObject(index:number):Object; + /** + * Gets or sets the object at the given index. + * @param {number} index The index of the object to access. + * @return {Object} The object at the given index. + * @see Specified by {@link yfiles.objectcollections.IList#getObject}. + */ + setObject(index:number,value:Object):void; + getItemAt(index:number):T; + setItem(index:number,value:T):void; + /** + * Seals this instance, making it unmodifiable. + */ + seal():void; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + /** + * Raises the {@link yfiles.system.SealableCollection#addCollectionChangedListener CollectionChanged} event. + * @param {yfiles.collections.NotifyCollectionChangedEventArgs} args The {@link yfiles.collections.NotifyCollectionChangedEventArgs} instance containing the event data. + */ + onCollectionChanged(args:yfiles.collections.NotifyCollectionChangedEventArgs):void; + /** + * Occurs when the items list of the collection has changed, or the collection is reset. + * Note that a {@link yfiles.system.SealableCollection#isSealed sealed} instance will never trigger this event. + */ + addCollectionChangedListener(value:(sender:Object,e:yfiles.collections.NotifyCollectionChangedEventArgs)=> void):void; + /** + * Occurs when the items list of the collection has changed, or the collection is reset. + * Note that a {@link yfiles.system.SealableCollection#isSealed sealed} instance will never trigger this event. + */ + removeCollectionChangedListener(value:(sender:Object,e:yfiles.collections.NotifyCollectionChangedEventArgs)=> void):void; + } + var SealableCollection:{ + $class:yfiles.lang.Class; + new ():yfiles.system.SealableCollection; + }; + /** + * Support interface used by {@link yfiles.system.TypeConverter}. + */ + export interface ITypeDescriptorContext extends Object,yfiles.support.ILookup{ + onComponentChanged():void; + onComponentChanging():boolean; + instance:Object; + container:Object; + propertyDescriptor:Object; + } + var ITypeDescriptorContext:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A utility class that holds all properties of a pen. + */ + export interface Pen extends yfiles.system.Freezable{ + /** + * Gets or sets the brush for the pen. + * Value: The brush. + */ + brush:yfiles.system.Brush; + /** + * Gets or sets the dash cap. + * Value: The dash cap. + */ + dashCap:yfiles.system.PenLineCap; + /** + * Gets or sets the line cap for the end of the line. This property has no + * visual effect but remains for compatibility reasons. + * Value: The end line cap. This property has no visual effect but remains + * for compatibility reasons. + */ + endLineCap:yfiles.system.PenLineCap; + /** + * Gets or sets the line join property. + * Value: The line join property. + */ + lineJoin:yfiles.system.PenLineJoin; + /** + * Gets or sets the dash style for the pen. + * Note that the visual appearance of the 'dashes' and 'gaps' specified by + * this property depends on the value of the property {@link yfiles.system.Pen#dashCap}, + * too. + * Value: The dash style. The values of a dash style are in terms of + * multiples of the the thickness of this pen. This is different from + * the corresponding properties of a SVG stroke. + */ + dashStyle:yfiles.system.DashStyle; + /** + * Gets or sets the miter limit. + * Value: The miter limit. + */ + miterLimit:number; + /** + * Gets or sets the line cap for the start of the line. This property has + * no visual effect but remains for compatibility reasons. + * Value: The start line cap. This property has no visual effect but + * remains for compatibility reasons. + */ + startLineCap:yfiles.system.PenLineCap; + /** + * Gets or sets the thickness of the stroke. + * Value: The thickness. + */ + thickness:number; + /** + * Callback that needs to be overridden by subclasses to actually freeze the instance. + */ + freezeCore():void; + /** + * Clones this instance by returning a {@link Object#memberwiseClone} or this in case this instance + * is already {@link yfiles.system.Freezable#isFrozen frozen}. + * @return {yfiles.system.Freezable} An instance of the same type as this instance. + */ + clone():yfiles.system.Freezable; + /** + * Clones the current value of this instance to a new unfrozen pen. + */ + cloneCurrentValue():yfiles.system.Pen; + /** + * Converts the pen to a SVG stroke. + * This is a bridge method that delegates to {@link yfiles.canvas.SVGExtensions#toSvgStroke}. + * @return {string} + */ + toSvgStroke():string; + } + var Pen:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.Pen} class. + */ + new ():yfiles.system.Pen; + /** + * Initializes a new instance of the {@link yfiles.system.Pen} class using the given brush. + * @param {yfiles.system.Brush} brush The brush. + */ + FromBrush:{ + new (brush:yfiles.system.Brush):yfiles.system.Pen; + }; + /** + * Initializes a new instance of the {@link yfiles.system.Pen} class using the given brush and thickness. + * @param {yfiles.system.Brush} brush The brush. + * @param {number} thickness The thickness. + */ + FromBrushAndThickness:{ + new (brush:yfiles.system.Brush,thickness:number):yfiles.system.Pen; + }; + }; + /** + * The base class for {@link yfiles.system.ComponentResourceKey} that exists for compatibility with WPF classes. + */ + export interface ResourceKey extends Object{ + /** + * Gets the key that is used by this instance. + * Value: The key. + */ + key:string; + /** + * Returns the {@link yfiles.system.ResourceKey#key}. + */ + toString():string; + } + var ResourceKey:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.ResourceKey} class using the given string as the key. + * @param {string} key The key. + */ + new (key:string):yfiles.system.ResourceKey; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface ResourceKeyConverter extends yfiles.system.TypeConverter{ + /** + * Returns whether a value can be converted from sourceType with this converter. + * @param {yfiles.lang.Class} sourceType The source type of the conversion. + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @return {boolean} true if this instance can convert values of type sourceType. + */ + canConvertFromWithContext(context:yfiles.system.ITypeDescriptorContext,sourceType:yfiles.lang.Class):boolean; + /** + * Returns whether a value can be converted from destinationType with this converter. + * @param {yfiles.lang.Class} destinationType The target type of the conversion. + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @return {boolean} true if this instance can convert values of type destinationType. + */ + canConvertToWithContext(context:yfiles.system.ITypeDescriptorContext,destinationType:yfiles.lang.Class):boolean; + /** + * Converts value to another object. + * @param {Object} value The source value + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @param {yfiles.system.CultureInfo} culture Additional culture information. + * @return {Object} The converted destination value. + */ + convertFromWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object):Object; + /** + * Converts value to another object of type destinationType. + * @param {Object} value The source value + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @param {yfiles.system.CultureInfo} culture Additional culture information. + * @param {yfiles.lang.Class} destinationType The target type of the conversion. + * @return {Object} The converted destination value. + */ + convertToWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object,destinationType:yfiles.lang.Class):Object; + } + var ResourceKeyConverter:{ + $class:yfiles.lang.Class; + new ():yfiles.system.ResourceKeyConverter; + }; + /** + * An attribute used to describe the return type of the instances return by a {@link yfiles.system.MarkupExtension}'s + * {@link yfiles.system.MarkupExtension#provideValue ProvideValue} implementation. + */ + export interface MarkupExtensionReturnTypeAttribute extends yfiles.lang.Attribute{ + /** + * Gets the type of the return value of the {@link yfiles.system.MarkupExtension#provideValue} method. + * Value: The type of instances returned by the {@link yfiles.system.MarkupExtension#provideValue} method. + */ + returnType:yfiles.lang.Class; + } + var MarkupExtensionReturnTypeAttribute:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.MarkupExtensionReturnTypeAttribute} class. + * @param {yfiles.lang.Class} t The type of the instances returned by the markup extension. + */ + new (t:yfiles.lang.Class):yfiles.system.MarkupExtensionReturnTypeAttribute; + }; + export interface ContentPropertyAttribute extends yfiles.lang.Attribute{ + name:string; + } + var ContentPropertyAttribute:{ + $class:yfiles.lang.Class; + new (propertyName:string):yfiles.system.ContentPropertyAttribute; + }; + /** + * Holds a number of default zoom related {@link yfiles.system.RoutedUICommand}s. + * The commands are not backed by any implementation. + */ + export interface NavigationCommands extends Object{ + } + var NavigationCommands:{ + $class:yfiles.lang.Class; + /** + * Gets the increase zoom command. + * Value: The increase zoom command. + */ + INCREASE_ZOOM:yfiles.system.RoutedUICommand; + /** + * Gets the decrease zoom command. + * Value: The decrease zoom command. + */ + DECREASE_ZOOM:yfiles.system.RoutedUICommand; + /** + * Gets the zoom command. + * Value: The zoom command. + */ + ZOOM:yfiles.system.RoutedUICommand; + }; + /** + * The event argument that is used by the {@link yfiles.system.CommandBinding#addExecutedListener Executed} event. + */ + export interface ExecutedRoutedEventArgs extends yfiles.system.EventArgs{ + /** + * Gets or sets a value indicating whether this {@link yfiles.system.ExecutedRoutedEventArgs} is handled. + * Value: true if handled; otherwise, false. + */ + handled:boolean; + /** + * Gets the parameter that is associated with this execution of the command. + * Value: The parameter. + */ + parameter:Object; + /** + * Gets the source of the event. + * Value: The source. + */ + source:Object; + /** + * Gets the command that shall be executed. + * Value: The command to execute. + */ + command:yfiles.system.ICommand; + } + var ExecutedRoutedEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.ExecutedRoutedEventArgs} class. + * @param {yfiles.system.ICommand} command The command instance. + * @param {Object} parameter The parameter for the execution of the command. + */ + FromCommandAndParameter:{ + new (command:yfiles.system.ICommand,parameter:Object):yfiles.system.ExecutedRoutedEventArgs; + }; + /** + * Initializes a new instance of the {@link yfiles.system.ExecutedRoutedEventArgs} class. + * @param {Object} source The source of the command execution. + * @param {yfiles.system.ICommand} command The command instance. + * @param {Object} parameter The parameter for the execution of the command. + */ + new (source:Object,command:yfiles.system.ICommand,parameter:Object):yfiles.system.ExecutedRoutedEventArgs; + }; + /** + * Class that supports the concept of freezing an object. + * Freezing an object makes it immutable, which can result in performance enhancements. + */ + export interface Freezable extends Object{ + /** + * Gets a value indicating whether this instance is frozen. + * Value: true if this instance is frozen; otherwise, false. + */ + isFrozen:boolean; + /** + * Freezes this instance. + */ + freeze():void; + /** + * Should be called before an attempt is made by subclasses to write to the state of this instance. + * This method will throw an {@link yfiles.system.InvalidOperationException} if the instance {@link yfiles.system.Freezable#isFrozen}. + */ + writePreamble():void; + /** + * Callback that needs to be overridden by subclasses to actually freeze the instance. + */ + freezeCore():void; + /** + * Gets this instance as frozen instance. + * If this instance is frozen, it will return itself, otherwise a frozen clone will be returned. + * @return {yfiles.system.Freezable} A frozen version of this instance. + */ + getAsFrozen():yfiles.system.Freezable; + /** + * Determines whether this instance is not yet {@link yfiles.system.Freezable#isFrozen frozen}. + */ + canFreeze:boolean; + /** + * Clones this instance by returning a {@link Object#memberwiseClone} or this in case this instance + * is already {@link yfiles.system.Freezable#isFrozen frozen}. + * @return {yfiles.system.Freezable} An instance of the same type as this instance. + */ + clone():yfiles.system.Freezable; + } + var Freezable:{ + $class:yfiles.lang.Class; + }; + /** + * An {@link yfiles.system.InputGesture} implementation that reacts to {@link yfiles.input.KeyEventArgs}. + */ + export interface KeyGesture extends yfiles.system.InputGesture{ + /** + * Matches the arguments against the key and modifiers. + * @param {Object} targetElement The target element. + * @param {yfiles.system.RoutedEventArgs} inputEventArgs The {@link yfiles.system.RoutedEventArgs} instance containing the event data. + * @return {boolean} Whether the input event arg describes the given key and modifier press. + * @see Overrides {@link yfiles.system.InputGesture#matches} + */ + matches(targetElement:Object,inputEventArgs:yfiles.system.RoutedEventArgs):boolean; + /** + * Gets or sets the display string for this gesture. + * Value: The display string. + */ + displayString:string; + /** + * Gets or sets the key to match. + * Value: The key to match. + */ + key:yfiles.input.Key; + /** + * Gets or sets the modifiers to match. + * Value: The modifiers. + */ + modifiers:yfiles.input.ModifierKeys; + } + var KeyGesture:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.KeyGesture} class that reacts to no key. + */ + WithDefaults:{ + new ():yfiles.system.KeyGesture; + }; + /** + * Initializes a new instance of the {@link yfiles.system.KeyGesture} class that reacts to the given key. + * @param {yfiles.input.Key} key The key. + */ + new (key:yfiles.input.Key):yfiles.system.KeyGesture; + /** + * Initializes a new instance of the {@link yfiles.system.KeyGesture} class that reacts to the given key and modifier. + * @param {yfiles.input.Key} key The key. + * @param {yfiles.input.ModifierKeys} modifiers The modifiers. + */ + WithModifiers:{ + new (key:yfiles.input.Key,modifiers:yfiles.input.ModifierKeys):yfiles.system.KeyGesture; + }; + /** + * Initializes a new instance of the {@link yfiles.system.KeyGesture} class that reacts to the given key and modifier using + * the provided display string. + * @param {yfiles.input.Key} key The key. + * @param {yfiles.input.ModifierKeys} modifiers The modifiers. + * @param {string} displayString The display string. + */ + WithModifiersAndDisplayString:{ + new (key:yfiles.input.Key,modifiers:yfiles.input.ModifierKeys,displayString:string):yfiles.system.KeyGesture; + }; + }; + /** + * A collection of {@link yfiles.system.InputBinding}s for use with the + * {@link yfiles.system.CommandManager} utility class. + */ + export interface InputBindingCollection extends yfiles.system.SealableCollection{ + } + var InputBindingCollection:{ + $class:yfiles.lang.Class; + new ():yfiles.system.InputBindingCollection; + }; + /** + * Helper class used by {@link yfiles.system.CommandManager} that can recognize and match input events. + */ + export interface InputGesture extends Object{ + /** + * Tries to match the input event argument for the given target element. + * @param {Object} targetElement The target element on which the event happened. + * @param {yfiles.system.RoutedEventArgs} inputEventArgs The {@link yfiles.system.RoutedEventArgs} instance containing the event data. + * @return {boolean} Whether this instances matches the given event. + */ + matches(targetElement:Object,inputEventArgs:yfiles.system.RoutedEventArgs):boolean; + } + var InputGesture:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.InputGesture} class. + */ + new ():yfiles.system.InputGesture; + }; + /** + * Base interface for a command that can be executed. + */ + export interface ICommand extends Object{ + /** + * Determines whether this command be executed with respect to the given parameter. + * @param {Object} parameter The parameter or null + * @return {boolean} Whether {@link yfiles.system.ICommand#execute} can be called with the given parameter. + * @see Specified by {@link yfiles.system.ICommand#canExecute}. + */ + canExecute(parameter:Object):boolean; + /** + * Executes this command with respect to the given parameter. + * @param {Object} parameter The parameter or null + * @return {void} Whether {@link yfiles.system.ICommand#execute} can be called with the given parameter. + * @see Specified by {@link yfiles.system.ICommand#execute}. + */ + execute(parameter:Object):void; + /** + * Triggered to signal that the result of a call to {@link yfiles.system.ICommand#canExecute} may yield a different result. + */ + addCanExecuteChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Triggered to signal that the result of a call to {@link yfiles.system.ICommand#canExecute} may yield a different result. + */ + removeCanExecuteChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + } + var ICommand:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Holds a binding between an {@link yfiles.system.InputGesture} and a {@link yfiles.system.RoutedCommand}, + * as well as the {@link yfiles.system.InputBinding#commandParameter} and {@link yfiles.system.InputBinding#commandTarget}. + */ + export interface InputBinding extends Object{ + /** + * Gets or sets the command parameter to use as the parameter during {@link yfiles.system.ExecutedRoutedEventArgs execution}. + * Value: The command parameter to use for execution. + */ + commandParameter:Object; + /** + * Gets or sets the command target to execute the command on if not the currently focused one should be used. + * Value: The command target to use or null. + */ + commandTarget:yfiles.canvas.Control; + /** + * Gets or sets the command that is bound by this instance. + * Value: The command. + */ + command:yfiles.system.ICommand; + /** + * Gets or sets the gesture that is bound by this instance. + * Value: The gesture. + */ + gesture:yfiles.system.InputGesture; + } + var InputBinding:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.InputBinding} class. + */ + WithDefaults:{ + new ():yfiles.system.InputBinding; + }; + /** + * Initializes a new instance of the {@link yfiles.system.InputBinding} class. + * @param {yfiles.system.ICommand} command The command. + * @param {yfiles.system.InputGesture} gesture The gesture. + */ + new (command:yfiles.system.ICommand,gesture:yfiles.system.InputGesture):yfiles.system.InputBinding; + }; + /** + * A helper class for use in XAML that binds a {@link yfiles.system.KeyGesture} to a {@link yfiles.system.RoutedCommand}. + */ + export interface KeyBinding extends yfiles.system.InputBinding{ + /** + * Gets or sets the key to use for the {@link yfiles.system.KeyGesture}. + * Value: The key. + */ + key:yfiles.input.Key; + /** + * Gets or sets the modifiers to use for the {@link yfiles.system.KeyGesture}. + * Value: The modifiers. + */ + modifiers:yfiles.input.ModifierKeys; + } + var KeyBinding:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.KeyBinding} class. + */ + WithDefaults:{ + new ():yfiles.system.KeyBinding; + }; + /** + * Initializes a new instance of the {@link yfiles.system.KeyBinding} class. + * @param {yfiles.system.ICommand} command The command. + * @param {yfiles.system.KeyGesture} gesture The gesture. + */ + new (command:yfiles.system.ICommand,gesture:yfiles.system.KeyGesture):yfiles.system.KeyBinding; + /** + * Initializes a new instance of the {@link yfiles.system.KeyBinding} class. + * @param {yfiles.system.ICommand} command The command. + * @param {yfiles.input.Key} key The key for the gesture. + * @param {yfiles.input.ModifierKeys} modifiers The modifiers to use for the gesture. + */ + WithModifiers:{ + new (command:yfiles.system.ICommand,key:yfiles.input.Key,modifiers:yfiles.input.ModifierKeys):yfiles.system.KeyBinding; + }; + }; + /** + * An {@link yfiles.system.ICommand} that can be routed through the visual tree. + * @see {@link yfiles.system.CommandManager} + */ + export interface RoutedCommand extends Object,yfiles.system.ICommand{ + /** + * Is triggered whenever the return value of {@link yfiles.system.RoutedCommand#canExecuteOnTarget} + * might have changed. + * This event is currently triggered whenever {@link yfiles.system.CommandManager#invalidateRequerySuggested} + * is called and an event handler is registered with this event. + */ + addCanExecuteChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Is triggered whenever the return value of {@link yfiles.system.RoutedCommand#canExecuteOnTarget} + * might have changed. + * This event is currently triggered whenever {@link yfiles.system.CommandManager#invalidateRequerySuggested} + * is called and an event handler is registered with this event. + */ + removeCanExecuteChangedListener(value:(sender:Object,e:yfiles.system.EventArgs)=> void):void; + /** + * Determines whether this instance can be executed for the specified parameters. + * @param {Object} parameter The command parameter for use in the {@link yfiles.system.CanExecuteRoutedEventArgs#parameter}. + * @param {yfiles.canvas.Control} target The target where the command should be executed. May be null in which case the current + * focused element will be used. + * @return {boolean} + * true if this instance can be executed using the specified parameter and target; otherwise, false. + */ + canExecuteOnTarget(parameter:Object,target:yfiles.canvas.Control):boolean; + /** + * Executes this command by routing the corresponding {@link yfiles.system.ExecutedRoutedEventArgs} through the + * visual tree. + * The visual tree is traversed starting from target or the currently focused element + * to find a suitable {@link yfiles.system.CommandManager#getCommandBindings command binding} that will perform + * the actual execution. + * @param {Object} parameter The parameter to use for the {@link yfiles.system.ExecutedRoutedEventArgs#parameter}. + * @param {yfiles.canvas.Control} target The target element to start the routing or null. + */ + executeOnTarget(parameter:Object,target:yfiles.canvas.Control):void; + /** + * This implementation delegates to {@link yfiles.system.RoutedCommand#canExecuteOnTarget}. + * @see Specified by {@link yfiles.system.ICommand#canExecute}. + */ + canExecute(parameter:Object):boolean; + /** + * This implementation delegates to {@link yfiles.system.RoutedCommand#executeOnTarget}. + * @see Specified by {@link yfiles.system.ICommand#execute}. + */ + execute(parameter:Object):void; + /** + * Raises the {@link yfiles.system.RoutedCommand#addCanExecuteChangedListener CanExecuteChanged} event. + * @param {yfiles.system.EventArgs} args The {@link yfiles.system.EventArgs} instance containing the event data. + */ + onCanExecuteChanged(args:yfiles.system.EventArgs):void; + /** + * Gets the collection of input gestures for this command. + * Value: The input gestures. + */ + inputGestures:yfiles.system.InputGestureCollection; + /** + * Gets the name of this command. + * Value: The name. + */ + name:string; + /** + * Gets the type of the owner that declares this command. + * Value: The type of the owner. + */ + ownerType:yfiles.lang.Class; + } + var RoutedCommand:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.RoutedCommand} class. + */ + WithDefaults:{ + new ():yfiles.system.RoutedCommand; + }; + /** + * Initializes a new instance of the {@link yfiles.system.RoutedCommand} class with the given name and owner type. + * @param {string} name The name of the command. + * @param {yfiles.lang.Class} ownerType Type of the owner type where this command is declared. + */ + FromNameAndType:{ + new (name:string,ownerType:yfiles.lang.Class):yfiles.system.RoutedCommand; + }; + /** + * Initializes a new instance of the {@link yfiles.system.RoutedCommand} class with the given name, owner type, and input gestures. + * @param {string} name The name of the command. + * @param {yfiles.lang.Class} ownerType Type of the owner type where this command is declared. + * @param {yfiles.system.InputGestureCollection} inputGestures The collection of input gestures for this command. + */ + new (name:string,ownerType:yfiles.lang.Class,inputGestures:yfiles.system.InputGestureCollection):yfiles.system.RoutedCommand; + }; + /** + * Represents a list of {@link yfiles.system.GradientStop} objects. + */ + export interface GradientStopCollection extends yfiles.system.Freezable,yfiles.collections.IList,yfiles.objectcollections.IList{ + /** + * Callback that needs to be overridden by subclasses to actually freeze the instance. + */ + freezeCore():void; + /** + * Adds the given item to the collection. + * @param {T} item + * @see Specified by {@link yfiles.collections.ICollection#add}. + */ + add(item:yfiles.system.GradientStop):void; + /** + * Adds the given object at the end of the list. + * @param {Object} value The object to add. + * @return {number} The index of the added object. + * @see Specified by {@link yfiles.objectcollections.IList#addWithValue}. + */ + addWithValue(value:Object):number; + /** + * Whether this list contains the given object. + * @param {Object} value The object to search for. + * @return {boolean} true if the given object is contained in the list. + * @see Specified by {@link yfiles.objectcollections.IList#containsValue}. + */ + containsValue(value:Object):boolean; + /** + * Removes all items from this collection. + * @see Specified by {@link yfiles.collections.ICollection#clear}. + */ + clear():void; + /** + * Determines the index of the given item in the {@link yfiles.objectcollections.IList}. + * @param {Object} item The object to get the index for + * @return {number} The index of the given item. -1 if the item is not in the list. + * @see Specified by {@link yfiles.objectcollections.IList#indexOfItem}. + */ + indexOfItem(value:Object):number; + /** + * Inserts the given item at the given index. + * @param {number} index The index at which the item should be inserted. + * @param {Object} item The item to insert. + * @see Specified by {@link yfiles.objectcollections.IList#insertAt}. + */ + insertAt(index:number,value:Object):void; + /** + * Removes the given object from the list. + * @param {Object} value The object to remove. + * @see Specified by {@link yfiles.objectcollections.IList#removeValue}. + */ + removeValue(value:Object):void; + /** + * Whether the given item is contained in this collection. + * @param {T} item The item to search for. + * @return {boolean} true if the given item is contained in this collection. + * @see Specified by {@link yfiles.collections.ICollection#contains}. + */ + contains(item:yfiles.system.GradientStop):boolean; + /** + * Copies all elements of this collection into the given array. + * @param {T[]} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.collections.ICollection#copyToArrayAt}. + */ + copyToArrayAt(array:yfiles.system.GradientStop[],arrayIndex:number):void; + /** + * Removes the given item from this collection. + * @param {T} item The item to remove. + * @return {boolean} Whether the item was removed from the collection. + * @see Specified by {@link yfiles.collections.ICollection#remove}. + */ + remove(item:yfiles.system.GradientStop):boolean; + /** + * Copies the elements of this collection into the given array starting at the given arrayIndex. + * @param {Object} array The array to copy the elements to. + * @param {number} arrayIndex The index in the given array where the first element should be copied to. + * @see Specified by {@link yfiles.objectcollections.ICollection#copyTo}. + */ + copyTo(array:Object,index:number):void; + /** + * The number of elements in this collection. + * @see Specified by {@link yfiles.collections.ICollection#count}. + */ + count:number; + /** + * @see Specified by {@link yfiles.objectcollections.ICollection#syncRoot}. + */ + syncRoot:Object; + /** + * @see Specified by {@link yfiles.objectcollections.ICollection#isSynchronized}. + */ + isSynchronized:boolean; + /** + * Whether this collection is read-only. + * @see Specified by {@link yfiles.collections.ICollection#isReadOnly}. + */ + isReadOnly:boolean; + /** + * Whether the collection has a fixed size. + * @see Specified by {@link yfiles.objectcollections.IList#isFixedSize}. + */ + isFixedSize:boolean; + /** + * The index of the given item in the list. + * @param {T} item The item to search for. + * @return {number} The index of the given item in the list. -1 if the item is not in the list. + * @see Specified by {@link yfiles.collections.IList#indexOf}. + */ + indexOf(item:yfiles.system.GradientStop):number; + /** + * Inserts the given item at the given index. + * @param {number} index The index to insert the item at. + * @param {T} item The item to insert. + * @see Specified by {@link yfiles.collections.IList#insert}. + */ + insert(index:number,item:yfiles.system.GradientStop):void; + /** + * Removes the item at the given index from the list. + * @param {number} index The index of the item to remove. + * @see Specified by {@link yfiles.collections.IList#removeAt}. + */ + removeAt(index:number):void; + getObject(index:number):Object; + setObject(index:number,value:Object):void; + /** + * Gets or sets the item at the given index. + * @param {number} index The index of the item to access. + * @return {T} The item at the given index. + * @see Specified by {@link yfiles.collections.IList#get}. + */ + get(index:number):yfiles.system.GradientStop; + /** + * Gets or sets the item at the given index. + * @param {number} index The index of the item to access. + * @return {T} The item at the given index. + * @see Specified by {@link yfiles.collections.IList#get}. + */ + set(index:number,value:yfiles.system.GradientStop):void; + /** + * Gets an {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance. + * @return {yfiles.collections.IEnumerator.} The {@link yfiles.collections.IEnumerator} which can be used to iterate over the items in this instance + * @see Specified by {@link yfiles.collections.IEnumerable#getEnumerator}. + */ + getEnumerator():yfiles.collections.IEnumerator; + /** + * Gets an {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * This method exists for internal purposes mainly, if available the {@link yfiles.collections.IEnumerable#getEnumerator} should be used instead. + * @return {yfiles.objectcollections.IEnumerator} The {@link yfiles.objectcollections.IEnumerator} which can be used to iterate over the items in this instance. + * @see Specified by {@link yfiles.objectcollections.IEnumerable#getObjectEnumerator}. + */ + getObjectEnumerator():yfiles.objectcollections.IEnumerator; + } + var GradientStopCollection:{ + $class:yfiles.lang.Class; + new ():yfiles.system.GradientStopCollection; + }; + /** + * Fills an area with a specified solid color. + */ + export interface SolidColorBrush extends yfiles.system.Brush{ + /** + * Gets the solid color with which the area is filled. + */ + color:yfiles.system.Color; + } + var SolidColorBrush:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.SolidColorBrush} class with the specified color. + * @param {yfiles.system.Color} color The solid color with which the area is filled. + */ + new (color:yfiles.system.Color):yfiles.system.SolidColorBrush; + }; + /** + * Represents any object which fills an area. + */ + export interface Brush extends yfiles.system.Freezable{ + } + var Brush:{ + $class:yfiles.lang.Class; + new ():yfiles.system.Brush; + }; + /** + * Fills an area with a gradient. + * The transition points of a gradient brush are defined by {@link yfiles.system.GradientStop} objects. + */ + export interface GradientBrush extends yfiles.system.Brush,yfiles.drawing.IDefsSupport{ + /** + * Gets or sets the gradient stops of this brush. + * Value: + * The gradient stops of this brush. + */ + gradientStops:yfiles.system.GradientStopCollection; + /** + * Callback that needs to be overridden by subclasses to actually freeze the instance. + */ + freezeCore():void; + /** + * Creates a new SVG gradient that corresponds to this gradient brush. + * @return {SVGElement} A new SVG gradient that corresponds to this gradient brush + */ + toSvgGradient():SVGElement; + /** + * Updates the SVG gradient within the defs section of the SVG document if it has changed. + * @param {SVGElement} oldElement The old element. + * @param {yfiles.canvas.ICanvasContext} context The context. + */ + updateSvgGradient(oldElement:SVGElement,context:yfiles.canvas.ICanvasContext):void; + /** + * Creates a new SVG gradient that corresponds to this gradient brush. + * @return {SVGElement} A new SVG gradient that corresponds to this gradient brush + * @see Specified by {@link yfiles.drawing.IDefsSupport#createDefsElement}. + */ + createDefsElement(context:yfiles.canvas.ICanvasContext):SVGElement; + /** + * Updates the SVG gradient within the defs section of the SVG document if it has changed. + * @param {SVGElement} oldElement The old element. + * @param {yfiles.canvas.ICanvasContext} context The context. + * @see Specified by {@link yfiles.drawing.IDefsSupport#updateDefsElement}. + */ + updateDefsElement(oldElement:SVGElement,context:yfiles.canvas.ICanvasContext):void; + /** + * Checks if the specified node references the element represented by this object. + * @param {yfiles.canvas.ICanvasContext} context The current canvas context. + * @param {Node} node The SVG node. + * @param {string} id The defs id that has been stored for this instance by the provided context. + * @return {boolean} true if node references the element represented by this instance. + * @see Specified by {@link yfiles.drawing.IDefsSupport#accept}. + */ + accept(ctx:yfiles.canvas.ICanvasContext,item:Node,id:string):boolean; + } + var GradientBrush:{ + $class:yfiles.lang.Class; + new ():yfiles.system.GradientBrush; + }; + export enum GradientSpreadMethod{ + /** + * The outside is filled with the terminal colors of the gradient. + */ + PAD, + /** + * The outside is filled by repeating the gradient but in alternating directions, until the area is filled. + */ + REFLECT, + /** + * The outside is filled by repeating the original gradient. + */ + REPEAT + } + /** + * Specifies the properties of a transition point of a gradient. + */ + export interface GradientStop extends yfiles.system.Freezable{ + /** + * Gets or sets the color of this transition point. + * Value: + * The color of this transition point. + */ + color:yfiles.system.Color; + /** + * Gets or sets the offset of this transition point. + * Value: + * The offset of this transition point. + */ + offset:number; + /** + * Converts the gradient stop color to a SVG color string. + * This is a bridge method that delegates to {@link yfiles.canvas.SVGExtensions#gradientStopToSvgColor}. + * @return {string} + */ + toSvgColor():string; + } + var GradientStop:{ + $class:yfiles.lang.Class; + new ():yfiles.system.GradientStop; + }; + /** + * Static helper class that provides convenience access to commonly used + * {@link yfiles.system.Brush} instances. + */ + export interface HatchBrushes extends Object{ + } + var HatchBrushes:{ + $class:yfiles.lang.Class; + /** + * Gets a 50 percent hatch brush. + * Value: The frozen brush instance. + */ + HATCH50:yfiles.system.Brush; + }; + /** + * An attribute that can be used on the {@link system.AttributeTargets#ASSEMBLY assembly level} + * to help with the automatic XAML-like serialization of the classes in that assembly. + * This attribute can be used to tell the serialization engine which XML prefix to use for + * for a certain XML namespace that has been declared using the {@link yfiles.system.XmlnsDefinitionAttribute} in the assembly + * this attribute is declared for. + *

+ * A typical use case is to map several CLR namespaces to a human readable XML namespace. + * If this attribute is not specified for a CLR namespace, a standard clr-namespace:XXX XML namespace is generated. + *

+ * @see {@link yfiles.system.XmlnsPrefixAttribute} + */ + export interface XmlnsPrefixAttribute extends yfiles.lang.Attribute{ + /** + * Gets the prefix. + * Value: The prefix. + */ + prefix:string; + /** + * Gets the XML namespace. + * Value: The XML namespace. + */ + xmlNamespace:string; + } + var XmlnsPrefixAttribute:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.XmlnsPrefixAttribute} class. + * @param {string} xmlNamespace The XML namespace. + * @param {string} prefix The prefix to prefer for that namespace. + */ + new (xmlNamespace:string,prefix:string):yfiles.system.XmlnsPrefixAttribute; + }; + /** + * An attribute that can be used on the {@link system.AttributeTargets#ASSEMBLY assembly level} + * to help with the automatic XAML-like serialization of the classes in that assembly. + *

+ * This attribute can be used to tell the serialization engine which symbolic namespace URIs to use + * for certain CLR namespaces in the assembly this attribute is declared for. + *

+ *

The actual XAML serialization process is free to ignore this prefix if necessary.

+ * @see {@link yfiles.system.XmlnsPrefixAttribute} + */ + export interface XmlnsDefinitionAttribute extends yfiles.lang.Attribute{ + /** + * Gets or sets the name of the assembly. + * Value: The name of the assembly. + */ + assemblyName:string; + /** + * Gets the CLR namespace. + * Value: The CLR namespace. + */ + clrNamespace:string; + /** + * Gets the XML namespace. + * Value: The XML namespace. + */ + xmlNamespace:string; + } + var XmlnsDefinitionAttribute:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of this attribute. + * @param {string} xmlNamespace The symbolic namespace uri to map the CLR-namespace to. + * @param {string} clrNamespace A single CLR-namespace to map to the namespace uri. + */ + new (xmlNamespace:string,clrNamespace:string):yfiles.system.XmlnsDefinitionAttribute; + }; + /** + * Event argument modeled after the WPF TouchEventArgs for use with the + * {@link yfiles.system.TouchEventArgs#touchDevice}. + */ + export interface TouchEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the position associated with the event. + * Value: The position. + */ + position:yfiles.geometry.PointD; + /** + * Gets the position of the event within the target bounds. + * @param {Element} target The target. + * @return {yfiles.geometry.PointD} + */ + getPosition(target:Element):yfiles.geometry.PointD; + /** + * Gets or sets a value indicating whether this {@link yfiles.system.TouchEventArgs} is handled. + * Value: true if handled; otherwise, false. + */ + handled:boolean; + /** + * Gets the touch device that is associated with this event. + * Value: The touch device. + */ + touchDevice:yfiles.system.TouchDevice; + } + var TouchEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.TouchEventArgs} class. + * @param {HTMLElement} target The target element. + * @param {SVGElement} touchEvent + * @param {Object} touch The touch. + */ + ForTouch:{ + new (target:HTMLElement,touchEvent:SVGElement,touch:Object):yfiles.system.TouchEventArgs; + }; + /** + * Initializes a new instance of the {@link yfiles.system.TouchEventArgs} class. + * @param {HTMLElement} target The target element. + * @param {MouseEvent} e An MSPointerEvent or PointerEvent instance. + */ + new (target:HTMLElement,e:MouseEvent):yfiles.system.TouchEventArgs; + }; + /** + * Represents a TouchDevice which is identified by a textual ID. + */ + export interface TouchDevice extends Object{ + /** + * Gets the id of this touch device. + */ + id:number; + } + var TouchDevice:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.TouchDevice} class with the specified ID. + * @param {number} id The ID of this touch device. + */ + new (id:number):yfiles.system.TouchDevice; + }; + export enum FontWeight{ + NORMAL, + BOLD, + BOLDER, + LIGHTER, + ITEM100, + ITEM200, + ITEM300, + ITEM400, + ITEM500, + ITEM600, + ITEM700, + ITEM800, + ITEM900, + INHERIT + } + export enum TextDecoration{ + /** + * No Text Decoration. + */ + NONE, + /** + * Underlined text. + */ + UNDERLINE, + /** + * Overlined Text. + */ + OVERLINE, + /** + * Text with line through. + */ + LINE_THROUGH, + /** + * Blinking Text. + */ + BLINK + } + /** + * Extends the {@link yfiles.system.RoutedCommand} class and provides an additional {@link yfiles.system.RoutedUICommand#text} attribute + * for display in a UI. + */ + export interface RoutedUICommand extends yfiles.system.RoutedCommand{ + /** + * Gets or sets the text to display in a UI component. + * Value: The text. + */ + text:string; + /** + * Returns a {@link String} that represents this instance using {@link yfiles.system.RoutedUICommand#text}. + * @return {string} + * A {@link String} that represents this instance. + */ + toString():string; + } + var RoutedUICommand:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.RoutedUICommand} class with an empty {@link yfiles.system.RoutedUICommand#text}. + */ + WithDefaults:{ + new ():yfiles.system.RoutedUICommand; + }; + /** + * Initializes a new instance of the {@link yfiles.system.RoutedUICommand} class. + * @param {string} text The text for display in a UI. + * @param {string} name The name of the command. + * @param {yfiles.lang.Class} ownerType The type of the owner of the command that declares it. + */ + FromNameTypeAndInputGestures:{ + new (text:string,name:string,ownerType:yfiles.lang.Class):yfiles.system.RoutedUICommand; + }; + /** + * Initializes a new instance of the {@link yfiles.system.RoutedUICommand} class. + * @param {string} text The text for display in a UI. + * @param {string} name The name of the command. + * @param {yfiles.lang.Class} ownerType The type of the owner of the command that declares it. + * @param {yfiles.system.InputGestureCollection} inputGestures The input gestures. + */ + new (text:string,name:string,ownerType:yfiles.lang.Class,inputGestures:yfiles.system.InputGestureCollection):yfiles.system.RoutedUICommand; + }; + /** + * Describes a font, with size, family, style, weight and line spacing. + */ + export interface Typeface extends Object{ + /** + * Gets or sets the size of the font. + * Value: The size of the font. + * The font size is interpreted as px. + */ + fontSize:number; + /** + * Gets or sets the font family. + * Value: The font family. + */ + fontFamily:string; + /** + * Gets or sets the font style. + * Value: The font style. + */ + fontStyle:yfiles.system.FontStyle; + /** + * Gets or sets the font weight. + * Value: The font weight. + */ + fontWeight:yfiles.system.FontWeight; + /** + * Gets or sets the line spacing. + * The value is interpreted as parts of the line height. + * Value: The line spacing. + */ + lineSpacing:number; + /** + * Gets or sets the text decoration. + * Value: The text decoration. + */ + textDecoration:yfiles.system.TextDecoration; + } + var Typeface:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.Typeface} class + * with size 10, "Arial" family, normal weight and style and line + * spacing 0.5. + */ + new ():yfiles.system.Typeface; + }; + export enum FontStyle{ + NORMAL, + ITALIC, + OBLIQUE, + INHERIT + } + /** + * Fills an area with a SVG pattern. + */ + export interface PatternBrush extends yfiles.system.Brush,yfiles.drawing.IDefsSupport{ + /** + * Gets or sets the content. + * Value: + * The content. + */ + content:yfiles.drawing.Visual; + /** + * Gets or sets the SVG view box of this pattern brush. + * Value: + * The SVG view box of this pattern brush. + */ + viewBox:yfiles.geometry.RectD; + /** + * Gets or sets the origin of this pattern brush. + * Value: + * The origin of this pattern brush. + */ + origin:yfiles.geometry.PointD; + /** + * Gets or sets the size of this pattern brush. + * Value: + * The size of this pattern brush. + */ + size:yfiles.geometry.SizeD; + /** + * Updates the defs element with the current gradient data. + * @param {SVGElement} oldElement + * @param {yfiles.canvas.ICanvasContext} context + * @see Specified by {@link yfiles.drawing.IDefsSupport#updateDefsElement}. + */ + updateDefsElement(oldElement:SVGElement,context:yfiles.canvas.ICanvasContext):void; + /** + * Creates the element that is put into the defs section of the SVG element. + * @param {yfiles.canvas.ICanvasContext} context The canvas context that can be used to register brushes etc. + * @return {SVGElement} An {@link SVGElement} that can be put into the defs section of the SVG element. + * @see Specified by {@link yfiles.drawing.IDefsSupport#createDefsElement}. + */ + createDefsElement(context:yfiles.canvas.ICanvasContext):SVGElement; + /** + * Checks if the specified node references the element represented by this object. + * @param {yfiles.canvas.ICanvasContext} context The current canvas context. + * @param {Node} node The SVG node. + * @param {string} id The defs id that has been stored for this instance by the provided context. + * @return {boolean} true if node references the element represented by this instance. + * @see Specified by {@link yfiles.drawing.IDefsSupport#accept}. + */ + accept(context:yfiles.canvas.ICanvasContext,node:Node,id:string):boolean; + } + var PatternBrush:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.PatternBrush} class. + */ + new ():yfiles.system.PatternBrush; + }; + /** + * Fills an area with a radial gradient. + */ + export interface RadialGradientBrush extends yfiles.system.GradientBrush{ + /** + * Gets or sets the center of this radial gradient. + * Value: + * The center of this radial gradient. + */ + center:yfiles.geometry.PointD; + /** + * Gets or sets the origin of this radial gradient. + * Value: + * The origin of this radial gradient. + */ + gradientOrigin:yfiles.geometry.PointD; + /** + * Gets or sets the radius of the largest circle of this radial gradient in horizontal direction. + * Value: + * The radius of the largest circle of this radial gradient in horizontal direction. + */ + radiusX:number; + /** + * Gets or sets the radius of the largest circle of this radial gradient in vertical direction. + * Value: + * The radius of the largest circle of this radial gradient in vertical direction. + */ + radiusY:number; + /** + * Gets or sets the spread method of this gradient. + * Value: + * The spread method of this gradient. + */ + spreadMethod:yfiles.system.GradientSpreadMethod; + /** + * Gets the SVG specification's spread method of this gradient. + * @return {string} The spread method of the SVG specification the corresponds to this gradient. + */ + getRadialSpreadMethod():string; + /** + * Creates a new SVG gradient that corresponds to this gradient brush. + * @return {SVGElement} A new SVG gradient that corresponds to this gradient brush + */ + toSvgGradient():SVGElement; + /** + * Updates the SVG gradient within the defs section of the SVG document if it has changed. + * @param {SVGElement} oldElement The old element. + * @param {yfiles.canvas.ICanvasContext} context The context. + */ + updateSvgGradient(oldElement:SVGElement,context:yfiles.canvas.ICanvasContext):void; + } + var RadialGradientBrush:{ + $class:yfiles.lang.Class; + new ():yfiles.system.RadialGradientBrush; + }; + /** + * Fills an area with a linear gradient. + */ + export interface LinearGradientBrush extends yfiles.system.GradientBrush{ + /** + * Gets or sets the spread method of this gradient. + * Value: + * The spread method of this gradient. + */ + spreadMethod:yfiles.system.GradientSpreadMethod; + /** + * Gets or sets the start point of this gradient. + * Value: + * The start point of this gradient. + */ + startPoint:yfiles.geometry.PointD; + /** + * Gets or sets the end point of this gradient. + * Value: + * The end point of this gradient. + */ + endPoint:yfiles.geometry.PointD; + /** + * Gets the SVG specification's spread method of this gradient. + * @return {string} The spread method of the SVG specification the corresponds to this gradient. + */ + getLinearSpreadMethod():string; + /** + * Creates a new SVG gradient that corresponds to this gradient brush. + * @return {SVGElement} A new SVG gradient that corresponds to this gradient brush + */ + toSvgGradient():SVGElement; + /** + * Updates the SVG gradient within the defs section of the SVG document if it has changed. + * @param {SVGElement} oldElement The old element. + * @param {yfiles.canvas.ICanvasContext} context The context. + */ + updateSvgGradient(oldElement:SVGElement,context:yfiles.canvas.ICanvasContext):void; + } + var LinearGradientBrush:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.LinearGradientBrush} class. + */ + new ():yfiles.system.LinearGradientBrush; + /** + * Initializes a new instance of the {@link yfiles.system.LinearGradientBrush} class for the specified properties. + * @param {yfiles.system.GradientStopCollection} gradientStops The gradient stops of the new instance. + * @param {number} angle The angle of the new instance. + */ + FromGradientStopsAndAngle:{ + new (gradientStops:yfiles.system.GradientStopCollection,angle:number):yfiles.system.LinearGradientBrush; + }; + /** + * Initializes a new instance of the {@link yfiles.system.LinearGradientBrush} class for the specified properties. + * @param {yfiles.system.GradientStopCollection} gradientStops The gradient stops of the new instance. + * @param {yfiles.geometry.PointD} startPoint The start point of the new instance. + * @param {yfiles.geometry.PointD} endPoint The end point of the new instance. + */ + FromGradientStopsStartPointAndEndPoint:{ + new (gradientStops:yfiles.system.GradientStopCollection,startPoint:yfiles.geometry.PointD,endPoint:yfiles.geometry.PointD):yfiles.system.LinearGradientBrush; + }; + }; + /** + * Helper class that contains extension methods for use with {@link yfiles.canvas.Control}s, + * {@link yfiles.drawing.ArrangeVisual}s, and {@link yfiles.canvas.Control}s. + */ + export interface UIElementExtensions extends Object{ + } + var UIElementExtensions:{ + $class:yfiles.lang.Class; + /** + * Helper method that sets the attached {@link yfiles.canvas.CanvasContainer#transform} to match rect. + * @param {yfiles.canvas.CanvasContainer} element The element to set the attached property. + * @param {yfiles.geometry.RectD} rect The rectangle to set. + */ + setCanvasArrangeRect(element:yfiles.canvas.CanvasContainer,rect:yfiles.geometry.RectD):void; + /** + * Tries to find the resource in the resource dictionaries + * of the control and its ancestors. + * @param {yfiles.canvas.Control} element The element to start searching for. + * @param {Object} resourceKey The resource key to use as the key. + * @return {Object} The result or null. + */ + tryFindResource(element:yfiles.canvas.Control,resourceKey:Object):Object; + /** + * Determines whether the specified element is visible. + * @param {yfiles.canvas.Control} element The element. + * @return {boolean} + * true if the specified element is visible; otherwise, false. + */ + isVisible(element:yfiles.canvas.Control):boolean; + /** + * Determines whether the specified source has the keyboard focus. + * @param {yfiles.canvas.Control} element The source. + * @return {boolean} + * true if the element is the currently focused element; otherwise, false. + */ + isKeyboardFocused(element:yfiles.canvas.Control):boolean; + /** + * Determines whether the keyboard focus is within the visual tree of the specified element. + * @param {yfiles.canvas.Control} element The element to inspect. + * @return {boolean} + * true if keyboard focus is within the subtree; otherwise, false. + */ + isKeyboardFocusWithin(element:yfiles.canvas.Control):boolean; + }; + /** + * Helper classes used during the XAML serialization of instances. + * Using this class instances can be written in xml attributes as strings. + */ + export interface ValueSerializer extends Object{ + /** + * Determines whether this instance can convert the specified value to a string. + * @param {Object} value The value. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {boolean} + * true if this instance can convert the specified value to a string; otherwise, false. + */ + canConvertToString(value:Object,context:yfiles.system.IValueSerializerContext):boolean; + /** + * Converts the given value to string. + * @param {Object} o The value. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {string} The value as string representation. + */ + convertToString(o:Object,context:yfiles.system.IValueSerializerContext):string; + /** + * Converts the string to an appropriate instance. + * @param {string} value The value to convert to an object. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {Object} The converted object + */ + convertFromString(value:string,context:yfiles.system.IValueSerializerContext):Object; + /** + * Determines whether this instance can convert the specified value from the given string. + * @param {string} value The string value to convert. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {boolean} + * true if this instance can convert the specified value from the string; otherwise, false. + */ + canConvertFromString(value:string,context:yfiles.system.IValueSerializerContext):boolean; + } + var ValueSerializer:{ + $class:yfiles.lang.Class; + /** + * Gets the {@link yfiles.system.ValueSerializer} implementation for the given descriptor. + * @param {yfiles.system.PropertyInfo} propertyInfo The descriptor. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {yfiles.system.ValueSerializer} The serializer to use for the descriptor. + */ + getSerializerForContext(propertyInfo:yfiles.system.PropertyInfo,context:yfiles.system.IValueSerializerContext):yfiles.system.ValueSerializer; + /** + * Gets the {@link yfiles.system.ValueSerializer} implementation for the given type. + * @param {yfiles.lang.Class} type The type. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {yfiles.system.ValueSerializer} The serializer to use for the type. + */ + getSerializerForTypeAndContext(type:yfiles.lang.Class,context:yfiles.system.IValueSerializerContext):yfiles.system.ValueSerializer; + /** + * Gets the {@link yfiles.system.ValueSerializer} implementation for the given type. + * @param {yfiles.lang.Class} type The type. + * @return {yfiles.system.ValueSerializer} The serializer to use for the type. + */ + getSerializerFor(type:yfiles.lang.Class):yfiles.system.ValueSerializer; + /** + * Gets the {@link yfiles.system.ValueSerializer} implementation for the given descriptor. + * @param {yfiles.system.PropertyInfo} propertyInfo The descriptor. + * @return {yfiles.system.ValueSerializer} The serializer to use for the type. + */ + getSerializerForWithPropertyInfo(propertyInfo:yfiles.system.PropertyInfo):yfiles.system.ValueSerializer; + }; + /** + * Represents a list of double values. + */ + export interface DoubleCollection extends yfiles.collections.List{ + } + var DoubleCollection:{ + $class:yfiles.lang.Class; + new ():yfiles.system.DoubleCollection; + }; + /** + * A static helper class that provides access to the attached properties of type {@link yfiles.system.RoutedCommand} + * for {@link yfiles.canvas.Control}s. + * {@link yfiles.system.RoutedCommand}s are a simplified implementation of WPF's routed command pattern. Most of the classes of the WPF + * implementation have been reimplemented here. + * The InputBindings and CommandBindings properties have been implemented as attached properties. + * For an overview of the concepts please see the corresponding documentation of the WPF implementation. + */ + export interface CommandManager extends Object{ + } + var CommandManager:{ + $class:yfiles.lang.Class; + /** + * Registers a default command binding for all instances of the given type or a subtype thereof. + * @param {yfiles.lang.Class} type The type to register the binding as a default for. + * @param {yfiles.system.CommandBinding} commandBinding The command binding. + */ + registerClassCommandBinding(type:yfiles.lang.Class,commandBinding:yfiles.system.CommandBinding):void; + /** + * Registers a default input binding for all instances of the given type or a subtype thereof. + * @param {yfiles.lang.Class} type The type to register the binding as a default for. + * @param {yfiles.system.InputBinding} inputBinding The input binding. + */ + registerClassInputBinding(type:yfiles.lang.Class,inputBinding:yfiles.system.InputBinding):void; + /** + * Suggests a requery of the {@link yfiles.system.RoutedCommand#canExecuteOnTarget executability} + * of all routed commands that are known to the system to adjust the UI to properly reflect the state. + * This will enqueue a delayed query into the event queue. + */ + invalidateRequerySuggested():void; + }; + /** + * Holds a number of default component navigation and focus related {@link yfiles.system.RoutedUICommand}s. + * The commands are not backed by any implementation. + */ + export interface ComponentCommands extends Object{ + } + var ComponentCommands:{ + $class:yfiles.lang.Class; + /** + * Gets the move left command. + * Value: The move left command. + */ + MOVE_LEFT:yfiles.system.RoutedUICommand; + /** + * Gets the move right command. + * Value: The move right command. + */ + MOVE_RIGHT:yfiles.system.RoutedUICommand; + /** + * Gets the move up command. + * Value: The move up command. + */ + MOVE_UP:yfiles.system.RoutedUICommand; + /** + * Gets the move down command. + * Value: The move down command. + */ + MOVE_DOWN:yfiles.system.RoutedUICommand; + /** + * Gets the move to page up command. + * Value: The move to page up command. + */ + MOVE_TO_PAGE_UP:yfiles.system.RoutedUICommand; + /** + * Gets the move to page down command. + * Value: The move to page down command. + */ + MOVE_TO_PAGE_DOWN:yfiles.system.RoutedUICommand; + /** + * Gets the move focus back command. + * Value: The move focus back command. + */ + MOVE_FOCUS_BACK:yfiles.system.RoutedUICommand; + /** + * Gets the move focus forward command. + * Value: The move focus forward command. + */ + MOVE_FOCUS_FORWARD:yfiles.system.RoutedUICommand; + /** + * Gets the move focus up command. + * Value: The move focus up command. + */ + MOVE_FOCUS_UP:yfiles.system.RoutedUICommand; + /** + * Gets the move focus down command. + * Value: The move focus down command. + */ + MOVE_FOCUS_DOWN:yfiles.system.RoutedUICommand; + /** + * Gets the move focus page up command. + * Value: The move focus page up command. + */ + MOVE_FOCUS_PAGE_UP:yfiles.system.RoutedUICommand; + /** + * Gets the move focus page down command. + * Value: The move focus page down command. + */ + MOVE_FOCUS_PAGE_DOWN:yfiles.system.RoutedUICommand; + /** + * Gets the extend selection left command. + * Value: The extend selection left command. + */ + EXTEND_SELECTION_LEFT:yfiles.system.RoutedUICommand; + /** + * Gets the extend selection right command. + * Value: The extend selection righr command. + */ + EXTEND_SELECTION_RIGHT:yfiles.system.RoutedUICommand; + /** + * Gets the extend selection up command. + * Value: The extend selection up command. + */ + EXTEND_SELECTION_UP:yfiles.system.RoutedUICommand; + /** + * Gets the extend selection down command. + * Value: The extend selection down command. + */ + EXTEND_SELECTION_DOWN:yfiles.system.RoutedUICommand; + /** + * Gets the select to page up command. + * Value: The select to page up command. + */ + SELECT_TO_PAGE_UP:yfiles.system.RoutedUICommand; + /** + * Gets the select to page down command. + * Value: The select to page down command. + */ + SELECT_TO_PAGE_DOWN:yfiles.system.RoutedUICommand; + /** + * Gets the scroll page up command. + * Value: The scroll page up command. + */ + SCROLL_PAGE_UP:yfiles.system.RoutedUICommand; + /** + * Gets the scroll page down command. + * Value: The scroll page down command. + */ + SCROLL_PAGE_DOWN:yfiles.system.RoutedUICommand; + /** + * Gets the scroll page left command. + * Value: The scroll page left command. + */ + SCROLL_PAGE_LEFT:yfiles.system.RoutedUICommand; + /** + * Gets the scroll page right command. + * Value: The scroll page right command. + */ + SCROLL_PAGE_RIGHT:yfiles.system.RoutedUICommand; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface ColorValueSerializer extends yfiles.system.ValueSerializer{ + /** + * Determines whether this instance can convert the specified value from the given string. + * @param {string} value The string value to convert. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {boolean} + * true if this instance can convert the specified value from the string; otherwise, false. + */ + canConvertFromString(value:string,context:yfiles.system.IValueSerializerContext):boolean; + /** + * Determines whether this instance can convert the specified value to a string. + * @param {Object} value The value. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {boolean} + * true if this instance can convert the specified value to a string; otherwise, false. + */ + canConvertToString(value:Object,context:yfiles.system.IValueSerializerContext):boolean; + /** + * Converts the string to an appropriate instance. + * @param {string} value The value to convert to an object. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {Object} The converted object + */ + convertFromString(c:string,context:yfiles.system.IValueSerializerContext):Object; + /** + * Converts the given value to string. + * @param {Object} o The value. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {string} The value as string representation. + */ + convertToString(o:Object,context:yfiles.system.IValueSerializerContext):string; + } + var ColorValueSerializer:{ + $class:yfiles.lang.Class; + new ():yfiles.system.ColorValueSerializer; + }; + /** + * Describes a binding between a {@link yfiles.system.RoutedCommand} and both + * a function of type function(object, {@link yfiles.system.ExecutedRoutedEventArgs}) that performs the actual command execution and a function of type function(object, {@link yfiles.system.CanExecuteRoutedEventArgs}) that determines + * whether to execute the command at all. + */ + export interface CommandBinding extends Object{ + /** + * Occurs when a query is made whether the command can be executed. + */ + addCanExecuteListener(value:(sender:Object,e:yfiles.system.CanExecuteRoutedEventArgs)=> void):void; + /** + * Occurs when a query is made whether the command can be executed. + */ + removeCanExecuteListener(value:(sender:Object,e:yfiles.system.CanExecuteRoutedEventArgs)=> void):void; + /** + * Occurs when the command is executed. + */ + addExecutedListener(value:(sender:Object,e:yfiles.system.ExecutedRoutedEventArgs)=> void):void; + /** + * Occurs when the command is executed. + */ + removeExecutedListener(value:(sender:Object,e:yfiles.system.ExecutedRoutedEventArgs)=> void):void; + /** + * Gets or sets the command for the binding. + * Value: The command. + */ + command:yfiles.system.ICommand; + } + var CommandBinding:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.CommandBinding} class. + */ + WithDefaults:{ + new ():yfiles.system.CommandBinding; + }; + /** + * Initializes a new instance of the {@link yfiles.system.CommandBinding} class. + * @param {yfiles.system.ICommand} command The command. + * @param {function(Object, yfiles.system.ExecutedRoutedEventArgs)} onCommandExecuted The command executed handler. + */ + WithCommandAndHandler:{ + new (command:yfiles.system.ICommand,onCommandExecuted:(sender:Object,e:yfiles.system.ExecutedRoutedEventArgs)=> void):yfiles.system.CommandBinding; + }; + /** + * Initializes a new instance of the {@link yfiles.system.CommandBinding} class. + * @param {yfiles.system.ICommand} command The command. + * @param {function(Object, yfiles.system.ExecutedRoutedEventArgs)} commandExecutedHandler The command executed handler. + * @param {function(Object, yfiles.system.CanExecuteRoutedEventArgs)} canExecuteCommandHandler The executability handler. + */ + new (command:yfiles.system.ICommand,commandExecutedHandler:(sender:Object,e:yfiles.system.ExecutedRoutedEventArgs)=> void,canExecuteCommandHandler:(sender:Object,e:yfiles.system.CanExecuteRoutedEventArgs)=> void):yfiles.system.CommandBinding; + }; + /** + * A type converter that can be used to convert {@link yfiles.system.RoutedCommand}s for XAML. + */ + export interface CommandTypeConverter extends yfiles.system.TypeConverter{ + /** + * Returns whether this converter can convert an object of sourceType, using the specified context. + * @see Overrides {@link yfiles.system.TypeConverter#canConvertFromWithContext} + */ + canConvertFromWithContext(context:yfiles.system.ITypeDescriptorContext,sourceType:yfiles.lang.Class):boolean; + /** + * Converts the value, using the specified context and culture information. + * @see Overrides {@link yfiles.system.TypeConverter#convertFromWithContextAndCulture} + */ + convertFromWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object):Object; + } + var CommandTypeConverter:{ + $class:yfiles.lang.Class; + new ():yfiles.system.CommandTypeConverter; + }; + /** + * An {@link yfiles.lang.Exception} to indicate that a class cannot be found. + */ + export interface ClassNotFoundException extends yfiles.lang.Exception{ + } + var ClassNotFoundException:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with the given message. + * @param {string} message The error message. + */ + new (message:string):yfiles.system.ClassNotFoundException; + }; + /** + * An {@link yfiles.lang.Exception} to indicate that a value is null where it shouldn't. + */ + export interface NullReferenceException extends yfiles.lang.Exception{ + } + var NullReferenceException:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with an empty message. + */ + new ():yfiles.system.NullReferenceException; + /** + * Creates a new instance with the given message. + * @param {string} message The error message. + */ + WithMessage:{ + new (message:string):yfiles.system.NullReferenceException; + }; + }; + /** + * An {@link yfiles.lang.Exception} to indicate that the {@link yfiles.collections.IDictionary} does not contain the given key. + */ + export interface KeyNotFoundException extends yfiles.lang.Exception{ + } + var KeyNotFoundException:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with an empty message. + */ + new ():yfiles.system.KeyNotFoundException; + /** + * Creates a new instance with the given message. + * @param {string} message The error message. + */ + WithMessage:{ + new (message:string):yfiles.system.KeyNotFoundException; + }; + }; + export interface ApplicationException extends yfiles.lang.Exception{ + } + var ApplicationException:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with an empty message. + */ + new ():yfiles.system.ApplicationException; + /** + * Creates a new instance with the given message. + * @param {string} message The error message. + */ + WithMessage:{ + new (message:string):yfiles.system.ApplicationException; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface DashStyleTypeConverter extends yfiles.system.TypeConverter{ + /** + * Returns whether a value can be converted from sourceType with this converter. + * @param {yfiles.lang.Class} sourceType The source type of the conversion. + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @return {boolean} true if this instance can convert values of type sourceType. + */ + canConvertFromWithContext(context:yfiles.system.ITypeDescriptorContext,sourceType:yfiles.lang.Class):boolean; + /** + * Returns whether a value can be converted from destinationType with this converter. + * @param {yfiles.lang.Class} destinationType The target type of the conversion. + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @return {boolean} true if this instance can convert values of type destinationType. + */ + canConvertToWithContext(context:yfiles.system.ITypeDescriptorContext,destinationType:yfiles.lang.Class):boolean; + /** + * Converts value to another object. + * @param {Object} value The source value + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @param {yfiles.system.CultureInfo} culture Additional culture information. + * @return {Object} The converted destination value. + */ + convertFromWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object):Object; + /** + * Converts value to another object of type destinationType. + * @param {Object} value The source value + * @param {yfiles.system.ITypeDescriptorContext} context Additional context information. + * @param {yfiles.system.CultureInfo} culture Additional culture information. + * @param {yfiles.lang.Class} destinationType The target type of the conversion. + * @return {Object} The converted destination value. + */ + convertToWithContextAndCulture(context:yfiles.system.ITypeDescriptorContext,culture:yfiles.system.CultureInfo,value:Object,destinationType:yfiles.lang.Class):Object; + } + var DashStyleTypeConverter:{ + $class:yfiles.lang.Class; + new ():yfiles.system.DashStyleTypeConverter; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface DashStyleValueSerializer extends yfiles.system.ValueSerializer{ + /** + * Determines whether this instance can convert the specified value to a string. + * @param {Object} value The value. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {boolean} + * true if this instance can convert the specified value to a string; otherwise, false. + */ + canConvertToString(value:Object,context:yfiles.system.IValueSerializerContext):boolean; + /** + * Converts the given value to string. + * @param {Object} o The value. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {string} The value as string representation. + */ + convertToString(value:Object,context:yfiles.system.IValueSerializerContext):string; + /** + * Converts the string to an appropriate instance. + * @param {string} value The value to convert to an object. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {Object} The converted object + */ + convertFromString(value:string,context:yfiles.system.IValueSerializerContext):Object; + /** + * Determines whether this instance can convert the specified value from the given string. + * @param {string} value The string value to convert. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {boolean} + * true if this instance can convert the specified value from the string; otherwise, false. + */ + canConvertFromString(value:string,context:yfiles.system.IValueSerializerContext):boolean; + } + var DashStyleValueSerializer:{ + $class:yfiles.lang.Class; + new ():yfiles.system.DashStyleValueSerializer; + }; + /** + * A pseudo-random number generator. + */ + export interface Random extends Object{ + /** + * Sets the random seed. + */ + seed:Number; + /** + * Gets a random boolean value. + * @return {boolean} A random boolean value. + */ + nextBoolean():boolean; + /** + * Gets a random positive integer value between 0 (included) and {@link yfiles.system.Math#INT32_MAX_VALUE} (excluded). + * @return {number} A random integer value (0 <= value < {@link yfiles.system.Math#INT32_MAX_VALUE}). + */ + next():number; + /** + * Gets a random positive integer value between 0 (included) and max (excluded). + * @param {number} max The maximum value of the returned integer values. Must be greater than 0. + * @return {number} A random integer value (0 <= value < max). + */ + nextInt(max:number):number; + /** + * Gets a random integer value between min (included) and max (excluded). + * @param {number} min The lower bound of the range of possible values. + * @param {number} max The upper bound of the range of possible values. + * @return {number} A random integer value (min <= value < max). + */ + nextIntInRange(min:number,max:number):number; + /** + * Returns a byte array with random values. + * @param {number[]} buffer The byte array to fill with random values. + */ + nextBytes(buffer:number[]):void; + /** + * Returns a random Number between 0 (included) and 1 (excluded). + * @return {number} A random Number (0 <= value < 1). + */ + nextDouble():number; + /** + * Returns a random Number between 0 (included) and 1 (excluded). + * @return {number} A random Number (0 <= value < 1). + */ + sample():number; + } + var Random:{ + $class:yfiles.lang.Class; + /** + * Create a new instance which uses the current system time as seed. + */ + new ():yfiles.system.Random; + /** + * Create a new instance with the given seed. + * @param {Number} seed A number to use as seed. + */ + WithSeed:{ + new (seed:Number):yfiles.system.Random; + }; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface DoubleCollectionValueSerializer extends yfiles.system.DoubleCollectionValueSerializerBase{ + /** + * Converts the string to an appropriate instance. + * @param {string} value The value to convert to an object. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {Object} The converted object + */ + convertFromString(value:string,context:yfiles.system.IValueSerializerContext):Object; + } + var DoubleCollectionValueSerializer:{ + $class:yfiles.lang.Class; + new ():yfiles.system.DoubleCollectionValueSerializer; + }; + /** + * Event argument used by the {@link yfiles.system.CommandBinding#addCanExecuteListener CanExecute} event. + */ + export interface CanExecuteRoutedEventArgs extends yfiles.system.EventArgs{ + /** + * Gets the command which is affected by the query. + * Value: The command. + */ + command:yfiles.system.ICommand; + /** + * Gets or sets a value indicating whether to continue event routing, even if + * this argument is {@link yfiles.system.CanExecuteRoutedEventArgs#handled}. + * The default is false. + * Value: true if routing of the event should be continued; otherwise, false. + */ + continueRouting:boolean; + /** + * Gets or sets the parameter that is associated with this event. + * Value: The parameter. + */ + parameter:Object; + /** + * Gets the source of the event. + * Value: The source. + */ + source:Object; + /** + * Gets or sets a value indicating whether the command can be executed. + * Value: + * true if the command can be executed; otherwise, false. + * @see {@link yfiles.system.CanExecuteRoutedEventArgs#handled} + */ + canExecute:boolean; + /** + * Gets or sets a value indicating whether this {@link yfiles.system.CanExecuteRoutedEventArgs} is Handled. + * Value: true if handled; otherwise, false. + */ + handled:boolean; + } + var CanExecuteRoutedEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.CanExecuteRoutedEventArgs} class. + * @param {yfiles.system.ICommand} command The command. + * @param {Object} parameter The parameter. + * @param {Object} source The source that triggered the event + */ + new (command:yfiles.system.ICommand,parameter:Object,source:Object):yfiles.system.CanExecuteRoutedEventArgs; + }; + /** + * A convenience class that recreates the wellknown {@link yfiles.system.Color}s + * present in HTML. + */ + export interface Colors extends Object{ + } + var Colors:{ + $class:yfiles.lang.Class; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name AliceBlue. + * This method will yield the same value for every call because it is immutable. + */ + ALICE_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name AntiqueWhite. + * This method will yield the same value for every call because it is immutable. + */ + ANTIQUE_WHITE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Aqua. + * This method will yield the same value for every call because it is immutable. + */ + AQUA:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Aquamarine. + * This method will yield the same value for every call because it is immutable. + */ + AQUAMARINE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Azure. + * This method will yield the same value for every call because it is immutable. + */ + AZURE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Beige. + * This method will yield the same value for every call because it is immutable. + */ + BEIGE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Bisque. + * This method will yield the same value for every call because it is immutable. + */ + BISQUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Black. + * This method will yield the same value for every call because it is immutable. + */ + BLACK:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name BlanchedAlmond. + * This method will yield the same value for every call because it is immutable. + */ + BLANCHED_ALMOND:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Blue. + * This method will yield the same value for every call because it is immutable. + */ + BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name BlueViolet. + * This method will yield the same value for every call because it is immutable. + */ + BLUE_VIOLET:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Brown. + * This method will yield the same value for every call because it is immutable. + */ + BROWN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name BurlyWood. + * This method will yield the same value for every call because it is immutable. + */ + BURLY_WOOD:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name CadetBlue. + * This method will yield the same value for every call because it is immutable. + */ + CADET_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Chartreuse. + * This method will yield the same value for every call because it is immutable. + */ + CHARTREUSE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Chocolate. + * This method will yield the same value for every call because it is immutable. + */ + CHOCOLATE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Coral. + * This method will yield the same value for every call because it is immutable. + */ + CORAL:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name CornflowerBlue. + * This method will yield the same value for every call because it is immutable. + */ + CORNFLOWER_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Cornsilk. + * This method will yield the same value for every call because it is immutable. + */ + CORNSILK:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Crimson. + * This method will yield the same value for every call because it is immutable. + */ + CRIMSON:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Cyan. + * This method will yield the same value for every call because it is immutable. + */ + CYAN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkBlue. + * This method will yield the same value for every call because it is immutable. + */ + DARK_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkCyan. + * This method will yield the same value for every call because it is immutable. + */ + DARK_CYAN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkGoldenrod. + * This method will yield the same value for every call because it is immutable. + */ + DARK_GOLDENROD:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkGray. + * This method will yield the same value for every call because it is immutable. + */ + DARK_GRAY:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkGreen. + * This method will yield the same value for every call because it is immutable. + */ + DARK_GREEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkKhaki. + * This method will yield the same value for every call because it is immutable. + */ + DARK_KHAKI:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkMagenta. + * This method will yield the same value for every call because it is immutable. + */ + DARK_MAGENTA:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkOliveGreen. + * This method will yield the same value for every call because it is immutable. + */ + DARK_OLIVE_GREEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkOrange. + * This method will yield the same value for every call because it is immutable. + */ + DARK_ORANGE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkOrchid. + * This method will yield the same value for every call because it is immutable. + */ + DARK_ORCHID:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkRed. + * This method will yield the same value for every call because it is immutable. + */ + DARK_RED:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkSalmon. + * This method will yield the same value for every call because it is immutable. + */ + DARK_SALMON:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkSeaGreen. + * This method will yield the same value for every call because it is immutable. + */ + DARK_SEA_GREEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkSlateBlue. + * This method will yield the same value for every call because it is immutable. + */ + DARK_SLATE_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkSlateGray. + * This method will yield the same value for every call because it is immutable. + */ + DARK_SLATE_GRAY:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkTurquoise. + * This method will yield the same value for every call because it is immutable. + */ + DARK_TURQUOISE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DarkViolet. + * This method will yield the same value for every call because it is immutable. + */ + DARK_VIOLET:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DeepPink. + * This method will yield the same value for every call because it is immutable. + */ + DEEP_PINK:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DeepSkyBlue. + * This method will yield the same value for every call because it is immutable. + */ + DEEP_SKY_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DimGray. + * This method will yield the same value for every call because it is immutable. + */ + DIM_GRAY:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name DodgerBlue. + * This method will yield the same value for every call because it is immutable. + */ + DODGER_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Firebrick. + * This method will yield the same value for every call because it is immutable. + */ + FIREBRICK:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name FloralWhite. + * This method will yield the same value for every call because it is immutable. + */ + FLORAL_WHITE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name ForestGreen. + * This method will yield the same value for every call because it is immutable. + */ + FOREST_GREEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Fuchsia. + * This method will yield the same value for every call because it is immutable. + */ + FUCHSIA:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Gainsboro. + * This method will yield the same value for every call because it is immutable. + */ + GAINSBORO:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name GhostWhite. + * This method will yield the same value for every call because it is immutable. + */ + GHOST_WHITE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Gold. + * This method will yield the same value for every call because it is immutable. + */ + GOLD:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Goldenrod. + * This method will yield the same value for every call because it is immutable. + */ + GOLDENROD:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Gray. + * This method will yield the same value for every call because it is immutable. + */ + GRAY:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Green. + * This method will yield the same value for every call because it is immutable. + */ + GREEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name GreenYellow. + * This method will yield the same value for every call because it is immutable. + */ + GREEN_YELLOW:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Honeydew. + * This method will yield the same value for every call because it is immutable. + */ + HONEYDEW:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name HotPink. + * This method will yield the same value for every call because it is immutable. + */ + HOT_PINK:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name IndianRed. + * This method will yield the same value for every call because it is immutable. + */ + INDIAN_RED:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Indigo. + * This method will yield the same value for every call because it is immutable. + */ + INDIGO:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Ivory. + * This method will yield the same value for every call because it is immutable. + */ + IVORY:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Khaki. + * This method will yield the same value for every call because it is immutable. + */ + KHAKI:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Lavender. + * This method will yield the same value for every call because it is immutable. + */ + LAVENDER:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LavenderBlush. + * This method will yield the same value for every call because it is immutable. + */ + LAVENDER_BLUSH:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LawnGreen. + * This method will yield the same value for every call because it is immutable. + */ + LAWN_GREEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LemonChiffon. + * This method will yield the same value for every call because it is immutable. + */ + LEMON_CHIFFON:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LightBlue. + * This method will yield the same value for every call because it is immutable. + */ + LIGHT_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LightCoral. + * This method will yield the same value for every call because it is immutable. + */ + LIGHT_CORAL:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LightCyan. + * This method will yield the same value for every call because it is immutable. + */ + LIGHT_CYAN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LightGoldenrodYellow. + * This method will yield the same value for every call because it is immutable. + */ + LIGHT_GOLDENROD_YELLOW:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LightGray. + * This method will yield the same value for every call because it is immutable. + */ + LIGHT_GRAY:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LightGreen. + * This method will yield the same value for every call because it is immutable. + */ + LIGHT_GREEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LightPink. + * This method will yield the same value for every call because it is immutable. + */ + LIGHT_PINK:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LightSalmon. + * This method will yield the same value for every call because it is immutable. + */ + LIGHT_SALMON:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LightSeaGreen. + * This method will yield the same value for every call because it is immutable. + */ + LIGHT_SEA_GREEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LightSkyBlue. + * This method will yield the same value for every call because it is immutable. + */ + LIGHT_SKY_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LightSlateGray. + * This method will yield the same value for every call because it is immutable. + */ + LIGHT_SLATE_GRAY:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LightSteelBlue. + * This method will yield the same value for every call because it is immutable. + */ + LIGHT_STEEL_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LightYellow. + * This method will yield the same value for every call because it is immutable. + */ + LIGHT_YELLOW:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Lime. + * This method will yield the same value for every call because it is immutable. + */ + LIME:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name LimeGreen. + * This method will yield the same value for every call because it is immutable. + */ + LIME_GREEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Linen. + * This method will yield the same value for every call because it is immutable. + */ + LINEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Magenta. + * This method will yield the same value for every call because it is immutable. + */ + MAGENTA:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Maroon. + * This method will yield the same value for every call because it is immutable. + */ + MAROON:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name MediumAquamarine. + * This method will yield the same value for every call because it is immutable. + */ + MEDIUM_AQUAMARINE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name MediumBlue. + * This method will yield the same value for every call because it is immutable. + */ + MEDIUM_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name MediumOrchid. + * This method will yield the same value for every call because it is immutable. + */ + MEDIUM_ORCHID:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name MediumPurple. + * This method will yield the same value for every call because it is immutable. + */ + MEDIUM_PURPLE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name MediumSeaGreen. + * This method will yield the same value for every call because it is immutable. + */ + MEDIUM_SEA_GREEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name MediumSlateBlue. + * This method will yield the same value for every call because it is immutable. + */ + MEDIUM_SLATE_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name MediumSpringGreen. + * This method will yield the same value for every call because it is immutable. + */ + MEDIUM_SPRING_GREEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name MediumTurquoise. + * This method will yield the same value for every call because it is immutable. + */ + MEDIUM_TURQUOISE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name MediumVioletRed. + * This method will yield the same value for every call because it is immutable. + */ + MEDIUM_VIOLET_RED:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name MidnightBlue. + * This method will yield the same value for every call because it is immutable. + */ + MIDNIGHT_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name MintCream. + * This method will yield the same value for every call because it is immutable. + */ + MINT_CREAM:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name MistyRose. + * This method will yield the same value for every call because it is immutable. + */ + MISTY_ROSE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Moccasin. + * This method will yield the same value for every call because it is immutable. + */ + MOCCASIN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name NavajoWhite. + * This method will yield the same value for every call because it is immutable. + */ + NAVAJO_WHITE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Navy. + * This method will yield the same value for every call because it is immutable. + */ + NAVY:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name OldLace. + * This method will yield the same value for every call because it is immutable. + */ + OLD_LACE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Olive. + * This method will yield the same value for every call because it is immutable. + */ + OLIVE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name OliveDrab. + * This method will yield the same value for every call because it is immutable. + */ + OLIVE_DRAB:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Orange. + * This method will yield the same value for every call because it is immutable. + */ + ORANGE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name OrangeRed. + * This method will yield the same value for every call because it is immutable. + */ + ORANGE_RED:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Orchid. + * This method will yield the same value for every call because it is immutable. + */ + ORCHID:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name PaleGoldenrod. + * This method will yield the same value for every call because it is immutable. + */ + PALE_GOLDENROD:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name PaleGreen. + * This method will yield the same value for every call because it is immutable. + */ + PALE_GREEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name PaleTurquoise. + * This method will yield the same value for every call because it is immutable. + */ + PALE_TURQUOISE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name PaleVioletRed. + * This method will yield the same value for every call because it is immutable. + */ + PALE_VIOLET_RED:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name PapayaWhip. + * This method will yield the same value for every call because it is immutable. + */ + PAPAYA_WHIP:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name PeachPuff. + * This method will yield the same value for every call because it is immutable. + */ + PEACH_PUFF:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Peru. + * This method will yield the same value for every call because it is immutable. + */ + PERU:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Pink. + * This method will yield the same value for every call because it is immutable. + */ + PINK:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Plum. + * This method will yield the same value for every call because it is immutable. + */ + PLUM:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name PowderBlue. + * This method will yield the same value for every call because it is immutable. + */ + POWDER_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Purple. + * This method will yield the same value for every call because it is immutable. + */ + PURPLE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Red. + * This method will yield the same value for every call because it is immutable. + */ + RED:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name RosyBrown. + * This method will yield the same value for every call because it is immutable. + */ + ROSY_BROWN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name RoyalBlue. + * This method will yield the same value for every call because it is immutable. + */ + ROYAL_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name SaddleBrown. + * This method will yield the same value for every call because it is immutable. + */ + SADDLE_BROWN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Salmon. + * This method will yield the same value for every call because it is immutable. + */ + SALMON:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name SandyBrown. + * This method will yield the same value for every call because it is immutable. + */ + SANDY_BROWN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name SeaGreen. + * This method will yield the same value for every call because it is immutable. + */ + SEA_GREEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name SeaShell. + * This method will yield the same value for every call because it is immutable. + */ + SEA_SHELL:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Sienna. + * This method will yield the same value for every call because it is immutable. + */ + SIENNA:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Silver. + * This method will yield the same value for every call because it is immutable. + */ + SILVER:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name SkyBlue. + * This method will yield the same value for every call because it is immutable. + */ + SKY_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name SlateBlue. + * This method will yield the same value for every call because it is immutable. + */ + SLATE_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name SlateGray. + * This method will yield the same value for every call because it is immutable. + */ + SLATE_GRAY:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Snow. + * This method will yield the same value for every call because it is immutable. + */ + SNOW:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name SpringGreen. + * This method will yield the same value for every call because it is immutable. + */ + SPRING_GREEN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name SteelBlue. + * This method will yield the same value for every call because it is immutable. + */ + STEEL_BLUE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Tan. + * This method will yield the same value for every call because it is immutable. + */ + TAN:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Teal. + * This method will yield the same value for every call because it is immutable. + */ + TEAL:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Thistle. + * This method will yield the same value for every call because it is immutable. + */ + THISTLE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Tomato. + * This method will yield the same value for every call because it is immutable. + */ + TOMATO:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Transparent. + * This method will yield the same value for every call because it is immutable. + */ + TRANSPARENT:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Turquoise. + * This method will yield the same value for every call because it is immutable. + */ + TURQUOISE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Violet. + * This method will yield the same value for every call because it is immutable. + */ + VIOLET:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Wheat. + * This method will yield the same value for every call because it is immutable. + */ + WHEAT:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name White. + * This method will yield the same value for every call because it is immutable. + */ + WHITE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name WhiteSmoke. + * This method will yield the same value for every call because it is immutable. + */ + WHITE_SMOKE:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name Yellow. + * This method will yield the same value for every call because it is immutable. + */ + YELLOW:yfiles.system.Color; + /** + * Yields a new {@link yfiles.system.Color} for the wellknown name YellowGreen. + * This method will yield the same value for every call because it is immutable. + */ + YELLOW_GREEN:yfiles.system.Color; + }; + /** + * Helper class for XAML usage. + * This class is not meant to be used from within code but supports the writing and parsing of XAML code only. + */ + export interface BrushValueSerializer extends yfiles.system.ValueSerializer{ + /** + * Determines whether this instance can convert the specified value from the given string. + * @param {string} value The string value to convert. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {boolean} + * true if this instance can convert the specified value from the string; otherwise, false. + */ + canConvertFromString(value:string,context:yfiles.system.IValueSerializerContext):boolean; + /** + * Determines whether this instance can convert the specified value to a string. + * @param {Object} value The value. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {boolean} + * true if this instance can convert the specified value to a string; otherwise, false. + */ + canConvertToString(value:Object,context:yfiles.system.IValueSerializerContext):boolean; + /** + * Converts the string to an appropriate instance. + * @param {string} value The value to convert to an object. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {Object} The converted object + */ + convertFromString(c:string,context:yfiles.system.IValueSerializerContext):Object; + /** + * Converts the given value to string. + * @param {Object} o The value. + * @param {yfiles.system.IValueSerializerContext} context The context. + * @return {string} The value as string representation. + */ + convertToString(o:Object,context:yfiles.system.IValueSerializerContext):string; + } + var BrushValueSerializer:{ + $class:yfiles.lang.Class; + new ():yfiles.system.BrushValueSerializer; + }; + /** + * An {@link yfiles.lang.Exception} to indicate that the operation is not supported. + */ + export interface NotSupportedException extends yfiles.lang.Exception{ + } + var NotSupportedException:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with an empty message. + */ + new ():yfiles.system.NotSupportedException; + /** + * Creates a new instance with the given message. + * @param {string} message The error message. + */ + WithMessage:{ + new (message:string):yfiles.system.NotSupportedException; + }; + }; + export interface IDataObject extends Object{ + /** + * This method has been implemented to satisfy the interface requirements. + * @return {Object} Always null. + * @see {@link yfiles.system.IDataObject#getData} + * @see Specified by {@link yfiles.system.IDataObject#getFormattedData}. + */ + getFormattedData(format:string):Object; + /** + * Gets the data as an instance of the given type if available. + * @param {yfiles.lang.Class} type The type to retrieve the data as. + * @return {Object} The instance or null if no {@link yfiles.system.IDataObject#getDataPresent data is present} of the given type. + * @see {@link yfiles.system.IDataObject#getDataPresent} + * @see Specified by {@link yfiles.system.IDataObject#getData}. + */ + getData(type:yfiles.lang.Class):Object; + /** + * This method has been implemented to satisfy the interface requirements. + * @return {Object} Always null. + * @see {@link yfiles.system.IDataObject#getData} + * @see Specified by {@link yfiles.system.IDataObject#getFormattedAndConvertedData}. + */ + getFormattedAndConvertedData(format:string,autoConvert:boolean):Object; + /** + * This method has been implemented to satisfy the interface requirements. + * @return {boolean} Always false. + * @see Specified by {@link yfiles.system.IDataObject#getFormattedDataPresent}. + */ + getFormattedDataPresent(format:string):boolean; + /** + * Determines whether the data is available for the given type. + * @param {yfiles.lang.Class} type The type of the data. + * @return {boolean} Whether the contained data can be returned as an instance of the given type. + * @see Specified by {@link yfiles.system.IDataObject#getDataPresent}. + */ + getDataPresent(type:yfiles.lang.Class):boolean; + /** + * This method has been implemented to satisfy the interface requirements. + * @return {boolean} Always false. + * @see Specified by {@link yfiles.system.IDataObject#getFormattedAndConvertedDataPresent}. + */ + getFormattedAndConvertedDataPresent(format:string,autoConvert:boolean):boolean; + /** + * This method has been implemented to satisfy the interface requirements. + * @return {string[]} An empty string array. + * @see Specified by {@link yfiles.system.IDataObject#getFormats}. + */ + getFormats():string[]; + /** + * This method has been implemented to satisfy the interface requirements. + * @return {string[]} An empty string array. + * @see Specified by {@link yfiles.system.IDataObject#getFormatsWithAutoConvert}. + */ + getFormatsWithAutoConvert(autoConvert:boolean):string[]; + /** + * This method has been implemented to satisfy the interface requirements. + * This is the same as calling {@link yfiles.system.IDataObject#setDataForType} + * @see Specified by {@link yfiles.system.IDataObject#setData}. + */ + setData(data:Object):void; + /** + * This method has been implemented to satisfy the interface requirements. + * This is the same as calling {@link yfiles.system.IDataObject#setDataForType} + * @see Specified by {@link yfiles.system.IDataObject#setFormattedData}. + */ + setFormattedData(format:string,data:Object):void; + /** + * Sets the data object for this instance. + * This implementation allows for only a single data. + * @param {yfiles.lang.Class} type The type of the data, this implementation ignores this parameter. + * @param {Object} data The data. + * @see Specified by {@link yfiles.system.IDataObject#setDataForType}. + */ + setDataForType(type:yfiles.lang.Class,data:Object):void; + /** + * This method has been implemented to satisfy the interface requirements. + * This is the same as calling {@link yfiles.system.IDataObject#setDataForType} + * @see Specified by {@link yfiles.system.IDataObject#setFormattedAndConvertedData}. + */ + setFormattedAndConvertedData(format:string,data:Object,autoConvert:boolean):void; + } + var IDataObject:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * Simple default implementation of the {@link yfiles.system.IDataObject} interface for use + * in {@link yfiles.system.DragSource#doDragDropWithDataObject}. + */ + export interface DataObject extends Object,yfiles.system.IDataObject{ + /** + * This method has been implemented to satisfy the interface requirements. + * @return {Object} Always null. + * @see {@link yfiles.system.DataObject#getData} + * @see Specified by {@link yfiles.system.IDataObject#getFormattedData}. + */ + getFormattedData(format:string):Object; + /** + * Gets the data as an instance of the given type if available. + * @param {yfiles.lang.Class} type The type to retrieve the data as. + * @return {Object} The instance or null if no {@link yfiles.system.DataObject#getDataPresent data is present} of the given type. + * @see {@link yfiles.system.DataObject#getDataPresent} + * @see Specified by {@link yfiles.system.IDataObject#getData}. + */ + getData(type:yfiles.lang.Class):Object; + /** + * This method has been implemented to satisfy the interface requirements. + * @return {Object} Always null. + * @see {@link yfiles.system.DataObject#getData} + * @see Specified by {@link yfiles.system.IDataObject#getFormattedAndConvertedData}. + */ + getFormattedAndConvertedData(format:string,autoConvert:boolean):Object; + /** + * This method has been implemented to satisfy the interface requirements. + * @return {boolean} Always false. + * @see Specified by {@link yfiles.system.IDataObject#getFormattedDataPresent}. + */ + getFormattedDataPresent(format:string):boolean; + /** + * Determines whether the data is available for the given type. + * @param {yfiles.lang.Class} type The type of the data. + * @return {boolean} Whether the contained data can be returned as an instance of the given type. + * @see Specified by {@link yfiles.system.IDataObject#getDataPresent}. + */ + getDataPresent(type:yfiles.lang.Class):boolean; + /** + * This method has been implemented to satisfy the interface requirements. + * @return {boolean} Always false. + * @see Specified by {@link yfiles.system.IDataObject#getFormattedAndConvertedDataPresent}. + */ + getFormattedAndConvertedDataPresent(format:string,autoConvert:boolean):boolean; + /** + * This method has been implemented to satisfy the interface requirements. + * @return {string[]} An empty string array. + * @see Specified by {@link yfiles.system.IDataObject#getFormats}. + */ + getFormats():string[]; + /** + * This method has been implemented to satisfy the interface requirements. + * @return {string[]} An empty string array. + * @see Specified by {@link yfiles.system.IDataObject#getFormatsWithAutoConvert}. + */ + getFormatsWithAutoConvert(autoConvert:boolean):string[]; + /** + * This method has been implemented to satisfy the interface requirements. + * This is the same as calling {@link yfiles.system.DataObject#setDataForType} + * @see Specified by {@link yfiles.system.IDataObject#setData}. + */ + setData(data:Object):void; + /** + * This method has been implemented to satisfy the interface requirements. + * This is the same as calling {@link yfiles.system.DataObject#setDataForType} + * @see Specified by {@link yfiles.system.IDataObject#setFormattedData}. + */ + setFormattedData(format:string,data:Object):void; + /** + * Sets the data object for this instance. + * This implementation allows for only a single data. + * @param {yfiles.lang.Class} type The type of the data, this implementation ignores this parameter. + * @param {Object} data The data. + * @see Specified by {@link yfiles.system.IDataObject#setDataForType}. + */ + setDataForType(type:yfiles.lang.Class,data:Object):void; + /** + * This method has been implemented to satisfy the interface requirements. + * This is the same as calling {@link yfiles.system.DataObject#setDataForType} + * @see Specified by {@link yfiles.system.IDataObject#setFormattedAndConvertedData}. + */ + setFormattedAndConvertedData(format:string,data:Object,autoConvert:boolean):void; + } + var DataObject:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.DataObject} class with no data. + */ + WithDefaults:{ + new ():yfiles.system.DataObject; + }; + /** + * Initializes a new instance of the {@link yfiles.system.DataObject} class using the provided data. + * @param {Object} data The data. + */ + new (data:Object):yfiles.system.DataObject; + }; + /** + * A {@link yfiles.system.ResourceKey key} for resources that are bound to a specific type. + */ + export interface ComponentResourceKey extends yfiles.system.ResourceKey{ + } + var ComponentResourceKey:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.ComponentResourceKey} class. + * @param {yfiles.lang.Class} type The type for which this resource is created. + * @param {Object} value The identifier that further specifies the resource. + * The {@link Object#toString} representation of this identifier is used for creating the key. + */ + new (type:yfiles.lang.Class,value:Object):yfiles.system.ComponentResourceKey; + /** + * Gets the string representation for this key that will be used to lookup the resource. + * @return {string} A string where all '.' in the namespace of the type are replaced by '_', followed by ':', the type name, a + * '.' and the {@link Object#toString} representation of the value. + */ + getString(type:yfiles.lang.Class,value:Object):string; + }; + /** + * A container for {@link yfiles.system.DashStyle#dashes} and an {@link yfiles.system.DashStyle#offset}. All of + * these values are in terms of multiples of the the thickness of a pen. This + * is different from the corresponding properties of a SVG stroke. + */ + export interface DashStyle extends yfiles.system.Freezable{ + /** + * Gets or sets the dashes. + * Value: The dashes. + */ + dashes:yfiles.system.DoubleCollection; + /** + * Gets or sets the offset. + * Value: The offset. + */ + offset:number; + } + var DashStyle:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.DashStyle} class using the provided dashes and offset. + * @param {number[]} dashes The dashes. + * @param {number} offset The offset. + */ + WithDashesAndOffset:{ + new (dashes:number[],offset:number):yfiles.system.DashStyle; + }; + /** + * Initializes a new instance of the {@link yfiles.system.DashStyle} class using an empty {@link yfiles.system.DashStyle#dashes} + * and zero {@link yfiles.system.DashStyle#offset}. + */ + new ():yfiles.system.DashStyle; + }; + /** + * Holds a number of default {@link yfiles.system.DashStyle} instances. + */ + export interface DashStyles extends Object{ + } + var DashStyles:{ + $class:yfiles.lang.Class; + /** + * Gets the dash style with a single dash. + * A pen with this style doesn't look as expected if it uses the dash cap + * {@link yfiles.system.PenLineCap#FLAT}. Since + * {@link yfiles.system.PenLineCap#FLAT} is the default value, you should + * explicitly set another value, for example + * {@link yfiles.system.PenLineCap#SQUARE} or {@link yfiles.system.PenLineCap#ROUND}. + * Value: The 'dash' dash style. + */ + DASH:yfiles.system.DashStyle; + /** + * Gets the dash style with a single dash and dot. + * A pen with this style doesn't look as expected if it uses the dash cap + * {@link yfiles.system.PenLineCap#FLAT}. Since + * {@link yfiles.system.PenLineCap#FLAT} is the default value, you should + * explicitly set another value, for example + * {@link yfiles.system.PenLineCap#SQUARE} or {@link yfiles.system.PenLineCap#ROUND}. + * Value: The 'dash-dot' dash style. + */ + DASH_DOT:yfiles.system.DashStyle; + /** + * Gets the dash style with a single dash and two dots. + * A pen with this style doesn't look as expected if it uses the dash cap + * {@link yfiles.system.PenLineCap#FLAT}. Since + * {@link yfiles.system.PenLineCap#FLAT} is the default value, you should + * explicitly set another value, for example + * {@link yfiles.system.PenLineCap#SQUARE} or {@link yfiles.system.PenLineCap#ROUND}. + * Value: The 'dash-dot-dot' dash style. + */ + DASH_DOT_DOT:yfiles.system.DashStyle; + /** + * Gets the dash style with a single dot. + * A pen with this style doesn't look as expected if it uses the dash cap + * {@link yfiles.system.PenLineCap#FLAT}. Since + * {@link yfiles.system.PenLineCap#FLAT} is the default value, you should + * explicitly set another value, for example + * {@link yfiles.system.PenLineCap#SQUARE} or {@link yfiles.system.PenLineCap#ROUND}. + * Value: The 'dot' dash style. + */ + DOT:yfiles.system.DashStyle; + /** + * Gets the solid dash style with no dashes. + * Value: The solid dash style. + */ + SOLID:yfiles.system.DashStyle; + }; + export enum DesignerSerializationVisibility{ + /** + * The code generator produces code for the contents of the object, rather than for the object itself. + */ + CONTENT, + /** + * The code generator does not produce code for the object. + */ + HIDDEN, + /** + * The code generator produces code for the object. + */ + VISIBLE + } + /** + * A copy of the implementation of the same {@link yfiles.lang.Attribute} found in WPF and .net + * Specifies the type of persistence to use when serializing a property on a component at design time. + */ + export interface DesignerSerializationVisibilityAttribute extends yfiles.lang.Attribute{ + visibility:yfiles.system.DesignerSerializationVisibility; + } + var DesignerSerializationVisibilityAttribute:{ + $class:yfiles.lang.Class; + CONTENT:yfiles.system.DesignerSerializationVisibilityAttribute; + VISIBLE:yfiles.system.DesignerSerializationVisibilityAttribute; + HIDDEN:yfiles.system.DesignerSerializationVisibilityAttribute; + DEFAULT:yfiles.system.DesignerSerializationVisibilityAttribute; + }; + /** + * A copy of the implementation of the same {@link yfiles.lang.Attribute} found in WPF and .net + * Specifies the default value for a property. + */ + export interface DefaultValueAttribute extends yfiles.lang.Attribute{ + /** + * Gets the default value of the property this attribute is bound to. + */ + value:Object; + /** + * Sets the default value of the property this attribute is bound to. + * @param {Object} value + */ + setValue(value:Object):void; + } + var DefaultValueAttribute:{ + $class:yfiles.lang.Class; + With:{ + new (value:Object):yfiles.system.DefaultValueAttribute; + }; + ConvertedFrom:{ + new (type:yfiles.lang.Class,value:string):yfiles.system.DefaultValueAttribute; + }; + }; + export interface Convert extends Object{ + } + var Convert:{ + $class:yfiles.lang.Class; + /** + * Converts a string into a Number type. Simply forwards to the standard parseFloat method on window. + * @param {string} s The string which represents the number. + * @return {number} The Number represented by the string + */ + stringToDouble(s:string):number; + /** + * Converts a Double object to a Number. + * @param {number} d The double. + * @return {number} The Number represented by the input. + */ + toDouble(d:number):number; + /** + * Converts an object into a Number using the native parseFloat method. + * The object is first converted to a string before it is converted to a Number. + * @param {Object} o The object. + * @return {number} The Number represented by the object. + */ + objectToDouble(o:Object):number; + /** + * Converts a string into a boolean. + * Only the value true is converted to the boolean value true, all other values are converted to false. + * @param {string} s The string. + * @return {boolean} true, if the string value equals true; false otherwise. + */ + stringToBoolean(s:string):boolean; + /** + * Casts an object to a boolean. + * This method follows the standard Javascript rules to determine whether an object is "truthy" or "falsy". + * @param {Object} o The object. + * @return {boolean} true, unless the object has a "falsy" value, i.e. is undefined or null. + */ + objectToBoolean(o:Object):boolean; + /** + * Returns the string representation of the given number. + * @param {number} value The number + * @return {string} A string representation of the given number. + */ + doubleToString(value:number):string; + /** + * Returns the string representation of the given number with respect to the specified base. + * @param {number} value The number + * @param {number} toBase The base + * @return {string} A string representation of the given number with respect to the specified base. + */ + intToStringWithBase(value:number,toBase:number):string; + /** + * Converts an integer value into a byte value by keeping only the last 8 bits. + * @param {number} value The value. + * @return {number} + */ + toByte(value:number):number; + /** + * Converts the integer value into a 16-bit long integer by keeping only the last 16 bits. + * @param {number} value The value. + * @return {number} + */ + toInt16(value:number):number; + /** + * Converts a string into an integer with a base of 10 (decimal system). + * @param {string} value The value. + * @return {number} The integer value as parsed from the string. + */ + stringToInt32(value:string):number; + /** + * Converts a string into an integer with the given radix as the base. + * @param {string} value The value. + * @param {number} radix The radix. + * @return {number} The integer value as parsed from the string. + */ + stringToInt32WithRadix(value:string,radix:number):number; + /** + * Converts an object into an integer with a base of 10 (decimal system). + * @param {Object} value The value. + * @return {number} The integer value as parsed from the string. + */ + objectToInt32(value:Object):number; + stringToInt64(value:string):number; + toUInt16(value:number):Number; + toUInt32(value:number):number; + toUInt64(value:number):number; + }; + /** + * Provides helper methods to manipulate arrays. + */ + export interface ArrayExtensions extends Object{ + } + var ArrayExtensions:{ + $class:yfiles.lang.Class; + /** + * Not implemented. Always throws an exception. + * @param {Object} arrayCreationExpression The array creation expression. + */ + consumeSideEffects(arrayCreationExpression:Object):void; + /** + * Creates a class object of an array with the given type and the given dimension. + * @param {yfiles.lang.Class} type The type of an array element. + * @param {number} dimension The dimension of the array. + * @return {yfiles.lang.Class} + */ + arrayTypeOf(type:yfiles.lang.Class,dimension:number):yfiles.lang.Class; + /** + * Creates an array of numbers with the given length, + * initialized with 0. + * @param {number} length The length of the array to create. + * @return {Array} An array of numbers with the given length. + */ + createnumberArray(length:number):Array; + /** + * Creates an array of numbers with the given length, + * initialized with 0. + * @param {number} length The length of the array to create. + * @return {Array} An array of numbers with the given length. + */ + createbyteArray(length:number):Array; + /** + * Creates an array of numbers with the given length, + * initialized with 0. + * @param {number} length The length of the array to create. + * @return {Array} An array of numbers with the given length. + */ + createintArray(length:number):Array; + /** + * Creates an array of numbers with the given length, + * initialized with 0. + * @param {number} length The length of the array to create. + * @return {Array} An array of numbers with the given length. + */ + createlongArray(length:number):Array; + /** + * Creates an array of booleans with the given length, + * initialized with false. + * @param {number} length The length of the array to create. + * @return {Array} An array of booleans with the given length. + */ + createbooleanArray(length:number):Array; + /** + * Creates an array of objects with the given length. + * @param {number} length The length of the array to create. + * @return {Array} A object array with the given length. + */ + createObjectArray(length:number):Array; + /** + * Creates an array of strings with the given length, + * initialized with the empty string. + * @param {number} length The length of the array to create. + * @return {Array} An array of strings with the given length. + */ + createstringArray(length:number):Array; + /** + * Creates an array of strings with the given length, + * initialized with the empty string. + * @param {number} length The length of the array to create. + * @return {Array} An array of strings with the given length. + */ + createcharArray(length:number):Array; + /** + * Creates an array of numbers with the given length, + * initialized with 0. + * @param {number} length The length of the array to create. + * @return {Array} An array of numbers with the given length. + */ + createfloatArray(length:number):Array; + /** + * Creates an array of numbers with the given length, + * initialized with 0. + * @param {number} length The length of the array to create. + * @return {Array} An array of numbers with the given length. + */ + createdoubleArray(length:number):Array; + /** + * Creates a multi dimensional array with the given lengths. + * @param {number[]} lengths An array with the length of the dimensions of the array to create. + * @return {Array} A multi dimensional array. + */ + createMultiArray(lengths:number[]):Array; + /** + * Whether the given object is an array. + * @param {Object} obj The object to test. + * @param {number} dimensions The number of the dimensions of the array. Not used here. + * @return {boolean} true if the given object is an array. + */ + instanceOfArray(obj:Object,dimensions:number):boolean; + /** + * Copies a given array into another one. + * @param {Object[]} src The array to copy from. + * @param {Object[]} target The array to copy to. + * @param {number} index The index to start at the target. + */ + copyTo(src:Object[],target:Object[],index:number):void; + /** + * Copies a part of a given array into another one. + * @param {Object[]} src The array to copy from. + * @param {Object[]} target The array to copy to. + * @param {number} length The number of elements to copy. + */ + copy(src:Object[],target:Object[],length:number):void; + /** + * Copies a part of a given array into another one. + * @param {Object[]} src The array to copy from. + * @param {number} srcIndex The index to start copying at the source array. + * @param {Object[]} target The array to copy to. + * @param {number} targetIndex The index to start copying to at the target array. + * @param {number} count The number of elements to copy. + */ + arrayCopy(src:Object[],srcIndex:number,target:Object[],targetIndex:number,count:number):void; + /** + * Reverses the order of elements in the given array. + * @param {Object} array The array to revert. + */ + reverse(array:Object):void; + /** + * Sorts a given array in ascending order. + * This method determines the sort order: + *
    + *
  • Numbers are sorted according to their numerical value.
  • + *
  • Implementors of {@link yfiles.lang.IObjectComparable} and {@link yfiles.lang.IComparable} are sorted according to their {@link yfiles.lang.IComparable#compareTo} method.
  • + *
  • All other items are sorted alphabetically.
  • + *
+ * @param {Object} array The array to sort. + */ + sort(array:Object):void; + /** + * Sorts an array in ascending order using the given {@link yfiles.collections.IComparer}. + * @param {Object} a The array ti sort. + * @param {yfiles.collections.IComparer.} comparer The comparer to use to compare the array elements. + */ + sortComparer(a:Object,comparer:yfiles.collections.IComparer):void; + /** + * Sorts an array in ascending order using the given {@link yfiles.objectcollections.IComparer}. + * @param {Object} a The array ti sort. + * @param {yfiles.objectcollections.IComparer} comparer The comparer to use to compare the array elements. + */ + sortObjectComparer(a:Object,comparer:yfiles.objectcollections.IComparer):void; + /** + * Sorts an array in ascending order using the given comparer. + * The comparison function takes two arguments, o1 and o2, and returns + *
    + *
  • -1 if >o1 < o2
  • + *
  • 0 if >o1 == o2
  • + *
  • 1 if >o1 > o2
  • + *
+ * @param {Object} a The array to sort. + * @param {function(Object, Object):number} comparer The comparison function. + */ + sortComparison(a:Object,comparer:(arg1:Object,arg2:Object)=>number):void; + /** + * Sorts the range of an array in ascending order. + * @param {yfiles.lang.Class} type The type of the array elements. + * @param {Array} a The array to sort. + * @param {number} index The index to start from. + * @param {number} length The length of the range to sort. + */ + sortRange(type:yfiles.lang.Class,a:Array,index:number,length:number):void; + /** + * Sorts an array with the given type in ascending order. + * @param {yfiles.lang.Class} type The type of the array elements. + * @param {Array} a The array to sort. + */ + sortTyped(type:yfiles.lang.Class,a:Array):void; + /** + * Creates an {@link yfiles.collections.IEnumerator} which iterates over the given array. + * @param {Object[]} array The array to create the enumerator for. + * @return {yfiles.collections.IEnumerator.} An {@link yfiles.collections.IEnumerator} which iterates over the given array. + */ + getEnumerator(array:Object[]):yfiles.collections.IEnumerator; + /** + * Returns the highest possible index for the given dimension of the given array. + * The highest possible index is the array's length - 1. + * @param {Array} a The array to get the bound for. + * @param {number} dimension The dimension of the array to get the bound for. 0 for a one-dimensional array. + * @return {number} The upper bound of the given array. + */ + getUpperBound(a:Array,dimension:number):number; + /** + * Returns the length of the given dimension of the given array. + * @param {Array} a The array to get the length for. + * @param {number} dimension The dimension of the array to get the length for. 0 for a one-dimensional array. + * @return {number} The length of the given array. + */ + getLength(a:Array,dimension:number):number; + }; + /** + * A copy of the implementation of the same {@link yfiles.lang.Attribute} found in WPF and .net + * Specifies what type to use as a converter for the object this attribute is bound to. This class cannot be inherited. + */ + export interface TypeConverterAttribute extends yfiles.lang.Attribute{ + converterTypeName:string; + } + var TypeConverterAttribute:{ + $class:yfiles.lang.Class; + new ():yfiles.system.TypeConverterAttribute; + WithType:{ + new (type:yfiles.lang.Class):yfiles.system.TypeConverterAttribute; + }; + WithTypeName:{ + new (typeName:string):yfiles.system.TypeConverterAttribute; + }; + }; + /** + * An {@link yfiles.lang.Exception} to indicate an error in an arithmetic operation. + */ + export interface ArithmeticException extends yfiles.lang.Exception{ + } + var ArithmeticException:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with an empty message. + */ + new ():yfiles.system.ArithmeticException; + /** + * Creates a new instance with the given message. + * @param {string} message The error message. + */ + WithMessage:{ + new (message:string):yfiles.system.ArithmeticException; + }; + }; + /** + * An {@link yfiles.lang.Exception} to indicate that one or more parameters passed to the current method are out of the legal range. + */ + export interface IndexOutOfRangeException extends yfiles.lang.Exception{ + } + var IndexOutOfRangeException:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with an empty message. + */ + new ():yfiles.system.IndexOutOfRangeException; + /** + * Creates a new instance with the given message. + * @param {string} message The error message. + */ + WithMessage:{ + new (message:string):yfiles.system.IndexOutOfRangeException; + }; + }; + /** + * An {@link yfiles.lang.Exception} to indicate that the current operation is not valid in the object's current state. + */ + export interface InvalidOperationException extends yfiles.lang.Exception{ + } + var InvalidOperationException:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with an empty message. + */ + new ():yfiles.system.InvalidOperationException; + /** + * Creates a new instance with the given message. + * @param {string} message The error message. + */ + WithMessage:{ + new (message:string):yfiles.system.InvalidOperationException; + }; + }; + /** + * An {@link yfiles.lang.Exception} to indicate that the called method is not implemented. + */ + export interface NotImplementedException extends yfiles.lang.Exception{ + } + var NotImplementedException:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with an empty message. + */ + new ():yfiles.system.NotImplementedException; + /** + * Creates a new instance with the given message. + * @param {string} message The error message. + */ + WithMessage:{ + new (message:string):yfiles.system.NotImplementedException; + }; + }; + /** + * An {@link yfiles.lang.Exception} to indicate an error in an IO operation. + */ + export interface IOException extends yfiles.lang.Exception{ + } + var IOException:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with an empty message. + */ + new ():yfiles.system.IOException; + /** + * Creates a new instance with the given message. + * @param {string} message The error message. + */ + FromMessage:{ + new (message:string):yfiles.system.IOException; + }; + /** + * Creates a new instance based on the given Exception. + * @param {string} message The error message. + * @param {yfiles.lang.Exception} ex The exception which should be forwarded by the new instance. The exception's message is concatenated to the given message. + */ + FromMessageAndException:{ + new (message:string,ex:yfiles.lang.Exception):yfiles.system.IOException; + }; + }; + /** + * An {@link yfiles.lang.Exception} to indicate that an argument has not the expected format. + */ + export interface FormatException extends yfiles.lang.Exception{ + } + var FormatException:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with an empty message. + */ + new ():yfiles.system.FormatException; + /** + * Creates a new instance with the given message. + * @param {string} message The error message. + */ + WithMessage:{ + new (message:string):yfiles.system.FormatException; + }; + }; + /** + * An event that sends this argument can be canceled. + * If, after the event handlers have been processed, the {@link yfiles.system.CancelEventArgs#cancel} property + * is set to true, then the expected behaviour of the event source is to cancel the action it was + * about to do. + */ + export interface CancelEventArgs extends yfiles.system.EventArgs{ + /** + * Gets or sets a value indicating whether the action should be canceled. + * Value: + * true if the action should be canceled; otherwise, false. + */ + cancel:boolean; + } + var CancelEventArgs:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance of the {@link yfiles.system.CancelEventArgs} class. + * The default value for the {@link yfiles.system.CancelEventArgs#cancel} property will be false. + */ + new ():yfiles.system.CancelEventArgs; + /** + * Initializes a new instance of the {@link yfiles.system.CancelEventArgs} class with the given value for the + * {@link yfiles.system.CancelEventArgs#cancel} field. + * This constructor can be useful if the event is fired in a "opt-in" style, i.e. if the action should not be + * performed unless at least one of the event handlers requested it by setting the value of {@link yfiles.system.CancelEventArgs#cancel} to + * false- + * @param {boolean} cancel The starting value of the {@link yfiles.system.CancelEventArgs#cancel} property. + */ + WithCancel:{ + new (cancel:boolean):yfiles.system.CancelEventArgs; + }; + }; + /** + * Subclasses of {@link yfiles.system.EventArgs} are passed to event handlers to provide the + * information they need to handle an event. + */ + export interface EventArgs extends Object{ + } + var EventArgs:{ + $class:yfiles.lang.Class; + /** + * An empty {@link yfiles.system.EventArgs} object that can be used when no information needs to be passed + * to the event handler. + */ + EMPTY:yfiles.system.EventArgs; + }; + /** + * Provides error handling functionality for the yFiles library. + * If {@link yfiles.system.ErrorHandling#catchErrors} is enabled, most entry points (e.g. event listeners) + * use try/catch blocks to catch possible errors that could be thrown in the event handlers. + * The errors are handled by the {@link yfiles.system.ErrorHandling#handleError} function, which calls the {@link yfiles.system.ErrorHandling#errorHandler} + * function, if it has been set. + * Note that for some browsers/plugins, try/catch blocks prevent error debugging functionality. Hence, {@link yfiles.system.ErrorHandling#catchErrors} + * should be turned off while debugging. + */ + export interface ErrorHandling extends Object{ + } + var ErrorHandling:{ + $class:yfiles.lang.Class; + /** + * Whether to use try/catch blocks when invoking event handlers. + * If this property is enabled, try/catch blocks are used when invoking event handlers. + * As most browsers provide a stack trace with Error objects, this property can be used to provide + * more detailed error information. + */ + catchErrors:boolean; + /** + * If {@link yfiles.system.ErrorHandling#catchErrors} is enabled, any caught errors are passed to this function. + */ + errorHandler:(obj:Object)=> void; + /** + * This function is called in catch blocks if {@link yfiles.system.ErrorHandling#catchErrors} is enabled. + * If an {@link yfiles.system.ErrorHandling#errorHandler} is registered, the error is passed to the error handler. + * @param {Object} error The error that has been caught + */ + handleError(error:Object):void; + }; + /** + * An {@link yfiles.lang.Exception} to indicate that one or more parameters passed to the current method are out of the legal range. + */ + export interface ArgumentOutOfRangeException extends yfiles.lang.Exception{ + } + var ArgumentOutOfRangeException:{ + $class:yfiles.lang.Class; + new ():yfiles.system.ArgumentOutOfRangeException; + /** + * Creates a new instance with the given parameter. + * @param {string} param The parameter name that was out of range. + */ + FromMessage:{ + new (param:string):yfiles.system.ArgumentOutOfRangeException; + }; + /** + * Creates a new instance with the given message. + * @param {string} param The error message. + * @param {string} message The message. + */ + FromMessageAndParameter:{ + new (param:string,message:string):yfiles.system.ArgumentOutOfRangeException; + }; + }; + /** + * An {@link yfiles.lang.Exception} to indicate that one or more parameters passed to the current method are + * null where a non-null parameter was expected. + */ + export interface ArgumentNullException extends yfiles.lang.Exception{ + } + var ArgumentNullException:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with an empty message. + */ + new ():yfiles.system.ArgumentNullException; + /** + * Creates a new instance with the given message. + * @param {string} parameter The parameter name. + */ + FromMessage:{ + new (parameter:string):yfiles.system.ArgumentNullException; + }; + /** + * Creates a new instance with the given message. + * @param {string} message The error message. + * @param {string} parameter The parameter name. + */ + FromMessageAndParameter:{ + new (parameter:string,message:string):yfiles.system.ArgumentNullException; + }; + }; + /** + * An {@link yfiles.lang.Exception} to indicate that one or more parameters passed to the current method are illegal. + */ + export interface ArgumentException extends yfiles.lang.Exception{ + } + var ArgumentException:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with an empty message. + */ + new ():yfiles.system.ArgumentException; + /** + * Creates a new instance with the given message. + * @param {string} message The error message. + */ + FromMessage:{ + new (message:string):yfiles.system.ArgumentException; + }; + /** + * Creates a new instance with the given message. + * @param {string} message The error message. + * @param {string} parameterName The parameter name that caused the problem. + */ + FromMessageAndParameter:{ + new (message:string,parameterName:string):yfiles.system.ArgumentException; + }; + /** + * Creates a new instance based on the given Exception. + * @param {string} message The error message. + * @param {yfiles.lang.Exception} exception The exception which should be forwarded by the new instance. The exception's message is concatenated to the given message. + */ + FromMessageAndException:{ + new (message:string,exception:yfiles.lang.Exception):yfiles.system.ArgumentException; + }; + }; + } + export module tree{ + export interface HierarchicTreePlacer extends yfiles.tree.AbstractNodePlacer{ + /** + * This method must be implemented by subclasses. + * It assigns a connector shape + * direction to each child. + * @param {yfiles.algorithms.Node} child the child node + * @return {number} + * a byte constant as defined in the {@link yfiles.tree.INodePlacer} interface + */ + determineChildConnector(child:yfiles.algorithms.Node):number; + /** + * The main placeSubtree method that must be implemented by subclasses. + * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction of the connector shape + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} a SubtreeShape instance that describes the shape of the whole subtree + */ + placeSubtreeImpl(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.GenericTreeLayouter.SubtreeShape; + } + var HierarchicTreePlacer:{ + $class:yfiles.lang.Class; + /** + * creates a new HierarchicTreePlacer. + * @param {number} minimalNodeDistance the minimal allowed distance between two nodes in the same layer + */ + new (minimalNodeDistance:number):yfiles.tree.HierarchicTreePlacer; + }; + /** + * This tree layouter allows to layout a tree such that + * each subgraph rooted at a node can either have a horizontal or + * vertical layout. + * Here is an sample output of the layouter + *
+ */ + export interface HVTreeLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * The layout graph being acted upon. + */ + graph:yfiles.layout.LayoutGraph; + /** + * The horizontal distance between adjacent nodes. + * By default a value of 10 is set. + */ + horizontalSpace:number; + /** + * The vertical distance between adjacent nodes. + * By default a value of 10 is set. + */ + verticalSpace:number; + /** + * Core layout routine. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * The core layouter can layout trees. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Returns whether or not the subtree rooted at the given node should + * be laid out vertically. + */ + isVerticalRoot(v:yfiles.algorithms.Node):boolean; + /** + * Returns whether or not the subtree rooted at the given node should + * be laid out horizontally. + */ + isHorizontalRoot(v:yfiles.algorithms.Node):boolean; + getSuccessors(localParent:yfiles.algorithms.Node):yfiles.algorithms.INodeCursor; + /** + * The{@link yfiles.objectcollections.IComparer} that will be used + * to sort the {@link yfiles.algorithms.Node#sortOutEdges outgoing edges} + * of each local root in the tree before they are being arranged. + * The default value is null which indicates that the algorithm should + * use its built-in logic. + */ + comparator:yfiles.objectcollections.IComparer; + } + var HVTreeLayouter:{ + $class:yfiles.lang.Class; + /** + * The data provider key used to specify the subtree orientation + * of each node in the tree. + * This layout algorithm will try to retrieve a + * data provider from the tree to be laid out with this key. + * The looked up data provider should provide either + * {@link yfiles.tree.HVTreeLayouter#HORIZONTAL_SUBTREE}, {@link yfiles.tree.HVTreeLayouter#VERTICAL_SUBTREE} + */ + SUBTREE_ORIENTATION_DP_KEY:Object; + /** + * Subtree orientation specifier. + * This specifier indicated + * that the subtree rooted at the associated node should be laid + * out horizontally. + */ + HORIZONTAL_SUBTREE:Object; + /** + * Subtree orientation specifier. + * This specifier indicated + * that the subtree rooted at the associated node should be laid + * out vertically. + */ + VERTICAL_SUBTREE:Object; + new ():yfiles.tree.HVTreeLayouter; + }; + /** + * A FromSketchNodePlacer is responsible for arranging its nodes using a comparator, which sorts + * the outgoing edges of a node according to the position of their target nodes in the graph before the actual placement + * happens. + * @see {@link yfiles.tree.INodePlacer} + */ + export interface IFromSketchNodePlacer extends Object,yfiles.tree.INodePlacer{ + /** + * Creates a comparator for edges. + * This comparator is used to sort the outgoing edges of a node before the + * placement of the node's subtree is calculated. + * @return {yfiles.objectcollections.IComparer} a comparator for edges. + * @see Specified by {@link yfiles.tree.IFromSketchNodePlacer#createFromSketchComparator}. + */ + createFromSketchComparator():yfiles.objectcollections.IComparer; + } + var IFromSketchNodePlacer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This NodePlacer arranges nodes into a grid. + * The grid consists of a number of columns. Rows are filled automatically by the placer. + * Each row is filled from left to right. When all columns in a row are filled, the next row is created. + */ + export interface GridNodePlacer extends yfiles.tree.AbstractRotatableNodePlacer{ + /** + * Returns {@link yfiles.tree.ParentConnectorDirection#NORTH}. + * @return {yfiles.tree.ParentConnectorDirection} + * {@link yfiles.tree.ParentConnectorDirection#NORTH}. + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#determineChildConnector} + */ + determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; + /** + * Places the children in a grid. + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#placeSubtreeWithDirection} + */ + placeSubtreeWithDirection(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShapeRotated; + /** + * Creates a comparator that uses the positions of the target nodes to + * order edges. + * For two edges e1=(s,t1) and e2=(s,t2), + * e1 is considered to be less than e2, if + * t1's row is less than t2's row. If both + * t1 and t2 lie in the same row, then the nodes' + * x-coordinates are compared. + * @return {yfiles.objectcollections.IComparer} + * a comparator that orders edges lexicographically by row and + * x-coordinate of their target nodes. + * @see {@link yfiles.tree.GridNodePlacer#GRID_DP_KEY} + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#createFromSketchComparator} + * @see Specified by {@link yfiles.tree.IFromSketchNodePlacer#createFromSketchComparator}. + */ + createFromSketchComparator():yfiles.objectcollections.IComparer; + /** + * The horizontal alignment of the root node. + */ + rootAlignment:yfiles.tree.AbstractRotatableNodePlacer.RootAlignment; + } + var GridNodePlacer:{ + $class:yfiles.lang.Class; + /** + * Key which can be used to register a data provider that tells the placer in which row + * a given node should be put into. + * For each node, the row is determined using + * the data provider's {@link yfiles.algorithms.IDataProvider#getInt getInt} method. + * If no provider is specified, all nodes will be placed in one row. + */ + GRID_DP_KEY:Object; + /** + * Creates a grid placer with the modification matrix {@link yfiles.tree.AbstractRotatableNodePlacer.Matrix#DEFAULT}. + */ + new ():yfiles.tree.GridNodePlacer; + /** + * Creates grid placer with a given modification matrix. + */ + WithMatrix:{ + new (modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix):yfiles.tree.GridNodePlacer; + }; + /** + * Creates grid placer with a given modification matrix and the horizontal alignment of the root. + */ + WithMatrixAndAlignment:{ + new (modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix,rootAlignment:yfiles.tree.AbstractRotatableNodePlacer.RootAlignment):yfiles.tree.GridNodePlacer; + }; + }; + /** + * A {@link yfiles.tree.INodePlacer} that places the children of a local root in groups. + *

+ * The placement of the groups is specified by a {@link yfiles.tree.INodePlacer} which will consider grouped children + * as one child. The children within a group are placed by another NodePlacer. + *

+ *

+ * The groups are determined by the grouping of the edges that connect the children to its root. + *

+ * @see {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} + * @see {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} + */ + export interface GroupedNodePlacer extends Object,yfiles.tree.INodePlacer{ + /** + * This method is called by GenericTreeLayouter before the subtree shapes of + * this local root node's children are calculated. + * This method must provide for each child node a byte constant indicating + * the preferred direction of the connector to the subtree shape. + * @param {yfiles.algorithms.Node} localRoot + * the local root node whose child nodes will be provided with + * a byte constant indicating the direction of the connector + * @param {yfiles.algorithms.IDataMap} connectorMap + * the map that should be used for storing the byte constant + * with the child nodes. + * @see Specified by {@link yfiles.tree.INodePlacer#determineChildConnectors}. + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; + /** + * The main method of the tree layout algorithm. + * This method arranges the + * SubtreeShapes and the shape of the local root, routes the edges to the + * SubtreeShapes, calculates the resulting SubtreeShape and returns it. + * @param {yfiles.algorithms.IDataProvider} nodeShapeProvider + * this instance can be used to obtain an initial shape + * of the root node. This shape can then be merged with all the subtrees' shapes + * and finally be returned by this method. + * @param {yfiles.algorithms.IDataProvider} subtreeShapeProvider + * provides access to the pre-calculated shapes of + * the subtrees. It is guaranteed that at the time of the invocation of this + * method for every child node the subtree shape has already been calculated + * @param {yfiles.layout.LayoutGraph} graph the graph which is to be laid out + * @param {yfiles.algorithms.Node} localRoot the root of the subtree that should be laid out by this method + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection + * the direction byte constant as it is defined + * in this interface, that must be used for initializing the connector of the + * localRoot node to the parent node of the localRoot node + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} the shape of the whole subtree + * @see Specified by {@link yfiles.tree.INodePlacer#placeSubtree}. + */ + placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * Creates an optional Processor for pre- and post-processing. + * @param {yfiles.tree.GenericTreeLayouter} layouter + * @param {yfiles.layout.LayoutGraph} graph the actual graph + * @param {yfiles.algorithms.Node} currentRoot the actual root node for this node placer + * @return {yfiles.tree.IProcessor} a Processor or null + * @see Specified by {@link yfiles.tree.INodePlacer#createProcessor}. + */ + createProcessor(layouter:yfiles.tree.GenericTreeLayouter,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + } + var GroupedNodePlacer:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of GroupedNodePlacer that uses a groupPlacer to place the grouped + * nodes combined and a childPlacer to place the children within their group. + * @param {yfiles.tree.INodePlacer} groupPlacer the NodePlacer which places the child groups. + * @param {yfiles.tree.INodePlacer} childPlacer the NodePlacer which places the children within their group. + */ + new (groupPlacer:yfiles.tree.INodePlacer,childPlacer:yfiles.tree.INodePlacer):yfiles.tree.GroupedNodePlacer; + }; + /** + * This interface is used by {@link yfiles.tree.GenericTreeLayouter}. + * Classes implementing this + * interface are responsible for the arrangement of a root node and all of its subtrees. + * Subtrees are represented as shapes with a connecting edge to the root of the subtree. + * Instances have to: + *
    + *
  • arrange the subtree shapes and the root node + * (only the relative position matters, shapes can be placed at any absolute location, + * GenericTreeLayouter will perform the final alignment). + *
  • + *
  • perform the edge routing from the root node to all child nodes with respect + * to the connector provided by the subtree shapes
  • + *
  • + * calculate the union of the subtree shapes and the shape of the root node as well as + * any edges added in this run + *
  • + *
  • + * initialize the connector of the root node with respect to the preferred connection + * direction + *
  • + *
  • + * return the subtree shape + *
  • + *
+ * Instances may modify the subtree shape instances of the subtrees of the current + * root node and use the subtree shape obtained by the DataProvider as the return value. + */ + export interface INodePlacer extends Object{ + /** + * This method is called by GenericTreeLayouter before the subtree shapes of + * this local root node's children are calculated. + * This method must provide for each child node a byte constant indicating + * the preferred direction of the connector to the subtree shape. + * @param {yfiles.algorithms.Node} localRoot + * the local root node whose child nodes will be provided with + * a byte constant indicating the direction of the connector + * @param {yfiles.algorithms.IDataMap} connectorMap + * the map that should be used for storing the byte constant + * with the child nodes. + * @see Specified by {@link yfiles.tree.INodePlacer#determineChildConnectors}. + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; + /** + * The main method of the tree layout algorithm. + * This method arranges the + * SubtreeShapes and the shape of the local root, routes the edges to the + * SubtreeShapes, calculates the resulting SubtreeShape and returns it. + * @param {yfiles.algorithms.IDataProvider} nodeShapeProvider + * this instance can be used to obtain an initial shape + * of the root node. This shape can then be merged with all the subtrees' shapes + * and finally be returned by this method. + * @param {yfiles.algorithms.IDataProvider} subtreeShapeProvider + * provides access to the pre-calculated shapes of + * the subtrees. It is guaranteed that at the time of the invocation of this + * method for every child node the subtree shape has already been calculated + * @param {yfiles.layout.LayoutGraph} graph the graph which is to be laid out + * @param {yfiles.algorithms.Node} localRoot the root of the subtree that should be laid out by this method + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection + * the direction byte constant as it is defined + * in this interface, that must be used for initializing the connector of the + * localRoot node to the parent node of the localRoot node + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} the shape of the whole subtree + * @see Specified by {@link yfiles.tree.INodePlacer#placeSubtree}. + */ + placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * Creates an optional Processor for pre- and post-processing. + * @param {yfiles.tree.GenericTreeLayouter} layouter + * @param {yfiles.layout.LayoutGraph} graph the actual graph + * @param {yfiles.algorithms.Node} currentRoot the actual root node for this node placer + * @return {yfiles.tree.IProcessor} a Processor or null + * @see Specified by {@link yfiles.tree.INodePlacer#createProcessor}. + */ + createProcessor(layouter:yfiles.tree.GenericTreeLayouter,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + } + var INodePlacer:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * The LeftRightPlacer is a NodePlacer that arranges the Nodes on the left and + * right side of a vertical bus. + */ + export interface LeftRightPlacer extends yfiles.tree.AbstractRotatableNodePlacer{ + /** + * The horizontal distance/spacing between subtree shapes. + *

+ * By default, a value of 20 is used. + *

+ * @see {@link yfiles.tree.LeftRightPlacer#verticalDistance} + * @see {@link yfiles.tree.LeftRightPlacer#verticalDistance} + * @see {@link yfiles.tree.LeftRightPlacer#verticalDistance} + * @see {@link yfiles.tree.LeftRightPlacer#verticalDistance} + */ + horizontalDistance:number; + /** + * The vertical distance/spacing between subtree shapes. + *

+ * By default, a value of 20 is used. + *

+ * @see {@link yfiles.tree.LeftRightPlacer#horizontalDistance} + * @see {@link yfiles.tree.LeftRightPlacer#horizontalDistance} + * @see {@link yfiles.tree.LeftRightPlacer#horizontalDistance} + * @see {@link yfiles.tree.LeftRightPlacer#horizontalDistance} + */ + verticalDistance:number; + /** + * Specifies the spacing between subtrees this NodePlacer is + * arranging. + * Calls + *
+ * setHorizontalDistance(spacing);
+ * setVerticalDistance(spacing); + *
+ * @see {@link yfiles.tree.LeftRightPlacer#horizontalDistance} + * @see {@link yfiles.tree.LeftRightPlacer#verticalDistance} + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#spacing} + */ + spacing:number; + /** + * Determines the direction the children should place their connectors. + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#determineChildConnectors} + * @see Specified by {@link yfiles.tree.INodePlacer#determineChildConnectors}. + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; + /** + * Throws IllegalStateException, should not be reached. + * @throws {yfiles.system.InvalidOperationException} always. + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#determineChildConnector} + */ + determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; + /** + * Places the shapes of the children on the left and right side of a vertical bus. + * @return {yfiles.tree.SubtreeShapeRotated} the new subtree shape + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#placeSubtreeWithDirection} + */ + placeSubtreeWithDirection(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShapeRotated; + /** + * Specifies whether or not the last child is placed at the bottom of the other. + *

+ * By default, this feature is enabled. + *

+ */ + placeLastOnBottom:boolean; + /** + * Returns a comparator for edges. + * The comparator applies the modification matrix of the {@link yfiles.tree.LeftRightPlacer} + * and returns + *
    + *
  • 1 if the target node of the first edge is above the target node of the second edge.
  • + *
  • 0 if the edges to compare point to nodes which lie in the same horizontal plane.
  • + *
  • -1 if the target node of the first edge is below the target node of the second edge.
  • + *
+ * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#createComparator} + */ + createComparator():yfiles.objectcollections.IComparer; + } + export module LeftRightPlacer{ + /** + * Utility class providing a method to determine if a given node + * is aligned left (true) or right (false) to the parent node. + */ + export interface LeftRightDataProvider extends yfiles.algorithms.DataProviderAdapter{ + /** + * Determines if the given node is "left" of its parent node. + * Left is considered as + * a lower x coordinate when the alignment of the nodes is vertical (north or south) and + * a lower y coordinate when the alignment of the nodes is horizontal (east or west). + * @param {Object} dataHolder a node to check the placement to its parent node. + * @return {boolean} true if the given node is left of its parent node. + * @see Overrides {@link yfiles.algorithms.DataProviderAdapter#getBool} + * @see Specified by {@link yfiles.algorithms.IDataProvider#getBool}. + */ + getBool(dataHolder:Object):boolean; + } + } + var LeftRightPlacer:{ + $class:yfiles.lang.Class; + /** + * Key which can be used to register a data provider that tells the node + * placer whether the node shall be placed on the left or right side. + * If no provider is specified, the nodes will be placed alternating from + * left to right. + * The provider should return true if the node shall be placed on the left + * side. + */ + LEFT_RIGHT_DP_KEY:Object; + /** + * Creates a LeftRightPlacer with the default modificationMatrix. + */ + new ():yfiles.tree.LeftRightPlacer; + /** + * Creates a LeftRightPlacer with the given modificationMatrix. + */ + WithMatrix:{ + new (modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix):yfiles.tree.LeftRightPlacer; + }; + LeftRightDataProvider:{ + $class:yfiles.lang.Class; + /** + * Constructs a new data provider for the LeftRightPlacer. + * The nodePlacerMap is a reference to the map where the node placer for each node in the graph is stored. + * The node placer of a node holds its modification matrix which can be used to determine + * the alignment of the node to its parent (if its "left"). + */ + new (nodePlacerMap:yfiles.algorithms.IDataProvider):yfiles.tree.LeftRightPlacer; + }; + }; + /** + * This class is used by {@link yfiles.tree.GenericTreeLayouter} to determine the desired + * layout of nodes that constitute a multi-parent structure. + * All nodes of such a structure are placed side by side and the incident + * edges are routed over common points for incoming edges and for outgoing edges. + * @see {@link yfiles.tree.GenericTreeLayouter#MULTI_PARENT_DESCRIPTOR_DP_KEY} + */ + export interface MultiParentDescriptor extends Object{ + /** + * The minimum distance between two nodes belonging to the same multi-parent structure. + */ + minimumNodeDistance:number; + /** + * The minimum distance between the nodes of a multi-parent structure and the bus connecting these nodes. + * In case the edges style is not orthogonal the bus only consists of a common point. + */ + minimumBusDistance:number; + /** + * The relative vertical alignment of nodes belonging to the same multi-parent structure. + * A value of 0 + * means nodes are top aligned; a value of 1 means nodes are bottom aligned; a value of 0.5 + * means nodes are center aligned. Values outside the interval [0,1] will result in a compact node + * placement with unaligned nodes. + *

By default the compact placement with unaligned nodes is used.

+ */ + verticalAlignment:number; + /** + * The routing style for edges that connect to nodes that constitute a multi-parent structure. + * The routing style is applied only to the part of the edge route that is not shared. + */ + edgeStyle:yfiles.tree.MultiParentRoutingStyle; + } + var MultiParentDescriptor:{ + $class:yfiles.lang.Class; + new ():yfiles.tree.MultiParentDescriptor; + }; + /** + * This implementation can be used to "place" leafs. + * It only routes the first incoming edge. + */ + export interface LeafPlacer extends Object,yfiles.tree.INodePlacer{ + /** + * Creates an optional Processor for pre- and post-processing. + * @param {yfiles.tree.GenericTreeLayouter} layouter + * @param {yfiles.layout.LayoutGraph} graph the actual graph + * @param {yfiles.algorithms.Node} currentRoot the actual root node for this node placer + * @return {yfiles.tree.IProcessor} a Processor or null + * @see Specified by {@link yfiles.tree.INodePlacer#createProcessor}. + */ + createProcessor(layouter:yfiles.tree.GenericTreeLayouter,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + /** + * This method is called by GenericTreeLayouter before the subtree shapes of + * this local root node's children are calculated. + * This method must provide for each child node a byte constant indicating + * the preferred direction of the connector to the subtree shape. + * @param {yfiles.algorithms.Node} localRoot + * the local root node whose child nodes will be provided with + * a byte constant indicating the direction of the connector + * @param {yfiles.algorithms.IDataMap} connectorMap + * the map that should be used for storing the byte constant + * with the child nodes. + * @see Specified by {@link yfiles.tree.INodePlacer#determineChildConnectors}. + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; + /** + * The main method of the tree layout algorithm. + * This method arranges the + * SubtreeShapes and the shape of the local root, routes the edges to the + * SubtreeShapes, calculates the resulting SubtreeShape and returns it. + * @param {yfiles.algorithms.IDataProvider} nodeShapeProvider + * this instance can be used to obtain an initial shape + * of the root node. This shape can then be merged with all the subtrees' shapes + * and finally be returned by this method. + * @param {yfiles.algorithms.IDataProvider} subtreeShapeProvider + * provides access to the pre-calculated shapes of + * the subtrees. It is guaranteed that at the time of the invocation of this + * method for every child node the subtree shape has already been calculated + * @param {yfiles.layout.LayoutGraph} graph the graph which is to be laid out + * @param {yfiles.algorithms.Node} localRoot the root of the subtree that should be laid out by this method + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection + * the direction byte constant as it is defined + * in this interface, that must be used for initializing the connector of the + * localRoot node to the parent node of the localRoot node + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} the shape of the whole subtree + * @see Specified by {@link yfiles.tree.INodePlacer#placeSubtree}. + */ + placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.GenericTreeLayouter.SubtreeShape; + } + var LeafPlacer:{ + $class:yfiles.lang.Class; + }; + /** + * This interface is used by {@link yfiles.tree.GenericTreeLayouter}. + * Classes implementing + * this interface are responsible for the assignment of the edges' ports. + * {@link yfiles.tree.INodePlacer} instances will have to obey the currently set ports. + */ + export interface IPortAssignment extends Object{ + /** + * Called by {@link yfiles.tree.GenericTreeLayouter} before the actual layout + * of the graph takes place. + * This method assigns both the single + * incoming edge's target port as well as all source ports for all + * outgoing child edges. Note that at the time this method gets invoked, + * GenericTreeLayouter may have reversed some edges in order to normalize the + * tree structure. + * @param {yfiles.layout.LayoutGraph} graph the graph instance the node is part of + * @param {yfiles.algorithms.Node} node the node whose adjacent edges' ports should be set + * @see Specified by {@link yfiles.tree.IPortAssignment#assignPorts}. + */ + assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; + } + var IPortAssignment:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * A processor is the possibility for each NodePlacer to prepare (and clean up) the graph for its children. + * It is created within {@link yfiles.tree.INodePlacer#createProcessor} and called by the + * GenericTreeLayouter at specific positions of the life-cycle. + * The processor may change the values within the DataMaps for its children. + */ + export interface IProcessor extends Object{ + /** + * This method is called before the NodePlacers are called recursively. + * A NodePlacer may change different + * settings within this method. This can be used to specify values for its children, manipulate the graph structure + * or do anything else that needs to be done. + * But only changes for the descendants of current root are allowed. + * @param {yfiles.algorithms.IDataMap} nodePlacerDataProvider + * @param {yfiles.algorithms.IDataMap} portAssignmentDataProvider + * @param {yfiles.algorithms.IDataMap} childComparatorProvider + * @see Specified by {@link yfiles.tree.IProcessor#preProcess}. + */ + preProcess(nodePlacerDataProvider:yfiles.algorithms.IDataMap,portAssignmentDataProvider:yfiles.algorithms.IDataMap,childComparatorProvider:yfiles.algorithms.IDataMap):void; + /** + * This method is called from the GenericTreeLayouter after the layout has finished. + * It can be used for + * cleanup tasks. + * E.g. changes on the graph structure that have been made in {@link yfiles.tree.IProcessor#preProcess} + * can be undone here. + * @see Specified by {@link yfiles.tree.IProcessor#postProcess}. + */ + postProcess():void; + } + var IProcessor:{ + $class:yfiles.lang.Class; + isInstance(o:Object):boolean; + }; + /** + * This NodePlacer calculates and respects layers. + *

+ * Warning: Changing the orientation within the LayeredNodePlacers will + * result in dubious problems. + *

+ */ + export interface LayeredNodePlacer extends yfiles.tree.AbstractRotatableNodePlacer{ + dendrogramStyle:boolean; + /** + * This method must be implemented by subclasses. + * It is used to assigns a connector shape direction to each child. + * @param {yfiles.algorithms.Node} child the child node + * @return {yfiles.tree.ParentConnectorDirection} + * a byte constant as defined in the {@link yfiles.tree.INodePlacer} interface + */ + determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; + /** + * This method must be implemented by subclasses. + * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction of the connector shape + * @return {yfiles.tree.SubtreeShapeRotated} a SubtreeShape instance that describes the shape of the whole subtree + */ + placeSubtreeWithDirection(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShapeRotated; + /** + * Creates an processor that distributes the LayerRoot. + * @param {yfiles.layout.LayoutGraph} graph the actual graph + * @param {yfiles.algorithms.Node} currentRoot the actual root node for this node placer + * @return {yfiles.tree.IProcessor} a Processor or null + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#createProcessor} + * @see Specified by {@link yfiles.tree.INodePlacer#createProcessor}. + */ + createProcessor(layouter:yfiles.tree.GenericTreeLayouter,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + /** + * The alignment strategy for the tree's root node. + */ + rootAlignment:yfiles.tree.AbstractRotatableNodePlacer.RootAlignment; + /** + * The relative vertical alignment of nodes within their respective + * layers. + * A value of 0 means nodes are top aligned; + * a value of 1 means nodes are bottom aligned. + *

+ * Defaults to 0.5, i.e. nodes are center aligned. + *

+ */ + verticalAlignment:number; + /** + * The ID. + * The ID is used to identify LayeredNodePlacers that share information about their height. Using + * different IDs offers aligned layouts within different subtrees. + */ + id:Object; + /** + * The spacing between two layers. + */ + layerSpacing:number; + /** + * The routing style. + * The possible values are:
  • {@link yfiles.tree.LayeredRoutingStyle#ORTHOGONAL}
  • {@link yfiles.tree.LayeredRoutingStyle#PLAIN}
+ */ + routingStyle:yfiles.tree.LayeredRoutingStyle; + /** + * The vertical bus alignment for orthogonally routed edge buses. + * The bus alignment determines the relative position of an edge bus in + * between two subsequent layers of nodes. + * A value of 0 places the bus at the top right below the parent node; + * a value of 0.5 places the bus in the middle between parent and child nodes; and + * a value of 1 places the bus at the bottom right above the child nodes. + *

+ * Defaults to 0.3. + *

+ */ + busAlignment:number; + /** + * Specifies whether polyline labeling is used. + *

If set to true, the poly line connectors between the + * parent and its children are added to the shape. Labels (of nodes and edges) will not cut them.

+ */ + polylineLabelingEnabled:boolean; + } + var LayeredNodePlacer:{ + $class:yfiles.lang.Class; + /** + * Default constructor. + * Instantiates a new instance with the given modification matrix. + * @param {yfiles.tree.AbstractRotatableNodePlacer.Matrix} modificationMatrix the translation for the NodePlacer + */ + WithMatrixAndId:{ + new (modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix,id:Object):yfiles.tree.LayeredNodePlacer; + }; + new ():yfiles.tree.LayeredNodePlacer; + }; + /** + * This class implements the basis of a generic tree layout algorithm. + * It can be customized easily to control the + * placement and order of child nodes, the edge routing and port assignment on a per node basis. + * Using {@link yfiles.algorithms.IDataProvider}s, one can specify objects that implement the {@link yfiles.tree.INodePlacer} interface. Those instances are + * responsible for the arrangement of the subtrees of the node's they are registered with and the routing of the + * connecting edges. + * Likewise instances of {@link yfiles.tree.IPortAssignment} are responsible for the assignment of the ports + * and {@link yfiles.objectcollections.IComparer} instances can be used to sort the outgoing edges of each node. + * Customization of this + * class should be done via own implementations of the {@link yfiles.tree.INodePlacer}, possibly {@link yfiles.tree.IPortAssignment}, and {@link yfiles.objectcollections.IComparer} instances. + * Here is an example output that shows multiple different configurations in one layout using {@link yfiles.tree.DefaultNodePlacer} + * instances: + *
+ * @see {@link yfiles.tree.INodePlacer} + * @see {@link yfiles.tree.DefaultNodePlacer} + * @see {@link yfiles.tree.IPortAssignment} + * @see {@link yfiles.tree.DefaultPortAssignment} + */ + export interface GenericTreeLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * the graph this layout is running on. + */ + graph:yfiles.layout.LayoutGraph; + /** + * True if grouping support is enabled. + * Note that the grouping only works correctly, if each group represents a complete subtree. + * This means that for each group there is a node v such that the group contains exactly v and all its descendants. + */ + groupingSupported:boolean; + /** + * Subclasses have to provide information whether or not they + * can layout the given graph. + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Subclasses have to provide core layout code in this method. + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * Provides access to the SubTreeShape instances for each node. + * Those instances should be modified only during the + * layout of the parent node. + * @param {yfiles.algorithms.Node} localRoot the node for which the subtree should be returned + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} the SubTreeShape instance if it has been calculated already or null otherwise + */ + getSubtreeShape(localRoot:yfiles.algorithms.Node):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * This is the core method of the algorithm. + * This method is invoked for each node in the tree exactly once in such an + * order that all of the child nodes of each node have already been calculated by the time of the method invocation. + * This method uses the {@link yfiles.tree.GenericTreeLayouter#getSubtreeShape} callback to retrieve the shapes of the subtrees of all + * of the children of localRoot. + * @param {yfiles.algorithms.Node} localRoot The root to be laid out together with its SubtreeShapes + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} the combined SubtreeShape of the local root node and all of its children and connecting edges + */ + layoutRoot(localRoot:yfiles.algorithms.Node):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * This method returns a {@link yfiles.tree.IPortAssignment} instance that will be used for the port assignments at the given Node. + * This method is allowed to return a shared instance for multiple different nodes, the instances are not used after + * subsequent calls to this method. + * @param {yfiles.algorithms.Node} localRoot the root of the local subtree + * @return {yfiles.tree.IPortAssignment} + * a readily configured instance of {@link yfiles.tree.IPortAssignment} that can be used to assign the ports of the edges + * at the given local root node. + */ + getPortAssignment(localRoot:yfiles.algorithms.Node):yfiles.tree.IPortAssignment; + /** + * This method returns a {@link yfiles.objectcollections.IComparer} instance or null that will be used for the sorting of the + * outgoing edges at the given Node. + * This method is allowed to return a shared instance for multiple different nodes, + * the instances are not used after subsequent calls to this method. + * @param {yfiles.algorithms.Node} localRoot the root of the local subtree + * @return {yfiles.objectcollections.IComparer} + * a readily configured instance of {@link yfiles.objectcollections.IComparer} or null that can be used sort the outgoing + * edges of the given node + */ + getChildNodeInEdgeComparator(localRoot:yfiles.algorithms.Node):yfiles.objectcollections.IComparer; + /** + * This method returns a {@link yfiles.tree.INodePlacer} instance that will be used for the placement of the root node and the + * subtree shapes. + * This method is allowed to return a shared instance for multiple different nodes, the instances are + * not used after subsequent calls to this method. + * @param {yfiles.algorithms.Node} localRoot the root of the local subtree + * @return {yfiles.tree.INodePlacer} + * a readily configured instance of {@link yfiles.tree.INodePlacer} that can be used to layout the subtree under the given + * local root node. + */ + getNodePlacer(localRoot:yfiles.algorithms.Node):yfiles.tree.INodePlacer; + /** + * Factory method that creates a SubtreeShape for a given node, that consists of the bounds of the node only. + * @param {yfiles.algorithms.Node} node the node that will be represented by a SubTreeShape instance + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} a newly created SubtreeShape describing the bounds of the given node + */ + getNodeShape(node:yfiles.algorithms.Node):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * Returns the array of the nodes to be laid out. + * The order of the elements is chosen so that no parent is laid out + * before one of its successors. + * @param {yfiles.algorithms.Node} root the node that should be used as the root of the tree + * @return {yfiles.algorithms.Node[]} all nodes in the graph that should be laid out in order + */ + getRootsArray(root:yfiles.algorithms.Node):yfiles.algorithms.Node[]; + /** + * This method is called initially with the graph to calculate a rooted tree. + * It returns a list of edges that have to + * be reversed in order for the graph to become a valid rooted and directed tree. + * @return {yfiles.algorithms.EdgeList} an EdgeList containing all the edges that need to be reversed + */ + directTree():yfiles.algorithms.EdgeList; + /** + * A{@link yfiles.algorithms.IDataAcceptor} implementation + * that can be used to overwrite the source port constraint ({@link yfiles.layout.PortConstraint} + * temporarily for use during the layout. + */ + sourcePortConstraintDataAcceptor:yfiles.algorithms.IDataAcceptor; + /** + * A{@link yfiles.algorithms.IDataAcceptor} implementation + * that can be used to overwrite the target port constraint ({@link yfiles.layout.PortConstraint} + * temporarily for use during the layout. + */ + targetPortConstraintDataAcceptor:yfiles.algorithms.IDataAcceptor; + /** + * A{@link yfiles.algorithms.IDataAcceptor} implementation that can be used to overwrite edge grouping at source temporarily + * for use during the layout. + * @see {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} + */ + sourceGroupDataAcceptor:yfiles.algorithms.IDataAcceptor; + /** + * A{@link yfiles.algorithms.IDataAcceptor} implementation that can be used to overwrite edge grouping at target temporarily + * for use during the layout. + * @see {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} + */ + targetGroupDataAcceptor:yfiles.algorithms.IDataAcceptor; + /** + * This method is used for the actual reversal of edges. + * It will be called initially after the {@link yfiles.tree.GenericTreeLayouter#directTree} method and finally + * after the layout has been calculated. + * @param {yfiles.algorithms.EdgeList} reversedEdges the edges that will be reversed by this method + */ + reverseEdges(reversedEdges:yfiles.algorithms.EdgeList):void; + /** + * The default{@link yfiles.tree.INodePlacer} instance that will be used for those subtrees, that don't have their own + * specific instance set via the appropriate DataProvider. + * This should be non-null, unless it is + * guaranteed that for any node in the graph there is a specific instance provided by the registered DataProvider + * instance. + */ + defaultNodePlacer:yfiles.tree.INodePlacer; + /** + * The default{@link yfiles.tree.INodePlacer} instance that will be used for the leaf nodes of the tree. + */ + defaultLeafPlacer:yfiles.tree.INodePlacer; + /** + * The default{@link yfiles.tree.IPortAssignment} instance that will be used for those subtrees, that don't have their + * own specific instance set via the appropriate DataProvider. + * This should be non-null, unless it is + * guaranteed that for any node in the graph there is a specific instance provided by the registered DataProvider + * instance. + */ + defaultPortAssignment:yfiles.tree.IPortAssignment; + /** + * The default{@link yfiles.objectcollections.IComparer} instance or null that will be used for those subtrees, that + * don't have their own specific instance set via the appropriate DataProvider. + * This can be set to null which implies no + * sorting by default. + */ + defaultChildComparator:yfiles.objectcollections.IComparer; + /** + * Specifies whether integrated node labeling is enabled (extension of the + * shapes of the nodes with its labels). + * If set to true, the shape of the nodes will be extended with + * the shapes of its labels. + */ + integratedNodeLabeling:boolean; + /** + * Specifies whether integrated edge labeling is enabled (extension of the + * shapes of subtrees with the labels of the edges). + */ + integratedEdgeLabeling:boolean; + /** + * Determines whether or not multi-parent structures are allowed for this tree layout. + *

+ * If multi-parent structures are allowed, the directed input graph may contain structures of multiple + * nodes that share the same predecessors + * as well as the same successors. All nodes belonging to such a structure are placed side by side and the incident + * edges are routed in a bus-style. + *

+ *

+ * Note that if the input graph contains groups, all nodes belonging to the same multi-parent structure must + * be associated with the same group node, i.e., it is not possible to assign these nodes to different group nodes. + *

+ *

+ * By default multi-parent structures are not allowed. + *

+ *

+ * As for the different ways in which the {@link yfiles.tree.INodePlacer}s route their edges, multi-parent structures only work + * for some NodePlacers: + *

    + *
  • + * {@link yfiles.tree.DefaultNodePlacer} delivers the best results for multi-parents. However, routing style + * {@link yfiles.tree.RoutingStyle#FORK_AT_ROOT} as well as root alignments + * {@link yfiles.tree.RootAlignment#LEADING_ON_BUS} and + * {@link yfiles.tree.RootAlignment#TRAILING_ON_BUS} are not supported. + *
  • + *
  • + * {@link yfiles.tree.DendrogramPlacer} fully supports multi-parents. + *
  • + *
  • + * {@link yfiles.tree.BusPlacer} supports multi-parents. + *
  • + *
  • + * {@link yfiles.tree.LeftRightPlacer} supports multi-parents. + *
  • + *
+ *

+ */ + multiParentAllowed:boolean; + } + export module GenericTreeLayouter{ + /** + * Instances of this class are used to represent the shape of subtrees during the layout. + */ + export interface SubtreeShape extends Object{ + /** + * Yields the bounds of the {@link yfiles.layout.INodeLayout} of the root node. + */ + coreBounds:yfiles.algorithms.Rectangle2D.Double; + /** + * The current bounds of this SubtreeShape. + */ + bounds:yfiles.algorithms.Rectangle2D; + /** + * The current x coordinate of the connection point where the layout algorithm should connect the ingoing + * edge to. + */ + connectorX:number; + /** + * The current y coordinate of the connection point where the layout algorithm should connect the ingoing + * edge to. + */ + connectorY:number; + /** + * Adds the line segments of the connector shape to the bounds and borderlines of this SubTreeShape. + */ + updateConnectorShape():void; + /** + * Adds another point to the connecting edge (away from the target node). + * @param {number} x the current x coordinate of the point + * @param {number} y the current x coordinate of the point + */ + addTargetPoint(x:number,y:number):void; + /** + * Helper method that takes all edge segments of the given Edge instance and updates the shape bounds with that + * information. + * @param {yfiles.layout.LayoutGraph} lg the LayoutGraph that contains the edge + * @param {yfiles.algorithms.Edge} e the edge whose path will be used to update the shape + */ + addEdgeSegments(lg:yfiles.layout.LayoutGraph,e:yfiles.algorithms.Edge):void; + /** + * Appends all target points that have previously been added to this shape to the given EdgeLayout instance. + * Used by + * NodePlacer instances for the final edge connections. + * @param {yfiles.layout.IEdgeLayout} el the EdgeLayout that will be modified + */ + appendTargetPoints(el:yfiles.layout.IEdgeLayout):void; + /** + * The direction byte constant as defined in this class, that indicates the direction of the last connecting + * edge segment. + */ + connectorDirection:yfiles.tree.ConnectorDirection; + /** + * Convenience method that updates the shape to respect the given line segment. + */ + addLineSegment(x1:number,y1:number,x2:number,y2:number):void; + /** + * Adds a rectangular shape to the current shape. + */ + addBoundsToShape(x:number,y:number,width:number,height:number):void; + /** + * Merges the given SubtreeShape with this shape's bounds. + * @param {yfiles.tree.GenericTreeLayouter.SubtreeShape} other the shape to be merged with this shape + */ + mergeWith(other:yfiles.tree.GenericTreeLayouter.SubtreeShape):void; + /** + * The current minimal x coordinate of this shape. + */ + minX:number; + /** + * The current minimal y coordinate of this shape. + */ + minY:number; + /** + * The current maximum x coordinate of this shape. + */ + maxX:number; + /** + * The current maximum y coordinate of this shape. + */ + maxY:number; + /** + * Returns the BorderLine instance for the given direction. + * @param {number} index + * the direction index where + * {@link yfiles.tree.BorderlineSide#NORTH} is north, + * {@link yfiles.tree.BorderlineSide#EAST} is east, + * {@link yfiles.tree.BorderlineSide#SOUTH} is south, and + * {@link yfiles.tree.BorderlineSide#WEST} is west. + * @return {yfiles.algorithms.BorderLine} + * the current {@link yfiles.algorithms.BorderLine} instance + */ + getBorderLine(index:number):yfiles.algorithms.BorderLine; + /** + * Moves this shape and its connector by the given offsets. + * This is a cheap operation and does not depend on the + * size or complexity of the shape or connector. + * @param {number} dx the delta x offset this shape will be moved by + * @param {number} dy the delta y offset this shape will be moved by + */ + move(dx:number,dy:number):void; + /** + * The current x coordinate of the origin of this shape. + * The origin is defined as the upper left corner of + * the NodeLayout of the local root of this shape. + */ + originX:number; + /** + * The current y coordinate of the origin of this shape. + * The origin is defined as the upper left corner of + * the NodeLayout of the local root of this shape. + */ + originY:number; + /** + * Creates a clone of this instance, modifying it using the provided matrix. + */ + createCopy(matrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * Copies this instance to another shape, applying a modification matrix. + */ + assignValuesTo(toShape:yfiles.tree.GenericTreeLayouter.SubtreeShape,modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix):void; + toString():string; + } + } + var GenericTreeLayouter:{ + $class:yfiles.lang.Class; + /** + * DataProvider key that can be registered with the graph to provide each node with its own {@link yfiles.tree.INodePlacer} + * instance. + */ + NODE_PLACER_DP_KEY:Object; + /** + * DataProvider key that can be registered with the graph to provide each node with its own {@link yfiles.tree.IPortAssignment} + * instance. + */ + PORT_ASSIGNMENT_DP_KEY:Object; + /** + * DataProvider key that can be registered with the graph to provide each node with its own {@link yfiles.objectcollections.IComparer} + * instance that will be used to sort its outgoing edges. + */ + CHILD_COMPARATOR_DP_KEY:Object; + /** + * {@link yfiles.algorithms.IDataProvider} key used to store the priority (integer values) for "critical" edges. + * The layouter tries to align each node pair that is connected by a critical edge (integer value > 0). + * This feature can for example be utilized to highlight different edge paths that are relevant for a user. Conflicts + * between different critical edges are always resolved in favor of the higher priority. + *

+ * Critical edges will always align the centers of source and target node, thus replace the current root alignment + * of the {@link yfiles.tree.INodePlacer}. + *

+ *

+ * Note that the critical edge may not be straight if subtrees are rotated or port constraints are assigned. + *

+ *

+ * This feature is only supported by the following NodePlacers: + *

    + *
  • {@link yfiles.tree.DefaultNodePlacer}
  • + *
  • {@link yfiles.tree.SimpleNodePlacer}
  • + *
  • {@link yfiles.tree.LayeredNodePlacer}
  • + *
  • {@link yfiles.tree.DoubleLinePlacer}
  • + *
  • {@link yfiles.tree.DendrogramPlacer}
  • + *
+ *

+ */ + CRITICAL_EDGE_DP_KEY:Object; + /** + * {@link yfiles.algorithms.IDataProvider} key used to retrieve {@link yfiles.tree.MultiParentDescriptor} + * instances for each node that belongs to a multi-parent structure. + * The returned descriptor affects the layout of the multi-parent structure. + *

+ * Note that this key is only considered if multi-parent structures are allowed, + * see {@link yfiles.tree.GenericTreeLayouter#multiParentAllowed}. Furthermore, all nodes belonging to the same multi-parent + * structure should return the same descriptor. + *

+ * @see {@link yfiles.tree.GenericTreeLayouter#multiParentAllowed} + */ + MULTI_PARENT_DESCRIPTOR_DP_KEY:Object; + /** + * Creates a new GenericTreeLayouter with a default {@link yfiles.tree.INodePlacer}, a default {@link yfiles.tree.IPortAssignment} instance and + * no default edge comparator. + */ + new ():yfiles.tree.GenericTreeLayouter; + }; + /** + * This class is used by {@link yfiles.tree.GenericTreeLayouter} and implements a + * sophisticated {@link yfiles.tree.INodePlacer}. + * Subtrees are placed so that the overall + * subtree layout's aspect ratio will be close to a given aspect ratio. + */ + export interface ARNodePlacer extends yfiles.tree.AbstractNodePlacer,yfiles.tree.IFromSketchNodePlacer{ + /** + * This method must be implemented by subclasses. + * It assigns a connector shape + * direction to each child. + * @param {yfiles.algorithms.Node} child the child node + * @return {number} + * a byte constant as defined in the {@link yfiles.tree.INodePlacer} interface + */ + determineChildConnector(child:yfiles.algorithms.Node):number; + /** + * The main placeSubtree method that must be implemented by subclasses. + * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction of the connector shape + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} a SubtreeShape instance that describes the shape of the whole subtree + */ + placeSubtreeImpl(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * Specifies whether this instance is configured to create horizontal + * rows of child nodes. + */ + horizontal:boolean; + /** + * The vertical distance this NodePlacer should use for the + * arrangement of the elements. + */ + verticalDistance:number; + /** + * The horizontal distance this NodePlacer should use for the + * arrangement of the elements. + */ + horizontalDistance:number; + /** + * The preferred aspect ratio. + */ + aspectRatio:number; + /** + * The fill style. + * The byte constant defines how nodes should + * be distributed within their lanes. + */ + fillStyle:yfiles.tree.FillStyle; + /** + * Creates a comparator for edges. + * This comparator is used to sort the outgoing edges of a node before the + * placement of the node's subtree is calculated. + * @return {yfiles.objectcollections.IComparer} a comparator for edges. + * @see Specified by {@link yfiles.tree.IFromSketchNodePlacer#createFromSketchComparator}. + */ + createFromSketchComparator():yfiles.objectcollections.IComparer; + } + var ARNodePlacer:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of ARNodePlacer with default orientation (vertical), + * aspect ratio (1.0d), fill style ({@link yfiles.tree.FillStyle#LEADING}), + * and default distances (40.0d). + */ + new ():yfiles.tree.ARNodePlacer; + /** + * Creates a new instance of ARNodePlacer with given orientation + * and distances. + * @param {boolean} horizontal true for horizontal row mode + * @param {number} horizontalDistance horizontal distance between adjacent elements + * @param {number} verticalDistance vertical distance between adjacent elements + * @param {number} aspectRatio the aspectRatio, this instance should try to obey + * @param {yfiles.tree.FillStyle} fillStyle a fill style constant describing the node distribution + */ + WithOrientationAndAspectRatio:{ + new (horizontal:boolean,aspectRatio:number,fillStyle:yfiles.tree.FillStyle,horizontalDistance:number,verticalDistance:number):yfiles.tree.ARNodePlacer; + }; + }; + /** + * This tree layouter tries to generate compact tree layouts with a certain aspect + * ratio. + * The ratio can be specified for each subtree. + * Here is a sample layout output (using an aspect ratio of 1 by 2) + *
+ */ + export interface ARTreeLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + graph:yfiles.layout.LayoutGraph; + /** + * The horizontal distance between adjacent nodes. + * By default a value of 10 is set. + */ + horizontalSpace:number; + /** + * The vertical distance between adjacent nodes. + * By default a value of 10 is set. + */ + verticalSpace:number; + /** + * Core layout routine. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * The core layouter can layout trees. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Returns the aspectRatio that should be used for the subtree starting + * at the given node. + */ + getAspectRatio(v:yfiles.algorithms.Node):number; + getSuccessors(localRoot:yfiles.algorithms.Node):yfiles.algorithms.INodeCursor; + /** + * The{@link yfiles.objectcollections.IComparer} that will be used + * to sort the {@link yfiles.algorithms.Node#sortOutEdges outgoing edges} + * of each local root in the tree before they are being arranged. + * Note that the algorithm will only use the order induced by the comparator, + * if the nodes (or better their whole subtrees) have equal size. + * The default value is null which indicates that the algorithm should + * use its built-in logic, only. + */ + comparator:yfiles.objectcollections.IComparer; + createBends(el:yfiles.layout.IEdgeLayout,root:yfiles.algorithms.Node,child:yfiles.algorithms.Node,rootPlacement:Object,routingPolicy:Object):void; + /** + * Returns the routing policy used by this ARTreeLayouter for + * the given subtree root. + * Should be one of + *
    + *
  • {@link yfiles.tree.ARTreeLayouter#ROUTING_HORIZONTAL}
  • + *
  • {@link yfiles.tree.ARTreeLayouter#ROUTING_VERTICAL}
  • + *
+ * @param {Object} root the subtree root. + * @return {Object} the routing policy used for the given subtree root. + */ + getRoutingPolicy(root:Object):Object; + /** + * Returns the desired placement for the given subtree root. + * Should be one of + *
    + *
  • {@link yfiles.tree.ARTreeLayouter#PLACEMENT_TOP}
  • + *
  • {@link yfiles.tree.ARTreeLayouter#PLACEMENT_CORNER}
  • + *
  • {@link yfiles.tree.ARTreeLayouter#PLACEMENT_CORNER_SIDE}
  • + *
  • {@link yfiles.tree.ARTreeLayouter#PLACEMENT_CORNER_TOP}
  • + *
+ * @param {Object} root the subtree root. + * @return {Object} + * a symbolic constant representing the desired placement for the + * given subtree root. + */ + getRootPlacement(root:Object):Object; + /** + * The preferred aspect ratio for this ARTreeLayouter. + */ + aspectRatio:number; + /** + * The desired placement of the tree's root node. + * Should be one of + *
    + *
  • {@link yfiles.tree.ARTreeLayouter#PLACEMENT_TOP}
  • + *
  • {@link yfiles.tree.ARTreeLayouter#PLACEMENT_CORNER}
  • + *
  • {@link yfiles.tree.ARTreeLayouter#PLACEMENT_CORNER_SIDE}
  • + *
  • {@link yfiles.tree.ARTreeLayouter#PLACEMENT_CORNER_TOP}
  • + *
+ * By default, PLACEMENT_CORNER is used. + */ + rootPlacement:Object; + /** + * The routing policy used by this ARTreeLayouter. + * Should be one of + *
    + *
  • {@link yfiles.tree.ARTreeLayouter#ROUTING_HORIZONTAL}
  • + *
  • {@link yfiles.tree.ARTreeLayouter#ROUTING_VERTICAL}
  • + *
+ */ + routingPolicy:Object; + /** + * The preferred distance between any two bends of an edge. + * Additionally, the preferred bend distance governs the distance between the + * first and last edges and the corresponding ports. + */ + bendDistance:number; + } + var ARTreeLayouter:{ + $class:yfiles.lang.Class; + /** + * The data provider key used to specify a target aspect ratio for each subtree individually. + *

+ * The aspect ratio needs to be greater than 0: + *

    + *
  • aspect ratio 1: width and height of the layout should be the same.
  • + *
  • aspect ratio between 0 and 1: layouts are higher than wide.
  • + *
  • aspect ratio larger than 1: layouts are wider than high.
  • + *
+ *

+ *

+ * If no specific ratio is defined for a subtree, the layouter uses the default + * {@link yfiles.tree.ARTreeLayouter#aspectRatio aspect ratio}. + *

+ */ + RATIO_DP_KEY:Object; + /** + * The data provider key used to specify the placement of each subtree root individually. + * If no root placement is specified for one of the subtree roots, the layouter uses the default + * {@link yfiles.tree.ARTreeLayouter#rootPlacement route placement}. + * @see {@link yfiles.tree.ARTreeLayouter#PLACEMENT_TOP} + * @see {@link yfiles.tree.ARTreeLayouter#PLACEMENT_CORNER} + * @see {@link yfiles.tree.ARTreeLayouter#PLACEMENT_CORNER_SIDE} + * @see {@link yfiles.tree.ARTreeLayouter#PLACEMENT_CORNER_TOP} + */ + ROOT_PLACEMENT_DP_KEY:Object; + /** + * A constant value to describe the placement of the root of a subtree. + * When this placement is used, a subtree's root + * is placed above its children in relation to the {@link yfiles.layout.CanonicMultiStageLayouter#layoutOrientation layout orientation}. + * @see {@link yfiles.tree.ARTreeLayouter#ROOT_PLACEMENT_DP_KEY} + */ + PLACEMENT_TOP:Object; + /** + * A constant value to describe the placement of the root of a subtree. + * When this placement is used, a subtree's root + * is placed in the upper left corner of the subtree bounds regarding the + * {@link yfiles.layout.CanonicMultiStageLayouter#layoutOrientation layout orientation}. + *

+ * If the root is placed entirely beside the subtree with no horizontal overlaps or entirely above the node + * without vertical overlaps will be determined by the layout of the subtree. The layouter tries minimize the bounds + * of the subtree. + *

+ * @see {@link yfiles.tree.ARTreeLayouter#ROOT_PLACEMENT_DP_KEY} + * @see {@link yfiles.tree.ARTreeLayouter#PLACEMENT_CORNER_TOP} + * @see {@link yfiles.tree.ARTreeLayouter#PLACEMENT_CORNER_SIDE} + */ + PLACEMENT_CORNER:Object; + /** + * A constant value to describe the placement of the root of a subtree. + * When this placement is used, a subtree's root + * is placed in the upper left corner of the subtree bounds regarding the + * {@link yfiles.layout.CanonicMultiStageLayouter#layoutOrientation layout orientation}. + *

+ * The root is placed entirely beside the subtree with no horizontal overlaps. This might by important if + * the root's height is very large while its width is small. + *

+ * @see {@link yfiles.tree.ARTreeLayouter#ROOT_PLACEMENT_DP_KEY} + */ + PLACEMENT_CORNER_SIDE:Object; + /** + * A constant value to describe the placement of the root of a subtree. + * When this placement is used, a subtree's root + * is placed in the upper left corner of the subtree bounds regarding the + * {@link yfiles.layout.CanonicMultiStageLayouter#layoutOrientation layout orientation}. + *

+ * The root is placed entirely above the subtree with no vertical overlaps. This might by important if the root's + * width is very large while its height is small. + *

+ * @see {@link yfiles.tree.ARTreeLayouter#ROOT_PLACEMENT_DP_KEY} + */ + PLACEMENT_CORNER_TOP:Object; + /** + * The data provider key used to specify the routing policy of each subtree root individually. + * The children in a subtree are arranged either horizontal or vertical. The edges are routed to the top of the child + * nodes or at the side, respectively. Directions depend on the + * {@link yfiles.layout.CanonicMultiStageLayouter#layoutOrientation layout orientation} and refer to {@link yfiles.layout.LayoutOrientation#TOP_TO_BOTTOM} in this + * case. + *

+ * If no specific routing policy is specified for a subtree root, the default + * {@link yfiles.tree.ARTreeLayouter#routingPolicy routing policy} is used. + *

+ * @see {@link yfiles.tree.ARTreeLayouter#ROUTING_HORIZONTAL} + * @see {@link yfiles.tree.ARTreeLayouter#ROUTING_VERTICAL} + */ + ROUTING_POLICY_DP_KEY:Object; + /** + * A constant value to describe the routing for each subtree root. + * When this routing is applied to a + * subtree, the children will be placed next to each other in direction of the + * {@link yfiles.layout.CanonicMultiStageLayouter#layoutOrientation layout orientation} with the edges connecting to in flow direction. + * @see {@link yfiles.tree.ARTreeLayouter#ROUTING_POLICY_DP_KEY} + */ + ROUTING_HORIZONTAL:Object; + /** + * A constant value to describe the routing for each subtree root. + * When this routing is applied to a + * subtree, the children will be placed above each other in direction of the + * {@link yfiles.layout.CanonicMultiStageLayouter#layoutOrientation layout orientation} with the edges connecting orthogonal to the flow + * direction. + * @see {@link yfiles.tree.ARTreeLayouter#ROUTING_POLICY_DP_KEY} + */ + ROUTING_VERTICAL:Object; + /** + * Initializes a new instance of the ARTreeLayouter class. + */ + new ():yfiles.tree.ARTreeLayouter; + }; + /** + * The assistant placer is a NodePlacer that delegates the node placement to two different node placers depending + * on the type of the children. + * The type of a child is recognized using a DataProvider providing boolean values. + * The data provider is registered + * using the key {@link yfiles.tree.AssistantPlacer#ASSISTANT_DP_KEY}. + * Assistant placer uses a {@link yfiles.tree.LeftRightPlacer} for those nodes the DataProvider returns true (they are + * understood as "assistants"). + * Below the assistants the other children are arranged using the childNodePlacer (settable + * using {@link yfiles.tree.AssistantPlacer#childNodePlacer}). + *

+ * Assistant placer provides the best results when using a port assignment that starts all edges at the same node. + * If the ports are distributed at the border, edge crossings may occur. + *

+ */ + export interface AssistantPlacer extends yfiles.tree.AbstractRotatableNodePlacer{ + /** + * This method must be implemented by subclasses. + * It is used to assigns a connector shape direction to each child. + * @param {yfiles.algorithms.Node} child the child node + * @return {yfiles.tree.ParentConnectorDirection} + * a byte constant as defined in the {@link yfiles.tree.INodePlacer} interface + */ + determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; + /** + * Delegates to the the left right placer. + * @param {yfiles.algorithms.Node} localRoot + * @param {yfiles.algorithms.IDataMap} connectorMap + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#determineChildConnectors} + * @see Specified by {@link yfiles.tree.INodePlacer#determineChildConnectors}. + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; + /** + * Returns the subtree shape for the given child node. + * @param {yfiles.algorithms.Node} node the child node the subtree shape is returned for. + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} the subtree shape for the given child node. + */ + getNodeShape(node:yfiles.algorithms.Node):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * Creates a processor that creates a dummy node and changes the edges for the non-assistant children. + * @param {yfiles.tree.GenericTreeLayouter} layouter + * @param {yfiles.layout.LayoutGraph} graph + * @param {yfiles.algorithms.Node} currentRoot + * @return {yfiles.tree.IProcessor} the processor that changes the graph structure suitable for the AssistantPlacer + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#createProcessor} + * @see Specified by {@link yfiles.tree.INodePlacer#createProcessor}. + */ + createProcessor(layouter:yfiles.tree.GenericTreeLayouter,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + /** + * The spacing between subtrees this NodePlacer is + * arranging. + */ + spacing:number; + /** + * Places the shapes. + * @param {yfiles.algorithms.IDataProvider} nodeShapeProvider + * @param {yfiles.algorithms.IDataProvider} subtreeShapeProvider + * @param {yfiles.layout.LayoutGraph} graph + * @param {yfiles.algorithms.Node} localRoot + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#placeSubtree} + * @see Specified by {@link yfiles.tree.INodePlacer#placeSubtree}. + */ + placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * This method must be implemented by subclasses. + * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction of the connector shape + * @return {yfiles.tree.SubtreeShapeRotated} a SubtreeShape instance that describes the shape of the whole subtree + */ + placeSubtreeWithDirection(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShapeRotated; + /** + * The child node placer for the non-assistant children. + * The child node placer is used to arrange the nodes that are not assistants. + * {@link yfiles.tree.AssistantPlacer#ASSISTANT_DP_KEY} + */ + childNodePlacer:yfiles.tree.INodePlacer; + /** + * Creates a comparator that compares edges of two assistant nodes with the + * comparator created by {@link yfiles.tree.LeftRightPlacer} and all other edges with + * the sketch comparator created by this placer's childNodePlacer. + * @return {yfiles.objectcollections.IComparer} a comparator to compare two edges. + * @see {@link yfiles.tree.AssistantPlacer#childNodePlacer} + * @see {@link yfiles.tree.IFromSketchNodePlacer#createFromSketchComparator} + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#createComparator} + */ + createComparator():yfiles.objectcollections.IComparer; + } + var AssistantPlacer:{ + $class:yfiles.lang.Class; + /** + * Contains a boolean for each node whether it is an assistant or not. + * True: Is assistant + * False: Is not an assistant + */ + ASSISTANT_DP_KEY:Object; + /** + * Creates a default instance with horizontal orientation. + * Call to this(Matrix.DEFAULT) + */ + new ():yfiles.tree.AssistantPlacer; + /** + * Creates an AssistantPlacer for the given modification matrix. + * @param {yfiles.tree.AbstractRotatableNodePlacer.Matrix} modificationMatrix the modification matrix that is used as translation matrix. + */ + WithMatrix:{ + new (modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix):yfiles.tree.AssistantPlacer; + }; + /** + * Creates a comparator that compares edges connecting to assistant nodes + * with the given assistantComparator and all other edges with + * the given childComparator. + * @param {yfiles.objectcollections.IComparer} assistantComparator the comparator for assistant edges + * @param {yfiles.objectcollections.IComparer} childComparator the comparator for non-assistants edges + * @return {yfiles.objectcollections.IComparer} + * a comparator that compares edges connecting to assistant nodes + * with the given assistantComparator and all other edges + * with the given childComparator. + */ + createCompoundComparator(assistantComparator:yfiles.objectcollections.IComparer,childComparator:yfiles.objectcollections.IComparer):yfiles.objectcollections.IComparer; + }; + /** + * This is an abstract base class for NodePlacers that supports rotations. + * "Supporting rotation" means that the NodePlacers only implement the default direction (e.g. + * bottom-down). + * The other directions are calculated using the modification matrix within the constructor. + * But take care! Using rotatable NodePlacers contains some pitfalls. Especially calculations must be aware of + * that. Especially operations on {@link yfiles.algorithms.BorderLine}s should not be called directly (e.g. mergeWithMin, mergeWithMax). + * Use the corresponding methods on AbstractRotatableNodePlacer instead. + */ + export interface AbstractRotatableNodePlacer extends Object,yfiles.tree.IFromSketchNodePlacer{ + /** + * The graph instance this class is working on. + */ + graphF:yfiles.layout.LayoutGraph; + /** + * The active modification matrix. + */ + modificationMatrixF:yfiles.tree.AbstractRotatableNodePlacer.Matrix; + /** + * The actual subtree shape provider. + */ + subtreeShapeProviderF:yfiles.algorithms.IDataProvider; + /** + * The actual node shape provider. + */ + nodeShapeProviderF:yfiles.algorithms.IDataProvider; + /** + * List containing the created children. + */ + createdChildrenF:yfiles.algorithms.IList; + /** + * Creates an optional Processor for pre- and post-processing. + * @param {yfiles.tree.GenericTreeLayouter} layouter + * @param {yfiles.layout.LayoutGraph} graph the actual graph + * @param {yfiles.algorithms.Node} currentRoot the actual root node for this node placer + * @return {yfiles.tree.IProcessor} a Processor or null + * @see Specified by {@link yfiles.tree.INodePlacer#createProcessor}. + */ + createProcessor(layouter:yfiles.tree.GenericTreeLayouter,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + /** + * Translates the absolute source point of the given edge to the "view coordinates" (translated by + * the modification matrix). + * @param {yfiles.algorithms.Edge} edge the source point for is returned + * @return {yfiles.algorithms.YPoint} the translated absolute source point for the given edge and the actual modification matrix + */ + getSourcePointAbs(edge:yfiles.algorithms.Edge):yfiles.algorithms.YPoint; + /** + * This method must be implemented by subclasses. + * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction of the connector shape + * @return {yfiles.tree.SubtreeShapeRotated} a SubtreeShape instance that describes the shape of the whole subtree + */ + placeSubtreeWithDirection(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShapeRotated; + /** + * Convenience method that queries the DataProvider for the shape of a single node as a SubtreeShape instance. + * This + * instance can be used to modify and return it in the main placeSubtree method. + * This method can only be called during the execution of {@link yfiles.tree.AbstractRotatableNodePlacer#placeSubtreeWithDirection} + * @param {yfiles.algorithms.Node} node the node whose shape will be returned in the form of a SubtreeShape instance + * @return {yfiles.tree.SubtreeShapeRotated} an instance that can be modified + */ + createRootNodeShape(node:yfiles.algorithms.Node):yfiles.tree.SubtreeShapeRotated; + /** + * Convenience method that queries the DataProvider for a SubtreeShape. + * This method can only be called during the execution of {@link yfiles.tree.AbstractRotatableNodePlacer#placeSubtreeWithDirection} + * @param {yfiles.algorithms.Node} node the root node whose subtree shape will be returned in the form of a SubtreeShape instance + * @return {yfiles.tree.SubtreeShapeRotated} an instance that can be modified + */ + createSubtreeShape(node:yfiles.algorithms.Node):yfiles.tree.SubtreeShapeRotated; + /** + * This method initializes internal data structures, then uses the abstract method {@link yfiles.tree.AbstractRotatableNodePlacer#determineChildConnector} + * to determine the child node connector directions. + * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.algorithms.IDataMap} connectorMap the map that will be used to store the values + * @see {@link yfiles.tree.AbstractRotatableNodePlacer#determineChildConnector} + * @see Specified by {@link yfiles.tree.INodePlacer#determineChildConnectors}. + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; + /** + * Lookup method to get the PortConstraint for the local root translated. + * @param {yfiles.algorithms.Node} localRoot the local root + * @return {yfiles.layout.PortConstraint} + * the PortConstraint for the local root. The PortConstraint is translated based on the + * actual modification matrix. + */ + getPortConstraint(localRoot:yfiles.algorithms.Node):yfiles.layout.PortConstraint; + /** + * Translates a modelDirectionModel into the "real" directionModel. + * @param {yfiles.tree.ParentConnectorDirection} modelDirection the model direction + * @return {number} the translated model direction + */ + translateDirectionToReal(modelDirection:yfiles.tree.ParentConnectorDirection):number; + /** + * Translates a "real" direction into a directionModel direction. + * @param {yfiles.tree.ParentConnectorDirection} realDirection the "real" direction + * @return {number} the translated direction + */ + translateDirectionToModel(realDirection:yfiles.tree.ParentConnectorDirection):number; + /** + * This method must be implemented by subclasses. + * It is used to assigns a connector shape direction to each child. + * @param {yfiles.algorithms.Node} child the child node + * @return {yfiles.tree.ParentConnectorDirection} + * a byte constant as defined in the {@link yfiles.tree.INodePlacer} interface + */ + determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; + /** + * This method initializes the local data structures and then delegates the work to the abstract variant. + * @see {@link yfiles.tree.AbstractRotatableNodePlacer#placeSubtreeWithDirection} + * @see Specified by {@link yfiles.tree.INodePlacer#placeSubtree}. + */ + placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * The actual modification matrix. + */ + modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix; + createComparator():yfiles.objectcollections.IComparer; + /** + * The spacing between subtrees this NodePlacer is + * arranging. + */ + spacing:number; + /** + * Creates a comparator for edges. + * This comparator is used to sort the outgoing edges of a node before the + * placement of the node's subtree is calculated. + * @return {yfiles.objectcollections.IComparer} a comparator for edges. + * @see Specified by {@link yfiles.tree.IFromSketchNodePlacer#createFromSketchComparator}. + */ + createFromSketchComparator():yfiles.objectcollections.IComparer; + } + export module AbstractRotatableNodePlacer{ + /** + * This class represents the horizontal alignment of the root node. + * There are several implementation that may be used: + *
    + *
  • {@link yfiles.tree.AbstractRotatableNodePlacer.RootAlignment#CENTER}: Placement in the center
  • + *
  • {@link yfiles.tree.AbstractRotatableNodePlacer.RootAlignment#CENTER_OVER_CHILDREN}: Placement in the center of the direct children
  • + *
  • {@link yfiles.tree.AbstractRotatableNodePlacer.RootAlignment#LEADING}: Placement on the left of the children.
  • + *
  • {@link yfiles.tree.AbstractRotatableNodePlacer.RootAlignment#TRAILING}: Placement on the right of the children
  • + *
  • {@link yfiles.tree.AbstractRotatableNodePlacer.RootAlignment#LEFT}: Left alignment of root and children
  • + *
  • {@link yfiles.tree.AbstractRotatableNodePlacer.RootAlignment#RIGHT}: Right alignment of root and children
  • + *
+ */ + export interface RootAlignment extends Object{ + /** + * This method moves the rootShape to the right position relative to the children's shapes. + * The movement should + * only be done on the X-axis (horizontally). + * @param {yfiles.tree.SubtreeShapeRotated} rootShape the shape of the root node that is moved + * @param {yfiles.algorithms.IList} shapes list of shapes of the children nodes + * @param {yfiles.algorithms.Rectangle2D} shapeBounds accumulated shapes of all children's shapes + * @param {number} spacing the spacing that should be used. + */ + placeParentHorizontal(rootShape:yfiles.tree.SubtreeShapeRotated,shapes:yfiles.algorithms.IList,shapeBounds:yfiles.algorithms.Rectangle2D,spacing:number):void; + } + /** + * Instances of this class may be used to configure the {@link yfiles.tree.AbstractRotatableNodePlacer}. + * The possible transformations are: + *
    + *
  • {@link yfiles.tree.AbstractRotatableNodePlacer.Matrix#DEFAULT}
  • + *
  • {@link yfiles.tree.AbstractRotatableNodePlacer.Matrix#ROT90}
  • + *
  • {@link yfiles.tree.AbstractRotatableNodePlacer.Matrix#ROT180}
  • + *
  • {@link yfiles.tree.AbstractRotatableNodePlacer.Matrix#ROT270}
  • + *
  • {@link yfiles.tree.AbstractRotatableNodePlacer.Matrix#MIR_HOR}
  • + *
  • {@link yfiles.tree.AbstractRotatableNodePlacer.Matrix#MIR_VERT}
  • + *
  • {@link yfiles.tree.AbstractRotatableNodePlacer.Matrix#MIR_HOR_ROT90}
  • + *
  • {@link yfiles.tree.AbstractRotatableNodePlacer.Matrix#MIR_VERT_ROT90}
  • + *
+ */ + export interface Matrix extends Object{ + /** + * Multiplies this matrix with another matrix. + * @param {yfiles.tree.AbstractRotatableNodePlacer.Matrix} other the other matrix + * @return {yfiles.tree.AbstractRotatableNodePlacer.Matrix} the product of this and the other matrix + */ + multiply(other:yfiles.tree.AbstractRotatableNodePlacer.Matrix):yfiles.tree.AbstractRotatableNodePlacer.Matrix; + /** + * Returns a String representation of this matrix. + * @return {string} a String representing this matrix + */ + toString():string; + /** + * Compares the values of the actual matrix with the values of the given matrix. + * @param {yfiles.tree.AbstractRotatableNodePlacer.Matrix} result the given matrix + * @return {boolean} true if all values are the same, false otherwise + */ + equalValues(result:yfiles.tree.AbstractRotatableNodePlacer.Matrix):boolean; + } + } + var AbstractRotatableNodePlacer:{ + $class:yfiles.lang.Class; + /** + * Default constructor. + * Instantiates a new instance with the + * given modification matrix. + * @param {yfiles.tree.AbstractRotatableNodePlacer.Matrix} modificationMatrix the translation for the NodePlacer + */ + new (modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix):yfiles.tree.AbstractRotatableNodePlacer; + /** + * Translates a "real world point" to a "model point". + * @param {yfiles.tree.AbstractRotatableNodePlacer.Matrix} modificationMatrix the matrix to apply + * @param {yfiles.algorithms.YPoint} realWorldPoint the point with the coordinates from the real world + * @return {yfiles.algorithms.YPoint} the model point + */ + translatePoint(modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix,realWorldPoint:yfiles.algorithms.YPoint):yfiles.algorithms.YPoint; + RootAlignment:{ + $class:yfiles.lang.Class; + /** + * Horizontal alignment at the center. + * The root node is horizontally placed at the center of its whole subgraph. + * To determine the alignment, only node layouts are considered instead of including node labels which + * are also contained in subtree shapes. + */ + CENTER:yfiles.tree.AbstractRotatableNodePlacer.RootAlignment; + /** + * Horizontal alignment at the median. + * The root node is placed above the median of its children. + * To determine the alignment, only node layouts are considered instead of including node labels which + * are also contained in subtree shapes. + */ + MEDIAN:yfiles.tree.AbstractRotatableNodePlacer.RootAlignment; + /** + * Horizontal alignment at the left side of the children. + * The root node leaves a distance specified by the current + * spacing to the leftmost child. + * To determine the alignment, only node layouts are considered instead of including node labels which + * are also contained in subtree shapes. + */ + LEADING:yfiles.tree.AbstractRotatableNodePlacer.RootAlignment; + /** + * Horizontal alignment at the right side of the children. + * The root node leaves a distance specified by the current + * spacing to the rightmost child. + * To determine the alignment, only node layouts are considered instead of including node labels which + * are also contained in subtree shapes. + */ + TRAILING:yfiles.tree.AbstractRotatableNodePlacer.RootAlignment; + /** + * Horizontal alignment at the left. + * The root node is placed left aligned with its leftmost child. + * To determine the alignment, only node layouts are considered instead of including node labels which + * are also contained in subtree shapes. + */ + LEFT:yfiles.tree.AbstractRotatableNodePlacer.RootAlignment; + /** + * Horizontal alignment at the right. + * The root node is placed right aligned with its rightmost child. + * To determine the alignment, only node layouts are considered instead of including node labels which + * are also contained in subtree shapes. + */ + RIGHT:yfiles.tree.AbstractRotatableNodePlacer.RootAlignment; + /** + * Horizontal alignment at the center. + * The root node is placed centered over its direct children. + * To determine the alignment, only node layouts are considered instead of including node labels which + * are also contained in subtree shapes. + */ + CENTER_OVER_CHILDREN:yfiles.tree.AbstractRotatableNodePlacer.RootAlignment; + ALL:yfiles.tree.AbstractRotatableNodePlacer.RootAlignment[]; + /** + * Calculates the bounds of a list of shapes. + * @param {yfiles.algorithms.IList} shapes the list of shapes the bounds shall be calculated of. + * @return {yfiles.algorithms.Rectangle2D} the bounds around all shapes in the list. + */ + getBounds(shapes:yfiles.algorithms.IList):yfiles.algorithms.Rectangle2D; + }; + Matrix:{ + $class:yfiles.lang.Class; + /** + * no transformation. + */ + DEFAULT:yfiles.tree.AbstractRotatableNodePlacer.Matrix; + /** + * rotation by 90 degrees counter-clockwise. + */ + ROT90:yfiles.tree.AbstractRotatableNodePlacer.Matrix; + /** + * rotation by 180 degrees. + */ + ROT180:yfiles.tree.AbstractRotatableNodePlacer.Matrix; + /** + * rotation by 270 degrees counter-clockwise. + */ + ROT270:yfiles.tree.AbstractRotatableNodePlacer.Matrix; + /** + * mirror horizontally. + */ + MIR_HOR:yfiles.tree.AbstractRotatableNodePlacer.Matrix; + /** + * mirror vertically. + */ + MIR_VERT:yfiles.tree.AbstractRotatableNodePlacer.Matrix; + /** + * mirror horizontally and rotate by 90 degrees counter-clockwise. + */ + MIR_HOR_ROT90:yfiles.tree.AbstractRotatableNodePlacer.Matrix; + /** + * mirror vertically and rotate by 90 degrees counter-clockwise. + */ + MIR_VERT_ROT90:yfiles.tree.AbstractRotatableNodePlacer.Matrix; + AVAILABLE:yfiles.algorithms.IList; + }; + }; + /** + * Utility class that serves as a basis for implementations of the + * {@link yfiles.tree.INodePlacer} interface. + * It provides convenience methods for + * often used sub tasks during a layout. + * Subclasses need to override the two abstract methods only. + */ + export interface AbstractNodePlacer extends Object,yfiles.tree.INodePlacer,yfiles.algorithms.ICloneable{ + /** + * The graph instance this class is working on. + */ + graph:yfiles.layout.LayoutGraph; + /** + * Creates an optional Processor for pre- and post-processing. + * @param {yfiles.tree.GenericTreeLayouter} layouter + * @param {yfiles.layout.LayoutGraph} graph the actual graph + * @param {yfiles.algorithms.Node} currentRoot the actual root node for this node placer + * @return {yfiles.tree.IProcessor} a Processor or null + * @see Specified by {@link yfiles.tree.INodePlacer#createProcessor}. + */ + createProcessor(layouter:yfiles.tree.GenericTreeLayouter,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + /** + * Convenience method that queries the DataProvider for a SubtreeShape. + * This method can be called during the execution of {@link yfiles.tree.AbstractNodePlacer#placeSubtreeImpl} + * @param {yfiles.algorithms.Node} node the root node whose subtree shape will be returned in the form of a SubtreeShape instance + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} an instance that can be modified + */ + getSubtreeShape(node:yfiles.algorithms.Node):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * Convenience method that queries the DataProvider for the shape of a single + * node as a SubtreeShape instance. + * This instance can be used to modify it and + * return it in the main placeSubtree method. + * This method can be called during the execution of {@link yfiles.tree.AbstractNodePlacer#placeSubtreeImpl} + * @param {yfiles.algorithms.Node} node the node whose shape will be returned in the form of a SubtreeShape instance + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} an instance that can be modified + */ + getNodeShape(node:yfiles.algorithms.Node):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * This method initializes internal data structures and then uses the + * abstract method to determine the child node connector directions. + * @see {@link yfiles.tree.AbstractNodePlacer#determineChildConnector} + * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.algorithms.IDataMap} connectorMap the map that will be used to store the values + * @see Specified by {@link yfiles.tree.INodePlacer#determineChildConnectors}. + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; + /** + * This method must be implemented by subclasses. + * It assigns a connector shape + * direction to each child. + * @param {yfiles.algorithms.Node} child the child node + * @return {number} + * a byte constant as defined in the {@link yfiles.tree.INodePlacer} interface + */ + determineChildConnector(child:yfiles.algorithms.Node):number; + /** + * The main placeSubtree method that must be implemented by subclasses. + * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction of the connector shape + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} a SubtreeShape instance that describes the shape of the whole subtree + */ + placeSubtreeImpl(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * This method initializes the local data structures and then delegates the work + * to the abstract variant. + * @see {@link yfiles.tree.AbstractNodePlacer#placeSubtreeImpl} + * @see Specified by {@link yfiles.tree.INodePlacer#placeSubtree}. + */ + placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * Overwritten to support cloning. + * @return {Object} an exact copy of this instance + * @see Specified by {@link yfiles.algorithms.ICloneable#clone}. + */ + clone():Object; + } + var AbstractNodePlacer:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of AbstractNodePlacer. + */ + new ():yfiles.tree.AbstractNodePlacer; + }; + /** + * The BusPlacer is a special NodePlacer that creates a bus where all child nodes and the root node + * are connected to. + * The BusPlacer is rotatable using the constructor . + */ + export interface BusPlacer extends yfiles.tree.AbstractRotatableNodePlacer{ + /** + * This method must be implemented by subclasses. + * It is used to assigns a connector shape direction to each child. + * @param {yfiles.algorithms.Node} child the child node + * @return {yfiles.tree.ParentConnectorDirection} + * a byte constant as defined in the {@link yfiles.tree.INodePlacer} interface + */ + determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; + /** + * This method initializes internal data structures, then uses the abstract method {@link yfiles.tree.BusPlacer#determineChildConnector} + * to determine the child node connector directions. + * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.algorithms.IDataMap} connectorMap the map that will be used to store the values + * @see {@link yfiles.tree.BusPlacer#determineChildConnector} + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#determineChildConnectors} + * @see Specified by {@link yfiles.tree.INodePlacer#determineChildConnectors}. + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; + /** + * Places the root node and its children. + * @param {yfiles.algorithms.Node} localRoot + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection + * @return {yfiles.tree.SubtreeShapeRotated} the created subtree shape + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#placeSubtreeWithDirection} + */ + placeSubtreeWithDirection(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShapeRotated; + createComparator():yfiles.objectcollections.IComparer; + } + var BusPlacer:{ + $class:yfiles.lang.Class; + /** + * Initializes a new instance with the Default matrix. + */ + new ():yfiles.tree.BusPlacer; + /** + * Initializes a new BusPlacer with the given modification matrix. + * @param {yfiles.tree.AbstractRotatableNodePlacer.Matrix} modificationMatrix + */ + WithMatrix:{ + new (modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix):yfiles.tree.BusPlacer; + }; + }; + /** + * This is an implementation of the {@link yfiles.tree.INodePlacer} interface that + * can be used to create dendrogram-like tree layouts. + * This placer arranges nodes from top to bottom. + * It arranges subtrees in such a way that all subtrees of a single local root align at their bottom border. + * This implementation does not support {@link yfiles.layout.PortConstraint}s. + */ + export interface DendrogramPlacer extends Object,yfiles.tree.IFromSketchNodePlacer{ + /** + * The distance between the root shape and the bus connecting all of its subtrees. + * The default is 30. + */ + minimumRootDistance:number; + /** + * The distance between two adjacent subtree shapes. + * The default is 30. + */ + minimumSubtreeDistance:number; + /** + * This method is called by GenericTreeLayouter before the subtree shapes of + * this local root node's children are calculated. + * This method must provide for each child node a byte constant indicating + * the preferred direction of the connector to the subtree shape. + * @param {yfiles.algorithms.Node} localRoot + * the local root node whose child nodes will be provided with + * a byte constant indicating the direction of the connector + * @param {yfiles.algorithms.IDataMap} connectorMap + * the map that should be used for storing the byte constant + * with the child nodes. + * @see Specified by {@link yfiles.tree.INodePlacer#determineChildConnectors}. + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; + /** + * Creates a comparator that can be used to do a from sketch layout. + * If this instance is used for the root node's {@link yfiles.tree.GenericTreeLayouter#CHILD_COMPARATOR_DP_KEY} + * this implementation will do a from sketch layout. + * @return {yfiles.objectcollections.IComparer} the comparator implementation to use to simulate from sketch layout + */ + createComparator():yfiles.objectcollections.IComparer; + /** + * The main method of the tree layout algorithm. + * This method arranges the + * SubtreeShapes and the shape of the local root, routes the edges to the + * SubtreeShapes, calculates the resulting SubtreeShape and returns it. + * @param {yfiles.algorithms.IDataProvider} nodeShapeProvider + * this instance can be used to obtain an initial shape + * of the root node. This shape can then be merged with all the subtrees' shapes + * and finally be returned by this method. + * @param {yfiles.algorithms.IDataProvider} subtreeShapeProvider + * provides access to the pre-calculated shapes of + * the subtrees. It is guaranteed that at the time of the invocation of this + * method for every child node the subtree shape has already been calculated + * @param {yfiles.layout.LayoutGraph} graph the graph which is to be laid out + * @param {yfiles.algorithms.Node} localRoot the root of the subtree that should be laid out by this method + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection + * the direction byte constant as it is defined + * in this interface, that must be used for initializing the connector of the + * localRoot node to the parent node of the localRoot node + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} the shape of the whole subtree + * @see Specified by {@link yfiles.tree.INodePlacer#placeSubtree}. + */ + placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * Creates an optional Processor for pre- and post-processing. + * @param {yfiles.tree.GenericTreeLayouter} layouter + * @param {yfiles.layout.LayoutGraph} graph the actual graph + * @param {yfiles.algorithms.Node} currentRoot the actual root node for this node placer + * @return {yfiles.tree.IProcessor} a Processor or null + * @see Specified by {@link yfiles.tree.INodePlacer#createProcessor}. + */ + createProcessor(layouter:yfiles.tree.GenericTreeLayouter,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + /** + * Creates a comparator for edges. + * This comparator is used to sort the outgoing edges of a node before the + * placement of the node's subtree is calculated. + * @return {yfiles.objectcollections.IComparer} a comparator for edges. + * @see Specified by {@link yfiles.tree.IFromSketchNodePlacer#createFromSketchComparator}. + */ + createFromSketchComparator():yfiles.objectcollections.IComparer; + } + var DendrogramPlacer:{ + $class:yfiles.lang.Class; + }; + /** + * The DoubleLinePlacer is a special node placer that places its children in + * two lines. + * This node placer is especially useful for leaves with great width. + */ + export interface DoubleLinePlacer extends yfiles.tree.AbstractRotatableNodePlacer{ + /** + * Returns {@link yfiles.tree.ParentConnectorDirection#NORTH}. + * @return {yfiles.tree.ParentConnectorDirection} NodePlacer#DIRECTION_NORTH + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#determineChildConnector} + */ + determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; + /** + * Places the subtree in two lines. + * @return {yfiles.tree.SubtreeShapeRotated} the subtree + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#placeSubtreeWithDirection} + */ + placeSubtreeWithDirection(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShapeRotated; + /** + * The horizontal alignment that is used for the root node. + */ + rootAlignment:yfiles.tree.AbstractRotatableNodePlacer.RootAlignment; + /** + * The ratio of the{@link yfiles.tree.AbstractRotatableNodePlacer#spacing spacing} between the root and the children in the upper line + * and the spacing between the two lines of subtrees. + *

+ * By default, the ratio is 0.33 due to backwards compatibility. + *

+ */ + doubleLineSpacingRatio:number; + } + var DoubleLinePlacer:{ + $class:yfiles.lang.Class; + /** + * Creates a new DoubleLinePlacer with the default modification matrix. + */ + new ():yfiles.tree.DoubleLinePlacer; + /** + * Creates a new DoubleLinePlacer with the given modification matrix. + * @param {yfiles.tree.AbstractRotatableNodePlacer.Matrix} modificationMatrix the current modification matrix + */ + WithMatrix:{ + new (modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix):yfiles.tree.DoubleLinePlacer; + }; + }; + /** + * Placer that can be used as simple "pseudo"-placer. + * May be useful if the localRoot does not have any children + * or you want to place them manually. + */ + export interface FreePlacer extends yfiles.tree.AbstractRotatableNodePlacer{ + /** + * This method must be implemented by subclasses. + * It is used to assigns a connector shape direction to each child. + * @param {yfiles.algorithms.Node} child the child node + * @return {yfiles.tree.ParentConnectorDirection} + * a byte constant as defined in the {@link yfiles.tree.INodePlacer} interface + */ + determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; + /** + * Creates the subtree shape. + * @param {yfiles.algorithms.Node} localRoot + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection + * @return {yfiles.tree.SubtreeShapeRotated} the created subtree shape + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#placeSubtreeWithDirection} + */ + placeSubtreeWithDirection(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShapeRotated; + /** + * Creates a processor suitable to the FreePlacer. + * This processor will change all descendants node placers to FreePlacer. + * @param {yfiles.tree.GenericTreeLayouter} layouter + * @param {yfiles.layout.LayoutGraph} graph + * @param {yfiles.algorithms.Node} currentRoot + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#createProcessor} + * @see Specified by {@link yfiles.tree.INodePlacer#createProcessor}. + */ + createProcessor(layouter:yfiles.tree.GenericTreeLayouter,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + } + var FreePlacer:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance with the default matrix. + */ + new ():yfiles.tree.FreePlacer; + }; + /** + * The DelegatingNodePlacer may be used to layout the children of the actual + * node with two different NodePlacers. + */ + export interface DelegatingNodePlacer extends yfiles.tree.AbstractRotatableNodePlacer{ + /** + * Creates a processor that partitions child nodes of the specified root node + * into two subsets, one to be arranged by the "upper left" + * NodePlacer and one to be arranged by the "lower right" + * NodePlacer. + * @see {@link yfiles.tree.DelegatingNodePlacer#placerLowerRight} + * @see {@link yfiles.tree.DelegatingNodePlacer#placerUpperLeft} + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#createProcessor} + * @see Specified by {@link yfiles.tree.INodePlacer#createProcessor}. + */ + createProcessor(layouter:yfiles.tree.GenericTreeLayouter,graph:yfiles.layout.LayoutGraph,currentRoot:yfiles.algorithms.Node):yfiles.tree.IProcessor; + /** + * This method is called by GenericTreeLayouter before the subtree shapes of + * this local root node's children are calculated. + * This method must provide for each child node a byte constant indicating + * the preferred direction of the connector to the subtree shape. + * @param {yfiles.algorithms.Node} localRoot + * the local root node whose child nodes will be provided with + * a byte constant indicating the direction of the connector + * @param {yfiles.algorithms.IDataMap} connectorMap + * the map that should be used for storing the byte constant + * with the child nodes. + * @see Specified by {@link yfiles.tree.INodePlacer#determineChildConnectors}. + */ + determineChildConnectors(localRoot:yfiles.algorithms.Node,connectorMap:yfiles.algorithms.IDataMap):void; + /** + * Places the shapes of the children using the two node placers {@link yfiles.tree.DelegatingNodePlacer#getUpperLeftChildren} and + * {@link yfiles.tree.DelegatingNodePlacer#getLowerRightChildren}. + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} the subtree shape for the given local root. + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#placeSubtree} + * @see Specified by {@link yfiles.tree.INodePlacer#placeSubtree}. + */ + placeSubtree(nodeShapeProvider:yfiles.algorithms.IDataProvider,subtreeShapeProvider:yfiles.algorithms.IDataProvider,graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * Determines the lower right children of the specified root node. + * Data provider LEFT_RIGHT_DPKEY is used to determine + * on which side a node is placed. + * If no provider is specified, the first half of the nodes get placed on the + * left, the others on the right side + * These nodes are placed using the NodePlacer returned by + * {@link yfiles.tree.DelegatingNodePlacer#placerLowerRight}. + * @return {yfiles.algorithms.NodeList} a NodeList containing the lower right nodes. + * @see {@link yfiles.tree.DelegatingNodePlacer#LEFT_RIGHT_DP_KEY} + */ + getLowerRightChildren(localRoot:yfiles.algorithms.Node,graph:yfiles.layout.LayoutGraph):yfiles.algorithms.NodeList; + /** + * Determines the upper left children of the specified root node. + * Data provider LEFT_RIGHT_DPKEY is used to determine + * on which side a node is placed. + * If no provider is specified, the first half of the nodes get placed on the + * left, the others on the right side + * These nodes are placed using the NodePlacer returned by + * {@link yfiles.tree.DelegatingNodePlacer#placerUpperLeft}. + * @return {yfiles.algorithms.NodeList} a NodeList containing the upper left nodes. + * @see {@link yfiles.tree.DelegatingNodePlacer#LEFT_RIGHT_DP_KEY} + */ + getUpperLeftChildren(localRoot:yfiles.algorithms.Node,graph:yfiles.layout.LayoutGraph):yfiles.algorithms.NodeList; + /** + * This method must be implemented by subclasses. + * It is used to assigns a connector shape direction to each child. + * @param {yfiles.algorithms.Node} child the child node + * @return {yfiles.tree.ParentConnectorDirection} + * a byte constant as defined in the {@link yfiles.tree.INodePlacer} interface + */ + determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; + /** + * This method must be implemented by subclasses. + * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction of the connector shape + * @return {yfiles.tree.SubtreeShapeRotated} a SubtreeShape instance that describes the shape of the whole subtree + */ + placeSubtreeWithDirection(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShapeRotated; + /** + * The orientation according to which node shapes are aligned by + * this placer. + * Depending on the orientation the shapes are aligned on the x- or y-axis. + */ + orientation:yfiles.tree.Orientation; + /** + * The NodePlacer that is used to layout the nodes on + * the "lower right". + */ + placerLowerRight:yfiles.tree.INodePlacer; + /** + * The NodePlacer that is used to layout the nodes on + * the "upper left". + */ + placerUpperLeft:yfiles.tree.INodePlacer; + } + var DelegatingNodePlacer:{ + $class:yfiles.lang.Class; + /** + * Key which can be used to register a data provider that tells the node + * placer whether the node shall be placed on the left or right side. + * If no provider is specified, the first half of the nodes placed on the + * left, the others on the right side + * The provider should return true if the node shall be placed on the left + * side. + */ + LEFT_RIGHT_DP_KEY:Object; + /** + * Creates a new instance using the given modification matrix an the node placers "this" delegates to. + */ + new (modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix,placerUpperLeft:yfiles.tree.INodePlacer,placerLowerRight:yfiles.tree.INodePlacer):yfiles.tree.DelegatingNodePlacer; + }; + /** + * Versatile default implementation of {@link yfiles.tree.INodePlacer} used by + * {@link yfiles.tree.GenericTreeLayouter}. + * This implementation provides + * a couple of related styles for laying out subtrees in a tree layout. + * The styles can be customized easily using a wealth of different options. + * This implementation is capable of dealing with PortConstraints correctly. + */ + export interface DefaultNodePlacer extends yfiles.tree.AbstractNodePlacer,yfiles.tree.IFromSketchNodePlacer,yfiles.algorithms.ICloneable{ + /** + * The main placeSubtree method that must be implemented by subclasses. + * @param {yfiles.algorithms.Node} localRoot the local root node + * @param {yfiles.tree.ParentConnectorDirection} parentConnectorDirection the direction of the connector shape + * @return {yfiles.tree.GenericTreeLayouter.SubtreeShape} a SubtreeShape instance that describes the shape of the whole subtree + */ + placeSubtreeImpl(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.GenericTreeLayouter.SubtreeShape; + /** + * Calculates the connector the the parent node. + * Subclasses may override this method. + * @param {yfiles.layout.LayoutGraph} graph the graph + * @param {yfiles.algorithms.Node} localRoot + * the root whose connector must be calculated and stored in the + * subtreeShape + * @param {yfiles.layout.INodeLayout} rootLayout the NodeLayout of the root node + * @param {yfiles.tree.GenericTreeLayouter.SubtreeShape} subtreeShape the shape to be used for the connector information + * @param {yfiles.algorithms.Edge} parentEdge + * the edge that will later be routed according to the + * information in the subtreeShape + * @param {yfiles.layout.IEdgeLayout} parentEdgeLayout the current EdgeLayout of the edge + * @param {number} direction + * the direction byte constant as defined in the + * {@link yfiles.tree.INodePlacer} interface which should be used for + * the connector + */ + calcParentConnector(graph:yfiles.layout.LayoutGraph,localRoot:yfiles.algorithms.Node,rootLayout:yfiles.layout.INodeLayout,subtreeShape:yfiles.tree.GenericTreeLayouter.SubtreeShape,parentEdge:yfiles.algorithms.Edge,parentEdgeLayout:yfiles.layout.IEdgeLayout,direction:number):void; + /** + * Performs the routing of the target side of the edge to + * the given child node. + * This method does nothing but resets the current + * EdgeLayout. + * @param {yfiles.layout.INodeLayout} rootLayout the NodeLayout of the local root node + * @param {yfiles.tree.GenericTreeLayouter.SubtreeShape} childShape + * the SubtreeShape instance of the corresponding child's + * subtree + * @param {yfiles.algorithms.Edge} edge the edge + */ + calcTargetEdgeLayout(rootLayout:yfiles.layout.INodeLayout,childShape:yfiles.tree.GenericTreeLayouter.SubtreeShape,edge:yfiles.algorithms.Edge):void; + /** + * Performs the routing of the source side of the edge to + * the given child node. + * This method delegates to {@link yfiles.tree.DefaultNodePlacer#calcSourceEdgeLayout} + * if routingStyle is not ROUTING_FORK + * This method calculates the source bends according to + * the current routingStyle, and connects the bends of the child + * SubtreeShape connector to the EdgeLayout. + * @param {yfiles.layout.INodeLayout} rootLayout the NodeLayout of the local root node + * @param {yfiles.tree.GenericTreeLayouter.SubtreeShape} childShape the SubtreeShape instance of the corresponding child's subtree + * @param {yfiles.algorithms.Edge} edge the edge + * @param {number} rootForkCoordinate the y-coordinate of the first bend of the edge if the placement is horizontal and the x-coordinate otherwise. + * @param {number} childForkCoordinate the y-coordinate of the second (= last) bend of the edge if the placement is horizontal and the x-coordinate otherwise. + */ + calcSlopedSourceEdgeLayout(rootLayout:yfiles.layout.INodeLayout,childShape:yfiles.tree.GenericTreeLayouter.SubtreeShape,edge:yfiles.algorithms.Edge,childForkCoordinate:number,rootForkCoordinate:number):void; + /** + * Performs the routing of the source side of the edge to + * the given child node. + * This method calculates the source bends according to + * the current routingStyle, and connects the bends of the child + * SubtreeShape connector to the EdgeLayout. + * @param {yfiles.layout.INodeLayout} rootLayout the NodeLayout of the local root node + * @param {yfiles.tree.GenericTreeLayouter.SubtreeShape} childShape + * the SubtreeShape instance of the corresponding child's + * subtree + * @param {yfiles.algorithms.Edge} edge the edge + */ + calcSourceEdgeLayout(rootLayout:yfiles.layout.INodeLayout,childShape:yfiles.tree.GenericTreeLayouter.SubtreeShape,edge:yfiles.algorithms.Edge):void; + /** + * The child node placement policy. + */ + childPlacement:yfiles.tree.ChildPlacement; + /** + * The root node alignment policy. + */ + rootAlignment:yfiles.tree.RootAlignment; + /** + * The relative vertical alignment of nodes with the same parent. + * A value of 0 means nodes are top aligned; + * a value of 1 means nodes are bottom aligned; + * a value of 0.5 means nodes are center aligned. + * Values outside the interval [0,1] will result in a compact node placement with unaligned nodes. + *

+ * By default the compact placement with unaligned nodes is used. + *

+ */ + verticalAlignment:number; + /** + * This method must be implemented by subclasses. + * It assigns a connector shape + * direction to each child. + * @param {yfiles.algorithms.Node} child the child node + * @return {number} + * a byte constant as defined in the {@link yfiles.tree.INodePlacer} interface + */ + determineChildConnector(child:yfiles.algorithms.Node):number; + /** + * The current routing style byte constant. + */ + routingStyle:yfiles.tree.RoutingStyle; + /** + * The vertical distance this NodePlacer should use for the + * arrangement of the elements. + */ + verticalDistance:number; + /** + * The minimum length of the segment between the parent node port and the first bend of the edge. + */ + minFirstSegmentLength:number; + /** + * The minimum length of the segment between the last bend of the slope and the port of the child node.. + */ + minLastSegmentLength:number; + /** + * The minimum slope of edges. + */ + minSlope:number; + /** + * The minimum height for slopes of edges. + */ + minSlopeHeight:number; + /** + * The horizontal distance this NodePlacer should use for the + * arrangement of the elements. + */ + horizontalDistance:number; + /** + * Returns a Comparator instance that can be used to register with the + * GenericTreeLayouter. + * The returned instance can be used to sort the child + * nodes in such a way that the layout will look like the current arrangement + * of the nodes. This is especially useful for interactive or incremental layouts. + * @return {yfiles.objectcollections.IComparer} + * a Comparator instance that can be used for the current configuration of + * this instance. + */ + createComparator():yfiles.objectcollections.IComparer; + /** + * Creates a comparator for edges. + * This comparator is used to sort the outgoing edges of a node before the + * placement of the node's subtree is calculated. + * @return {yfiles.objectcollections.IComparer} a comparator for edges. + * @see Specified by {@link yfiles.tree.IFromSketchNodePlacer#createFromSketchComparator}. + */ + createFromSketchComparator():yfiles.objectcollections.IComparer; + } + var DefaultNodePlacer:{ + $class:yfiles.lang.Class; + /** + * Creates a new DefaultNodePlacer with default alignment ({@link yfiles.tree.RootAlignment#CENTER}), + * default child placement ({@link yfiles.tree.ChildPlacement#HORIZONTAL_DOWNWARD}), + * and default edge routing ({@link yfiles.tree.RoutingStyle#FORK}) and a horizontal and vertical distance + * of 40.0d. + */ + new ():yfiles.tree.DefaultNodePlacer; + /** + * Creates a new DefaultNodePlacer with default alignment ({@link yfiles.tree.RootAlignment#CENTER}) + * and default edge routing ({@link yfiles.tree.RoutingStyle#FORK}). + * @param {yfiles.tree.ChildPlacement} childPlacement placement constant describing the style of the arrangement + * @param {number} verticalDistance + * the vertical distance between the root node and the subtree shapes or between + * subtree shapes in case of vertical child placement + * @param {number} horizontalDistance + * the horizontal distance between the root node and the subtree shapes or between + * subtree shapes in case of horizontal child placement + */ + WithDistance:{ + new (childPlacement:yfiles.tree.ChildPlacement,verticalDistance:number,horizontalDistance:number):yfiles.tree.DefaultNodePlacer; + }; + /** + * Creates a new DefaultNodePlacer with default edge routing ({@link yfiles.tree.RoutingStyle#FORK}). + * @param {yfiles.tree.ChildPlacement} childPlacement placement constant describing the style of the arrangement + * @param {yfiles.tree.RootAlignment} rootAlignment + * alignment constant describing the position of the root nod + * with respect to the subtrees + * @param {number} verticalDistance + * the vertical distance between the root node and the subtree shapes or between + * subtree shapes in case of vertical child placement + * @param {number} horizontalDistance + * the horizontal distance between the root node and the subtree shapes or between + * subtree shapes in case of horizontal child placement + */ + WithAlignmentAndDistance:{ + new (childPlacement:yfiles.tree.ChildPlacement,rootAlignment:yfiles.tree.RootAlignment,verticalDistance:number,horizontalDistance:number):yfiles.tree.DefaultNodePlacer; + }; + /** + * Creates a new DefaultNodePlacer. + * @param {yfiles.tree.RoutingStyle} routingStyle routing style constant + * @param {yfiles.tree.ChildPlacement} childPlacement placement constant describing the style of the arrangement + * @param {yfiles.tree.RootAlignment} rootAlignment + * alignment constant describing the position of the root nod + * with respect to the subtrees + * @param {number} verticalDistance + * the vertical distance between the root node and the subtree shapes or between + * subtree shapes in case of vertical child placement + * @param {number} horizontalDistance + * the horizontal distance between the root node and the subtree shapes or between + * subtree shapes in case of horizontal child placement + */ + WithAlignmentStyleAndDistance:{ + new (childPlacement:yfiles.tree.ChildPlacement,rootAlignment:yfiles.tree.RootAlignment,routingStyle:yfiles.tree.RoutingStyle,verticalDistance:number,horizontalDistance:number):yfiles.tree.DefaultNodePlacer; + }; + /** + * Creates a new DefaultNodePlacer. + * @param {yfiles.tree.RoutingStyle} routingStyle routing style constant + * @param {yfiles.tree.ChildPlacement} childPlacement placement constant describing the style of the arrangement + * @param {yfiles.tree.RootAlignment} rootAlignment + * alignment constant describing the position of the root nod + * with respect to the subtrees + * @param {number} verticalDistance + * the vertical distance between the root node and the subtree shapes or between + * subtree shapes in case of vertical child placement + * @param {number} horizontalDistance + * the horizontal distance between the root node and the subtree shapes or between + * subtree shapes in case of horizontal child placement + * @param {number} minFirstSegmentLength the minimum length of the segment from the parent node port to the bend of the slope + * @param {number} minLastSegmentLength the minimum length of the segment from the last bend of the slope to the port of the child node + * @param {number} minSlope the minimum slope between the root node and the subtree shapes + * @param {number} minSlopeHeight the minimum height of slopes between the root node and the subtree shapes + */ + WithAlignmentStyleDistanceLengthAndSlope:{ + new (childPlacement:yfiles.tree.ChildPlacement,rootAlignment:yfiles.tree.RootAlignment,routingStyle:yfiles.tree.RoutingStyle,verticalDistance:number,horizontalDistance:number,minFirstSegmentLength:number,minLastSegmentLength:number,minSlope:number,minSlopeHeight:number):yfiles.tree.DefaultNodePlacer; + }; + }; + /** + * This class provides simple default port assignment strategies. + */ + export interface DefaultPortAssignment extends Object,yfiles.tree.IPortAssignment{ + /** + * Called by {@link yfiles.tree.GenericTreeLayouter} before the actual layout + * of the graph takes place. + * This method assigns both the single + * incoming edge's target port as well as all source ports for all + * outgoing child edges. Note that at the time this method gets invoked, + * GenericTreeLayouter may have reversed some edges in order to normalize the + * tree structure. + * @param {yfiles.layout.LayoutGraph} graph the graph instance the node is part of + * @param {yfiles.algorithms.Node} node the node whose adjacent edges' ports should be set + * @see Specified by {@link yfiles.tree.IPortAssignment#assignPorts}. + */ + assignPorts(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node):void; + /** + * This method assigns the target port of the edge that goes to the parent node. + * @param {yfiles.layout.LayoutGraph} graph the graph which contains the node + * @param {yfiles.algorithms.Node} node the node + * @param {yfiles.algorithms.Edge} edge the edge to the parent node + */ + assignParentEdgeTargetPort(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge):void; + /** + * This method assigns the source port of an edge that goes to a child node. + * @param {yfiles.layout.LayoutGraph} graph the graph which contains the node + * @param {yfiles.algorithms.Node} node the parent node + * @param {yfiles.algorithms.Edge} edge the edge to the child node + * @param {number} index the zero-based index of the child edge + */ + assignChildEdgeSourcePort(graph:yfiles.layout.LayoutGraph,node:yfiles.algorithms.Node,edge:yfiles.algorithms.Edge,index:number):void; + /** + * Callback method used to determine the port border gap for each node and + * side. + * @param {number} sideLength the width/height of the side + * @param {number} edgeCount the number of edges/port that connect to this side + * @return {number} the absolute gap to be used on both sides of the ports + */ + getPortBorderGap(sideLength:number,edgeCount:number):number; + /** + * Callback method used to determine the distance between two adjacent ports. + * @param {number} sideLength the width/height of the side + * @param {number} edgeCount the number of edges/port that connect to this side + * @param {number} portBorderGap the previously calculated port border gap + * @return {number} the absolute distance to be used between two adjacent ports + */ + getPortDistanceDelta(sideLength:number,edgeCount:number,portBorderGap:number):number; + /** + * Returns the PortConstraint for the given edge or null if no + * PortConstraint is set. + * This implementation uses the PortConstraint data provider + * that is bound to the graph, if available. + * @param {yfiles.layout.LayoutGraph} graph the graph the edge is part of + * @param {yfiles.algorithms.Edge} edge the edge whose PortConstraint is to be determined + * @param {number} index the child's index + * @return {yfiles.layout.PortConstraint} a PortConstraint or null + */ + getSourcePortConstraint(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge,index:number):yfiles.layout.PortConstraint; + /** + * Returns the PortConstraint for the given edge or null if no + * PortConstraint is set. + * This implementation uses the PortConstraint data provider + * that is bound to the graph, if available. + * @param {yfiles.layout.LayoutGraph} graph the graph the edge is part of + * @param {yfiles.algorithms.Edge} edge the edge whose PortConstraint is to be determined + * @return {yfiles.layout.PortConstraint} a PortConstraint or null + */ + getTargetPortConstraint(graph:yfiles.layout.LayoutGraph,edge:yfiles.algorithms.Edge):yfiles.layout.PortConstraint; + /** + * The port assignment mode. + * Possible values are + *
    + *
  • {@link yfiles.tree.PortAssignmentMode#NONE}: all ports lie on the same point.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#DISTRIBUTED_NORTH}: ports are distributed among the northern side of the node.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#DISTRIBUTED_SOUTH}: ports are distributed among the southern side of the node.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#DISTRIBUTED_EAST}: ports are distributed among the eastern side of the node.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#DISTRIBUTED_WEST}: ports are distributed among the western side of the node.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#PORT_CONSTRAINT}: ports are distributed as specified.
  • + *
+ */ + mode:yfiles.tree.PortAssignmentMode; + /** + * The ratio of the gap between the border of the node and the next port and the gap between the ports. + * Getter:For example, the default value, 0.5, indicates that the border gap is as wide as half the gap between the ports. + * Setter:For example, 0.5 sets the border gap as wide as half the gap between the ports. Thus, + * the lower the value is, the wider "spread" the ports at the side of the node. + * Note: This setting is only useful for distributed port assignment. + */ + borderGapToPortGapRatio:number; + /** + * Indicates if the port assignment is set to reversed order. + * Getter:The default order is from + * left to right and from top to bottom. Thus, the default value is false. + * Setter:If set to true, the order is from right to left and from bottom to top. + * Note: This setting is only useful for distributed port assignment. + */ + reversedPortOrder:boolean; + } + var DefaultPortAssignment:{ + $class:yfiles.lang.Class; + /** + * Creates a new DefaultPortAssignment instance using mode {@link yfiles.tree.PortAssignmentMode#NONE}. + */ + new ():yfiles.tree.DefaultPortAssignment; + /** + * Creates a new DefaultPortAssignment instance using the given mode and the default value for + * the ratio of the gap between the border and the ports and the gap between the ports themselves. + * The default value is 0.5. + * Possible values for mode are: + *
    + *
  • {@link yfiles.tree.PortAssignmentMode#NONE}: all ports lie on the same point.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#DISTRIBUTED_NORTH}: ports are distributed among the northern side of the node.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#DISTRIBUTED_SOUTH}: ports are distributed among the southern side of the node.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#DISTRIBUTED_EAST}: ports are distributed among the eastern side of the node.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#DISTRIBUTED_WEST}: ports are distributed among the western side of the node.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#PORT_CONSTRAINT}: ports are distributed as specified.
  • + *
+ */ + WithMode:{ + new (mode:yfiles.tree.PortAssignmentMode):yfiles.tree.DefaultPortAssignment; + }; + /** + * Creates a new DefaultPortAssignment instance using the given mode and a given value for + * the ratio of the gap between the border and the ports and the gap between the ports themselves. + * Possible values for mode are: + *
    + *
  • {@link yfiles.tree.PortAssignmentMode#NONE}: all ports lie on the same point.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#DISTRIBUTED_NORTH}: ports are distributed among the northern side of the node.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#DISTRIBUTED_SOUTH}: ports are distributed among the southern side of the node.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#DISTRIBUTED_EAST}: ports are distributed among the eastern side of the node.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#DISTRIBUTED_WEST}: ports are distributed among the western side of the node.
  • + *
  • {@link yfiles.tree.PortAssignmentMode#PORT_CONSTRAINT}: ports are distributed as specified.
  • + *
+ */ + WithModeAndRatio:{ + new (mode:yfiles.tree.PortAssignmentMode,ratio:number):yfiles.tree.DefaultPortAssignment; + }; + }; + export enum PortAssignmentMode{ + /** + * Mode constant describing the strategy where edges having + *
    + *
  • + * a weak port constraint, i.e., effectively a side constraint, will be anchored + * at the center of that side + *
  • + *
  • + * no port constraint set will be anchored at the center of the node + *
  • + *
+ * Edges having a strong port constraint are anchored at that coordinates. + *

+ * If edges with port constraints are grouped, all edges in the same group will use the port coordinates of the + * first edge in the group. + *

+ * @see {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} + * @see {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} + */ + PORT_CONSTRAINT, + /** + * Mode constant describing the strategy where edges are distributed evenly at the + * northern side of their nodes. + *

+ * Grouped edges will use the same port coordinate and will be considered as a single edge when calculating the + * distribution. + *

+ * @see {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} + * @see {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} + */ + DISTRIBUTED_NORTH, + /** + * Mode constant describing the strategy where edges are distributed evenly at the + * southern side of their nodes. + *

+ * Grouped edges will use the same port coordinate and will be considered as a single edge when calculating the + * distribution. + *

+ * @see {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} + * @see {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} + */ + DISTRIBUTED_SOUTH, + /** + * Mode constant describing the strategy where edges are distributed evenly at the + * eastern side of their nodes. + *

+ * Grouped edges will use the same port coordinate and will be considered as a single edge when calculating the + * distribution. + *

+ * @see {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} + * @see {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} + */ + DISTRIBUTED_EAST, + /** + * Mode constant describing the strategy where edges are distributed evenly at the + * western side of their nodes. + *

+ * Grouped edges will use the same port coordinate and will be considered as a single edge when calculating the + * distribution. + *

+ * @see {@link yfiles.layout.PortConstraintKeys#SOURCE_GROUP_ID_DP_KEY} + * @see {@link yfiles.layout.PortConstraintKeys#TARGET_GROUP_ID_DP_KEY} + */ + DISTRIBUTED_WEST, + /** + * Mode constant describing the strategy where all ports are reset to the center + * of their nodes. + */ + NONE + } + export enum RoutingStyle{ + /** + * Routing style byte constant used for the routingStyle property. + * Using this value will result in orthogonally routed child node + * connectors where the bends are placed in the channel between the + * root node and the child nodes. + */ + FORK, + /** + * Routing style byte constant used for the routingStyle property. + * Using this value will result in orthogonally routed child node + * connectors with one bend each placed next to the root node. + */ + FORK_AT_ROOT, + /** + * Routing style byte constant used for the routingStyle property. + * Using this value will result in straight connections to the child nodes. + * Edges may overlap nodes in this case. + */ + STRAIGHT, + /** + * Routing style byte constant used for the routingStyle property. + * Using this value will result in straight connections to the connector of the subtree. + */ + POLY_LINE + } + export enum RootAlignment{ + /** + * Alignment byte constant used for the rootAlignment property. + * This constant places the root ahead of all the child subtrees. + */ + LEADING_OFFSET, + /** + * Alignment byte constant used for the rootAlignment property. + * This constant aligns the root with the first of its subtrees. + */ + LEADING, + /** + * Alignment byte constant used for the rootAlignment property. + * This constant aligns the root at the center of its subtrees. + */ + CENTER, + /** + * Alignment byte constant used for the rootAlignment property. + * This constant aligns the root at the median of the connection points to its subtrees. + */ + MEDIAN, + /** + * Alignment byte constant used for the rootAlignment property. + * This constant aligns the root at with the last of its subtrees. + */ + TRAILING, + /** + * Alignment byte constant used for the rootAlignment property. + * This constant places the root after all of its subtrees. + */ + TRAILING_OFFSET, + /** + * Alignment byte constant used for the rootAlignment property. + * This constant places the root after all of its subtrees and centered on the bus. + *

+ * Note: The vertical/horizontal distance between the root node and the subtree shapes depend on the value + * of parameters verticalDistance/horizontalDistance passed to the Constructor. + *

+ */ + TRAILING_ON_BUS, + /** + * Alignment byte constant used for the rootAlignment property. + * This constant places the root ahead of all the child subtrees and centered on the bus. + *

+ * Note: The vertical/horizontal distance between the root node and the subtree shapes depend on the value + * of parameters verticalDistance/horizontalDistance passed to the Constructor. + *

+ */ + LEADING_ON_BUS + } + export enum Orientation{ + /** + * Orientation specifier. Node shapes will be aligned on the x-axis. + */ + HORIZONTAL, + /** + * Orientation specifier. Node shapes will be aligned on the y-axis. + */ + VERTICAL + } + export enum LayeredRoutingStyle{ + /** + * Layout style constant. Draw edges as straight lines. + *

+ * Note that it is possible that edges overlap with nodes depending on their size and vertical alignment. When + * , there + * might also be edge overlaps with node labels that are placed above the according node. + *

+ */ + PLAIN, + /** + * Layout style constant. Draw edges orthogonally in a bus-like fashion. + */ + ORTHOGONAL + } + export enum BorderlineSide{ + /** + * Side constant used by . + */ + NORTH, + /** + * Side constant used by . + */ + EAST, + /** + * Side constant used by . + */ + SOUTH, + /** + * Side constant used by . + */ + WEST + } + export enum ConnectorDirection{ + /** + * Direction constant used by . + */ + NORTH, + /** + * Direction constant used by . + */ + EAST, + /** + * Direction constant used by . + */ + SOUTH, + /** + * Direction constant used by . + */ + WEST + } + export enum ChildPlacement{ + /** + * Placement byte constant used for the childPlacement property. + * This placement strategy arranges child subtrees vertically beneath each other + * to the left of the root node. + */ + VERTICAL_TO_LEFT, + /** + * Placement byte constant used for the childPlacement property. + * This placement strategy arranges child subtrees vertically beneath each other + * to the right of the root node. + */ + VERTICAL_TO_RIGHT, + /** + * Placement byte constant used for the childPlacement property. + * This placement strategy arranges child subtrees horizontally next to each other + * above the root node. + */ + HORIZONTAL_UPWARD, + /** + * Placement byte constant used for the childPlacement property. + * This placement strategy arranges child subtrees horizontally next to each other + * below the root node. + */ + HORIZONTAL_DOWNWARD + } + export enum InterleavedMode{ + /** + * Interleaved mode specifier constant. + * This mode does turn off the interleaved child arrangement for all nodes in the tree. + * This is the default mode. + * @see {@link yfiles.tree.BalloonLayouter#interleavedMode} + */ + OFF, + /** + * Interleaved mode specifier constant. + * Using this mode, the children (successors) of all nodes in the tree will possibly be placed in an interleaved + * fashion. Interleaved arrangement means, that the successors of node root are placed at different + * distances in an alternating way. + * Note: If there is enough space within the desired child wedge of some node to place all children without using + * different distances, than the children will simply be placed without interleaving. + * @see {@link yfiles.tree.BalloonLayouter#interleavedMode} + */ + ALL_NODES, + /** + * Interleaved mode specifier constant. + * Using this mode, it is possible to specify individually for each node if the nodes children should be arranged + * in an interleaved way or not. For this purpose a {@link yfiles.algorithms.IDataProvider} with key {@link yfiles.tree.BalloonLayouter#INTERLEAVED_NODES_DP_KEY} + * can be attached to the graph to be laid out. The data provider may then provide a boolean value which determines, + * if the children of a specific node will be placed interleaved or not. + *

If there is no {@link yfiles.algorithms.IDataProvider} with key {@link yfiles.tree.BalloonLayouter#INTERLEAVED_NODES_DP_KEY} registered, then + * the selection of nodes where children shall arranged interleaved will be made based on a very simple heuristic.

+ * @see {@link yfiles.tree.BalloonLayouter#interleavedMode} + */ + SELECTED_NODES + } + export enum FillStyle{ + /** + * Byte constant that can be used for the fillStyle property. + * Elements in one lane will be aligned with the leading edge. + */ + LEADING, + /** + * Byte constant that can be used for the fillStyle property. + * Elements in one lane will be centered with the bounds. + */ + CENTERED, + /** + * Byte constant that can be used for the fillStyle property. + * Elements in one lane will be justified with the bounds. + */ + JUSTIFY, + /** + * Byte constant that can be used for the fillStyle property. + * Elements in one lane will be aligned with the trailing edge. + */ + TRAILING + } + /** + * A tree layouter that lays out the subtrees of the tree in a balloon-like + * fashion. + * Here is a sample layout output + *
+ */ + export interface BalloonLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * The layout graph being acted upon. + */ + graph:yfiles.layout.LayoutGraph; + /** + * The{@link yfiles.objectcollections.IComparer} that will be used + * to sort the {@link yfiles.algorithms.Node#sortOutEdges outgoing edges} + * of each local root in the tree before they are being arranged. + * The default value is null which indicates that the algorithm should + * use its built-in logic. + */ + comparator:yfiles.objectcollections.IComparer; + /** + * The current policy for sorting the children around the local roots. + * Possible values are {@link yfiles.tree.ChildOrderingPolicy#COMPACT} and {@link yfiles.tree.ChildOrderingPolicy#SYMMETRIC}. + * Note: the policy is only considered if sketch mode is disabled (see method {@link yfiles.tree.BalloonLayouter#fromSketchMode}) + * and no comparator is set (see method {@link yfiles.tree.BalloonLayouter#comparator}). + * Furthermore, the policy is also ignored if the interleaving mode is active {@link yfiles.tree.BalloonLayouter#interleavedMode}. + */ + childOrderingPolicy:yfiles.tree.ChildOrderingPolicy; + /** + * The distance to keep between the nodes in the tree. + * Note that this distance is not always considered if {@link yfiles.tree.BalloonLayouter#allowOverlaps} is set to true. + * The default distance is 0.0. + * @see {@link yfiles.tree.BalloonLayouter#allowOverlaps} + */ + minimalNodeDistance:number; + /** + * Specifies whether or not to take the coordinates of the input diagram + * into account when arranging the nodes of the elements of the tree. + * If this features is enabled, the original circular order of child nodes around + * each parent node will be maintained. + * By default this feature is disabled. + */ + fromSketchMode:boolean; + /** + * The root node policy that determines which node + * is chosen as (virtual) tree root for the layout process. + * By default {@link yfiles.tree.RootNodePolicy#DIRECTED_ROOT} is set. + */ + rootNodePolicy:yfiles.tree.RootNodePolicy; + /** + * The preferred child wedge angle. + * This value controls the degree + * to which the child nodes may radiate away from the center of layout. + * By default the wedge is 340 degrees which means that + * the child nodes may radiate in almost any direction from a + * parent node. + * Allowed values lie within 0 and 360 + * degrees. + * By default a child wedge of 340 degrees is used. + */ + preferredChildWedge:number; + /** + * The preferred radial amount in degrees that stay unoccupied + * around the root node of the graph. + * By default a root wedge of 360 degrees is used. + */ + preferredRootWedge:number; + /** + * Specifies whether or not to allow partially overlapping nodes. + * Activating this feature results in a more compact layout. The price for + * this feature is that some nodes may partially overlap. + * By default this feature is set to false. + */ + allowOverlaps:boolean; + /** + * The compactness factor for this layouter. + * This factor has to be a + * double value between 0 and 1. + * The smaller the factor the more compact will the layout potentially be. + * The price for a more compact layout is a potentially higher running time. + */ + compactnessFactor:number; + /** + * The minimal edge length that this layouter assigns + * to laid out edges. + * By default a minimal edge length of 40 is set. + */ + minimalEdgeLength:number; + /** + * Specifies whether or not the layouter considers node labels for the next layout run. + * Note: this setting does only have an effect if the integrated labeling mechanism is not enabled, that is if + * {@link yfiles.tree.BalloonLayouter#integratedNodeLabeling} returns true. + */ + considerNodeLabels:boolean; + /** + * The mode for interleaving child node arrangement. + * Possible values are {@link yfiles.tree.InterleavedMode#ALL_NODES}, {@link yfiles.tree.InterleavedMode#OFF} (default) + * and {@link yfiles.tree.InterleavedMode#SELECTED_NODES}. + */ + interleavedMode:yfiles.tree.InterleavedMode; + /** + * The child alignment policy used by the layouter. + * This policy influences the distance of a child node to its parent node. + * Possible values are {@link yfiles.tree.ChildAlignmentPolicy#COMPACT} (default), {@link yfiles.tree.ChildAlignmentPolicy#PLAIN}, + * {@link yfiles.tree.ChildAlignmentPolicy#SAME_CENTER} and {@link yfiles.tree.ChildAlignmentPolicy#SMART}. + */ + childAlignmentPolicy:yfiles.tree.ChildAlignmentPolicy; + /** + * Specifies whether or not the integrated node labeling mechanism is enabled. + * The integrated labeling does automatically place node labels. Different strategies may be selected using + * {@link yfiles.tree.BalloonLayouter#nodeLabelingPolicy}. + * The default value is false. + * Note: if the integrated labeling mechanism is enabled, then the labels will always be placed by this algorithm, + * independent of the setting of {@link yfiles.tree.BalloonLayouter#considerNodeLabels}. + * @see {@link yfiles.tree.BalloonLayouter#nodeLabelingPolicy} + * @see {@link yfiles.tree.BalloonLayouter#nodeLabelingPolicy} + */ + integratedNodeLabeling:boolean; + /** + * Specifies whether or not the integrated edge labeling mechanism is enabled. + * With enabled integrated labeling the layouter does automatically place edge labels. + * The default value is false. + * Note: when enabling integrated edge labeling it is recommended to also activate the chain straightening mode, as + * edge labels (especially large ones) may lead to significantly non-straight chains. + * @see {@link yfiles.tree.BalloonLayouter#chainStraighteningMode} + */ + integratedEdgeLabeling:boolean; + /** + * The policy for the integrated node labeling mechanism. + * Possible values are {@link yfiles.tree.NodeLabelingPolicy#HORIZONTAL}, {@link yfiles.tree.NodeLabelingPolicy#RAYLIKE} (default) and + * {@link yfiles.tree.NodeLabelingPolicy#MIXED}. + * Note: the policy is only considered if {@link yfiles.tree.BalloonLayouter#integratedNodeLabeling} is set to true. + * @see {@link yfiles.tree.BalloonLayouter#integratedNodeLabeling} + * @see {@link yfiles.tree.BalloonLayouter#integratedNodeLabeling} + */ + nodeLabelingPolicy:yfiles.tree.NodeLabelingPolicy; + /** + * The node label spacing value. + * It affects the distance between two node labels of the same node as well as the + * distance of the labels and the node itself in case of a placement outside the node. + * The default value is 4.0d. + * Note, that the node label spacing has an effect only if the integrated node labeling is enabled. + * @see {@link yfiles.tree.BalloonLayouter#integratedNodeLabeling} + * @see {@link yfiles.tree.BalloonLayouter#integratedNodeLabeling} + */ + nodeLabelSpacing:number; + /** + * The edge label spacing value. + * It affects the distance between two edge labels belonging to the same edge as well + * as the distance of the edge labels to the target node. + * The default value is 4.0d. + * Note, that the edge label spacing has an effect only if the integrated edge labeling is enabled. + * @see {@link yfiles.tree.BalloonLayouter#integratedEdgeLabeling} + * @see {@link yfiles.tree.BalloonLayouter#integratedEdgeLabeling} + */ + edgeLabelSpacing:number; + /** + * Specifies whether chains within the graph shall be drawn straight or not. + * Straightening all chains may lead + * to smoother, more symmetric results. A chain is defined as a tree node with exactly one child. + * The default value is false. + */ + chainStraighteningMode:boolean; + /** + * Core layout routine. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * Returns true if the core layouter can layout the given graph structure. + * This is the case if the graph is a tree. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Returns the NodeInfo object that is associated with the given node + * while the layouter is active. + * Subclasses may want to use this information + * to refine the behavior of this algorithm. + */ + getInfo(v:yfiles.algorithms.Node):yfiles.tree.BalloonLayouter.NodeInfo; + /** + * Determines the root node of {@link yfiles.tree.BalloonLayouter#graph} according to the chosen root + * node policy. + * @return {yfiles.algorithms.Node} + * the root node of {@link yfiles.tree.BalloonLayouter#graph}. + * @see {@link yfiles.tree.BalloonLayouter#rootNodePolicy} + * @see {@link yfiles.tree.BalloonLayouter#rootNodePolicy} + */ + determineRoot():yfiles.algorithms.Node; + /** + * Calculates the child nodes arrangement for a given root node of the + * tree. + * Subclasses may overwrite this method to perform a + * custom child node arrangement. + */ + calcChildArrangement(root:yfiles.algorithms.Node):void; + /** + * Sorts the child nodes of the given node. + * This method uses + * the original node coordinates if fromSketchMode is enabled. + * Otherwise, it sorts the child nodes according to their wedge angle sizes, or, if present + * uses {@link yfiles.tree.BalloonLayouter#comparator the specified comparator} to sort the outgoing edges of + * the local root node. + * The biggest one receives median position in the sorting order. + * The smaller the wedges the further away a node will be placed from the + * median position. + * This method gets called within method + * {@link yfiles.tree.BalloonLayouter#calcChildArrangement} before coordinates are assigned and + * just after the wedges sizes for all subgraphs rooted at root were determined. + */ + sortChildNodes(root:yfiles.algorithms.Node):void; + /** + * Returns the preferred child wedge angle in degrees that is + * used for the children of the given root node. + * Subclasses may overwrite this method to provide + * a custom child wedge function. + */ + getPreferredChildWedge(root:yfiles.algorithms.Node):number; + /** + * Calculates the angle wedge that has to be reserved for the subtree rooted + * at the given node. + * Subclasses may overwrite this method to perform a + * custom angle wedge assignment scheme. + */ + calcAngles(root:yfiles.algorithms.Node):number; + /** + * Calculates the angle wedge that has to be reserved for the subtree rooted + * at the given node. + * The distance of the successor nodes is additionally scaled by scaleFactor + * (use scaleFactor = 1.0 for no scaling). + * Subclasses may overwrite this method to perform a + * custom angle wedge assignment scheme. + */ + calcAnglesWithRootAndScaleFactor(root:yfiles.algorithms.Node,scaleFactor:number):number; + } + export module BalloonLayouter{ + /** + * Encapsulates information bound to a node during the algorithm calculates a layout. + */ + export interface NodeInfo extends Object{ + /** + * The upper angle of the subtree wedge rooted at the node. + */ + upperAngle:number; + /** + * The lower angle of the subtree wedge rooted at the node. + */ + lowerAngle:number; + /** + * The angle that of the gap that to the wedge of the previous child node. + */ + gapAngle:number; + /** + * The distance of the node to its root node. + */ + dist:number; + /** + * The sum of all wedge angles. + */ + angleSum:number; + } + } + var BalloonLayouter:{ + $class:yfiles.lang.Class; + /** + * {@link yfiles.algorithms.IDataProvider} key used to store if the children of a node should be arranged in an + * interleaved fashion or not (boolean values, true encodes interleaved). + * It allows to individually + * configure the interleaving feature for each node in the graph. Note that the data provider will only be considered + * if mode is set to {@link yfiles.tree.InterleavedMode#SELECTED_NODES}. + * @see {@link yfiles.tree.BalloonLayouter#interleavedMode} + */ + INTERLEAVED_NODES_DP_KEY:Object; + new ():yfiles.tree.BalloonLayouter; + }; + export enum NodeLabelingPolicy{ + /** + * Node labeling policy specifier constant. + * Leaf nodes and nodes having exactly one successor (thus forming a sort of chain) will not be oriented horizontal + * but ray-like: that means they get the same orientation as their nodes' incoming edge. + * The labels of the nodes having more than 1 successor will be oriented horizontally and placed at the center + * of the corresponding node. + * @see {@link yfiles.tree.BalloonLayouter#nodeLabelingPolicy} + */ + RAYLIKE, + /** + * Node labeling policy specifier constant. + * Only labels corresponding to leaf nodes won't be oriented horizontally. They get the same orientation + * as their nodes' incoming edge. These labels will be placed outside the node (without overlaps). + * The labels of all the other nodes will be oriented horizontally and placed at the center of the corresponding node. + * @see {@link yfiles.tree.BalloonLayouter#nodeLabelingPolicy} + */ + MIXED, + /** + * Node labeling policy specifier constant. + * The labels of all nodes will be oriented horizontally and placed at the center of the corresponding node. + * @see {@link yfiles.tree.BalloonLayouter#nodeLabelingPolicy} + */ + HORIZONTAL + } + export enum RootNodePolicy{ + /** + * Root node policy specifier constant. A node with indegree 0 + * is chosen as root node of the tree. If no node with that property + * is present the an arbitrary node is chosen. + */ + DIRECTED_ROOT, + /** + * Root node policy specifier constant. A center node + * will be chosen as root node of the tree. + * @see {@link yfiles.algorithms.Trees#getCenterRoot} + */ + CENTER_ROOT, + /** + * Root node policy specifier constant. A weighted center node + * will be chosen as root node of the tree. + * @see {@link yfiles.algorithms.Trees#getCenterRoot} + */ + WEIGHTED_CENTER_ROOT + } + export enum ChildOrderingPolicy{ + /** + * Child ordering policy specifier constant. + * This policy sorts the child nodes according to the size of the subtree rooted by them in an interleaved fashion. + * Using this policy the produced results are often more compact. + * @see {@link yfiles.tree.BalloonLayouter#childOrderingPolicy} + */ + COMPACT, + /** + * Child ordering policy specifier constant. + * This policy sorts the child nodes according to their wedge angle sizes. + * The node with the biggest angle receives median position in the sorting order. + * The smaller the wedges the further away a node will be placed from the + * median position. Using this policy the produced results are often more symmetric. + * @see {@link yfiles.tree.BalloonLayouter#childOrderingPolicy} + */ + SYMMETRIC + } + export enum ChildAlignmentPolicy{ + /** + * Child alignment policy specifier constant. + * Child nodes rooted at the same node are aligned such that the border of the nodes convex hull has the same + * distance from the root for all of the children. + * Note: two different distances will be realized, if the interleaved mode is active {@link yfiles.tree.BalloonLayouter#interleavedMode}. + * @see {@link yfiles.tree.BalloonLayouter#childAlignmentPolicy} + */ + PLAIN, + /** + * Child alignment policy specifier constant. + * Child nodes rooted at the same node are aligned such that each node has the same center-to-center distance + * to the root. Therefore all nodes will be placed on one common radius around their root. + * Note: does realize two different radii if in interleaved mode {@link yfiles.tree.BalloonLayouter#interleavedMode}. + * @see {@link yfiles.tree.BalloonLayouter#childAlignmentPolicy} + */ + SAME_CENTER, + /** + * Child alignment policy specifier constant. + * Child nodes rooted at the same node are aligned such that the resulting drawing will be as compact as possible, + * not considering any symmetric constraints or similar. + * @see {@link yfiles.tree.BalloonLayouter#childAlignmentPolicy} + */ + COMPACT, + /** + * Child alignment policy specifier constant. + * Child nodes rooted at the same node are aligned using a smart strategy, which - if possible - tries + * to estimate an alignment such that the resulting drawing is well-balanced and symmetric. + * Note: if in interleaved mode {@link yfiles.tree.BalloonLayouter#interleavedMode}, then currently a plain alignment + * will be chosen {@link yfiles.tree.ChildAlignmentPolicy#PLAIN}. + * @see {@link yfiles.tree.BalloonLayouter#childAlignmentPolicy} + */ + SMART + } + export enum MultiParentRoutingStyle{ + /** + * Routing style for edges that are connected to nodes that constitute a multi-parent structure. + * Using this style will route the part of the edges that doesn't share the same path in a polyline fashion. + * @see {@link yfiles.tree.MultiParentRoutingStyle#ORTHOGONAL} + * @see {@link yfiles.tree.MultiParentRoutingStyle#STRAIGHT} + */ + POLYLINE, + /** + * Routing style for edges that are connected to nodes that constitute a multi-parent structure. + * Using this style will route the part of the edges that doesn't share the same path orthogonally. + * @see {@link yfiles.tree.MultiParentRoutingStyle#POLYLINE} + * @see {@link yfiles.tree.MultiParentRoutingStyle#STRAIGHT} + */ + ORTHOGONAL, + /** + * Routing style for edges that are connected to nodes that constitute a multi-parent structure. + * Using this style will route the part of the edges that doesn't share the same path directly from the center of the + * multi-parent to the common point of the edges in the multi-parent structure. + * @see {@link yfiles.tree.MultiParentRoutingStyle#POLYLINE} + * @see {@link yfiles.tree.MultiParentRoutingStyle#ORTHOGONAL} + */ + STRAIGHT + } + /** + * Decorates a SubtreeShape and provides rotated access on it. + */ + export interface SubtreeShapeRotated extends Object{ + } + var SubtreeShapeRotated:{ + $class:yfiles.lang.Class; + /** + * For testing purposes only. + */ + new ():yfiles.tree.SubtreeShapeRotated; + }; + /** + * This stage can be used to do mix layouts for tree-like subgraph structures and + * the non-tree like rest of a graph. + */ + export interface TreeComponentLayouter extends Object,yfiles.layout.ILayoutStage{ + /** + * Returns true iff the given graph can be laid + * out by this algorithm. + * Calling doLayout with + * the given graph as its argument will only success if + * this method returns true. + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Assigns a new graph layout to the given layout graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Called by {@link yfiles.tree.TreeComponentLayouter#doLayout} to delegate to the + * {@link yfiles.tree.TreeComponentLayouter#coreLayouter}, adding the dummy provider to the graph instance. + */ + doLayoutUsingDummies(graph:yfiles.layout.LayoutGraph,dummyDp:yfiles.algorithms.IDataProvider):void; + /** + * The core layouter. + * @see Specified by {@link yfiles.layout.ILayoutStage#coreLayouter}. + */ + coreLayouter:yfiles.layout.ILayouter; + /** + * The core layouter used for tree components. + */ + treeComponentCoreLayouter:yfiles.layout.ILayouter; + /** + * true if this layouter tries to improve tree component + * placement by changing the components orientation and false + * otherwise. + */ + orientationOptimizationActive:boolean; + } + var TreeComponentLayouter:{ + $class:yfiles.lang.Class; + /** + * During the main run of the layout dummy nodes can be identified by looking + * at the value of the registered DataProvider which can be obtained from + * the graph using this key. + */ + DUMMY_NODE_DP_KEY:Object; + /** + * Creates a new instance of TreeComponentLayouter using the specified + * layouter for laying out the subtrees. + */ + new (treeCoreLayouter:yfiles.layout.ILayouter):yfiles.tree.TreeComponentLayouter; + }; + /** + * This is a "default" NodePlacer. + * It arranges its children simply in one row. + */ + export interface SimpleNodePlacer extends yfiles.tree.AbstractRotatableNodePlacer{ + /** + * The horizontal alignment of the root node. + */ + rootAlignment:yfiles.tree.AbstractRotatableNodePlacer.RootAlignment; + /** + * The relative vertical alignment of nodes with the same parent. + * A value of 0 means nodes are top aligned; + * a value of 1 means nodes are bottom aligned; + * a value of 0.5 means nodes are center aligned. + * Values outside the interval [0,1] will result in a compact node placement with unaligned nodes. + *

+ * By default the compact placement with unaligned nodes is used. + *

+ */ + verticalAlignment:number; + /** + * Returns {@link yfiles.tree.ParentConnectorDirection#NORTH}. + * @return {yfiles.tree.ParentConnectorDirection} + * {@link yfiles.tree.ParentConnectorDirection#NORTH}. + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#determineChildConnector} + */ + determineChildConnector(child:yfiles.algorithms.Node):yfiles.tree.ParentConnectorDirection; + /** + * Specifies whether a bus should be created between the parent and its children. + */ + createBus:boolean; + /** + * Places the children in a single row. + * @see Overrides {@link yfiles.tree.AbstractRotatableNodePlacer#placeSubtreeWithDirection} + */ + placeSubtreeWithDirection(localRoot:yfiles.algorithms.Node,parentConnectorDirection:yfiles.tree.ParentConnectorDirection):yfiles.tree.SubtreeShapeRotated; + } + var SimpleNodePlacer:{ + $class:yfiles.lang.Class; + /** + * Default constructor that creates an instance with the modification matrix {@link yfiles.tree.AbstractRotatableNodePlacer.Matrix#DEFAULT}. + */ + new ():yfiles.tree.SimpleNodePlacer; + /** + * Constructor that creates an instance with the given modification matrix. + */ + WithMatrix:{ + new (modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix):yfiles.tree.SimpleNodePlacer; + }; + /** + * Constructor that creates an instance with the given modification matrix and the horizontal root alignment. + */ + WithMatrixAndRootAlignment:{ + new (modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix,rootAlignment:yfiles.tree.AbstractRotatableNodePlacer.RootAlignment):yfiles.tree.SimpleNodePlacer; + }; + }; + /** + * This comparator compares edges by examining the {@link yfiles.lang.IObjectComparable} + * that is obtained by passing the {@link yfiles.algorithms.Edge#target target nodes} to + * the {@link yfiles.algorithms.IDataProvider#get get method} + * of the {@link yfiles.algorithms.IDataProvider} bound to the graph via the + * {@link yfiles.tree.NodeOrderComparator#NODE_ORDER_DP_KEY} key. + * @see {@link yfiles.tree.TreeLayouter#comparator} + * @see {@link yfiles.tree.GenericTreeLayouter#defaultChildComparator} + * @see {@link yfiles.tree.GenericTreeLayouter#CHILD_COMPARATOR_DP_KEY} + * @see {@link yfiles.tree.BalloonLayouter#comparator} + * @see {@link yfiles.tree.ARTreeLayouter#comparator} + * @see {@link yfiles.tree.HVTreeLayouter#comparator} + * @see {@link yfiles.tree.NodeOrderComparator#NODE_ORDER_DP_KEY} + */ + export interface NodeOrderComparator extends Object,yfiles.objectcollections.IComparer,yfiles.algorithms.Comparators.IPartialOrder{ + /** + * Object is actually expected to be {@link yfiles.algorithms.Edge}. + * Compares values returned by {@link yfiles.algorithms.IDataProvider#get} for + * the {@link yfiles.algorithms.Edge#target target nodes} of the edges. + * null values or instances that do not implement the {@link yfiles.lang.IObjectComparable} + * interface will be treated as (equal) smaller values. + * @see Specified by {@link yfiles.objectcollections.IComparer#compare}. + */ + compare(a:Object,b:Object):number; + } + var NodeOrderComparator:{ + $class:yfiles.lang.Class; + /** + * A data provider key that can be used to register a + * {@link yfiles.algorithms.IDataProvider} for each {@link yfiles.algorithms.Node} in the graph that yields a {@link yfiles.lang.IObjectComparable} object + * via the {@link yfiles.algorithms.IDataProvider#get} method. + * The values can be used by the various tree layouter implementations to sort the children + * of each node in the tree and use the order to influence the layout. + * To achieve this use this comparator and assign it to the layouter implementations + * comparator property. + */ + NODE_ORDER_DP_KEY:Object; + }; + /** + * Implementation of a layout algorithm for trees. + * Here is an sample output of the layouter using left to right orientation and {@link yfiles.tree.EdgeLayoutStyle#ORTHOGONAL} layout style. + *
+ */ + export interface TreeLayouter extends yfiles.layout.CanonicMultiStageLayouter{ + /** + * Returns true if the core layouter can layout the given graph structure. + * This is the case if the graph is a tree. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#canLayoutCore} + */ + canLayoutCore(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Specifies whether or not global layering is enforced. + * If this feature is enabled, the algorithm ensures that nodes never span + * more than one layer. Otherwise, a large node might span two, three, etc + * layers of smaller nodes to produce a more compact layout. + *

+ * Disabling this feature to generate more compact layouts will usually + * result in the algorithm ignoring the specified relative vertical alignment + * for nodes. + *

+ * By default, this feature is enabled. + *

+ * @see {@link yfiles.tree.TreeLayouter#verticalAlignment} + * @see {@link yfiles.tree.TreeLayouter#verticalAlignment} + */ + enforceGlobalLayering:boolean; + /** + * The layout policy for leaf nodes. + *

+ * Defaults to {@link yfiles.tree.ChildPlacementPolicy#SIBLINGS_ON_SAME_LAYER}. + *

+ * @throws {yfiles.system.ArgumentException} if the specified policy does not match one of the leaf layout policy constants. + */ + childPlacementPolicy:yfiles.tree.ChildPlacementPolicy; + /** + * True if grouping support is enabled. + * Note that the grouping only works correctly, if each group represents + * a complete subtree. This means that for each group there is a node v such that the group contains exactly v and all + * its descendants. + */ + groupingSupported:boolean; + /** + * Starts the tree layout process. + * @see Overrides {@link yfiles.layout.CanonicMultiStageLayouter#doLayoutCore} + */ + doLayoutCore(graph:yfiles.layout.LayoutGraph):void; + /** + * The comparator for outgoing edges at a node This comparator defines the relative order of the child nodes + * in the layout to be calculated. + * By default {@link yfiles.tree.XCoordComparator} is set. + */ + comparator:yfiles.objectcollections.IComparer; + /** + * The port assignment style. + */ + portStyle:yfiles.tree.PortStyle; + /** + * The layout style of this layouter. + * @see {@link yfiles.tree.EdgeLayoutStyle#PLAIN} + * @see {@link yfiles.tree.EdgeLayoutStyle#ORTHOGONAL} + */ + layoutStyle:yfiles.tree.EdgeLayoutStyle; + /** + * The minimum horizontal distance between adjacent nodes for this layouter. + * Default value is 20.0. + */ + minimalNodeDistance:number; + /** + * The minimal distance between adjacent layers for the layout. + * Default value is 40.0. + */ + minimalLayerDistance:number; + /** + * Specifies whether integrated node labeling is enabled. + */ + integratedNodeLabeling:boolean; + /** + * Specifies whether integrated edge labeling is enabled. + */ + integratedEdgeLabeling:boolean; + /** + * The vertical bus alignment for orthogonally routed edge buses. + * The bus alignment determines the relative position of an edge bus in + * between two subsequent layers of nodes. + * A value of 0 places the bus at the top right below the parent node; + * a value of 0.5 places the bus in the middle between parent and child nodes; and + * a value of 1 places the bus at the bottom right above the child nodes. + *

+ * Bus alignment is taken into account only for + *

    + *
  • + * layout style {@link yfiles.tree.EdgeLayoutStyle#ORTHOGONAL} with global layering enforced and + *
  • + *
  • + * layout style {@link yfiles.tree.EdgeLayoutStyle#ORTHOGONAL} with child placement policy + * {@link yfiles.tree.ChildPlacementPolicy#ALL_LEAVES_ON_SAME_LAYER}. + *
  • + *
+ *

+ * Defaults to 0.3. + *

+ * @see {@link yfiles.tree.TreeLayouter#layoutStyle} + * @see {@link yfiles.tree.TreeLayouter#enforceGlobalLayering} + * @see {@link yfiles.tree.TreeLayouter#childPlacementPolicy} + * @see {@link yfiles.tree.TreeLayouter#layoutStyle} + * @see {@link yfiles.tree.TreeLayouter#enforceGlobalLayering} + * @see {@link yfiles.tree.TreeLayouter#childPlacementPolicy} + */ + busAlignment:number; + /** + * The relative vertical alignment of nodes within their respective + * layers. + * A value of 0 means nodes are top aligned; + * a value of 1 means nodes are bottom aligned. + *

+ * If global layering is not enforced, the value of this property is usually + * ignored. + *

+ * Defaults to 0.5, i.e. nodes are center aligned. + *

+ * @see {@link yfiles.tree.TreeLayouter#enforceGlobalLayering} + * @see {@link yfiles.tree.TreeLayouter#enforceGlobalLayering} + * @see {@link yfiles.tree.TreeLayouter#enforceGlobalLayering} + * @see {@link yfiles.tree.TreeLayouter#enforceGlobalLayering} + */ + verticalAlignment:number; + /** + * The modification matrix that is used to rotate / mirror the tree layout. + */ + modificationMatrix:yfiles.tree.AbstractRotatableNodePlacer.Matrix; + } + var TreeLayouter:{ + $class:yfiles.lang.Class; + /** + * Creates a new instance of TreeLayouter. + */ + new ():yfiles.tree.TreeLayouter; + }; + export enum EdgeLayoutStyle{ + /** + * Layout style constant. Draw edges as straight lines. + */ + PLAIN, + /** + * Layout style constant. Draw edges orthogonally in a bus-like fashion. + */ + ORTHOGONAL + } + export enum PortStyle{ + /** + * Port style constant. Uses (0,0) as port offset. + */ + NODE_CENTER, + /** + * Port style constant. Ports will lie at the center of a node border. + */ + BORDER_CENTER, + /** + * Port style constant. Ports will be distributed evenly on the side of a node. + */ + BORDER_DISTRIBUTED, + /** + * Port style constant. The specified port constraints will be considered. + */ + PORT_CONSTRAINTS_AWARE + } + export enum ParentConnectorDirection{ + /** + * Byte constant that is as argument to the main method, indicating that no connector + * should be calculated. + */ + NONE, + /** + * Byte constant that is an argument to the main method, indicating that any connector + * direction can be used for the connection to the parent node. + */ + ANY, + /** + * Byte constant that is an argument to the main method, indicating that the connector + * direction to the parent node should end in a segment that can be extended by a segment + * that goes into north direction. + */ + NORTH, + /** + * Byte constant that is an argument to the main method, indicating that the connector + * direction to the parent node should end in a segment that can be extended by a segment + * that goes into east direction. + */ + EAST, + /** + * Byte constant that is an argument to the main method, indicating that the connector + * direction to the parent node should end in a segment that can be extended by a segment + * that goes into south direction. + */ + SOUTH, + /** + * Byte constant that is an argument to the main method, indicating that the connector + * direction to the parent node should end in a segment that can be extended by a segment + * that goes into west direction. + */ + WEST + } + export enum ChildPlacementPolicy{ + /** + * Symbolic child placement policy specifier. + * This setting configures the algorithm for a stacked style of leaf nodes. + * In this context, stacked means that leaf nodes that connect to + * the same root node are placed one upon the other. + * This results in horizontally compact layouts. + * Additionally, this policy tries to balance stack heights. I.e. for each + * subtree that consists of leaf nodes only, + * {@link yfiles.tree.ChildPlacementPolicy#LEAVES_STACKED_RIGHT} or + * {@link yfiles.tree.ChildPlacementPolicy#LEAVES_STACKED_LEFT_AND_RIGHT} will be used + * depending on the number of leaves in the subtree. + */ + LEAVES_STACKED, + /** + * Symbolic child placement policy specifier. + * This setting configures the algorithm for a stacked style of leaf nodes. + * In this context, stacked means that leaf nodes that connect to + * the same root node are placed one upon the other. + * This results in horizontally compact layouts. + * Moreover, the stack of leaf nodes is on the left. + */ + LEAVES_STACKED_LEFT, + /** + * Symbolic child placement policy specifier. + * This setting configures the algorithm for a stacked style of leaf nodes. + * In this context, stacked means that leaf nodes that connect to + * the same root node are placed one upon the other. + * This results in horizontally compact layouts. + * Moreover, the stack of leaf nodes is on the right. + */ + LEAVES_STACKED_RIGHT, + /** + * Symbolic child placement policy specifier. + * This setting configures the algorithm for a stacked style of leaf nodes. + * In this context, stacked means that leaf nodes that connect to + * the same root node are placed one upon the other. + * This results in horizontally compact layouts. + * Moreover, leaf nodes are distributed among two stacks, one on the left + * and one on the right. + */ + LEAVES_STACKED_LEFT_AND_RIGHT, + /** + * Symbolic child placement policy specifier. + * This results in a Dendrogram-style layout with all leaf nodes being + * placed in one layer (i.e. all leaves are being placed on one horizontal + * line in a top to bottom or bottom to top layout). + * A Dendrogram layout is often applied in computational biology in order to + * show clustering of genes. + */ + ALL_LEAVES_ON_SAME_LAYER, + /** + * Symbolic child placement policy specifier. + * This setting configures the algorithm to place siblings (leaf nodes with + * the same parent node) in the same layer (i.e. siblings are being placed + * on one horizontal line in a top to bottom or bottom to top layout). + */ + SIBLINGS_ON_SAME_LAYER + } + /** + * This stage can be used to layout non-tree structures with a + * tree layout algorithm. + * First this stage transforms a graph into a tree or forest by removing some + * edges. + * Then it invokes the core layout algorithm on the reduced graph. + * Finally, it reinserts the hidden non-tree edges to the graph + * again and optionally routes these edges. + *

+ * Typical usage: + *

+ *

+    * var tl = new yfiles.tree.TreeLayouter();
+    * var trs = new yfiles.tree.TreeReductionStage();
+    * trs.nonTreeEdgeRouter = new yfiles.router.OrganicEdgeRouter();
+    * trs.nonTreeEdgeSelectionKey = yfiles.router.OrganicEdgeRouter.ROUTE_EDGE_DP_KEY;
+    * tl.appendStage(trs);
+    * graph.applyLayout(tl);
+    * tl.RemoveStage(trs);
+    * 
+ *

+ * Note that if there are edges between group nodes, the TreeLayouter may throw a + * {@link yfiles.algorithms.InvalidGraphStructureException} exception. Such exceptions can be prevented by adding a + * ComponentLayouter right after appending the TreeReductionStage, + * i.e., adding the line tl.appendStage(new yfiles.layout.ComponentLayouter()). + *

+ *

+ * Note that this layout stage is also able to handle multi-parent structures, i.e., structures of multiple nodes + * that share the same predecessors as well as the same successors. More precisely, if the specified core layout + * can handle multi-parent structures (see {@link yfiles.tree.GenericTreeLayouter#multiParentAllowed}) + * and option {@link yfiles.tree.TreeReductionStage#multiParentAllowed} is enabled, this stage does not hide such structures + * (i.e., the multi-parents are passed to the core layouter). + *

+ * @see {@link yfiles.router.OrganicEdgeRouter} + * @see {@link yfiles.router.polyline.EdgeRouter} + * @see {@link yfiles.router.OrthogonalEdgeRouter} + */ + export interface TreeReductionStage extends yfiles.layout.AbstractLayoutStage{ + /** + * Returns true. + * @see Overrides {@link yfiles.layout.AbstractLayoutStage#canLayout} + * @see Specified by {@link yfiles.layout.ILayouter#canLayout}. + */ + canLayout(graph:yfiles.layout.LayoutGraph):boolean; + /** + * Main layout routine that assigns new layout information to the given graph. + * @see Specified by {@link yfiles.layout.ILayouter#doLayout}. + */ + doLayout(graph:yfiles.layout.LayoutGraph):void; + /** + * Routes the non-tree edges. + * @param {yfiles.layout.LayoutGraph} graph graph that can contain tree and non-tree edges. + * @param {yfiles.algorithms.IEdgeMap} nonTreeEdgeMap + * an edge map that marks all non-tree edges + * in the graph with boolean value true. + */ + routeNonTreeEdges(graph:yfiles.layout.LayoutGraph,nonTreeEdgeMap:yfiles.algorithms.IEdgeMap):void; + /** + * Specifies whether or not multi-parent structures (structures of multiple nodes that share the same predecessors as + * well as the same successors) are allowed. + *

+ * More precisely, if this option is enabled and the specified core layout can handle multi-parent + * structures (see {@link yfiles.tree.GenericTreeLayouter#multiParentAllowed}), + * this stage does not hide such structures (i.e., the multi-parent structures are passed to the core layouter). + *

+ */ + multiParentAllowed:boolean; + /** + * The currently set edge router for non-tree edges. + * Very often, this method should + * be used in conjunction with {@link yfiles.tree.TreeReductionStage#nonTreeEdgeSelectionKey} to + * control the set of edges that should be handled by the edge router. + */ + nonTreeEdgeRouter:yfiles.layout.ILayouter; + /** + * The currently set non-tree edge selection key. + * @see {@link yfiles.algorithms.Graph#addDataProvider} + * @see {@link yfiles.tree.TreeReductionStage#nonTreeEdgeRouter} + */ + nonTreeEdgeSelectionKey:Object; + /** + * Creates a layouter that can be used to route all non-tree edges + * as a single straight-line segment. + * @see {@link yfiles.tree.TreeReductionStage#nonTreeEdgeRouter} + */ + createStraightlineRouter():yfiles.layout.ILayouter; + } + var TreeReductionStage:{ + $class:yfiles.lang.Class; + new ():yfiles.tree.TreeReductionStage; + /** + * DataProvider key that can be used to explicitly mark (some) edges + * that should not be considered to belong to a tree. + */ + NON_TREE_EDGES_DP_KEY:Object; + }; + /** + * This comparator compares edges by examining the x-coordinates of the centers + * of their target nodes. + */ + export interface XCoordComparator extends Object,yfiles.objectcollections.IComparer,yfiles.algorithms.Comparators.IPartialOrder{ + /** + * Object is actually expected to be {@link yfiles.algorithms.Edge}. + * Compares the x-coordinates of the centers of the target nodes. + * @see Specified by {@link yfiles.objectcollections.IComparer#compare}. + */ + compare(a:Object,b:Object):number; + } + var XCoordComparator:{ + $class:yfiles.lang.Class; + }; + } +} \ No newline at end of file